From patchwork Wed May 7 16:21:52 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Stefano Stabellini X-Patchwork-Id: 29809 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-ie0-f198.google.com (mail-ie0-f198.google.com [209.85.223.198]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id 34B9920534 for ; Wed, 7 May 2014 16:24:12 +0000 (UTC) Received: by mail-ie0-f198.google.com with SMTP id rp18sf5956616iec.1 for ; Wed, 07 May 2014 09:24:11 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:delivered-to:from:to:date:message-id:in-reply-to :references:mime-version:cc:subject:precedence:list-id :list-unsubscribe:list-post:list-help:list-subscribe:sender :errors-to:x-original-sender:x-original-authentication-results :mailing-list:list-archive:content-type:content-transfer-encoding; bh=X5ATuoBoS5GexVHfwJmghjuKIty2ca60rthYtsZTHfs=; b=iNMlA+2U1GSm0UCwrknr3s3LnanuXN9ycAKwDpYdM0JXY8pSwiMKgCsC+Z4JARAnUP GUqUEFA2m42UGt/yJ/67ADeAXPbE4g5i1w5x0tf0eIsBCMQFqe0fySqr+0D5JfuvhC3G PADwPKIdYi+SVtUVn3JshgZjS+hMh8OnVuj0rKAIepkhzIPA88vZQefvr/ZeUzD07QFh kxe5u0Llyh2NetJzy1meNMXtekFcZqxKq21K+EIOhgIh5ic4llH4150SyDVnYc4ERj2R YiryHxDL7hP/uLewbNjZneYcPGSGk9vWmg4yri6wRZpaZmHT5P6FV+gzb5k1pMrOnvfQ OfLA== X-Gm-Message-State: ALoCoQl+7zRrxHliq0KUiVnLa4IcEfFaj8orpW9xVQV4GfgdlPqqMowKYKrwczjHbzF2fINJylwh X-Received: by 10.182.95.68 with SMTP id di4mr5004937obb.4.1399479851630; Wed, 07 May 2014 09:24:11 -0700 (PDT) X-BeenThere: patchwork-forward@linaro.org Received: by 10.140.49.231 with SMTP id q94ls3544325qga.28.gmail; Wed, 07 May 2014 09:24:11 -0700 (PDT) X-Received: by 10.58.13.104 with SMTP id g8mr39431876vec.16.1399479851543; Wed, 07 May 2014 09:24:11 -0700 (PDT) Received: from mail-ve0-f170.google.com (mail-ve0-f170.google.com [209.85.128.170]) by mx.google.com with ESMTPS id g10si2990079vcj.145.2014.05.07.09.24.11 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Wed, 07 May 2014 09:24:11 -0700 (PDT) Received-SPF: none (google.com: patch+caf_=patchwork-forward=linaro.org@linaro.org does not designate permitted sender hosts) client-ip=209.85.128.170; Received: by mail-ve0-f170.google.com with SMTP id db11so1600130veb.15 for ; Wed, 07 May 2014 09:24:11 -0700 (PDT) X-Received: by 10.220.7.131 with SMTP id d3mr1597233vcd.45.1399479851421; Wed, 07 May 2014 09:24:11 -0700 (PDT) X-Forwarded-To: patchwork-forward@linaro.org X-Forwarded-For: patch@linaro.org patchwork-forward@linaro.org Delivered-To: patch@linaro.org Received: by 10.220.221.72 with SMTP id ib8csp323703vcb; Wed, 7 May 2014 09:24:11 -0700 (PDT) X-Received: by 10.52.137.174 with SMTP id qj14mr11163943vdb.32.1399479849812; Wed, 07 May 2014 09:24:09 -0700 (PDT) Received: from lists.xen.org (lists.xen.org. [50.57.142.19]) by mx.google.com with ESMTPS id uq6si3003205vcb.0.2014.05.07.09.24.09 for (version=TLSv1 cipher=RC4-SHA bits=128/128); Wed, 07 May 2014 09:24:09 -0700 (PDT) Received-SPF: none (google.com: xen-devel-bounces@lists.xen.org does not designate permitted sender hosts) client-ip=50.57.142.19; Received: from localhost ([127.0.0.1] helo=lists.xen.org) by lists.xen.org with esmtp (Exim 4.72) (envelope-from ) id 1Wi4c1-00052Y-Qx; Wed, 07 May 2014 16:22:29 +0000 Received: from mail6.bemta5.messagelabs.com ([195.245.231.135]) by lists.xen.org with esmtp (Exim 4.72) (envelope-from ) id 1Wi4c1-00051z-12 for xen-devel@lists.xensource.com; Wed, 07 May 2014 16:22:29 +0000 Received: from [85.158.139.211:17718] by server-17.bemta-5.messagelabs.com id FC/99-09046-4CD5A635; Wed, 07 May 2014 16:22:28 +0000 X-Env-Sender: Stefano.Stabellini@citrix.com X-Msg-Ref: server-2.tower-206.messagelabs.com!1399479746!2883866!1 X-Originating-IP: [66.165.176.89] X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: VHJ1c3RlZCBJUDogNjYuMTY1LjE3Ni44OSA9PiAyMDMwMDc=\n X-StarScan-Received: X-StarScan-Version: 6.11.3; banners=-,-,- X-VirusChecked: Checked Received: (qmail 6540 invoked from network); 7 May 2014 16:22:27 -0000 Received: from smtp.citrix.com (HELO SMTP.CITRIX.COM) (66.165.176.89) by server-2.tower-206.messagelabs.com with RC4-SHA encrypted SMTP; 7 May 2014 16:22:27 -0000 X-IronPort-AV: E=Sophos; i="4.97,1004,1389744000"; d="scan'208"; a="128670645" Received: from accessns.citrite.net (HELO FTLPEX01CL02.citrite.net) ([10.9.154.239]) by FTLPIPO01.CITRIX.COM with ESMTP; 07 May 2014 16:22:26 +0000 Received: from ukmail1.uk.xensource.com (10.80.16.128) by smtprelay.citrix.com (10.13.107.79) with Microsoft SMTP Server id 14.3.181.6; Wed, 7 May 2014 12:22:25 -0400 Received: from kaball.uk.xensource.com ([10.80.2.59]) by ukmail1.uk.xensource.com with esmtp (Exim 4.69) (envelope-from ) id 1Wi4bs-0005PV-8K; Wed, 07 May 2014 17:22:20 +0100 From: Stefano Stabellini To: Date: Wed, 7 May 2014 17:21:52 +0100 Message-ID: <1399479718-7351-1-git-send-email-stefano.stabellini@eu.citrix.com> X-Mailer: git-send-email 1.7.9.5 In-Reply-To: References: MIME-Version: 1.0 X-DLP: MIA1 Cc: olaf@aepfle.de, xen-devel@lists.xensource.com, Stefano Stabellini , Alexey Kardashevskiy , qemu-devel@nongnu.org, anthony@codemonkey.ws, Anthony.Perard@citrix.com, pbonzini@redhat.com Subject: [Xen-devel] [PULL 1/7] exec: Limit translation limiting in address_space_translate to xen X-BeenThere: xen-devel@lists.xen.org X-Mailman-Version: 2.1.13 Precedence: list List-Id: List-Unsubscribe: , List-Post: , List-Help: , List-Subscribe: , Sender: xen-devel-bounces@lists.xen.org Errors-To: xen-devel-bounces@lists.xen.org X-Removed-Original-Auth: Dkim didn't pass. X-Original-Sender: stefano.stabellini@eu.citrix.com X-Original-Authentication-Results: mx.google.com; spf=neutral (google.com: patch+caf_=patchwork-forward=linaro.org@linaro.org does not designate permitted sender hosts) smtp.mail=patch+caf_=patchwork-forward=linaro.org@linaro.org Mailing-list: list patchwork-forward@linaro.org; contact patchwork-forward+owners@linaro.org X-Google-Group-Id: 836684582541 List-Archive: From: Alexey Kardashevskiy The address_space_translate() function cuts the returned plen (page size) to hardcoded TARGET_PAGE_SIZE. This function can be used on pages bigger than that so this limiting should not be used on such pages. Since originally the limiting was introduced for XEN, we can safely limit this piece of code to XEN. So does the patch. Suggested-by: Paolo Bonzini Signed-off-by: Alexey Kardashevskiy Signed-off-by: Stefano Stabellini --- exec.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/exec.c b/exec.c index 91513c6..cf12049 100644 --- a/exec.c +++ b/exec.c @@ -380,7 +380,7 @@ MemoryRegion *address_space_translate(AddressSpace *as, hwaddr addr, as = iotlb.target_as; } - if (memory_access_is_direct(mr, is_write)) { + if (xen_enabled() && memory_access_is_direct(mr, is_write)) { hwaddr page = ((addr & TARGET_PAGE_MASK) + TARGET_PAGE_SIZE) - addr; len = MIN(page, len); }