From: Sean Christopherson <seanjc@google.com>
To: Vitaly Kuznetsov <vkuznets@redhat.com>
Cc: kalyazin@amazon.com, pbonzini@redhat.com, tglx@linutronix.de,
mingo@redhat.com, bp@alien8.de, dave.hansen@linux.intel.com,
hpa@zytor.com, kvm@vger.kernel.org,
linux-kernel@vger.kernel.org, david@redhat.com,
peterx@redhat.com, oleg@redhat.com, gshan@redhat.com,
graf@amazon.de, jgowans@amazon.com, roypat@amazon.co.uk,
derekmn@amazon.com, nsaenz@amazon.es, xmarcalx@amazon.com
Subject: Re: [PATCH] KVM: x86: async_pf: check earlier if can deliver async pf
Date: Fri, 22 Nov 2024 06:32:33 -0800 [thread overview]
Message-ID: <Z0CWAXqMl-wTdGXm@google.com> (raw)
In-Reply-To: <878qtbvcho.fsf@redhat.com>
On Fri, Nov 22, 2024, Vitaly Kuznetsov wrote:
> diff --git a/arch/x86/include/uapi/asm/kvm_para.h b/arch/x86/include/uapi/asm/kvm_para.h
> index a1efa7907a0b..5558a1ec3dc9 100644
> --- a/arch/x86/include/uapi/asm/kvm_para.h
> +++ b/arch/x86/include/uapi/asm/kvm_para.h
> @@ -87,7 +87,7 @@ struct kvm_clock_pairing {
> #define KVM_MAX_MMU_OP_BATCH 32
>
> #define KVM_ASYNC_PF_ENABLED (1 << 0)
> -#define KVM_ASYNC_PF_SEND_ALWAYS (1 << 1)
> +#define KVM_ASYNC_PF_SEND_ALWAYS (1 << 1) /* deprecated */
> #define KVM_ASYNC_PF_DELIVERY_AS_PF_VMEXIT (1 << 2)
> #define KVM_ASYNC_PF_DELIVERY_AS_INT (1 << 3)
>
> diff --git a/arch/x86/kvm/x86.c b/arch/x86/kvm/x86.c
> index 83fe0a78146f..cd15e738ca9b 100644
> --- a/arch/x86/kvm/x86.c
> +++ b/arch/x86/kvm/x86.c
> @@ -3585,7 +3585,6 @@ static int kvm_pv_enable_async_pf(struct kvm_vcpu *vcpu, u64 data)
> sizeof(u64)))
> return 1;
>
> - vcpu->arch.apf.send_user_only = !(data & KVM_ASYNC_PF_SEND_ALWAYS);
> vcpu->arch.apf.delivery_as_pf_vmexit = data & KVM_ASYNC_PF_DELIVERY_AS_PF_VMEXIT;
>
> kvm_async_pf_wakeup_all(vcpu);
> @@ -13374,8 +13373,7 @@ static bool kvm_can_deliver_async_pf(struct kvm_vcpu *vcpu)
> if (!kvm_pv_async_pf_enabled(vcpu))
> return false;
>
> - if (vcpu->arch.apf.send_user_only &&
> - kvm_x86_call(get_cpl)(vcpu) == 0)
> + if (kvm_x86_call(get_cpl)(vcpu) == 0)
By x86's general definition of "user", this should be "!= 3" :-)
next prev parent reply other threads:[~2024-11-22 14:32 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-11-18 13:04 [PATCH] KVM: x86: async_pf: check earlier if can deliver async pf Nikita Kalyazin
2024-11-18 17:58 ` Vitaly Kuznetsov
2024-11-21 18:10 ` Nikita Kalyazin
2024-11-22 9:33 ` Vitaly Kuznetsov
2024-11-22 14:32 ` Sean Christopherson [this message]
2024-11-19 13:24 ` Sean Christopherson
2024-11-21 17:59 ` Nikita Kalyazin
2024-11-21 21:05 ` Sean Christopherson
2024-11-25 15:50 ` Nikita Kalyazin
2024-11-26 0:06 ` Sean Christopherson
2024-11-26 15:35 ` Nikita Kalyazin
2024-11-26 22:10 ` Sean Christopherson
2024-11-27 10:35 ` Nikita Kalyazin
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=Z0CWAXqMl-wTdGXm@google.com \
--to=seanjc@google.com \
--cc=bp@alien8.de \
--cc=dave.hansen@linux.intel.com \
--cc=david@redhat.com \
--cc=derekmn@amazon.com \
--cc=graf@amazon.de \
--cc=gshan@redhat.com \
--cc=hpa@zytor.com \
--cc=jgowans@amazon.com \
--cc=kalyazin@amazon.com \
--cc=kvm@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=mingo@redhat.com \
--cc=nsaenz@amazon.es \
--cc=oleg@redhat.com \
--cc=pbonzini@redhat.com \
--cc=peterx@redhat.com \
--cc=roypat@amazon.co.uk \
--cc=tglx@linutronix.de \
--cc=vkuznets@redhat.com \
--cc=xmarcalx@amazon.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).