From patchwork Sun Dec 24 16:12:57 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Liran Alon X-Patchwork-Id: 10132085 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 7625C60318 for ; Sun, 24 Dec 2017 16:14:26 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 6989728D8F for ; Sun, 24 Dec 2017 16:14:26 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 5E95128D91; Sun, 24 Dec 2017 16:14:26 +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=-7.0 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, RCVD_IN_DNSWL_HI, UNPARSEABLE_RELAY autolearn=ham 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 E332A28D8F for ; Sun, 24 Dec 2017 16:14:25 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753419AbdLXQOX (ORCPT ); Sun, 24 Dec 2017 11:14:23 -0500 Received: from userp2120.oracle.com ([156.151.31.85]:35762 "EHLO userp2120.oracle.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752536AbdLXQOS (ORCPT ); Sun, 24 Dec 2017 11:14:18 -0500 Received: from pps.filterd (userp2120.oracle.com [127.0.0.1]) by userp2120.oracle.com (8.16.0.21/8.16.0.21) with SMTP id vBOGCncn193917; Sun, 24 Dec 2017 16:14:12 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oracle.com; h=from : to : cc : subject : date : message-id : in-reply-to : references; s=corp-2017-10-26; bh=sDTR/Zg5bUt7USP1ljP6YLRIhyH5Y7QPxdwBecHNv3I=; b=h7EqDoZtgj+8VTInPHdHVj+hHQmi7h8IK03EAHf1fOoJVSzv+FsGTBvyyhK3YcofmzFX 9l5CRgwRYno9X44smVGAB5RPxYqTBsASZrUaSDI3saIrn4Srv5LiSIw0Yr1Eej/k5xmA LSqeYYrfIAdFLnCuOXjQsFKkIqhPuHEcjP1ajQoFN6/9voX6uwVPHFuT6QQXigb1t2Lc Y9kTlrkvUK+qrt8U7PxmhV5EmqL/tdH0bL7ZuABtNh/m9YFt8zLgoLytoK7AzO35TCPI sQimdlh1z7PqEvyrVLAUZj+zNYkn/iyD6KLqQKslmHAOdidfLsb/tkqzNTlQzaEB/z4I zQ== Received: from aserv0022.oracle.com (aserv0022.oracle.com [141.146.126.234]) by userp2120.oracle.com with ESMTP id 2f2fce80mr-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Sun, 24 Dec 2017 16:14:11 +0000 Received: from userv0121.oracle.com (userv0121.oracle.com [156.151.31.72]) by aserv0022.oracle.com (8.14.4/8.14.4) with ESMTP id vBOGDb3t027702 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=FAIL); Sun, 24 Dec 2017 16:13:37 GMT Received: from abhmp0003.oracle.com (abhmp0003.oracle.com [141.146.116.9]) by userv0121.oracle.com (8.14.4/8.13.8) with ESMTP id vBOGDaKI031062; Sun, 24 Dec 2017 16:13:36 GMT Received: from liran-pc.ravello.local (/213.57.127.2) by default (Oracle Beehive Gateway v4.0) with ESMTP ; Sun, 24 Dec 2017 08:13:36 -0800 From: Liran Alon To: pbonzini@redhat.com, rkrcmar@redhat.com, kvm@vger.kernel.org Cc: jmattson@google.com, wanpeng.li@hotmail.com, idan.brown@oracle.com, Liran Alon , Liam Merwick Subject: [PATCH v3 05/11] KVM: x86: Rename functions which saves vCPU in per-cpu var Date: Sun, 24 Dec 2017 18:12:57 +0200 Message-Id: <1514131983-24305-6-git-send-email-liran.alon@oracle.com> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1514131983-24305-1-git-send-email-liran.alon@oracle.com> References: <1514131983-24305-1-git-send-email-liran.alon@oracle.com> X-Proofpoint-Virus-Version: vendor=nai engine=5900 definitions=8755 signatures=668650 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 suspectscore=0 malwarescore=0 phishscore=0 bulkscore=0 spamscore=0 mlxscore=0 mlxlogscore=614 adultscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.0.1-1711220000 definitions=main-1712240223 Sender: kvm-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: kvm@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP This commit doesn't change semantics. It is done as a preparation for future commits. Signed-off-by: Liran Alon Reviewed-by: Nikita Leshenko Reviewed-by: Liam Merwick Signed-off-by: Liam Merwick --- arch/x86/kvm/svm.c | 4 ++-- arch/x86/kvm/vmx.c | 4 ++-- arch/x86/kvm/x86.c | 8 ++++---- arch/x86/kvm/x86.h | 4 ++-- 4 files changed, 10 insertions(+), 10 deletions(-) diff --git a/arch/x86/kvm/svm.c b/arch/x86/kvm/svm.c index 99c42deb742b..cf51471d993b 100644 --- a/arch/x86/kvm/svm.c +++ b/arch/x86/kvm/svm.c @@ -5039,14 +5039,14 @@ static void svm_vcpu_run(struct kvm_vcpu *vcpu) vcpu->arch.regs[VCPU_REGS_RIP] = svm->vmcb->save.rip; if (unlikely(svm->vmcb->control.exit_code == SVM_EXIT_NMI)) - kvm_before_handle_nmi(&svm->vcpu); + kvm_before_handle_host_interrupts(&svm->vcpu); stgi(); /* Any pending NMI will happen here */ if (unlikely(svm->vmcb->control.exit_code == SVM_EXIT_NMI)) - kvm_after_handle_nmi(&svm->vcpu); + kvm_after_handle_host_interrupts(&svm->vcpu); sync_cr8_to_lapic(vcpu); diff --git a/arch/x86/kvm/vmx.c b/arch/x86/kvm/vmx.c index 41daf73cc528..34ffe929fb41 100644 --- a/arch/x86/kvm/vmx.c +++ b/arch/x86/kvm/vmx.c @@ -9095,9 +9095,9 @@ static void vmx_complete_atomic_exit(struct vcpu_vmx *vmx) /* We need to handle NMIs before interrupts are enabled */ if (is_nmi(exit_intr_info)) { - kvm_before_handle_nmi(&vmx->vcpu); + kvm_before_handle_host_interrupts(&vmx->vcpu); asm("int $2"); - kvm_after_handle_nmi(&vmx->vcpu); + kvm_after_handle_host_interrupts(&vmx->vcpu); } } diff --git a/arch/x86/kvm/x86.c b/arch/x86/kvm/x86.c index 82750791153e..8dfcdc8a0878 100644 --- a/arch/x86/kvm/x86.c +++ b/arch/x86/kvm/x86.c @@ -6041,17 +6041,17 @@ static unsigned long kvm_get_guest_ip(void) .get_guest_ip = kvm_get_guest_ip, }; -void kvm_before_handle_nmi(struct kvm_vcpu *vcpu) +void kvm_before_handle_host_interrupts(struct kvm_vcpu *vcpu) { __this_cpu_write(current_vcpu, vcpu); } -EXPORT_SYMBOL_GPL(kvm_before_handle_nmi); +EXPORT_SYMBOL_GPL(kvm_before_handle_host_interrupts); -void kvm_after_handle_nmi(struct kvm_vcpu *vcpu) +void kvm_after_handle_host_interrupts(struct kvm_vcpu *vcpu) { __this_cpu_write(current_vcpu, NULL); } -EXPORT_SYMBOL_GPL(kvm_after_handle_nmi); +EXPORT_SYMBOL_GPL(kvm_after_handle_host_interrupts); static void kvm_set_mmio_spte_mask(void) { diff --git a/arch/x86/kvm/x86.h b/arch/x86/kvm/x86.h index d0b95b7a90b4..3737884cc64d 100644 --- a/arch/x86/kvm/x86.h +++ b/arch/x86/kvm/x86.h @@ -204,8 +204,8 @@ static inline bool kvm_check_has_quirk(struct kvm *kvm, u64 quirk) return !(kvm->arch.disabled_quirks & quirk); } -void kvm_before_handle_nmi(struct kvm_vcpu *vcpu); -void kvm_after_handle_nmi(struct kvm_vcpu *vcpu); +void kvm_before_handle_host_interrupts(struct kvm_vcpu *vcpu); +void kvm_after_handle_host_interrupts(struct kvm_vcpu *vcpu); void kvm_set_pending_timer(struct kvm_vcpu *vcpu); int kvm_inject_realmode_interrupt(struct kvm_vcpu *vcpu, int irq, int inc_eip);