Received: by 2002:a05:6a11:4021:0:0:0:0 with SMTP id ky33csp42604pxb; Tue, 28 Sep 2021 15:01:00 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwS5rYKKIWvRdn1HkGj1/OUXOP3x9dZvOmNxM2kSpyNHR68+NgmrJx9m7T4E7rr62SW2ixR X-Received: by 2002:a65:4643:: with SMTP id k3mr918378pgr.264.1632866459891; Tue, 28 Sep 2021 15:00:59 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1632866459; cv=none; d=google.com; s=arc-20160816; b=ABnjU0j+nNYSVjCzZXCOCr0/Rn1iOICq0VcY1N5TMer7FJLGc8SVMFJ4s7btQMcnai XazRmhMQA5OkZ68KszXzY6epJR3hjs02fcts/1cxgcuv8ZjFvKdgN39og4lMMo6k9y0W j+EMvsHsQLhZYfEuS8Mys5T+9Kk84cDFk6BRnzFZ0hYp04RXJ9y5v04w2xrQLjxyoX37 6dAM3zmfqErKH1qm5DCPJYkyT4tuAk9OznYDsP9snLA4C75ll381ZRPm2bJXgMS9kQBy egP7q/Mlp+Vs9v97WP2zchOcbzukta00t1Rrcivoz6qX2/WAQZ/B0F9+Jhgry58HyPz7 RGRQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature; bh=hR85GCZfhL4YJawbBftoxChN3cnahiYUmelBrtysYzQ=; b=Nm6uiWmASZnpBd03G97a69YLFu9sTDqyLnp0+qESUyfN3oxtvSIUUzc6gfcQwukgcm E07tu6c56C7kpOBHIATlDAOburpHSlbTmE+hNZWiZ8TigLRaCDCTiMX/p/+ghld7J3jJ FYtnfG+FJMGMT/92HWEOTp9kSyycLySW/my/4vUeNbLYaqLB2Y7WrtiWlYoxFDQc91sC at9QTkN3puADGSJ+kXGlu4rQ43LZ2HJ35FN7Ts+eJ4f1on3L0re8UqjSy5fvqrxTZUwh I5mZrifatdZfcueU0Ab2nwI9RqomZkCirmxaUoHmjBkAL2cFhOXoi76ZeXNtkmGpzmzM 6K1g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@google.com header.s=20210112 header.b=d0JUHehy; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id o22si646186pgu.544.2021.09.28.15.00.24; Tue, 28 Sep 2021 15:00:59 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@google.com header.s=20210112 header.b=d0JUHehy; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S242981AbhI1WBP (ORCPT + 99 others); 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-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 >