From patchwork Thu Dec 17 20:22:50 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Boris Ostrovsky X-Patchwork-Id: 7877161 Return-Path: X-Original-To: patchwork-xen-devel@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork2.web.kernel.org (Postfix) with ESMTP id 7F1A8BEEE5 for ; Thu, 17 Dec 2015 20:24:54 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 92A62203FB for ; Thu, 17 Dec 2015 20:24:53 +0000 (UTC) Received: from lists.xen.org (lists.xenproject.org [50.57.142.19]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id B39DE20392 for ; Thu, 17 Dec 2015 20:24:52 +0000 (UTC) Received: from localhost ([127.0.0.1] helo=lists.xen.org) by lists.xen.org with esmtp (Exim 4.72) (envelope-from ) id 1a9f3r-00056n-Gi; Thu, 17 Dec 2015 20:22:03 +0000 Received: from mail6.bemta4.messagelabs.com ([85.158.143.247]) by lists.xen.org with esmtp (Exim 4.72) (envelope-from ) id 1a9f3p-00054D-Qb for xen-devel@lists.xen.org; Thu, 17 Dec 2015 20:22:01 +0000 Received: from [85.158.143.35] by server-2.bemta-4.messagelabs.com id AB/AC-18316-96913765; Thu, 17 Dec 2015 20:22:01 +0000 X-Env-Sender: boris.ostrovsky@oracle.com X-Msg-Ref: server-11.tower-21.messagelabs.com!1450383719!5961441!1 X-Originating-IP: [141.146.126.69] X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: VHJ1c3RlZCBJUDogMTQxLjE0Ni4xMjYuNjkgPT4gMjc3MjE4\n X-StarScan-Received: X-StarScan-Version: 7.35.1; banners=-,-,- X-VirusChecked: Checked Received: (qmail 30427 invoked from network); 17 Dec 2015 20:22:00 -0000 Received: from aserp1040.oracle.com (HELO aserp1040.oracle.com) (141.146.126.69) by server-11.tower-21.messagelabs.com with DHE-RSA-AES256-GCM-SHA384 encrypted SMTP; 17 Dec 2015 20:22:00 -0000 Received: from userv0021.oracle.com (userv0021.oracle.com [156.151.31.71]) by aserp1040.oracle.com (Sentrion-MTA-4.3.2/Sentrion-MTA-4.3.2) with ESMTP id tBHKLvpu031977 (version=TLSv1 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK); Thu, 17 Dec 2015 20:21:57 GMT Received: from aserv0122.oracle.com (aserv0122.oracle.com [141.146.126.236]) by userv0021.oracle.com (8.13.8/8.13.8) with ESMTP id tBHKLu7k021428 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=FAIL); Thu, 17 Dec 2015 20:21:56 GMT Received: from abhmp0005.oracle.com (abhmp0005.oracle.com [141.146.116.11]) by aserv0122.oracle.com (8.13.8/8.13.8) with ESMTP id tBHKLu2I008991; Thu, 17 Dec 2015 20:21:56 GMT Received: from ovs104.us.oracle.com (/10.149.76.204) by default (Oracle Beehive Gateway v4.0) with ESMTP ; Thu, 17 Dec 2015 12:21:56 -0800 From: Boris Ostrovsky To: jbeulich@suse.com, andrew.cooper3@citrix.com, keir@xen.org Date: Thu, 17 Dec 2015 15:22:50 -0500 Message-Id: <1450383771-3636-2-git-send-email-boris.ostrovsky@oracle.com> X-Mailer: git-send-email 1.7.1 In-Reply-To: <1450383771-3636-1-git-send-email-boris.ostrovsky@oracle.com> References: <1450383771-3636-1-git-send-email-boris.ostrovsky@oracle.com> X-Source-IP: userv0021.oracle.com [156.151.31.71] Cc: Boris Ostrovsky , xen-devel@lists.xen.org Subject: [Xen-devel] [PATCH v2 1/2] x86/mm: Add information about faulted page's presence to npfec structure X-BeenThere: xen-devel@lists.xen.org X-Mailman-Version: 2.1.13 Precedence: list List-Id: Xen developer discussion 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-Spam-Status: No, score=-4.2 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_MED, UNPARSEABLE_RELAY autolearn=unavailable version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP This is provided explicitly in SVM and implicitly in VMX (when neither of the three EPT_EFFECTIVE_* bits is set). Signed-off-by: Boris Ostrovsky Reviewed-by: Jan Beulich Acked-by: Kevin Tian --- xen/arch/x86/hvm/svm/svm.c | 3 ++- xen/arch/x86/hvm/vmx/vmx.c | 5 ++++- xen/include/xen/mm.h | 1 + 3 files changed, 7 insertions(+), 2 deletions(-) diff --git a/xen/arch/x86/hvm/svm/svm.c b/xen/arch/x86/hvm/svm/svm.c index 0078100..a66d854 100644 --- a/xen/arch/x86/hvm/svm/svm.c +++ b/xen/arch/x86/hvm/svm/svm.c @@ -1491,7 +1491,8 @@ static void svm_do_nested_pgfault(struct vcpu *v, struct npfec npfec = { .read_access = !(pfec & PFEC_insn_fetch), .write_access = !!(pfec & PFEC_write_access), - .insn_fetch = !!(pfec & PFEC_insn_fetch) + .insn_fetch = !!(pfec & PFEC_insn_fetch), + .present = !!(pfec & PFEC_page_present), }; /* These bits are mutually exclusive */ diff --git a/xen/arch/x86/hvm/vmx/vmx.c b/xen/arch/x86/hvm/vmx/vmx.c index 2922673..7ea1882 100644 --- a/xen/arch/x86/hvm/vmx/vmx.c +++ b/xen/arch/x86/hvm/vmx/vmx.c @@ -2746,7 +2746,10 @@ static void ept_handle_violation(unsigned long qualification, paddr_t gpa) .read_access = !!(qualification & EPT_READ_VIOLATION) || !!(qualification & EPT_WRITE_VIOLATION), .write_access = !!(qualification & EPT_WRITE_VIOLATION), - .insn_fetch = !!(qualification & EPT_EXEC_VIOLATION) + .insn_fetch = !!(qualification & EPT_EXEC_VIOLATION), + .present = !!(qualification & (EPT_EFFECTIVE_READ | + EPT_EFFECTIVE_WRITE | + EPT_EFFECTIVE_EXEC)) }; if ( tb_init_done ) diff --git a/xen/include/xen/mm.h b/xen/include/xen/mm.h index 5d4b64b..a795dd6 100644 --- a/xen/include/xen/mm.h +++ b/xen/include/xen/mm.h @@ -159,6 +159,7 @@ struct npfec { unsigned int read_access:1; unsigned int write_access:1; unsigned int insn_fetch:1; + unsigned int present:1; unsigned int gla_valid:1; unsigned int kind:2; /* npfec_kind_t */ };