Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751962AbdILPnP (ORCPT ); Tue, 12 Sep 2017 11:43:15 -0400 Received: from mail-bl2nam02on0080.outbound.protection.outlook.com ([104.47.38.80]:8448 "EHLO NAM02-BL2-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1751658AbdILPnG (ORCPT ); Tue, 12 Sep 2017 11:43:06 -0400 Authentication-Results: spf=none (sender IP is ) smtp.mailfrom=Suravee.Suthikulpanit@amd.com; From: Suravee Suthikulpanit To: kvm@vger.kernel.org, linux-kernel@vger.kernel.org Cc: pbonzini@redhat.com, rkrcmar@redhat.com, joro@8bytes.org, Suravee Suthikulpanit Subject: [PATCH v2 2/3] KVM: Add struct kvm_vcpu pointer parameter to get_enable_apicv() Date: Tue, 12 Sep 2017 10:42:41 -0500 Message-Id: <1505230962-86304-3-git-send-email-suravee.suthikulpanit@amd.com> X-Mailer: git-send-email 1.8.3.1 In-Reply-To: <1505230962-86304-1-git-send-email-suravee.suthikulpanit@amd.com> References: <1505230962-86304-1-git-send-email-suravee.suthikulpanit@amd.com> MIME-Version: 1.0 Content-Type: text/plain X-Originating-IP: [165.204.78.2] X-ClientProxiedBy: BN6PR2001CA0014.namprd20.prod.outlook.com (10.172.112.152) To CY4PR12MB1733.namprd12.prod.outlook.com (10.175.62.143) X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 3a0c0de6-177d-4c2b-e14a-08d4f9f4f2d2 X-MS-Office365-Filtering-HT: Tenant X-Microsoft-Antispam: UriScan:;BCL:0;PCL:0;RULEID:(300000500095)(300135000095)(300000501095)(300135300095)(300000502095)(300135100095)(22001)(2017030254152)(48565401081)(300000503095)(300135400095)(2017052603199)(201703131423075)(201703031133081)(201702281549075)(300000504095)(300135200095)(300000505095)(300135600095)(300000506095)(300135500095);SRVR:CY4PR12MB1733; X-Microsoft-Exchange-Diagnostics: 1;CY4PR12MB1733;3:A9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9SEz48UkO0in406+OraQT9rKb+G/aDYdNc2L18zmMruNGbqCJZcrb8/NtqTUkVI1OmKIh38ZPgNI91/t5TIFZjQUQWKc1YYMDIljshcLOwjNyD63vWdxypZaWB1sU2CkpRxq3DX6wKakiww3m8HxaudlUSsmNgwgIbWps2q0lATxFGSjybskqW8oA16T2J/cLyMCrc9QQH3JpsHi9zbktL/Arl9F3lYpAQsTWJfzGhzLfh1dNf6xHOeuJ9oohVQw1O3N0foH/pHXCvh33wWf0fkWEhbsQqYT4FoDdAWJT6FQQArH2tBYMFRvleVLoGVWZr3DakMO1bn3Uyfx/qv/IQ+wI4FEw1s;4:A6HHikucI3CvzYIYqwKbwiD6/AkMgwYOezQvdmMVOwAwWbQpmc0rL9c+6AEfcleGyKFw3QunLdxCkjMzsd5w8cMjQM6RaKG6UGS8XWIPXdiB5EYea7z1Hi29nW7CR8y+rheA4lvtQHjkAjBqhnDxDyQYKK9n1u+pyFC0kJxcm2mZfcje2gxcEoMy8Du1aZpwMI/UGejunFTRCpO4xeLDwluh1kfO4uv4L+D97XZIvm28rZ/AauJeHwooG+Cb1+2NlVK45e6TeOZEC5tRZEKk/Lhkd/PQrtuVcyVWXrd+Mr8= X-Exchange-Antispam-Report-Test: UriScan:(767451399110); X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-CFA-Test: BCL:0;PCL:0;RULEID:(100000700101)(100105000095)(100000701101)(100105300095)(100000702101)(100105100095)(6040450)(2401047)(5005006)(8121501046)(3002001)(100000703101)(100105400095)(10201501046)(93006095)(93001095)(6055026)(6041248)(201703131423075)(201702281528075)(201703061421075)(201703061406153)(20161123558100)(20161123564025)(20161123555025)(20161123560025)(20161123562025)(6072148)(201708071742011)(100000704101)(100105200095)(100000705101)(100105500095);SRVR:CY4PR12MB1733;BCL:0;PCL:0;RULEID:(100000800101)(100110000095)(100000801101)(100110300095)(100000802101)(100110100095)(100000803101)(100110400095)(100000804101)(100110200095)(100000805101)(100110500095);SRVR:CY4PR12MB1733; X-Forefront-PRVS: 042857DBB5 X-Forefront-Antispam-Report: SFV:NSPM;SFS:(10009020)(6009001)(39860400002)(199003)(189002)(305945005)(5660300001)(53416004)(7736002)(72206003)(2950100002)(25786009)(76176999)(2906002)(50986999)(106356001)(189998001)(4326008)(316002)(478600001)(33646002)(105586002)(101416001)(6486002)(48376002)(81166006)(36756003)(8936002)(47776003)(68736007)(3846002)(6116002)(81156014)(110136004)(42186005)(6666003)(97736004)(53936002)(50226002)(5003940100001)(8676002)(4720700003)(86362001)(66066001)(50466002);DIR:OUT;SFP:1101;SCL:1;SRVR:CY4PR12MB1733;H:dave-rhel73-ethanol.amd.com;FPR:;SPF:None;PTR:InfoNoRecords;A:1;MX:1;LANG:en; X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1;CY4PR12MB1733;23:vYHIMTm5Vzb5O9th2O65sPAcs+hbWqFszG14nVkbA?= =?us-ascii?Q?wVErPkztotU/vXFdpnQ/1h0xqTri/Caytg/uKeo8c09e0G7ScWVoHFwYE3xS?= =?us-ascii?Q?th4pbYz/uDYxTgoAFZxUy6CfI9nMN+7QC41ggC8uYHJVfcWWnCMGpNmmLyx2?= =?us-ascii?Q?Fi2Kc/7fw2HcbLnVVcuqQScp3lgiM026q2eCgkJ8VP403HeXi/UGHKKgXyO+?= =?us-ascii?Q?D5WBmQqBjmkEYMi0Le3hLIRi73pIO48hLT+2WW+LPrhmtPiVg9SR1EithEGm?= =?us-ascii?Q?+XqpL222x8lhIFhMPHeHwoEELYlG+7+k6Te6Qd7QWrp2lGDA9UFRKUv26Cd1?= =?us-ascii?Q?4WyACtGITacAsx5dv4JMYNnSwdcS9cl++NdomHA37KdSRbphS5BuaAaVJ0NT?= =?us-ascii?Q?ahr4i9Ol2KbZbMgfx161Fq3yFxHg/7WIMT+f9bQdlAN5WpU2jaulwSLNRgS5?= =?us-ascii?Q?KRzK1/wySN/7dpm3LSdkzOp/8EipVR3zL0axG/qbAg8uI8wH3efFSdDsOxbJ?= =?us-asc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mkVw3A==;5:sWwN5QClTLlX2rt95Y7D5JWUufBxk8VUy69hmLYR8aGnPwbSAZpXeTDnmRqNzRQZ3sVvIjhkC4+zh1oMIQBDLowEWc66w2v4OCZzqv2cWYB7af0BPLk7m6JRHEzU2Hi3C8vqHgbZVLG17yZxGZ7yVw==;24:Yfz3L93JRO2puzlQHpIeoJD9FPpVj8zjQSiESemzIw8oOjQUBBmSIqEuySnSFyudRFFAJJvD+LuYG15akZHG9gENg0VLmKMn0H9EBD1PAlI=;7:w+bipZhO5m8migRFS/tRlhL+n4kVBDb2H2B3SSwkJuRC0a3bsk+bNGvr1PVnA4/cw/FZj4dXSY9VK6ok2LXSnvAHxSWWzb9M693z9kTjr3dJhs/fHlhINoGfRA8wzNwluC3fNWpFf25JKC5ZysW5mSqe+GWlIyOyYmxHSQLcRX6wQft4I5UBM3vti/+1eOCupSaK3kjpodQh069B1E7MSJNAwba4IRrjphdisnc07oY= SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-Microsoft-Exchange-Diagnostics: 1;CY4PR12MB1733;20:pQh0Zw2FJeQXjQf9Z+oez9xMD86lF2AEnHLRWs/b9sVlxWAxWQ2ywkTIZPsLwMx0ArsQEHa5fd+OyRaVGUiB9iR+dZqo6oWug7t708f9ThwsRLytwgKG8IhWHJNQEpAj1r+1ezttzGifvH3Rvfgjb3QwPT+7yGV0RK7jyhpnglzmsJEOAgITLwdk37gVJF15naMpLYj8zAwguViC0t4RHWcptXvWER36JnEOxHnhSkaPg3qxUbTWnELEqd1/dr0O X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 12 Sep 2017 15:42:59.8262 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 3dd8961f-e488-4e60-8e11-a82d994e183d X-MS-Exchange-Transport-CrossTenantHeadersStamped: CY4PR12MB1733 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 2352 Lines: 65 Modify struct kvm_x86_ops.arch.apicv_active() to take struct kvm_vcpu pointer as parameter in preparation to subsequent changes. Signed-off-by: Suravee Suthikulpanit --- arch/x86/include/asm/kvm_host.h | 2 +- arch/x86/kvm/svm.c | 2 +- arch/x86/kvm/vmx.c | 2 +- arch/x86/kvm/x86.c | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/arch/x86/include/asm/kvm_host.h b/arch/x86/include/asm/kvm_host.h index 92c9032..bfe7b2a 100644 --- a/arch/x86/include/asm/kvm_host.h +++ b/arch/x86/include/asm/kvm_host.h @@ -969,7 +969,7 @@ struct kvm_x86_ops { void (*enable_nmi_window)(struct kvm_vcpu *vcpu); void (*enable_irq_window)(struct kvm_vcpu *vcpu); void (*update_cr8_intercept)(struct kvm_vcpu *vcpu, int tpr, int irr); - bool (*get_enable_apicv)(void); + bool (*get_enable_apicv)(struct kvm_vcpu *vcpu); void (*refresh_apicv_exec_ctrl)(struct kvm_vcpu *vcpu); void (*hwapic_irr_update)(struct kvm_vcpu *vcpu, int max_irr); void (*hwapic_isr_update)(struct kvm_vcpu *vcpu, int isr); diff --git a/arch/x86/kvm/svm.c b/arch/x86/kvm/svm.c index 316edbf..d1b3eb4 100644 --- a/arch/x86/kvm/svm.c +++ b/arch/x86/kvm/svm.c @@ -4386,7 +4386,7 @@ static void svm_set_virtual_x2apic_mode(struct kvm_vcpu *vcpu, bool set) return; } -static bool svm_get_enable_apicv(void) +static bool svm_get_enable_apicv(struct kvm_vcpu *vcpu) { return avic; } diff --git a/arch/x86/kvm/vmx.c b/arch/x86/kvm/vmx.c index c6ef294..8a7ab16 100644 --- a/arch/x86/kvm/vmx.c +++ b/arch/x86/kvm/vmx.c @@ -4983,7 +4983,7 @@ static void vmx_disable_intercept_msr_x2apic(u32 msr, int type, bool apicv_activ } } -static bool vmx_get_enable_apicv(void) +static bool vmx_get_enable_apicv(struct kvm_vcpu *vcpu) { return enable_apicv; } diff --git a/arch/x86/kvm/x86.c b/arch/x86/kvm/x86.c index 272320e..946875c 100644 --- a/arch/x86/kvm/x86.c +++ b/arch/x86/kvm/x86.c @@ -7935,7 +7935,7 @@ int kvm_arch_vcpu_init(struct kvm_vcpu *vcpu) BUG_ON(vcpu->kvm == NULL); kvm = vcpu->kvm; - vcpu->arch.apicv_active = kvm_x86_ops->get_enable_apicv(); + vcpu->arch.apicv_active = kvm_x86_ops->get_enable_apicv(vcpu); vcpu->arch.pv.pv_unhalted = false; vcpu->arch.emulate_ctxt.ops = &emulate_ops; if (!irqchip_in_kernel(kvm) || kvm_vcpu_is_reset_bsp(vcpu)) -- 1.8.3.1