Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754301AbdIFDkS (ORCPT ); Tue, 5 Sep 2017 23:40:18 -0400 Received: from mail-dm3nam03on0085.outbound.protection.outlook.com ([104.47.41.85]:7154 "EHLO NAM03-DM3-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1752353AbdIFDkK (ORCPT ); Tue, 5 Sep 2017 23:40:10 -0400 From: Suravee Suthikulpanit To: linux-kernel@vger.kernel.org, kvm@vger.kernel.org Cc: pbonzini@redhat.com, rkrcmar@redhat.com, joro@8bytes.org, Suravee Suthikulpanit Subject: [PATCH 2/3] KVM: Add struct kvm_vcpu pointer parameter to get_enable_apicv() Date: Tue, 5 Sep 2017 22:39:28 -0500 Message-Id: <1504669169-4919-3-git-send-email-suravee.suthikulpanit@amd.com> X-Mailer: git-send-email 1.8.3.1 In-Reply-To: <1504669169-4919-1-git-send-email-suravee.suthikulpanit@amd.com> References: <1504669169-4919-1-git-send-email-suravee.suthikulpanit@amd.com> MIME-Version: 1.0 Content-Type: text/plain X-Originating-IP: [114.109.128.54] X-ClientProxiedBy: SG2PR06CA0102.apcprd06.prod.outlook.com (10.170.138.28) To DM5PR12MB1737.namprd12.prod.outlook.com (10.175.89.142) X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 4eacc8c4-5d2a-4ead-3e6e-08d4f4d8f8f0 X-MS-Office365-Filtering-HT: Tenant X-Microsoft-Antispam: UriScan:;BCL:0;PCL:0;RULEID:(300000500095)(300135000095)(300000501095)(300135300095)(22001)(300000502095)(300135100095)(2017030254152)(48565401081)(300000503095)(300135400095)(2017052603199)(201703131423075)(201703031133081)(201702281549075)(300000504095)(300135200095)(300000505095)(300135600095)(300000506095)(300135500095);SRVR:DM5PR12MB1737; X-Microsoft-Exchange-Diagnostics: 1;DM5PR12MB1737;3:99fB9H0eF48HOB6MoGSqUCX6vXv+L7AbpNQTV+ThvaCEgikSh1O9rgZ8MUPyxg/s/zHUrCPujc+7WChEOgOc86jH78YdPMDs8BVeKFEJ8e/z/H21rovPy1exvMJbSg1FhKWsEVkAyrEb2Sc4bYfdz9PH1I90ksPHdOPFWzlLvPjpXzbNisrU9qEXn0YDBvYgquF1rk/Hp3rXNB2403VCBRZHCNTkkoeZIatOZcIdwLoL6tMZgeOZz0AjxoXZogDf;25:KUK7QEwfew0h5zFC376jhjGOt56tMjlxMcnfKEvExutsNtRlbSIwvfb9SnSONzjX1i0xv1oqtARYJP0TZF0BdJwJ4y7vgqoKjUVpgp96RaiVostiYiKADd44CBXVHSzF4/4yCNFalNoeg8m0QAXTruiLtTsTW+fJ2MnrkxR+3d1n7H+l8HdejnEMSN7XePbOoX3wcQ2HvCaAiaQ5G4AxNhutg/Y6DunXIGEce1hKWL4NxiMi20K79M9zXAphujq9MUq60TI8nQODWvc+5GTdBW2hXNdbMp5LJhyZJqymvj8LTb5qFKHZkcl7pJsP7rTiAlfr5FyW0Osk5Teh9EZp+A==;31:q4rmhl++Dnial1RmWn7pgyUN1EnLQYoRFHBKxvtL8YjQc0O1r3j5OEbt+OxLUOR9TOjbs/xEeNh0fT8+HBpJUmAa6zkfdAAYjYbbZJMqfBJcyJ5Ka4lDZCZUsfQBq8OaGUCwWPD0Ng5aKWD7kCEzD4PUYWbRfnlLIFQnbbslJJs40pH0jfe8kZvSvJ2ZUC5b6+wdJ++CE7A0XWz7AqNf/BP5vWVIuTKJl9Mrgj/XjtA= X-MS-TrafficTypeDiagnostic: DM5PR12MB1737: Authentication-Results: spf=none (sender IP is ) smtp.mailfrom=Suravee.Suthikulpanit@amd.com; X-Microsoft-Exchange-Diagnostics: 1;DM5PR12MB1737;20:P5RWRidbKSSjrhbnC5sN412oubV0VQlMtaY34q9RFcdbvWDjLNBunCxiexm1T7/LkLDpLT8wVe9QpPEc1KNuoTCnoCsINjV7CIpNJ58tWoAYNLSDe+T6E1MWKpxiTatnYFbuCYlu08bu7NsumZye8HnO24ZrNSSRqrwhOtBnU/86VZocCb0AqVNj1yDkEeZABYOMhB4C8e8Q71zkuyKpm3capO5yHg3H9FgJ25p5UrPX2w5IjvYSdofBBUfasrlDcK/FAMLGCRqG9IGD9dU4eUwFU7hT5V1JuH395FUUpTCuLc5YLOUr0fzGYvkErh1jRyyPkw3xfp4MSHy9NOts7dSGfUKJCMWD8k253EhEaqTFs6XAK5mxp2cH9ZpayqJNyEThc/9AUs5T819nUf6i7GkcP69DafZ6gwK+ZlBnXO0M68DFFEckVgrM5anhenRzVMJXvYX7ycpHTni7P2CdGl7/S+thIDxTR+LYk7nlNah9gGwMXKlbg6Kipo4v7LcH;4:bTSkchjzjZ+wogW6c1YBCwoIRjctCgPCPdVvyuZgSAJAJpwy+A4BZnAmqjoQRxmZCnYtSj2dCiAaOSH3UWwnGZBju79ekxgAt1xn4NeTpRllkbqf4uZtB7BxbsaKQHq4kyDJ9UgzF2fSaAx4joWWPA1Qu39i2iXw1GmuE35SgOA8CY3Vr6sx3h/B1wa8NtcM1ZRvHeiRgazH8ZMpBGkYvqTkMVz72aP/yfdro3Pi7Fp7EG3MDKiE/zfyFWghwx/mcFI85zC1WkCmuPgfjcsISvSsISVwuMhCPFj+4mU2jy0= 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)(8121501046)(5005006)(100000703101)(100105400095)(93006095)(93001095)(3002001)(10201501046)(6055026)(6041248)(20161123564025)(20161123562025)(201703131423075)(201702281528075)(201703061421075)(201703061406153)(20161123555025)(20161123560025)(20161123558100)(6072148)(201708071742011)(100000704101)(100105200095)(100000705101)(100105500095);SRVR:DM5PR12MB1737;BCL:0;PCL:0;RULEID:(100000800101)(100110000095)(100000801101)(100110300095)(100000802101)(100110100095)(100000803101)(100110400095)(100000804101)(100110200095)(100000805101)(100110500095);SRVR:DM5PR12MB1737; X-Forefront-PRVS: 0422860ED4 X-Forefront-Antispam-Report: SFV:NSPM;SFS:(10009020)(6009001)(39860400002)(199003)(189002)(8936002)(6666003)(2950100002)(6116002)(86362001)(53936002)(4720700003)(101416001)(6486002)(42186005)(106356001)(5660300001)(5003940100001)(105586002)(3846002)(110136004)(305945005)(4326008)(6506006)(72206003)(7736002)(76176999)(66066001)(47776003)(478600001)(25786009)(2906002)(8676002)(97736004)(50986999)(68736007)(50226002)(36756003)(81166006)(33646002)(81156014)(50466002)(189998001)(48376002)(6512007);DIR:OUT;SFP:1101;SCL:1;SRVR:DM5PR12MB1737;H:ssuthiku-rhel73-zp.localdomain;FPR:;SPF:None;PTR:InfoNoRecords;A:1;MX:1;LANG:en; X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1;DM5PR12MB1737;23:ycXBtKrQuzvS/jH+i/gZ223WTshnVv3Pm7tFUZBaj?= =?us-ascii?Q?mh7rAKWZqfkh1fKYFdLyzigSreZK/BlPahm8SpKsNJVAHC6ugI16hcFpccsc?= =?us-ascii?Q?tlBw5rFXvDYXytapfktMKny+RSKzOR5MjSftYVJyc4SGhL+oESCifi4iY2Eg?= =?us-ascii?Q?VfEOIfMw+iFY7w4IGIqCSu8W38MDNS/73q0OLAUAVOPCf89g7IJH28s76QxZ?= =?us-ascii?Q?mX3FzOowpzJytTU8HOPoWQcCVoCm1Uh1l9RK80se2RKdgrksr+htjJ9A85cs?= =?us-ascii?Q?3sbpiV5Hz/Wjfs/6RxBw+/iZTp0wdOX5w3u2kk5xmX7O+Cu300cHkLynASlH?= =?us-ascii?Q?kX1+KRSdjdEBEJjXtLLTVAtzpWwYOE2ZOyasGfPhBY6fXS5yd9JPh3ctt5dK?= =?us-ascii?Q?m/ULY+DnK32pqlmvwnoHE+XvjjSMC+19wo6DjUt9nZ1tpNiS/h+d74GdnYBW?= =?us-ascii?Q?KJdp1oZbRRwQNru4oY7MD2+fZCfWF9FP6O83kSDQvrzwH8vV46/VcgIRn6rG?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bybgrub0DERoHoaQ==;5:WgzxpYNlGTzk+OUHyOEWa13AWUyi1sKU535Kcqx7NOOaouYFSdWcAgkXuFAtb7TUctdZnmoDRzfFLafg6Z/bnhf3/wrBQaYBnaBSjOayauDjhZGVwmh55LVc0GG04omv7+hn/liIms7+3AQqX0UF1w==;24:vnLxPYXMMIvPQeIVEEKLgxWKyl6WeuTgtNyfMPfuM23KOC+wAW1Nv7/pg90qL1zsaw0NU+lMOLtJlOlD4cgWKHJim1TTQw8jceqE1ZPGwIk=;7:o1hDHh5UzdPk06yw/5V3h3LAGmf/ee6s9WHqf2rWfwwgiC4fQm6Wm7PaUZlLJyjYvsTdAZjK4e3zXXt6qwjbUHWneEbOzpeLAANnb7D4ZM2aivea2cuiRB5OVJVMYEA4u+l8nsKsKH9D01mtdc1G04MvZ40375gbUyhkI6YKR7CZpLI0GaUIGrYSFMLJOH9JetnsQLhIWXRWTEQ/P0NerdsnDqHgrgYKsbd33kYI9No= SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-Microsoft-Exchange-Diagnostics: 1;DM5PR12MB1737;20:WM79g2COX6AFR1Y2m8vG/obC+028zgwY2sbiFG6pnAIGYHTtjVofNglO08BGtJgkN1hJ+Tp0GfexvjbtYzgrK0s4CeaBBIifTW6PCxjUahomRV4tCGoLhflZqUWjF5yynmBizJbyfKV6axu7fZkXCRMD/IkLuikIE+u+3Q4ppevVZTDciDwmkJMmaS2DrG5mHb+R3bmWdE4/SzzJ4mv3S5pkadUldGiQV31WpH6KKy+XIncTecqcQfKKiz3nxaz6 X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 06 Sep 2017 03:40:07.2220 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 3dd8961f-e488-4e60-8e11-a82d994e183d X-MS-Exchange-Transport-CrossTenantHeadersStamped: DM5PR12MB1737 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 f4d120a..3cdde44 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 05a5e57..b8c40ca 100644 --- a/arch/x86/kvm/x86.c +++ b/arch/x86/kvm/x86.c @@ -7946,7 +7946,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