Message ID | 148846755776.2349.6707914627128907579.stgit@brijesh-build-machine (mailing list archive) |
---|---|
State | New, archived |
Headers | show
Return-Path: <kvm-owner@kernel.org> 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 C89F560429 for <patchwork-kvm@patchwork.kernel.org>; Thu, 2 Mar 2017 15:53:56 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id B882628485 for <patchwork-kvm@patchwork.kernel.org>; Thu, 2 Mar 2017 15:53:56 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id ACD37285A3; Thu, 2 Mar 2017 15:53:56 +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=-6.9 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,RCVD_IN_DNSWL_HI autolearn=unavailable version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 12EFA28485 for <patchwork-kvm@patchwork.kernel.org>; Thu, 2 Mar 2017 15:53:56 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754495AbdCBPwi (ORCPT <rfc822;patchwork-kvm@patchwork.kernel.org>); Thu, 2 Mar 2017 10:52:38 -0500 Received: from mail-dm3nam03on0088.outbound.protection.outlook.com ([104.47.41.88]:61888 "EHLO NAM03-DM3-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1753553AbdCBPwK (ORCPT <rfc822;kvm@vger.kernel.org>); Thu, 2 Mar 2017 10:52:10 -0500 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=SIfKjL/Kqgv8euDikRYtz/YCZVQFD5pRNey/SZzxsMA=; b=zQfoZaqDlBTtKFT6FdUo1ayQ0G/9+IqjmDZcfr1mXJ807vwEAgtSQArvQjgx034mLp/PxV0NQgWb0Hl7vJpdS98GI0DG01ZhLwHbZaveWRBEAIm6tc9sfIQJeHhn6hAOTOWIQ1BgwNLMgOLqGVmAAINVWkdBxkTtkqPV3XzjdBI= Authentication-Results: vger.kernel.org; dkim=none (message not signed) header.d=none; vger.kernel.org; dmarc=none action=none header.from=amd.com; Received: from [127.0.1.1] (165.204.77.1) by BN6PR12MB1602.namprd12.prod.outlook.com (10.172.20.151) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P384) id 15.1.947.12; Thu, 2 Mar 2017 15:12:39 +0000 Subject: [RFC PATCH v2 03/32] KVM: SVM: prepare for new bit definition in nested_ctl From: Brijesh Singh <brijesh.singh@amd.com> To: <simon.guinot@sequanux.org>, <linux-efi@vger.kernel.org>, <brijesh.singh@amd.com>, <kvm@vger.kernel.org>, <rkrcmar@redhat.com>, <matt@codeblueprint.co.uk>, <linux-pci@vger.kernel.org>, <linus.walleij@linaro.org>, <gary.hook@amd.com>, <linux-mm@kvack.org>, <paul.gortmaker@windriver.com>, <hpa@zytor.com>, <cl@linux.com>, <dan.j.williams@intel.com>, <aarcange@redhat.com>, <sfr@canb.auug.org.au>, <andriy.shevchenko@linux.intel.com>, <herbert@gondor.apana.org.au>, <bhe@redhat.com>, <xemul@parallels.com>, <joro@8bytes.org>, <x86@kernel.org>, <peterz@infradead.org>, <piotr.luc@intel.com>, <mingo@redhat.com>, <msalter@redhat.com>, <ross.zwisler@linux.intel.com>, <bp@suse.de>, <dyoung@redhat.com>, <thomas.lendacky@amd.com>, <jroedel@suse.de>, <keescook@chromium.org>, <arnd@arndb.de>, <toshi.kani@hpe.com>, <mathieu.desnoyers@efficios.com>, <luto@kernel.org>, <devel@linuxdriverproject.org>, <bhelgaas@google.com>, <tglx@linutronix.de>, <mchehab@kernel.org>, <iamjoonsoo.kim@lge.com>, <labbott@fedoraproject.org>, <tony.luck@intel.com>, <alexandre.bounine@idt.com>, <kuleshovmail@gmail.com>, <linux-kernel@vger.kernel.org>, <mcgrof@kernel.org>, <mst@redhat.com>, <linux-crypto@vger.kernel.org>, <tj@kernel.org>, <pbonzini@redhat.com>, <akpm@linux-foundation.org>, <davem@davemloft.net> Date: Thu, 2 Mar 2017 10:12:37 -0500 Message-ID: <148846755776.2349.6707914627128907579.stgit@brijesh-build-machine> In-Reply-To: <148846752022.2349.13667498174822419498.stgit@brijesh-build-machine> References: <148846752022.2349.13667498174822419498.stgit@brijesh-build-machine> User-Agent: StGit/0.17.1-dirty MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit X-Originating-IP: [165.204.77.1] X-ClientProxiedBy: DM5PR18CA0037.namprd18.prod.outlook.com (10.173.208.23) To BN6PR12MB1602.namprd12.prod.outlook.com (10.172.20.151) X-MS-Office365-Filtering-Correlation-Id: 8880384e-3663-4d0a-a0ea-08d4617e9369 X-MS-Office365-Filtering-HT: Tenant X-Microsoft-Antispam: UriScan:; BCL:0; PCL:0; RULEID:(22001)(48565401081); SRVR:BN6PR12MB1602; X-Microsoft-Exchange-Diagnostics: 1; BN6PR12MB1602; 3:0qNVdFtH66Xx0s/KaXhCp4oB9lF1Kdn03t5VtD2fPQgXuRTZrjHu9CyUQRjsbDZZ0L4/wSZKfmdltdTSn+IURABa5uGO6qVqg8unUqXbGx3Z0y0BuY6OsuhWV79QaYKppOwvvl0647P5ADkI8I51y06zrCC3jERIb9/Lpfhp4uJ4OI/C13alxjE7rbJ0XCwWGQe8+cjrpFfWxmlW6YKk/psCoRikU6KSG2ivi0MwISu8QrxnxERTbfU+3bk01xP3CEcS0bBXZDIbc4ty4j18ssak+jNKEzoTMGOEL3MxR34=; 25:uvWEMEdsgT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4sZMFDr0jYeCH3rsie5jDjWHXrnNYLY1CBZvrjY8Fq+rWuuT8RpHw+FKW483T1S1cRTveta4sTay36ipEi1bznWt2uqz07pnr4dRg+TJf6QXgu+RhHVQX8VPEOSRs8QwJzd2jXsCCw/2SNx9ivBsnTTKr8+WWhi X-Microsoft-Antispam-PRVS: <BN6PR12MB1602726B7C834BDAA82AA33AE5280@BN6PR12MB1602.namprd12.prod.outlook.com> X-Exchange-Antispam-Report-Test: UriScan:(767451399110); X-Exchange-Antispam-Report-CFA-Test: BCL:0; PCL:0; RULEID:(6040375)(601004)(2401047)(8121501046)(5005006)(3002001)(10201501046)(6055026)(6041248)(20161123562025)(20161123564025)(20161123560025)(20161123555025)(20161123558025)(6072148); SRVR:BN6PR12MB1602; BCL:0; PCL:0; RULEID:; SRVR:BN6PR12MB1602; X-Microsoft-Exchange-Diagnostics: 1; BN6PR12MB1602; 4:IhdGByPmgBpaQ4saMBLs+Hm5FOiZEiGEqm9zzV3GKLYt72rft6lNNaCIx7YeVw6HXFeChAWQ/JndaKRXzY9szhkM0+1LviRB2fEhRLZ78fjq8hxWfbygbBc+co6OJL8L3RU7ZGyfRhaWeUw7w3PeZkxs6Mo4zGRIs8ztNZPdxGLQ5si6VrOTmt4/40zjjgZ0j2IT8dSAY9OcRC8xs8yw5rt0tm5vIaWSUi6JuCFmtCcMoFGOsTKhDry10SpaI8bD84ThZho0VYVQ5Y/HNs/yE/sLARcKVJs5oIpjOKoP0V1d17KpkSYRDAVu4DTEA2J3edm0S1hAlaOdHIMveS4cb/0LQkiuCd8utCzu674Qh4lWbqku0bBaVQi/tAwBkEtkIGmuoKm82f4UhCiymhYY2S6608l51409Du0HeluiRYaacJ2oUZJvnEOibaoHOh3hG+r1DthCCvMk8K8QAWowVkFwNG7gmKM0oK5bjBLGJSIJqb6ar8XRJCnQZfhGWxg2m9eDXCn0bBBfSTtsvibWf6SS+M7lkFTbewRki++e9BeB9UOUGKo/JzJDnXgHwdOnlddz4gFC3h/a39S8AdfhURGot6NnMXSbzhbAni35yjZoUAxnCgoRRG9XhSVN2oJEq8A5KYHJu+eSPZNkUA+cZkkSfgkkCn6b09lj4sXALQc= X-Forefront-PRVS: 023495660C X-Forefront-Antispam-Report: SFV:NSPM; SFS:(10009020)(4630300001)(6009001)(6049001)(7916002)(39850400002)(39450400003)(39860400002)(39840400002)(39410400002)(25786008)(77096006)(23676002)(50466002)(47776003)(6486002)(230700001)(66066001)(5660300001)(9686003)(3846002)(50986999)(92566002)(83506001)(7416002)(7366002)(7736002)(7406005)(305945005)(103116003)(42186005)(1191002)(2906002)(90366009)(54356999)(33716001)(6116002)(53936002)(33646002)(2950100002)(8676002)(81166006)(38730400002)(2201001)(86362001)(189998001)(76176999)(921003)(2101003)(84006005)(1121003)(83996005)(217873001); DIR:OUT; SFP:1101; SCL:1; SRVR:BN6PR12MB1602; H:[127.0.1.1]; FPR:; SPF:None; MLV:sfv; LANG:en; X-Microsoft-Exchange-Diagnostics: =?utf-8?B?MTtCTjZQUjEyTUIxNjAyOzIzOnJSdWhjVGttOXBNeEJkWTMxQytHc2MvMklI?= =?utf-8?B?eHVmOWRmQXJ5bWxxdEN4YTdEWHMrb0IrTVZTZjFtY2x5RG5yblJsT2dKRi95?= =?utf-8?B?NXNWeXJCN2tJRVY0d0IwOGFQVytXOFNLRGg3cFpzSjB3bjlJeTQ2TmJ0WGRm?= =?utf-8?B?dWFlT3VGSUR0UVgyRXdleTRTRVRyNy80eGkvYWtKZXdnb0NMV05uSGVEMEhY?= =?utf-8?B?aHRURlFaWXRwbGZ6R0pMRHRwamR5OFA3aGxmSUtudWZybnQ2UmZ1Y3cwckZm?= =?utf-8?B?b1BDa3JlcXpUSlg2ZjN3N0JUVEZKak10N1RqcytvbFFJR1dtSExxOUMxN2tO?= =?utf-8?B?SXVLRE9EZHE2YTVtUGNSZzFWZXBkZmk0SVFhK0xZVkluVTI2bFl3aUJIclhU?= =?utf-8?B?ZWFsWUJBSEIvUGo4cWdxSTYvL1VVTl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pvzMX9Cc4BpKYeMrHNM7Grb3Kl4ryY083z3YcxxwsBEuaKlDJiAirtpg0B4eJiRf0iBmVZ6Icjvk+GA7/qqXGfus6GyA0eSk= SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-Microsoft-Exchange-Diagnostics: 1; BN6PR12MB1602; 7:JBd+Hyc0dJEmuqBfhRWRiaS586EmBTQVmctX2ijThWfhjAzN5n62SbvDn3/Hq7NKaWSUJhggdHnBn4Qwrnlifpon6qlt9eawmlWjDvsVouWIPe2GZC105Pu+xU54t4Krmgt3BVjNGrkoR0sIeSCvgrpJetim0kyAOO5vZA/ekPLHU9h46vZREO2Nfs2539WYmHYM1L17mvFOuR83aMhjp5kHSkbPwBQb48GLsTmlaKWVgjrOuWtX5XvBrLYdlC2K48SsY/kLm4AJqTIkUUWS0nqAPud4W3rRuWMnV6TGbQPzOjEMGr8mwnWOoGtV8tcUSNlyFMJaI8bsXVb2urXz1Q==; 20:za3iKX0Yvq6k8Jlr/kqVV73RJ9otKlqmlsphRJN3CBo6pVY+89NvMf2mZ13+BxoYvSLBD1yFVBkpQRgrkepznobPBIWnc31fGERR/h2TJhAMunAWcIQR/UbSuHoUWytvT6SvzAujPy1X5c717d/3787M7oEbsorX9yktm26459pPOKl00j3qfFa/+IZnzDollf9pK7NFeC/2t8PZcaCbPRwB0bBgsvkM2H8Ns9yXUygUk75y38TO5ZZnTcoFV3Ya X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 02 Mar 2017 15:12:39.9511 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-Transport-CrossTenantHeadersStamped: BN6PR12MB1602 Sender: kvm-owner@vger.kernel.org Precedence: bulk List-ID: <kvm.vger.kernel.org> X-Mailing-List: kvm@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP |
diff --git a/arch/x86/include/asm/svm.h b/arch/x86/include/asm/svm.h index 14824fc..2aca535 100644 --- a/arch/x86/include/asm/svm.h +++ b/arch/x86/include/asm/svm.h @@ -136,6 +136,8 @@ struct __attribute__ ((__packed__)) vmcb_control_area { #define SVM_VM_CR_SVM_LOCK_MASK 0x0008ULL #define SVM_VM_CR_SVM_DIS_MASK 0x0010ULL +#define SVM_NESTED_CTL_NP_ENABLE BIT(0) + struct __attribute__ ((__packed__)) vmcb_seg { u16 selector; u16 attrib; diff --git a/arch/x86/kvm/svm.c b/arch/x86/kvm/svm.c index 08a4d3a..75b0645 100644 --- a/arch/x86/kvm/svm.c +++ b/arch/x86/kvm/svm.c @@ -1246,7 +1246,7 @@ static void init_vmcb(struct vcpu_svm *svm) if (npt_enabled) { /* Setup VMCB for Nested Paging */ - control->nested_ctl = 1; + control->nested_ctl |= SVM_NESTED_CTL_NP_ENABLE; clr_intercept(svm, INTERCEPT_INVLPG); clr_exception_intercept(svm, PF_VECTOR); clr_cr_intercept(svm, INTERCEPT_CR3_READ); @@ -2840,7 +2840,8 @@ static bool nested_vmcb_checks(struct vmcb *vmcb) if (vmcb->control.asid == 0) return false; - if (vmcb->control.nested_ctl && !npt_enabled) + if ((vmcb->control.nested_ctl & SVM_NESTED_CTL_NP_ENABLE) && + !npt_enabled) return false; return true; @@ -2915,7 +2916,7 @@ static bool nested_svm_vmrun(struct vcpu_svm *svm) else svm->vcpu.arch.hflags &= ~HF_HIF_MASK; - if (nested_vmcb->control.nested_ctl) { + if (nested_vmcb->control.nested_ctl & SVM_NESTED_CTL_NP_ENABLE) { kvm_mmu_unload(&svm->vcpu); svm->nested.nested_cr3 = nested_vmcb->control.nested_cr3; nested_svm_init_mmu_context(&svm->vcpu);