From patchwork Wed Apr 3 08:56:37 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Razvan Cojocaru X-Patchwork-Id: 10883043 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 4DCE513B5 for ; Wed, 3 Apr 2019 08:58:46 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 38A2728869 for ; Wed, 3 Apr 2019 08:58:46 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 2D300289B5; Wed, 3 Apr 2019 08:58:46 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-5.2 required=2.0 tests=BAYES_00,MAILING_LIST_MULTI, RCVD_IN_DNSWL_MED autolearn=ham version=3.3.1 Received: from lists.xenproject.org (lists.xenproject.org [192.237.175.120]) (using TLSv1.2 with cipher AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id CD5B228869 for ; Wed, 3 Apr 2019 08:58:45 +0000 (UTC) Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.89) (envelope-from ) id 1hBbhR-0001NI-1F; Wed, 03 Apr 2019 08:56:49 +0000 Received: from all-amaz-eas1.inumbo.com ([34.197.232.57] helo=us1-amaz-eas2.inumbo.com) by lists.xenproject.org with esmtp (Exim 4.89) (envelope-from ) id 1hBbhQ-0001ND-7d for xen-devel@lists.xenproject.org; Wed, 03 Apr 2019 08:56:48 +0000 X-Inumbo-ID: 66ae0a5c-55ee-11e9-b170-13ed7f8f7960 Received: from mx01.bbu.dsd.mx.bitdefender.com (unknown [91.199.104.161]) by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS id 66ae0a5c-55ee-11e9-b170-13ed7f8f7960; Wed, 03 Apr 2019 08:56:43 +0000 (UTC) Received: from smtp.bitdefender.com (smtp01.buh.bitdefender.com [10.17.80.75]) by mx01.bbu.dsd.mx.bitdefender.com (Postfix) with ESMTPS id CC48D3041469; Wed, 3 Apr 2019 11:56:41 +0300 (EEST) Received: from rcojocaru.npunix.bitdefender.biz (unknown [10.17.12.174]) by smtp.bitdefender.com (Postfix) with ESMTPSA id 9C912306E477; Wed, 3 Apr 2019 11:56:41 +0300 (EEST) From: Razvan Cojocaru To: xen-devel@lists.xenproject.org Date: Wed, 3 Apr 2019 11:56:37 +0300 Message-Id: <1554281797-21368-1-git-send-email-rcojocaru@bitdefender.com> X-Mailer: git-send-email 2.7.4 Subject: [Xen-devel] [PATCH] x86/altp2m: treat view 0 as the hostp2m in p2m_get_mem_access() X-BeenThere: xen-devel@lists.xenproject.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: Xen developer discussion List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Cc: tamas@tklengyel.com, wei.liu2@citrix.com, Razvan Cojocaru , george.dunlap@eu.citrix.com, andrew.cooper3@citrix.com, jbeulich@suse.com, roger.pau@citrix.com MIME-Version: 1.0 Errors-To: xen-devel-bounces@lists.xenproject.org Sender: "Xen-devel" X-Virus-Scanned: ClamAV using ClamSMTP p2m_set_mem_access() (and other places) treat view 0 as the hostp2m, but p2m_get_mem_access() does not. Correct that inconsistency. Signed-off-by: Razvan Cojocaru Acked-by: Tamas K Lengyel --- xen/arch/x86/mm/mem_access.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/xen/arch/x86/mm/mem_access.c b/xen/arch/x86/mm/mem_access.c index 56c06a4..a144bb0 100644 --- a/xen/arch/x86/mm/mem_access.c +++ b/xen/arch/x86/mm/mem_access.c @@ -505,7 +505,7 @@ int p2m_get_mem_access(struct domain *d, gfn_t gfn, xenmem_access_t *access, if ( altp2m_idx ) return -EINVAL; } - else + else if ( altp2m_idx ) /* altp2m view 0 is treated as the hostp2m */ { if ( altp2m_idx >= MAX_ALTP2M || d->arch.altp2m_eptp[altp2m_idx] == mfn_x(INVALID_MFN) )