Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755495AbcDGIVk (ORCPT ); Thu, 7 Apr 2016 04:21:40 -0400 Received: from mail-by2on0076.outbound.protection.outlook.com ([207.46.100.76]:18688 "EHLO na01-by2-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1755260AbcDGIVf (ORCPT ); Thu, 7 Apr 2016 04:21:35 -0400 Authentication-Results: redhat.com; dkim=none (message not signed) header.d=none;redhat.com; dmarc=none action=none header.from=amd.com; From: Suravee Suthikulpanit To: , , , , , CC: , , , Subject: [PART1 RFC v4 04/11] KVM: split kvm_vcpu_wake_up from kvm_vcpu_kick Date: Thu, 7 Apr 2016 03:20:25 -0500 Message-ID: <1460017232-17429-5-git-send-email-Suravee.Suthikulpanit@amd.com> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1460017232-17429-1-git-send-email-Suravee.Suthikulpanit@amd.com> References: <1460017232-17429-1-git-send-email-Suravee.Suthikulpanit@amd.com> MIME-Version: 1.0 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: 8bit X-Originating-IP: [124.121.8.20] X-ClientProxiedBy: KL1PR02CA0009.apcprd02.prod.outlook.com (10.165.15.19) To SN1PR12MB0445.namprd12.prod.outlook.com (10.162.105.139) X-MS-Office365-Filtering-Correlation-Id: 9fdc3467-bab7-4061-30cb-08d35ebda001 X-Microsoft-Exchange-Diagnostics: 1;SN1PR12MB0445;2:71Tvo49MlzxCnG6Wab0lanSbw1wWhXTe03YT8QJ2MgSWQTDF0taTZjPnAcHJsnUm/c2KFzUhEjjQ2PGUhTOxMhougXQVWyZPjs5HQ876H+yP6akyaH8Xc1Ckl6AFfHe60V5TXLyPOF4GJQSwBj5NoHfm0Uv7z4ojYnCcmVOt3io76+X5QGaeutzwal1RQ6mJ;3:cv9NNT+9uSC4e82Bceo7ymvahN+aF8bKD34a0LEvig0kkUwqxw5b0fsjHgKvCXK9kDMF1vE7e0E3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TIhkUUNaRr16nj/JQsBphPIZs9QEIMttxfRcm4nWu0YP2r3S2bel96FIVHCleag8FvEZULXTaH/6Iz1Ourmn0DYxxCjTqZeyyOhDzfAgUZDLEFlFzyoqlHGD7L9dTz0SGy7fSkE0l+uX7hHiAvxS2RUrSGIwirkR2Iu+qpdp5NlTGZFsPc4ZTBQH7Kjs0l5IQAf+3DR;4:50fAmJhgu4yEA5lXruiDwek21871uf3FEMOMgB+9gODz2Eh6lxzd440spXMJvEnvoFe/D3NiKRLsX9rdgRJLpuITjBleM2vk8pieJz81gOSNk7wODZCyFed/I3mWWMFob5bSKOB4IoyRHZqqXdC/8XuQ8oayDippwPocysZXk8o6U6IzZxHfo4Cr3VZyV97IXMI4Sj4WoL9Pey0bFcagb5sqLr+jtl51T/15oyRWhIS09wskxVwDO/+s3jKPK6tTkemndCJfT+gEIqP5hfSIlUpcxKOOFIbo0cn/lNFLE0+uBSZEqlP7VgsBVvdwKnDjjYdqzoh5N0f97Kx1BXByTHPdyzUqjqEn57OiGWoL6npDCki4BBTWGYFpeqz39kC4 X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:; X-Exchange-Antispam-Report-CFA-Test: BCL:0;PCL:0;RULEID:(601004)(2401047)(5005006)(8121501046)(10201501046)(3002001);SRVR:SN1PR12MB0445;BCL:0;PCL:0;RULEID:;SRVR:SN1PR12MB0445; X-Forefront-PRVS: 0905A6B2C7 X-Forefront-Antispam-Report: SFV:NSPM;SFS:(10009020)(4630300001)(6069001)(6009001)(50226001)(86362001)(19580395003)(2201001)(229853001)(19580405001)(81166005)(66066001)(5008740100001)(6116002)(1096002)(586003)(42186005)(23676002)(3846002)(2906002)(50466002)(5001770100001)(4326007)(5820100001)(36756003)(2950100001)(47776003)(76176999)(92566002)(50986999)(2870700001)(77096005)(189998001);DIR:OUT;SFP:1101;SCL:1;SRVR:SN1PR12MB0445;H:localhost.localdomain;FPR:;SPF:None;MLV:sfv;LANG:en; X-Microsoft-Exchange-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C5gVxwRz9xM6q1sP69z2m3lpS0ERg==;24:bxNxeLCi3KN9Iomkq7sdBssiHMFMxiJVM0Fkd4GrIxq0gPfnCsKGHiwlQzWRuyyRNJvhvqlUga4k+kIdokqBv55bu5pXYowryAwTanl8gfs=;20:CDFLad5bHGq6NbHGnLj32JiMWwLrHtNJlS3vZj86bFb7o50rCmwUqFa/3frBH0+Kw7UpzLuws8+FJjZJyD+mHg7dOLUJB3ZK8ArTyAo6UFinObSLZBG1sViqZLfIOTkG/4YknSSwX/VDjOWS9r5Mnrt8/zu1CWALtlR8UkThNcTac909OYQBxiu3W17N+fxIwS6pyPdwhvA2IZb0FQjhb8Wd7S2vsH99XqYn/lI4G1PLYhPh23tNAIwtILwGmvTX X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 07 Apr 2016 08:21:28.3914 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-Transport-CrossTenantHeadersStamped: SN1PR12MB0445 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1947 Lines: 64 From: Radim Krčmář AVIC has a use for kvm_vcpu_wake_up. Signed-off-by: Radim Krčmář Tested-by: Suravee Suthikulpanit Reviewed-by: Paolo Bonzini --- include/linux/kvm_host.h | 1 + virt/kvm/kvm_main.c | 19 +++++++++++++------ 2 files changed, 14 insertions(+), 6 deletions(-) diff --git a/include/linux/kvm_host.h b/include/linux/kvm_host.h index 5276fe0..673749d 100644 --- a/include/linux/kvm_host.h +++ b/include/linux/kvm_host.h @@ -651,6 +651,7 @@ void kvm_vcpu_mark_page_dirty(struct kvm_vcpu *vcpu, gfn_t gfn); void kvm_vcpu_block(struct kvm_vcpu *vcpu); void kvm_arch_vcpu_blocking(struct kvm_vcpu *vcpu); void kvm_arch_vcpu_unblocking(struct kvm_vcpu *vcpu); +void kvm_vcpu_wake_up(struct kvm_vcpu *vcpu); void kvm_vcpu_kick(struct kvm_vcpu *vcpu); int kvm_vcpu_yield_to(struct kvm_vcpu *target); void kvm_vcpu_on_spin(struct kvm_vcpu *vcpu); diff --git a/virt/kvm/kvm_main.c b/virt/kvm/kvm_main.c index 4fd482f..5bf20f8 100644 --- a/virt/kvm/kvm_main.c +++ b/virt/kvm/kvm_main.c @@ -2071,13 +2071,8 @@ out: EXPORT_SYMBOL_GPL(kvm_vcpu_block); #ifndef CONFIG_S390 -/* - * Kick a sleeping VCPU, or a guest VCPU in guest mode, into host kernel mode. - */ -void kvm_vcpu_kick(struct kvm_vcpu *vcpu) +void kvm_vcpu_wake_up(struct kvm_vcpu *vcpu) { - int me; - int cpu = vcpu->cpu; struct swait_queue_head *wqp; wqp = kvm_arch_vcpu_wq(vcpu); @@ -2086,6 +2081,18 @@ void kvm_vcpu_kick(struct kvm_vcpu *vcpu) ++vcpu->stat.halt_wakeup; } +} +EXPORT_SYMBOL_GPL(kvm_vcpu_wake_up); + +/* + * Kick a sleeping VCPU, or a guest VCPU in guest mode, into host kernel mode. + */ +void kvm_vcpu_kick(struct kvm_vcpu *vcpu) +{ + int me; + int cpu = vcpu->cpu; + + kvm_vcpu_wake_up(vcpu); me = get_cpu(); if (cpu != me && (unsigned)cpu < nr_cpu_ids && cpu_online(cpu)) if (kvm_arch_vcpu_should_kick(vcpu)) -- 1.9.1