From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 8BF7AC433FE for ; Tue, 28 Sep 2021 21:59:37 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 782996137A for ; Tue, 28 Sep 2021 21:59:37 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S242990AbhI1WBP (ORCPT ); Tue, 28 Sep 2021 18:01:15 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:44432 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S241482AbhI1WBO (ORCPT ); Tue, 28 Sep 2021 18:01:14 -0400 Received: from mail-pg1-x536.google.com (mail-pg1-x536.google.com [IPv6:2607:f8b0:4864:20::536]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 950DAC061745 for ; Tue, 28 Sep 2021 14:59:34 -0700 (PDT) Received: by mail-pg1-x536.google.com with SMTP id g184so510650pgc.6 for ; Tue, 28 Sep 2021 14:59:34 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20210112; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to; bh=hR85GCZfhL4YJawbBftoxChN3cnahiYUmelBrtysYzQ=; b=d0JUHehyLXdFA5B/wgcgOjwuw3aZVkCR3Gk+OriLfpCmsGGgRbZi5+6+5dzXaHm/Rk H3TiGrTERzN09CS95iDAWiZDAmZQ7WtptNJXypeXDWyysDPrB9RadntKAmDj8faRpKjd fMchWKVs2KViwzp7iD2lGulOLLVhw7YhvFLNSrL+7iYLmoBrEXEPXy3mdg2HCz/DUqRI DfUngAkqbFuin6e/uZEVEtmEQ9sA6tW5M9iMir9UF/2O+6uyZKAnHgdD6XMtiWjc3kEe tZ6voUkCgJodnBe8T1C1vXvGgmHGQNNecVIO2odLcNPxegnl1sNnabyit3FrxNWbwdpX e9Kg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to; bh=hR85GCZfhL4YJawbBftoxChN3cnahiYUmelBrtysYzQ=; b=m+rcOCYynDk9GqBKY40PxyXbjHKIVgA0AiCqQzB9oFPIRRioDNEb/nEG0jx8J9mVDj kNY5V11/YL5z3LDtm7hyQ05GaWNmUjt6Bz+6iRWlve0HcQ9mkcey/JFYlpYJyjE7/+Hi 5gWEoI7oj4LclyocX3pVAyAxVU6lA2WGxSiUQ+q9uY9waQoztfDW2/s+VIU8oPPX43we oduR+LC+Bo1lgJlIjkMua2QCyQPSpKkOsOT/1MSfPg+6VgYzTfZuWOJ3EzIvAx9pJbUi m87seH6B+Y5O1N8PM3FMD84wEK1g7Misihu2IUNSbj2/Bdcw6vcXshIYobX1QIo5n3GT X1ew== X-Gm-Message-State: AOAM531cTF9Zj3PGOjWP6tb+EA+cXks+OteYEWdFxCksByFtWu0r6ayC YAZGFqjMIJ51a0ni5cu2ol98uw== X-Google-Smtp-Source: ABdhPJywxfOyjT/Bbb3z07Sb4ifGRgqWGAJFb2yLMs8NKV2zXEevYh6BB5SfG6ECW1CSnDRZbY3y1w== X-Received: by 2002:a63:50b:: with SMTP id 11mr5654394pgf.308.1632866373808; Tue, 28 Sep 2021 14:59:33 -0700 (PDT) Received: from google.com (254.80.82.34.bc.googleusercontent.com. [34.82.80.254]) by smtp.gmail.com with ESMTPSA id z14sm83969pjq.48.2021.09.28.14.59.32 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 28 Sep 2021 14:59:32 -0700 (PDT) Date: Tue, 28 Sep 2021 21:59:29 +0000 From: David Matlack To: Sean Christopherson Cc: Marc Zyngier , Huacai Chen , Aleksandar Markovic , Paul Mackerras , Christian Borntraeger , Janosch Frank , Paolo Bonzini , James Morse , Alexandru Elisei , Suzuki K Poulose , David Hildenbrand , Cornelia Huck , Claudio Imbrenda , Vitaly Kuznetsov , Wanpeng Li , Jim Mattson , Joerg Roedel , linux-arm-kernel@lists.infradead.org, kvmarm@lists.cs.columbia.edu, linux-mips@vger.kernel.org, kvm@vger.kernel.org, kvm-ppc@vger.kernel.org, linux-kernel@vger.kernel.org, Jing Zhang Subject: Re: [PATCH 08/14] KVM: x86: Tweak halt emulation helper names to free up kvm_vcpu_halt() Message-ID: References: <20210925005528.1145584-1-seanjc@google.com> <20210925005528.1145584-9-seanjc@google.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20210925005528.1145584-9-seanjc@google.com> Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Fri, Sep 24, 2021 at 05:55:22PM -0700, Sean Christopherson wrote: > Rename a variety of HLT-related helpers to free up the function name > "kvm_vcpu_halt" for future use in generic KVM code, e.g. to differentiate > between "block" and "halt". > > No functional change intended. > > Signed-off-by: Sean Christopherson Reviewed-by: David Matlack > --- > arch/x86/include/asm/kvm_host.h | 2 +- > arch/x86/kvm/vmx/nested.c | 2 +- > arch/x86/kvm/vmx/vmx.c | 4 ++-- > arch/x86/kvm/x86.c | 13 +++++++------ > 4 files changed, 11 insertions(+), 10 deletions(-) > > diff --git a/arch/x86/include/asm/kvm_host.h b/arch/x86/include/asm/kvm_host.h > index 4e8c21083bdb..cfebef10b89c 100644 > --- a/arch/x86/include/asm/kvm_host.h > +++ b/arch/x86/include/asm/kvm_host.h > @@ -1679,7 +1679,7 @@ int kvm_emulate_monitor(struct kvm_vcpu *vcpu); > int kvm_fast_pio(struct kvm_vcpu *vcpu, int size, unsigned short port, int in); > int kvm_emulate_cpuid(struct kvm_vcpu *vcpu); > int kvm_emulate_halt(struct kvm_vcpu *vcpu); > -int kvm_vcpu_halt(struct kvm_vcpu *vcpu); > +int kvm_emulate_halt_noskip(struct kvm_vcpu *vcpu); > int kvm_emulate_ap_reset_hold(struct kvm_vcpu *vcpu); > int kvm_emulate_wbinvd(struct kvm_vcpu *vcpu); > > diff --git a/arch/x86/kvm/vmx/nested.c b/arch/x86/kvm/vmx/nested.c > index eedcebf58004..f689e463b678 100644 > --- a/arch/x86/kvm/vmx/nested.c > +++ b/arch/x86/kvm/vmx/nested.c > @@ -3618,7 +3618,7 @@ static int nested_vmx_run(struct kvm_vcpu *vcpu, bool launch) > !(nested_cpu_has(vmcs12, CPU_BASED_INTR_WINDOW_EXITING) && > (vmcs12->guest_rflags & X86_EFLAGS_IF))) { > vmx->nested.nested_run_pending = 0; > - return kvm_vcpu_halt(vcpu); > + return kvm_emulate_halt_noskip(vcpu); > } > break; > case GUEST_ACTIVITY_WAIT_SIPI: > diff --git a/arch/x86/kvm/vmx/vmx.c b/arch/x86/kvm/vmx/vmx.c > index d118daed0530..858f5f1f1273 100644 > --- a/arch/x86/kvm/vmx/vmx.c > +++ b/arch/x86/kvm/vmx/vmx.c > @@ -4740,7 +4740,7 @@ static int handle_rmode_exception(struct kvm_vcpu *vcpu, > if (kvm_emulate_instruction(vcpu, 0)) { > if (vcpu->arch.halt_request) { > vcpu->arch.halt_request = 0; > - return kvm_vcpu_halt(vcpu); > + return kvm_emulate_halt_noskip(vcpu); > } > return 1; > } > @@ -5414,7 +5414,7 @@ static int handle_invalid_guest_state(struct kvm_vcpu *vcpu) > > if (vcpu->arch.halt_request) { > vcpu->arch.halt_request = 0; > - return kvm_vcpu_halt(vcpu); > + return kvm_emulate_halt_noskip(vcpu); > } > > /* > diff --git a/arch/x86/kvm/x86.c b/arch/x86/kvm/x86.c > index b0c21d42f453..eade8a2bdccf 100644 > --- a/arch/x86/kvm/x86.c > +++ b/arch/x86/kvm/x86.c > @@ -8643,7 +8643,7 @@ void kvm_arch_exit(void) > #endif > } > > -static int __kvm_vcpu_halt(struct kvm_vcpu *vcpu, int state, int reason) > +static int __kvm_emulate_halt(struct kvm_vcpu *vcpu, int state, int reason) > { > ++vcpu->stat.halt_exits; > if (lapic_in_kernel(vcpu)) { > @@ -8655,11 +8655,11 @@ static int __kvm_vcpu_halt(struct kvm_vcpu *vcpu, int state, int reason) > } > } > > -int kvm_vcpu_halt(struct kvm_vcpu *vcpu) > +int kvm_emulate_halt_noskip(struct kvm_vcpu *vcpu) > { > - return __kvm_vcpu_halt(vcpu, KVM_MP_STATE_HALTED, KVM_EXIT_HLT); > + return __kvm_emulate_halt(vcpu, KVM_MP_STATE_HALTED, KVM_EXIT_HLT); > } > -EXPORT_SYMBOL_GPL(kvm_vcpu_halt); > +EXPORT_SYMBOL_GPL(kvm_emulate_halt_noskip); > > int kvm_emulate_halt(struct kvm_vcpu *vcpu) > { > @@ -8668,7 +8668,7 @@ int kvm_emulate_halt(struct kvm_vcpu *vcpu) > * TODO: we might be squashing a GUESTDBG_SINGLESTEP-triggered > * KVM_EXIT_DEBUG here. > */ > - return kvm_vcpu_halt(vcpu) && ret; > + return kvm_emulate_halt_noskip(vcpu) && ret; > } > EXPORT_SYMBOL_GPL(kvm_emulate_halt); > > @@ -8676,7 +8676,8 @@ int kvm_emulate_ap_reset_hold(struct kvm_vcpu *vcpu) > { > int ret = kvm_skip_emulated_instruction(vcpu); > > - return __kvm_vcpu_halt(vcpu, KVM_MP_STATE_AP_RESET_HOLD, KVM_EXIT_AP_RESET_HOLD) && ret; > + return __kvm_emulate_halt(vcpu, KVM_MP_STATE_AP_RESET_HOLD, > + KVM_EXIT_AP_RESET_HOLD) && ret; > } > EXPORT_SYMBOL_GPL(kvm_emulate_ap_reset_hold); > > -- > 2.33.0.685.g46640cef36-goog > From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id D23DFC433F5 for ; Tue, 28 Sep 2021 22:01:33 +0000 (UTC) Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 9BB3361131 for ; Tue, 28 Sep 2021 22:01:33 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.1 mail.kernel.org 9BB3361131 Authentication-Results: mail.kernel.org; dmarc=fail (p=reject dis=none) header.from=google.com Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:In-Reply-To:MIME-Version:References: Message-ID:Subject:Cc:To:From:Date:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=cXQnVMFD9stpQdZTqOXH9Jx0yHyas60GJSeuLUiWF0Q=; b=UO+bPsyiToyjoH OrmUUlum5Np6JVJU7xzctK9gOYhGNQee+/oUERdEvFvpJaJpHQt7J6A7tfIW2KWTj7eje3dQDH/0R YC0CEAVwg7/onKewdkrn2DXpYYssEV/fgJOjDC9Gv7osKh5R26/67iDFqVDYZlaqUhBVHFSG1v4Bl +o92/n9d1616By3n0U1u0NcHXO6tjJxdg2jtntAv6VvkHk7lUlNK9wqK3tUT/etS03bBAxqJap3FM 9ow7OD4kGI4i3SVfwziu8OrtxWyB6zenslZrCeX11FfRRmpAPuHdNIZL5rVcUlJGrPJ9svgRVzhQk qH2i0cNq9JQuTaEn3NKw==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1mVL8W-008voB-CH; Tue, 28 Sep 2021 21:59:40 +0000 Received: from mail-pg1-x529.google.com ([2607:f8b0:4864:20::529]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1mVL8S-008vn2-Gp for linux-arm-kernel@lists.infradead.org; Tue, 28 Sep 2021 21:59:38 +0000 Received: by mail-pg1-x529.google.com with SMTP id 66so94769pgc.9 for ; Tue, 28 Sep 2021 14:59:34 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20210112; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to; bh=hR85GCZfhL4YJawbBftoxChN3cnahiYUmelBrtysYzQ=; b=d0JUHehyLXdFA5B/wgcgOjwuw3aZVkCR3Gk+OriLfpCmsGGgRbZi5+6+5dzXaHm/Rk H3TiGrTERzN09CS95iDAWiZDAmZQ7WtptNJXypeXDWyysDPrB9RadntKAmDj8faRpKjd fMchWKVs2KViwzp7iD2lGulOLLVhw7YhvFLNSrL+7iYLmoBrEXEPXy3mdg2HCz/DUqRI DfUngAkqbFuin6e/uZEVEtmEQ9sA6tW5M9iMir9UF/2O+6uyZKAnHgdD6XMtiWjc3kEe tZ6voUkCgJodnBe8T1C1vXvGgmHGQNNecVIO2odLcNPxegnl1sNnabyit3FrxNWbwdpX e9Kg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to; bh=hR85GCZfhL4YJawbBftoxChN3cnahiYUmelBrtysYzQ=; b=SjjTnGWjzh1MIo+skNJMB/Tl0UchADbeHHE0Bpp1Z/QKqDKSbtquSeU+9laqbjlvuS lSdVOXSKNWi/xD2Z9oliEzdElvJikwcB7fCONNZZWEpJokZpGAbofMs/zvWXuuCTCO/F UVQi+rcP0rVB4RURaMtAVC69ubKKZNVZfogepjpCj4ebsxpIu7vMiGs2MqVapi9PsIxA +oHLEAd/+PrN3VbgMIQvmSO9D7k+a6qNGQJlvlGTcWaVw9Ig33gOQNjGr3L2ZW6OdgPp E/kqsu80S4nb0LhVirFHwc9/LJwhK13cLPRpAyZql+4gWDi7Nd7eNqUna17MAYP7df5/ m9rg== X-Gm-Message-State: AOAM532EmzpSo6W8wBMEZoDEMIx9vO4Qq2/kBPi9YjwGpG/XlszPUJX6 W1545Pul34cmpDG+C+dhkXLDhg== X-Google-Smtp-Source: ABdhPJywxfOyjT/Bbb3z07Sb4ifGRgqWGAJFb2yLMs8NKV2zXEevYh6BB5SfG6ECW1CSnDRZbY3y1w== X-Received: by 2002:a63:50b:: with SMTP id 11mr5654394pgf.308.1632866373808; Tue, 28 Sep 2021 14:59:33 -0700 (PDT) Received: from google.com (254.80.82.34.bc.googleusercontent.com. [34.82.80.254]) by smtp.gmail.com with ESMTPSA id z14sm83969pjq.48.2021.09.28.14.59.32 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 28 Sep 2021 14:59:32 -0700 (PDT) Date: Tue, 28 Sep 2021 21:59:29 +0000 From: David Matlack To: Sean Christopherson Cc: Marc Zyngier , Huacai Chen , Aleksandar Markovic , Paul Mackerras , Christian Borntraeger , Janosch Frank , Paolo Bonzini , James Morse , Alexandru Elisei , Suzuki K Poulose , David Hildenbrand , Cornelia Huck , Claudio Imbrenda , Vitaly Kuznetsov , Wanpeng Li , Jim Mattson , Joerg Roedel , linux-arm-kernel@lists.infradead.org, kvmarm@lists.cs.columbia.edu, linux-mips@vger.kernel.org, kvm@vger.kernel.org, kvm-ppc@vger.kernel.org, linux-kernel@vger.kernel.org, Jing Zhang Subject: Re: [PATCH 08/14] KVM: x86: Tweak halt emulation helper names to free up kvm_vcpu_halt() Message-ID: References: <20210925005528.1145584-1-seanjc@google.com> <20210925005528.1145584-9-seanjc@google.com> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <20210925005528.1145584-9-seanjc@google.com> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20210928_145936_612076_D256E4CE X-CRM114-Status: GOOD ( 21.11 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org On Fri, Sep 24, 2021 at 05:55:22PM -0700, Sean Christopherson wrote: > Rename a variety of HLT-related helpers to free up the function name > "kvm_vcpu_halt" for future use in generic KVM code, e.g. to differentiate > between "block" and "halt". > > No functional change intended. > > Signed-off-by: Sean Christopherson Reviewed-by: David Matlack > --- > arch/x86/include/asm/kvm_host.h | 2 +- > arch/x86/kvm/vmx/nested.c | 2 +- > arch/x86/kvm/vmx/vmx.c | 4 ++-- > arch/x86/kvm/x86.c | 13 +++++++------ > 4 files changed, 11 insertions(+), 10 deletions(-) > > diff --git a/arch/x86/include/asm/kvm_host.h b/arch/x86/include/asm/kvm_host.h > index 4e8c21083bdb..cfebef10b89c 100644 > --- a/arch/x86/include/asm/kvm_host.h > +++ b/arch/x86/include/asm/kvm_host.h > @@ -1679,7 +1679,7 @@ int kvm_emulate_monitor(struct kvm_vcpu *vcpu); > int kvm_fast_pio(struct kvm_vcpu *vcpu, int size, unsigned short port, int in); > int kvm_emulate_cpuid(struct kvm_vcpu *vcpu); > int kvm_emulate_halt(struct kvm_vcpu *vcpu); > -int kvm_vcpu_halt(struct kvm_vcpu *vcpu); > +int kvm_emulate_halt_noskip(struct kvm_vcpu *vcpu); > int kvm_emulate_ap_reset_hold(struct kvm_vcpu *vcpu); > int kvm_emulate_wbinvd(struct kvm_vcpu *vcpu); > > diff --git a/arch/x86/kvm/vmx/nested.c b/arch/x86/kvm/vmx/nested.c > index eedcebf58004..f689e463b678 100644 > --- a/arch/x86/kvm/vmx/nested.c > +++ b/arch/x86/kvm/vmx/nested.c > @@ -3618,7 +3618,7 @@ static int nested_vmx_run(struct kvm_vcpu *vcpu, bool launch) > !(nested_cpu_has(vmcs12, CPU_BASED_INTR_WINDOW_EXITING) && > (vmcs12->guest_rflags & X86_EFLAGS_IF))) { > vmx->nested.nested_run_pending = 0; > - return kvm_vcpu_halt(vcpu); > + return kvm_emulate_halt_noskip(vcpu); > } > break; > case GUEST_ACTIVITY_WAIT_SIPI: > diff --git a/arch/x86/kvm/vmx/vmx.c b/arch/x86/kvm/vmx/vmx.c > index d118daed0530..858f5f1f1273 100644 > --- a/arch/x86/kvm/vmx/vmx.c > +++ b/arch/x86/kvm/vmx/vmx.c > @@ -4740,7 +4740,7 @@ static int handle_rmode_exception(struct kvm_vcpu *vcpu, > if (kvm_emulate_instruction(vcpu, 0)) { > if (vcpu->arch.halt_request) { > vcpu->arch.halt_request = 0; > - return kvm_vcpu_halt(vcpu); > + return kvm_emulate_halt_noskip(vcpu); > } > return 1; > } > @@ -5414,7 +5414,7 @@ static int handle_invalid_guest_state(struct kvm_vcpu *vcpu) > > if (vcpu->arch.halt_request) { > vcpu->arch.halt_request = 0; > - return kvm_vcpu_halt(vcpu); > + return kvm_emulate_halt_noskip(vcpu); > } > > /* > diff --git a/arch/x86/kvm/x86.c b/arch/x86/kvm/x86.c > index b0c21d42f453..eade8a2bdccf 100644 > --- a/arch/x86/kvm/x86.c > +++ b/arch/x86/kvm/x86.c > @@ -8643,7 +8643,7 @@ void kvm_arch_exit(void) > #endif > } > > -static int __kvm_vcpu_halt(struct kvm_vcpu *vcpu, int state, int reason) > +static int __kvm_emulate_halt(struct kvm_vcpu *vcpu, int state, int reason) > { > ++vcpu->stat.halt_exits; > if (lapic_in_kernel(vcpu)) { > @@ -8655,11 +8655,11 @@ static int __kvm_vcpu_halt(struct kvm_vcpu *vcpu, int state, int reason) > } > } > > -int kvm_vcpu_halt(struct kvm_vcpu *vcpu) > +int kvm_emulate_halt_noskip(struct kvm_vcpu *vcpu) > { > - return __kvm_vcpu_halt(vcpu, KVM_MP_STATE_HALTED, KVM_EXIT_HLT); > + return __kvm_emulate_halt(vcpu, KVM_MP_STATE_HALTED, KVM_EXIT_HLT); > } > -EXPORT_SYMBOL_GPL(kvm_vcpu_halt); > +EXPORT_SYMBOL_GPL(kvm_emulate_halt_noskip); > > int kvm_emulate_halt(struct kvm_vcpu *vcpu) > { > @@ -8668,7 +8668,7 @@ int kvm_emulate_halt(struct kvm_vcpu *vcpu) > * TODO: we might be squashing a GUESTDBG_SINGLESTEP-triggered > * KVM_EXIT_DEBUG here. > */ > - return kvm_vcpu_halt(vcpu) && ret; > + return kvm_emulate_halt_noskip(vcpu) && ret; > } > EXPORT_SYMBOL_GPL(kvm_emulate_halt); > > @@ -8676,7 +8676,8 @@ int kvm_emulate_ap_reset_hold(struct kvm_vcpu *vcpu) > { > int ret = kvm_skip_emulated_instruction(vcpu); > > - return __kvm_vcpu_halt(vcpu, KVM_MP_STATE_AP_RESET_HOLD, KVM_EXIT_AP_RESET_HOLD) && ret; > + return __kvm_emulate_halt(vcpu, KVM_MP_STATE_AP_RESET_HOLD, > + KVM_EXIT_AP_RESET_HOLD) && ret; > } > EXPORT_SYMBOL_GPL(kvm_emulate_ap_reset_hold); > > -- > 2.33.0.685.g46640cef36-goog > _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 1B641C433EF for ; Wed, 29 Sep 2021 07:12:47 +0000 (UTC) Received: from mm01.cs.columbia.edu (mm01.cs.columbia.edu [128.59.11.253]) by mail.kernel.org (Postfix) with ESMTP id C58706137E for ; Wed, 29 Sep 2021 07:12:46 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.1 mail.kernel.org C58706137E Authentication-Results: mail.kernel.org; dmarc=fail (p=reject dis=none) header.from=google.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=lists.cs.columbia.edu Received: from localhost (localhost [127.0.0.1]) by mm01.cs.columbia.edu (Postfix) with ESMTP id 707D64B0D9; Wed, 29 Sep 2021 03:12:46 -0400 (EDT) X-Virus-Scanned: at lists.cs.columbia.edu Authentication-Results: mm01.cs.columbia.edu (amavisd-new); dkim=softfail (fail, message has been altered) header.i=@google.com Received: from mm01.cs.columbia.edu ([127.0.0.1]) by localhost (mm01.cs.columbia.edu [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id I-qky1r-gZXI; Wed, 29 Sep 2021 03:12:45 -0400 (EDT) Received: from mm01.cs.columbia.edu (localhost [127.0.0.1]) by mm01.cs.columbia.edu (Postfix) with ESMTP id 960A54B14C; Wed, 29 Sep 2021 03:12:41 -0400 (EDT) Received: from localhost (localhost [127.0.0.1]) by mm01.cs.columbia.edu (Postfix) with ESMTP id 2925D407ED for ; Tue, 28 Sep 2021 17:59:36 -0400 (EDT) X-Virus-Scanned: at lists.cs.columbia.edu Received: from mm01.cs.columbia.edu ([127.0.0.1]) by localhost (mm01.cs.columbia.edu [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id kDPH+guQQJr9 for ; Tue, 28 Sep 2021 17:59:35 -0400 (EDT) Received: from mail-pg1-f177.google.com (mail-pg1-f177.google.com [209.85.215.177]) by mm01.cs.columbia.edu (Postfix) with ESMTPS id 03A3F40413 for ; Tue, 28 Sep 2021 17:59:34 -0400 (EDT) Received: by mail-pg1-f177.google.com with SMTP id y186so571547pgd.0 for ; Tue, 28 Sep 2021 14:59:34 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20210112; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to; bh=hR85GCZfhL4YJawbBftoxChN3cnahiYUmelBrtysYzQ=; b=d0JUHehyLXdFA5B/wgcgOjwuw3aZVkCR3Gk+OriLfpCmsGGgRbZi5+6+5dzXaHm/Rk H3TiGrTERzN09CS95iDAWiZDAmZQ7WtptNJXypeXDWyysDPrB9RadntKAmDj8faRpKjd fMchWKVs2KViwzp7iD2lGulOLLVhw7YhvFLNSrL+7iYLmoBrEXEPXy3mdg2HCz/DUqRI DfUngAkqbFuin6e/uZEVEtmEQ9sA6tW5M9iMir9UF/2O+6uyZKAnHgdD6XMtiWjc3kEe tZ6voUkCgJodnBe8T1C1vXvGgmHGQNNecVIO2odLcNPxegnl1sNnabyit3FrxNWbwdpX e9Kg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to; bh=hR85GCZfhL4YJawbBftoxChN3cnahiYUmelBrtysYzQ=; b=GFpAANJrHDRMoaT2CyvFqsIPO2AkISbGz9AkxBAVMbQX0JcrdscrkgvwUFreTphHzt XMRAVXPPmfHHLKjkqm7wEtmCjzm1yv2TiBeaLY1KedWPRPNay62AOLBx61vnNfhibGnE xBdZhlNFIdpmS9p4c2yx15YfpiIKICZkxB4mKsB/4Vu5gkvXPZ57du5tAFsZlST46yM/ j9EhMKFnB44sSBlzEXeKNjsrBeOS5FzUyz33oKIe0KYdYPOq7QDSeX7vY9XO9CNQuvT0 NCSH0rUKBuLsAK/6RSj7V61HQPi8QIHoDZfmoUd6mdiPODcf6h3c5lHea41S8IKdXGQ7 OANg== X-Gm-Message-State: AOAM530SmWrCif0+DqnBp3DI8K0KFl5kjIo/D4ZKhjPOW3Vv6ywfb1f6 MGn4lvtAs3e/AiqE3T8D8ZKO5Q== X-Google-Smtp-Source: ABdhPJywxfOyjT/Bbb3z07Sb4ifGRgqWGAJFb2yLMs8NKV2zXEevYh6BB5SfG6ECW1CSnDRZbY3y1w== X-Received: by 2002:a63:50b:: with SMTP id 11mr5654394pgf.308.1632866373808; Tue, 28 Sep 2021 14:59:33 -0700 (PDT) Received: from google.com (254.80.82.34.bc.googleusercontent.com. [34.82.80.254]) by smtp.gmail.com with ESMTPSA id z14sm83969pjq.48.2021.09.28.14.59.32 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 28 Sep 2021 14:59:32 -0700 (PDT) Date: Tue, 28 Sep 2021 21:59:29 +0000 From: David Matlack To: Sean Christopherson Subject: Re: [PATCH 08/14] KVM: x86: Tweak halt emulation helper names to free up kvm_vcpu_halt() Message-ID: References: <20210925005528.1145584-1-seanjc@google.com> <20210925005528.1145584-9-seanjc@google.com> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <20210925005528.1145584-9-seanjc@google.com> X-Mailman-Approved-At: Wed, 29 Sep 2021 03:12:40 -0400 Cc: Wanpeng Li , kvm@vger.kernel.org, David Hildenbrand , linux-kernel@vger.kernel.org, Paul Mackerras , Claudio Imbrenda , kvmarm@lists.cs.columbia.edu, Janosch Frank , Marc Zyngier , Joerg Roedel , Huacai Chen , Christian Borntraeger , Aleksandar Markovic , kvm-ppc@vger.kernel.org, linux-arm-kernel@lists.infradead.org, Jim Mattson , Cornelia Huck , linux-mips@vger.kernel.org, Paolo Bonzini , Vitaly Kuznetsov X-BeenThere: kvmarm@lists.cs.columbia.edu X-Mailman-Version: 2.1.14 Precedence: list List-Id: Where KVM/ARM decisions are made List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Errors-To: kvmarm-bounces@lists.cs.columbia.edu Sender: kvmarm-bounces@lists.cs.columbia.edu On Fri, Sep 24, 2021 at 05:55:22PM -0700, Sean Christopherson wrote: > Rename a variety of HLT-related helpers to free up the function name > "kvm_vcpu_halt" for future use in generic KVM code, e.g. to differentiate > between "block" and "halt". > > No functional change intended. > > Signed-off-by: Sean Christopherson Reviewed-by: David Matlack > --- > arch/x86/include/asm/kvm_host.h | 2 +- > arch/x86/kvm/vmx/nested.c | 2 +- > arch/x86/kvm/vmx/vmx.c | 4 ++-- > arch/x86/kvm/x86.c | 13 +++++++------ > 4 files changed, 11 insertions(+), 10 deletions(-) > > diff --git a/arch/x86/include/asm/kvm_host.h b/arch/x86/include/asm/kvm_host.h > index 4e8c21083bdb..cfebef10b89c 100644 > --- a/arch/x86/include/asm/kvm_host.h > +++ b/arch/x86/include/asm/kvm_host.h > @@ -1679,7 +1679,7 @@ int kvm_emulate_monitor(struct kvm_vcpu *vcpu); > int kvm_fast_pio(struct kvm_vcpu *vcpu, int size, unsigned short port, int in); > int kvm_emulate_cpuid(struct kvm_vcpu *vcpu); > int kvm_emulate_halt(struct kvm_vcpu *vcpu); > -int kvm_vcpu_halt(struct kvm_vcpu *vcpu); > +int kvm_emulate_halt_noskip(struct kvm_vcpu *vcpu); > int kvm_emulate_ap_reset_hold(struct kvm_vcpu *vcpu); > int kvm_emulate_wbinvd(struct kvm_vcpu *vcpu); > > diff --git a/arch/x86/kvm/vmx/nested.c b/arch/x86/kvm/vmx/nested.c > index eedcebf58004..f689e463b678 100644 > --- a/arch/x86/kvm/vmx/nested.c > +++ b/arch/x86/kvm/vmx/nested.c > @@ -3618,7 +3618,7 @@ static int nested_vmx_run(struct kvm_vcpu *vcpu, bool launch) > !(nested_cpu_has(vmcs12, CPU_BASED_INTR_WINDOW_EXITING) && > (vmcs12->guest_rflags & X86_EFLAGS_IF))) { > vmx->nested.nested_run_pending = 0; > - return kvm_vcpu_halt(vcpu); > + return kvm_emulate_halt_noskip(vcpu); > } > break; > case GUEST_ACTIVITY_WAIT_SIPI: > diff --git a/arch/x86/kvm/vmx/vmx.c b/arch/x86/kvm/vmx/vmx.c > index d118daed0530..858f5f1f1273 100644 > --- a/arch/x86/kvm/vmx/vmx.c > +++ b/arch/x86/kvm/vmx/vmx.c > @@ -4740,7 +4740,7 @@ static int handle_rmode_exception(struct kvm_vcpu *vcpu, > if (kvm_emulate_instruction(vcpu, 0)) { > if (vcpu->arch.halt_request) { > vcpu->arch.halt_request = 0; > - return kvm_vcpu_halt(vcpu); > + return kvm_emulate_halt_noskip(vcpu); > } > return 1; > } > @@ -5414,7 +5414,7 @@ static int handle_invalid_guest_state(struct kvm_vcpu *vcpu) > > if (vcpu->arch.halt_request) { > vcpu->arch.halt_request = 0; > - return kvm_vcpu_halt(vcpu); > + return kvm_emulate_halt_noskip(vcpu); > } > > /* > diff --git a/arch/x86/kvm/x86.c b/arch/x86/kvm/x86.c > index b0c21d42f453..eade8a2bdccf 100644 > --- a/arch/x86/kvm/x86.c > +++ b/arch/x86/kvm/x86.c > @@ -8643,7 +8643,7 @@ void kvm_arch_exit(void) > #endif > } > > -static int __kvm_vcpu_halt(struct kvm_vcpu *vcpu, int state, int reason) > +static int __kvm_emulate_halt(struct kvm_vcpu *vcpu, int state, int reason) > { > ++vcpu->stat.halt_exits; > if (lapic_in_kernel(vcpu)) { > @@ -8655,11 +8655,11 @@ static int __kvm_vcpu_halt(struct kvm_vcpu *vcpu, int state, int reason) > } > } > > -int kvm_vcpu_halt(struct kvm_vcpu *vcpu) > +int kvm_emulate_halt_noskip(struct kvm_vcpu *vcpu) > { > - return __kvm_vcpu_halt(vcpu, KVM_MP_STATE_HALTED, KVM_EXIT_HLT); > + return __kvm_emulate_halt(vcpu, KVM_MP_STATE_HALTED, KVM_EXIT_HLT); > } > -EXPORT_SYMBOL_GPL(kvm_vcpu_halt); > +EXPORT_SYMBOL_GPL(kvm_emulate_halt_noskip); > > int kvm_emulate_halt(struct kvm_vcpu *vcpu) > { > @@ -8668,7 +8668,7 @@ int kvm_emulate_halt(struct kvm_vcpu *vcpu) > * TODO: we might be squashing a GUESTDBG_SINGLESTEP-triggered > * KVM_EXIT_DEBUG here. > */ > - return kvm_vcpu_halt(vcpu) && ret; > + return kvm_emulate_halt_noskip(vcpu) && ret; > } > EXPORT_SYMBOL_GPL(kvm_emulate_halt); > > @@ -8676,7 +8676,8 @@ int kvm_emulate_ap_reset_hold(struct kvm_vcpu *vcpu) > { > int ret = kvm_skip_emulated_instruction(vcpu); > > - return __kvm_vcpu_halt(vcpu, KVM_MP_STATE_AP_RESET_HOLD, KVM_EXIT_AP_RESET_HOLD) && ret; > + return __kvm_emulate_halt(vcpu, KVM_MP_STATE_AP_RESET_HOLD, > + KVM_EXIT_AP_RESET_HOLD) && ret; > } > EXPORT_SYMBOL_GPL(kvm_emulate_ap_reset_hold); > > -- > 2.33.0.685.g46640cef36-goog > _______________________________________________ kvmarm mailing list kvmarm@lists.cs.columbia.edu https://lists.cs.columbia.edu/mailman/listinfo/kvmarm