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 vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id A5762C433F5 for ; Mon, 18 Apr 2022 08:38:14 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S237316AbiDRIku (ORCPT ); Mon, 18 Apr 2022 04:40:50 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:34686 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S237284AbiDRIks (ORCPT ); Mon, 18 Apr 2022 04:40:48 -0400 Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id F26A819C07 for ; Mon, 18 Apr 2022 01:38:09 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1650271089; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=LdbvqaVaOQQPzji0XpZH7xN+F7oFT2JmFZMage+5BKI=; b=EoYM7o5jiwnanELXscUnlps3relb6MK7EYwySYo3tdQ11aSq0+pObTzxIKPtfYTiFq7w87 c+XjzEYvNIa6+R2Dsoj/JLBspPM7evY3F2wWjKfCFq+HdLVWjAVy88pev07MPZOOED9zE0 kRfH9X5PoSQHRu8xVUTRJStxH5eS5yA= Received: from mimecast-mx02.redhat.com (mimecast-mx02.redhat.com [66.187.233.88]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-614-UeOd6_AiPpuzzfvLJa-NTw-1; Mon, 18 Apr 2022 04:38:06 -0400 X-MC-Unique: UeOd6_AiPpuzzfvLJa-NTw-1 Received: from smtp.corp.redhat.com (int-mx08.intmail.prod.int.rdu2.redhat.com [10.11.54.8]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 45BA380005D; Mon, 18 Apr 2022 08:37:55 +0000 (UTC) Received: from starship (unknown [10.40.194.231]) by smtp.corp.redhat.com (Postfix) with ESMTP id 89C71C5094E; Mon, 18 Apr 2022 08:37:49 +0000 (UTC) Message-ID: Subject: Re: [PATCH 1/4] KVM: x86: Tag APICv DISABLE inhibit, not ABSENT, if APICv is disabled From: Maxim Levitsky To: Sean Christopherson , Paolo Bonzini Cc: Vitaly Kuznetsov , Wanpeng Li , Jim Mattson , Joerg Roedel , kvm@vger.kernel.org, linux-kernel@vger.kernel.org, Gaoning Pan , Yongkang Jia Date: Mon, 18 Apr 2022 11:37:48 +0300 In-Reply-To: <20220416034249.2609491-2-seanjc@google.com> References: <20220416034249.2609491-1-seanjc@google.com> <20220416034249.2609491-2-seanjc@google.com> Content-Type: text/plain; charset="UTF-8" User-Agent: Evolution 3.36.5 (3.36.5-2.fc32) MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Scanned-By: MIMEDefang 2.85 on 10.11.54.8 Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Sat, 2022-04-16 at 03:42 +0000, Sean Christopherson wrote: > Set the DISABLE inhibit, not the ABSENT inhibit, if APICv is disabled via > module param. A recent refactoring to add a wrapper for setting/clearing > inhibits unintentionally changed the flag, probably due to a copy+paste > goof. > > Fixes: 4f4c4a3ee53c ("KVM: x86: Trace all APICv inhibit changes and capture overall status") > Signed-off-by: Sean Christopherson > --- > arch/x86/kvm/x86.c | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > diff --git a/arch/x86/kvm/x86.c b/arch/x86/kvm/x86.c > index ab336f7c82e4..753296902535 100644 > --- a/arch/x86/kvm/x86.c > +++ b/arch/x86/kvm/x86.c > @@ -9159,7 +9159,7 @@ static void kvm_apicv_init(struct kvm *kvm) > > if (!enable_apicv) > set_or_clear_apicv_inhibit(inhibits, > - APICV_INHIBIT_REASON_ABSENT, true); > + APICV_INHIBIT_REASON_DISABLE, true); > } > > static void kvm_sched_yield(struct kvm_vcpu *vcpu, unsigned long dest_id) So ABSENT means that userspace didn't enable, it and DISABLE means kernel module param disabled it. I didn't follow patches that touched those but it feels like we can use a single inhibit reason for both, or at least make better names for this. APICV_INHIBIT_REASON_ABSENT doesn't sound good to me. Having said that, the patch is OK. Reviewed-by: Maxim Levitsky Best regards, Maxim Levitsky