From patchwork Tue Oct 31 22:29:37 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: "Woods, Brian" X-Patchwork-Id: 10035463 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id DFBB260327 for ; Tue, 31 Oct 2017 22:32:12 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id CFB3328B21 for ; Tue, 31 Oct 2017 22:32:12 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id C341328B28; Tue, 31 Oct 2017 22:32:12 +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=-4.1 required=2.0 tests=BAD_ENC_HEADER,BAYES_00, DKIM_SIGNED, RCVD_IN_DNSWL_MED, T_DKIM_INVALID autolearn=ham version=3.3.1 Received: from lists.xenproject.org (lists.xenproject.org [192.237.175.120]) (using TLSv1.2 with cipher AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id 60A0528B21 for ; Tue, 31 Oct 2017 22:32:11 +0000 (UTC) Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.84_2) (envelope-from ) id 1e9f2a-0003F2-Su; Tue, 31 Oct 2017 22:29:48 +0000 Received: from mail6.bemta3.messagelabs.com ([195.245.230.39]) by lists.xenproject.org with esmtp (Exim 4.84_2) (envelope-from ) id 1e9f2Z-0003EQ-63 for xen-devel@lists.xenproject.org; Tue, 31 Oct 2017 22:29:47 +0000 Received: from [85.158.137.68] by server-17.bemta-3.messagelabs.com id 9D/06-06614-A59F8F95; Tue, 31 Oct 2017 22:29:46 +0000 X-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JxHMLmAwAA X-Env-Sender: Brian.Woods@amd.com X-Msg-Ref: server-15.tower-31.messagelabs.com!1509488983!108794455!1 X-Originating-IP: [104.47.37.57] X-SpamReason: No, hits=0.0 required=7.0 tests= X-StarScan-Received: X-StarScan-Version: 9.4.45; banners=-,-,- X-VirusChecked: Checked Received: (qmail 26397 invoked from network); 31 Oct 2017 22:29:44 -0000 Received: from mail-cys01nam02on0057.outbound.protection.outlook.com (HELO NAM02-CY1-obe.outbound.protection.outlook.com) (104.47.37.57) by server-15.tower-31.messagelabs.com with AES256-SHA256 encrypted SMTP; 31 Oct 2017 22:29:44 -0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=amdcloud.onmicrosoft.com; s=selector1-amd-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version; bh=N5d39hmgigvClcuwq1WYy8VLtdGMOMbPaURd1gqh9YY=; b=KB0UvJtOrkG1x30BbyTNua2756BLQYrQozqonxxkVSGn8iHORr9rmpNSHMPx6lHeMGsCjj1MRX9yJ+hOkuCHKdV6aLJJIkPLLDOJLXKim7UC1NMX3JhROpimb0CWSPlwECkFY0ghEX8xNW5ld4ua1DvWOcq/XCJgAcU4JcQN/bg= Received: from amd.com (165.204.77.1) by CY4PR12MB1830.namprd12.prod.outlook.com (10.175.81.148) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P256) id 15.20.156.4; Tue, 31 Oct 2017 22:29:41 +0000 Date: Tue, 31 Oct 2017 17:29:37 -0500 From: Brian Woods To: Andrew Cooper Message-ID: <20171031222937.GA1646@amd.com> References: <20171031220308.107679-1-brian.woods@amd.com> <20171031220308.107679-4-brian.woods@amd.com> <4722086f-af59-2711-5d08-9b941097eed1@citrix.com> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <4722086f-af59-2711-5d08-9b941097eed1@citrix.com> User-Agent: Mutt/1.5.24 (2015-08-30) X-Originating-IP: [165.204.77.1] X-ClientProxiedBy: CY4PR02CA0028.namprd02.prod.outlook.com (10.175.57.142) To CY4PR12MB1830.namprd12.prod.outlook.com (10.175.81.148) X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: bbb2d4d1-89c5-4b23-be74-08d520aee15b X-MS-Office365-Filtering-HT: Tenant X-Microsoft-Antispam: UriScan:; BCL:0; PCL:0; RULEID:(22001)(48565401081)(4534020)(4602075)(2017052603199)(49563074); SRVR:CY4PR12MB1830; X-Microsoft-Exchange-Diagnostics: 1; CY4PR12MB1830; 3:BCFkn9obfs6F9L7FyAJSAeys0Ppoa5goOF766RV8c7M4GzC4K6WWweP2KN0uRMkHY7xb5VQK0wn387VXM1MkBYuTY+gFgjyToqqV1aVkrtc1kJzgJu50yM9T+wpY2isp3cdmo08j9we+lfNQzWtAh7p1uYW2b5ZOWrQZh7SBwbEQFFoL/pp7Tu11RPTvfC9UNY1ULHJRT+pFLIM0BFnJ2ZcQMtn/Jnkg/wYB8oNADDWSmM8iIyiRtzDZDSVjyfce; 25:bftG0EWYjkUtXeU1NTLiiltiqU3E/lk7ToWZYwdEVCP/LGrjUtXS4DwbgZDVTJsxEiO9Oi+csdvZWfLU4Iek3Wu8agU5mW+bHKumKIiFdRbtr9WxGoYQQfZo7C5hjAcCmAESoW4qg1sZN0S6Ta5XzkgkOEGdOM9icrbfCe0L/+st8A0CaOekwcbo/RKrPTtIbcfELJtsodQ3z6rDa1oqzgySnShRCJRF6ahlJw6efNKBvs/fjM9Fi2eVrr3f4znPywZNQ/lqUs8U0lWUfkApoX1qk+nscO5CglPavWtF8QcgsZmqjy8LtMknvYswQgqiGevzAsddpmgquTP5Yj45ZA==; 31:puGweeE6G2eLvDyUQM5mQf7LLj/W7UudMJ47OjOAicOqlvUX2U7cqfsrk7yGejgBVqkNuRsPwCHMbb+dvUW3XI0i2yAZgFvI/zAvMbMaFawQ0Bw58BOCT3m36oD1qBTEUNq761z0DfP3rj/Ng6qaWfbV8GFk1/joLD+1W8VYGwv7scmiB18KkjqLfDACMEJuKj5XBkoIjIrOT7lPni5rJ6SSaQyuQgfH6rDZmSm5Ikw= X-MS-TrafficTypeDiagnostic: CY4PR12MB1830: X-Microsoft-Exchange-Diagnostics: 1; CY4PR12MB1830; 20:kpKIDPUaTOQkMYet49zh8+0XjRQLz6mEq3dlayyoyc0T3NEOo+T42fuQ/FKxHCJcRCEKxTSj+4PJJiT7NVUj2n8RnQzHjPv1In+Oo+jdjv8izcPsnutgafwlYPU10/VMu10xaSqeSmFJJ9JNgXUcbCMUdI1SIqmw8ORK3surGSqHCpuB3uqckEVHbYbWwItfn8jiILNWZF361PmmX5/DuCdKf4jS04Z9B1RnSa01mQCja2DAW4pJ7Qv54cDQI/tvFGhdn0i70orhXpx4Rof96KqOLvdU0jpop0XBu+ZHsPUm5rGLb5lmkg8Kb50IugwnZybhrat1SiSzXKLE7BO9AlkLlohIYNi4H5aMD00PkWddKu3odWPv7IzfMZ28bZGbhV88gNnuTzPJLnu4dDA36TBwzEyEn8q17B36jYL1AH9tAKdiMdfau/OPQSTEB1Vi2Jv/cwsCZ7UnQZSWNzKsI4D6ylMtHBjJRFnFKrenmuzJiOe+HiW7F1fMV++R3OCH; 4:K7eU3SagDFtC/80/ZuIOP43b0l3k9xcaHz4xoInXSg2bmK42kCOobrGmUK39+rMrvFhO1Ny838ZjExvVrKxLJ/yNS/lu9cidzSBh4bo+OjQcTRDLauQcPXBXloBttz2uRIeXctqnzX///FRFLuFtxqvgafQcnCQSfdytrcDQ0XD/BwSz254wTjNkLEA/Jp/xD08U0Ox02Lb1u97xLaqtgSuWgh0ONCc0tlvXyCy4/AOF9U4bDVIg/7lCzr1dC/ozMDOsCL6FOOBIGAROhggHvoUsbmj03yPPNBeNMGFh/AM= X-Exchange-Antispam-Report-Test: UriScan:(70601490899591); X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-CFA-Test: BCL:0; PCL:0; RULEID:(100000700101)(100105000095)(100000701101)(100105300095)(100000702101)(100105100095)(102415395)(6040450)(2401047)(5005006)(8121501046)(93006095)(93001095)(3231020)(100000703101)(100105400095)(3002001)(10201501046)(6055026)(6041248)(20161123564025)(201703131423075)(201702281528075)(201703061421075)(201703061406153)(20161123555025)(20161123560025)(20161123562025)(20161123558100)(6072148)(201708071742011)(100000704101)(100105200095)(100000705101)(100105500095); SRVR:CY4PR12MB1830; BCL:0; PCL:0; RULEID:(100000800101)(100110000095)(100000801101)(100110300095)(100000802101)(100110100095)(100000803101)(100110400095)(100000804101)(100110200095)(100000805101)(100110500095); SRVR:CY4PR12MB1830; X-Forefront-PRVS: 04772EA191 X-Forefront-Antispam-Report: SFV:NSPM; SFS:(10009020)(6009001)(346002)(376002)(39860400002)(24454002)(189002)(199003)(2950100002)(54356999)(2870700001)(50986999)(76176999)(66066001)(58126008)(5000100001)(105586002)(2906002)(21086003)(106356001)(55016002)(8666007)(4610100001)(6246003)(97736004)(53936002)(316002)(68736007)(101416001)(33656002)(4326008)(8676002)(84326002)(5890100001)(305945005)(83506002)(81166006)(36756003)(7736002)(5660300001)(229853002)(25786009)(6916009)(16526018)(6666003)(81156014)(478600001)(86362001)(8936002)(3846002)(2476003)(72206003)(1076002)(6116002)(189998001)(568964002)(18370500001)(2700100001); DIR:OUT; SFP:1101; SCL:1; SRVR:CY4PR12MB1830; H:amd.com; FPR:; SPF:None; PTR:InfoNoRecords; MX:1; A:1; LANG:en; Received-SPF: None (protection.outlook.com: amd.com does not designate permitted sender hosts) X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1; CY4PR12MB1830; 23:iJT/rbJFUAKiXyqxfqpQi5p7uJTP4GpWU9TDTe1rf?= =?us-ascii?Q?RftPu06MbdvB4MKdiqjoasW316PBSdh+5hABryHUBz+fIKUsrk2YGMsbe0zk?= =?us-ascii?Q?BwBTFZ4i/PjDMq8lVkdndKqgM5g6m9lTvzgD+LIg7y7i7I5ervGUA5oaAYTk?= =?us-ascii?Q?mHkr/+WzQIDP/yZB/qYMYGyOPVFLlOewf9l3pFx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M8cUnGWurKLCdmAUvIOpM1VYBUg0uyXV7gy7yjbaiRbo6JnA2Cy3iUvq0GFKhHz4ycvn9jEqp9QXAQSfSf/0BDiYC3VCeEgNJgA10fz7qCT7CjG5rgmwnlHhAQ8MfNDIML5Xp3DeuMd1V6T7zTrFcKOrypD8= SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-Microsoft-Exchange-Diagnostics: 1; CY4PR12MB1830; 20:yFl0vtCOEt6Q3mrCYy69MZHwbzF3FXhq59bK5rQoDU3IBgR7zZXLU+Qi1kkRmeVSfUrOua3ZjHLM8gYKpjrxasWsnpAxCm9GTeXElnkxd/pwnCO3iCWq5zK1+H8usaAZ6WJzPFxJfFoXgDskor8+jBRL9q45EjBjW3uRn8zvcjHTUfO8kUdl5jQeRnjXUNBsviS3NCYnj9cX3sv/O8S5CGeEeYIEocBNoOEc5aV+2Iv7G/6L5fbWPy0zpD1ZpMY9 X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 31 Oct 2017 22:29:41.7733 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: bbb2d4d1-89c5-4b23-be74-08d520aee15b X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 3dd8961f-e488-4e60-8e11-a82d994e183d X-MS-Exchange-Transport-CrossTenantHeadersStamped: CY4PR12MB1830 Cc: xen-devel@lists.xenproject.org, boris.ostrovsky@oracle.com, jbeulich@suse.com, suravee.suthikulpanit@amd.com Subject: Re: [Xen-devel] [PATCH 3/3] x86/svm: add virtual VMLOAD/VMSAVE support X-BeenThere: xen-devel@lists.xen.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: Xen developer discussion List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Errors-To: xen-devel-bounces@lists.xen.org Sender: "Xen-devel" X-Virus-Scanned: ClamAV using ClamSMTP On Tue, Oct 31, 2017 at 10:15:08PM +0000, Andrew Cooper wrote: > > The style in this file is quite hit and miss, but we expect new code to > conform to the standards.  In this case, the correct style is: > > if ( cpu_has_svm_vloadsave ) > { > > This can be fixed on commit if there are no other comments. > > All 3 patches Reviewed-by: Andrew Cooper > > ~Andrew > My mistake. Years of lknf has made it a habit. I'll make sure to double check next time. Attached is the git format-patch for that commit. From b0d7916a5a35096cb7309922176631f7e57efdf1 Mon Sep 17 00:00:00 2001 From: Brian Woods Date: Tue, 31 Oct 2017 14:13:01 -0500 Subject: [PATCH 3/3] x86/svm: add virtual VMLOAD/VMSAVE support MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit On AMD family 17h server processors, there is a feature called virtual VMLOAD/VMSAVE. This allows a nested hypervisor to preform a VMLOAD or VMSAVE without needing to be intercepted by the host hypervisor. Virtual VMLOAD/VMSAVE requires the host hypervisor to be in long mode and nested page tables to be enabled. For more information about it please see: AMD64 Architecture Programmer’s Manual Volume 2: System Programming http://support.amd.com/TechDocs/24593.pdf Section: VMSAVE and VMLOAD Virtualization (Section 15.33.1) This patch series adds support to check for and enable the virtual VMLOAD/VMSAVE features if available. Signed-off-by: Brian Woods --- xen/arch/x86/hvm/svm/svm.c | 1 + xen/arch/x86/hvm/svm/svmdebug.c | 2 ++ xen/arch/x86/hvm/svm/vmcb.c | 8 ++++++++ 3 files changed, 11 insertions(+) diff --git a/xen/arch/x86/hvm/svm/svm.c b/xen/arch/x86/hvm/svm/svm.c index c8ffb17515..60b1288a31 100644 --- a/xen/arch/x86/hvm/svm/svm.c +++ b/xen/arch/x86/hvm/svm/svm.c @@ -1669,6 +1669,7 @@ const struct hvm_function_table * __init start_svm(void) P(cpu_has_svm_nrips, "Next-RIP Saved on #VMEXIT"); P(cpu_has_svm_cleanbits, "VMCB Clean Bits"); P(cpu_has_svm_decode, "DecodeAssists"); + P(cpu_has_svm_vloadsave, "Virtual VMLOAD/VMSAVE"); P(cpu_has_pause_filter, "Pause-Intercept Filter"); P(cpu_has_tsc_ratio, "TSC Rate MSR"); #undef P diff --git a/xen/arch/x86/hvm/svm/svmdebug.c b/xen/arch/x86/hvm/svm/svmdebug.c index 89ef2db932..7145e2f5ca 100644 --- a/xen/arch/x86/hvm/svm/svmdebug.c +++ b/xen/arch/x86/hvm/svm/svmdebug.c @@ -55,6 +55,8 @@ void svm_vmcb_dump(const char *from, const struct vmcb_struct *vmcb) vmcb->exitinfo1, vmcb->exitinfo2); printk("np_enable = %#"PRIx64" guest_asid = %#x\n", vmcb_get_np_enable(vmcb), vmcb_get_guest_asid(vmcb)); + printk("virtual vmload/vmsave = %d virt_ext = %#"PRIx64"\n", + vmcb->virt_ext.fields.vloadsave_enable, vmcb->virt_ext.bytes); printk("cpl = %d efer = %#"PRIx64" star = %#"PRIx64" lstar = %#"PRIx64"\n", vmcb_get_cpl(vmcb), vmcb_get_efer(vmcb), vmcb->star, vmcb->lstar); printk("CR0 = 0x%016"PRIx64" CR2 = 0x%016"PRIx64"\n", diff --git a/xen/arch/x86/hvm/svm/vmcb.c b/xen/arch/x86/hvm/svm/vmcb.c index 997e7597e0..eccc1e28bf 100644 --- a/xen/arch/x86/hvm/svm/vmcb.c +++ b/xen/arch/x86/hvm/svm/vmcb.c @@ -200,6 +200,14 @@ static int construct_vmcb(struct vcpu *v) /* PAT is under complete control of SVM when using nested paging. */ svm_disable_intercept_for_msr(v, MSR_IA32_CR_PAT); + + /* use virtual VMLOAD/VMSAVE if available */ + if ( cpu_has_svm_vloadsave ) + { + vmcb->virt_ext.fields.vloadsave_enable = 1; + vmcb->_general2_intercepts &= ~GENERAL2_INTERCEPT_VMLOAD; + vmcb->_general2_intercepts &= ~GENERAL2_INTERCEPT_VMSAVE; + } } else { -- 2.11.0