From patchwork Thu Mar 26 22:05:26 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tamas K Lengyel X-Patchwork-Id: 46394 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-wi0-f200.google.com (mail-wi0-f200.google.com [209.85.212.200]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id D0B8421584 for ; Thu, 26 Mar 2015 22:08:09 +0000 (UTC) Received: by wibfv9 with SMTP id fv9sf948491wib.1 for ; Thu, 26 Mar 2015 15:08:09 -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:cc:subject:precedence:list-id:list-unsubscribe:list-post :list-help:list-subscribe:mime-version:content-type :content-transfer-encoding:sender:errors-to:x-original-sender :x-original-authentication-results:mailing-list:list-archive; bh=bB4NIi7mwsMovpu0YTbV+631ckUHCaKZQCnRwSkRj1o=; b=G+RbKvqeInKtGrF6zjwY2lnEptKBPacKYK36QOFoYAejuesuwlg+Sr6oG2s3Tkbnlk 5vlfYgs2srdSM0i/v4XOcV8t91AXzuUMKMxB5Dno41uLdG6ePVF/BspXTsbaHTHiX8q5 4+mXm25lC8eyu+qHUz9MzbG6ukMNGUAlb1RGl9n1iEtZhb/LfP0XVw6QlYJ6BVR9a4cA BgpdXDfoXHmqZl95+oVfAYvPTw7UxZ9Zl73u0PtkEHz20rN2kxMUEB7u1uzHa2W79nVA QCMlwvkS69BlDMgoVnui5ABatOKYEb79thYTos+89Vtm5KwbESOaniJv/xXIYU0hLUO2 HGgQ== X-Gm-Message-State: ALoCoQmIAd69PK67weZT1Y7K2FRpKo41AKJ7kavDuBx9tbZYOd4g0S9SRnk8NWo7rJFdHKUYFiDg X-Received: by 10.180.23.40 with SMTP id j8mr3042930wif.2.1427407689112; Thu, 26 Mar 2015 15:08:09 -0700 (PDT) X-BeenThere: patchwork-forward@linaro.org Received: by 10.152.197.2 with SMTP id iq2ls298530lac.100.gmail; Thu, 26 Mar 2015 15:08:09 -0700 (PDT) X-Received: by 10.112.133.2 with SMTP id oy2mr15461072lbb.124.1427407688985; Thu, 26 Mar 2015 15:08:08 -0700 (PDT) Received: from mail-la0-f49.google.com (mail-la0-f49.google.com. [209.85.215.49]) by mx.google.com with ESMTPS id rk2si60609lac.100.2015.03.26.15.08.08 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 26 Mar 2015 15:08:08 -0700 (PDT) Received-SPF: pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.215.49 as permitted sender) client-ip=209.85.215.49; Received: by lahp7 with SMTP id p7so38031095lah.2 for ; Thu, 26 Mar 2015 15:08:08 -0700 (PDT) X-Received: by 10.112.29.36 with SMTP id g4mr6892997lbh.56.1427407688902; Thu, 26 Mar 2015 15:08:08 -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.112.57.201 with SMTP id k9csp885889lbq; Thu, 26 Mar 2015 15:08:08 -0700 (PDT) X-Received: by 10.140.25.208 with SMTP id 74mr20071200qgt.58.1427407687465; Thu, 26 Mar 2015 15:08:07 -0700 (PDT) Received: from lists.xen.org (lists.xen.org. [50.57.142.19]) by mx.google.com with ESMTPS id j5si102544qhc.33.2015.03.26.15.08.06 (version=TLSv1 cipher=RC4-SHA bits=128/128); Thu, 26 Mar 2015 15:08:07 -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 1YbFub-0000Z0-6x; Thu, 26 Mar 2015 22:06:01 +0000 Received: from mail6.bemta14.messagelabs.com ([193.109.254.103]) by lists.xen.org with esmtp (Exim 4.72) (envelope-from ) id 1YbFuZ-0000Y2-Lh for xen-devel@lists.xen.org; Thu, 26 Mar 2015 22:05:59 +0000 Received: from [193.109.254.147] by server-11.bemta-14.messagelabs.com id 5F/D1-32337-7C284155; Thu, 26 Mar 2015 22:05:59 +0000 X-Env-Sender: tklengyel@sec.in.tum.de X-Msg-Ref: server-2.tower-27.messagelabs.com!1427407558!13502479!1 X-Originating-IP: [131.159.0.8] X-SpamReason: No, hits=0.0 required=7.0 tests= X-StarScan-Received: X-StarScan-Version: 6.13.6; banners=-,-,- X-VirusChecked: Checked Received: (qmail 24990 invoked from network); 26 Mar 2015 22:05:58 -0000 Received: from mail-out1.informatik.tu-muenchen.de (HELO mail-out1.informatik.tu-muenchen.de) (131.159.0.8) by server-2.tower-27.messagelabs.com with DHE-RSA-AES256-SHA encrypted SMTP; 26 Mar 2015 22:05:58 -0000 Received: from files.sec.in.tum.de (files.sec.in.tum.de [131.159.50.1]) by services.sec.in.tum.de (Postfix) with ESMTP id E818010194890; Thu, 26 Mar 2015 23:05:55 +0100 (CET) Received: from ourea.sec.in.tum.de (ourea.sec.in.tum.de [131.159.50.52]) by files.sec.in.tum.de (Postfix) with ESMTP id DDB36C002016; Thu, 26 Mar 2015 23:05:55 +0100 (CET) From: Tamas K Lengyel To: xen-devel@lists.xen.org Date: Thu, 26 Mar 2015 23:05:26 +0100 Message-Id: <1427407531-31694-3-git-send-email-tklengyel@sec.in.tum.de> X-Mailer: git-send-email 2.1.4 In-Reply-To: <1427407531-31694-1-git-send-email-tklengyel@sec.in.tum.de> References: <1427407531-31694-1-git-send-email-tklengyel@sec.in.tum.de> Cc: wei.liu2@citrix.com, ian.campbell@citrix.com, stefano.stabellini@eu.citrix.com, ian.jackson@eu.citrix.com, julien.grall@linaro.org, tim@xen.org, stefano.stabellini@citrix.com, jbeulich@suse.com, keir@xen.org Subject: [Xen-devel] [PATCH V14 2/7] xen/arm: Implement domain_get_maximum_gpfn 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: , MIME-Version: 1.0 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: patch@linaro.org X-Original-Authentication-Results: mx.google.com; spf=pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.215.49 as permitted sender) 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: Julien Grall The function domain_get_maximum_gpfn is returning the maximum gpfn ever mapped in the guest. We can use d->arch.p2m.max_mapped_gfn for this purpose. We use this in xenaccess as to avoid the user attempting to set page permissions on pages which don't exist for the domain, as a non-arch specific sanity check. Signed-off-by: Julien Grall --- xen/arch/arm/mm.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/xen/arch/arm/mm.c b/xen/arch/arm/mm.c index 7d4ba0c..ca0aa69 100644 --- a/xen/arch/arm/mm.c +++ b/xen/arch/arm/mm.c @@ -985,7 +985,7 @@ int page_is_ram_type(unsigned long mfn, unsigned long mem_type) unsigned long domain_get_maximum_gpfn(struct domain *d) { - return -ENOSYS; + return d->arch.p2m.max_mapped_gfn; } void share_xen_page_with_guest(struct page_info *page,