From patchwork Wed May 7 15:09:56 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Stefano Stabellini X-Patchwork-Id: 29794 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-ve0-f197.google.com (mail-ve0-f197.google.com [209.85.128.197]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id 30E13202E4 for ; Wed, 7 May 2014 15:12:32 +0000 (UTC) Received: by mail-ve0-f197.google.com with SMTP id db11sf3628137veb.0 for ; Wed, 07 May 2014 08:12:32 -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=ai12VV6F3vEJ1lmlRz15pxGjUvweDUIL7lWIlhS6bPyG6zQrP5oL0sRlDGHP5P9gbV 4HwT2WkoowPtvz4ifsl7oyl6NH5InI0gy1zSebgXTB9JUmNqM4HOpks9wrFydsC8LKMk 8DdtPeDJ9g/vnm1+GuHtFYO09Er6scpg7Lo9Xy0/GCFlFOzBuhgxbNnurJ3NSgaYCosj VD2dYUa76q2QSEz0I1y4Lhs8Gw9JpSz+3e0tKh866szAFtmVJMSA6ecpvUXHbumDsG5e G20SwalYP9XEjA5c5rX6W7V7Xy+xAqtLqEtaS93Mk9vhNNFJcV/Nh6l2pNVGr07Ewjdu /Wcw== X-Gm-Message-State: ALoCoQmuqhEN45sufnZEertWULgcZWJyFU6hR29X7JQudqISo5jZzG3ysaL0l895EPXkOu0yr4pl X-Received: by 10.58.82.193 with SMTP id k1mr4547784vey.41.1399475552813; Wed, 07 May 2014 08:12:32 -0700 (PDT) X-BeenThere: patchwork-forward@linaro.org Received: by 10.140.97.200 with SMTP id m66ls3307553qge.83.gmail; Wed, 07 May 2014 08:12:32 -0700 (PDT) X-Received: by 10.220.113.207 with SMTP id b15mr1227447vcq.55.1399475552680; Wed, 07 May 2014 08:12:32 -0700 (PDT) Received: from mail-vc0-f170.google.com (mail-vc0-f170.google.com [209.85.220.170]) by mx.google.com with ESMTPS id iq2si1943330veb.127.2014.05.07.08.12.32 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Wed, 07 May 2014 08:12:32 -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.220.170; Received: by mail-vc0-f170.google.com with SMTP id lf12so1474044vcb.15 for ; Wed, 07 May 2014 08:12:32 -0700 (PDT) X-Received: by 10.220.7.131 with SMTP id d3mr1250808vcd.45.1399475552609; Wed, 07 May 2014 08:12:32 -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 ib8csp317743vcb; Wed, 7 May 2014 08:12:31 -0700 (PDT) X-Received: by 10.224.93.16 with SMTP id t16mr39324479qam.82.1399475550492; Wed, 07 May 2014 08:12:30 -0700 (PDT) Received: from lists.xen.org (lists.xen.org. [50.57.142.19]) by mx.google.com with ESMTPS id j6si6867416qan.170.2014.05.07.08.12.29 for (version=TLSv1 cipher=RC4-SHA bits=128/128); Wed, 07 May 2014 08:12:30 -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 1Wi3Ua-0004Q0-7B; Wed, 07 May 2014 15:10:44 +0000 Received: from mail6.bemta14.messagelabs.com ([193.109.254.103]) by lists.xen.org with esmtp (Exim 4.72) (envelope-from ) id 1Wi3UX-0004OS-85 for xen-devel@lists.xensource.com; Wed, 07 May 2014 15:10:41 +0000 Received: from [193.109.254.147:42001] by server-12.bemta-14.messagelabs.com id CE/2C-27473-0FC4A635; Wed, 07 May 2014 15:10:40 +0000 X-Env-Sender: Stefano.Stabellini@citrix.com X-Msg-Ref: server-4.tower-27.messagelabs.com!1399475436!3308595!3 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 10816 invoked from network); 7 May 2014 15:10:39 -0000 Received: from smtp.citrix.com (HELO SMTP.CITRIX.COM) (66.165.176.89) by server-4.tower-27.messagelabs.com with RC4-SHA encrypted SMTP; 7 May 2014 15:10:39 -0000 X-IronPort-AV: E=Sophos; i="4.97,1004,1389744000"; d="scan'208"; a="128639615" Received: from accessns.citrite.net (HELO FTLPEX01CL03.citrite.net) ([10.9.154.239]) by FTLPIPO01.CITRIX.COM with ESMTP; 07 May 2014 15:10:35 +0000 Received: from ukmail1.uk.xensource.com (10.80.16.128) by smtprelay.citrix.com (10.13.107.80) with Microsoft SMTP Server id 14.3.181.6; Wed, 7 May 2014 11:10:33 -0400 Received: from kaball.uk.xensource.com ([10.80.2.59]) by ukmail1.uk.xensource.com with esmtp (Exim 4.69) (envelope-from ) id 1Wi3UK-0004B3-LE; Wed, 07 May 2014 16:10:28 +0100 From: Stefano Stabellini To: Date: Wed, 7 May 2014 16:09:56 +0100 Message-ID: <1399475403-5408-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); }