linux-kselftest.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Ivan Orlov <ivan.orlov0322@gmail.com>
To: Sean Christopherson <seanjc@google.com>, Ivan Orlov <iorlov@amazon.com>
Cc: bp@alien8.de, dave.hansen@linux.intel.com, mingo@redhat.com,
	pbonzini@redhat.com, shuah@kernel.org, tglx@linutronix.de,
	hpa@zytor.com, kvm@vger.kernel.org, linux-kernel@vger.kernel.org,
	linux-kselftest@vger.kernel.org, x86@kernel.org,
	jalliste@amazon.com, nh-open-source@amazon.com,
	pdurrant@amazon.co.uk
Subject: Re: [PATCH 1/3] KVM: x86, vmx: Add function for event delivery error generation
Date: Wed, 16 Oct 2024 23:05:04 +0100	[thread overview]
Message-ID: <cea2040f-7214-41cb-9e9c-98895bf5a1ec@gmail.com> (raw)
In-Reply-To: <ZxAqscbrROD1_szG@google.com>

On 10/16/24 22:05, Sean Christopherson wrote:
> On Tue, Oct 15, 2024, Ivan Orlov wrote:
>>>> diff --git a/arch/x86/kvm/vmx/vmx.c b/arch/x86/kvm/vmx/vmx.c
>>>> index c67e448c6ebd..afd785e7f3a3 100644
>>>> --- a/arch/x86/kvm/vmx/vmx.c
>>>> +++ b/arch/x86/kvm/vmx/vmx.c
>>>> @@ -6550,19 +6550,10 @@ static int __vmx_handle_exit(struct kvm_vcpu *vcpu, fastpath_t exit_fastpath)
>>>>   	     exit_reason.basic != EXIT_REASON_APIC_ACCESS &&
>>>>   	     exit_reason.basic != EXIT_REASON_TASK_SWITCH &&
>>>>   	     exit_reason.basic != EXIT_REASON_NOTIFY)) {
>>>> -		int ndata = 3;
>>>> +		gpa_t gpa = vmcs_read64(GUEST_PHYSICAL_ADDRESS);
>>>> +		bool is_mmio = exit_reason.basic == EXIT_REASON_EPT_MISCONFIG;
>>>
>>> There's no need for is_mmio, just pass INVALID_GPA when the GPA isn't known.
>>
>> Ah alright, then we definitely don't need an is_mmio field. I assume we
>> can't do MMIO at GPA=0, right?
> 
> Wrong :-)
> 

Then getting rid of `is_mmio` will make distinguishing between vectoring 
error due to MMIO with GPA=0 and non-mmio vectoring error quite hard for 
the error reporti

Passing INVALID_GPA into the userspace due to non-mmio vectoring error 
will change the existing internal.data order, but I can do it if it's 
fine. Sorry for nitpicking :)

>  From an architectural perspective, GPA=0 is not special in any way.  E.g. prior
> to L1TF, Linux would happily use the page with PFN=0.
> 

Cool, didn't know about this vulnerability... Thanks for the explanation!

-- 
Kind regards,
Ivan Orlov

  reply	other threads:[~2024-10-16 22:05 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-09-27 16:16 [PATCH 0/3] Handle MMIO during event delivery error on SVM Ivan Orlov
2024-09-27 16:16 ` [PATCH 1/3] KVM: x86, vmx: Add function for event delivery error generation Ivan Orlov
2024-10-11 23:20   ` Sean Christopherson
2024-10-12  0:06     ` Sean Christopherson
2024-10-15 19:52     ` Ivan Orlov
2024-10-16 21:05       ` Sean Christopherson
2024-10-16 22:05         ` Ivan Orlov [this message]
2024-10-16 23:12           ` Sean Christopherson
2024-09-27 16:16 ` [PATCH 2/3] KVM: vmx, svm, mmu: Process MMIO during event delivery Ivan Orlov
2024-10-12  0:05   ` Sean Christopherson
2024-10-16 22:53     ` Ivan Orlov
2024-10-17 16:20       ` Sean Christopherson
2024-09-27 16:16 ` [PATCH 3/3] selftests: KVM: Add test case for " Ivan Orlov
2024-10-12  0:21   ` Sean Christopherson
2024-10-17 16:27     ` David Woodhouse
2024-10-17 16:58       ` Sean Christopherson

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=cea2040f-7214-41cb-9e9c-98895bf5a1ec@gmail.com \
    --to=ivan.orlov0322@gmail.com \
    --cc=bp@alien8.de \
    --cc=dave.hansen@linux.intel.com \
    --cc=hpa@zytor.com \
    --cc=iorlov@amazon.com \
    --cc=jalliste@amazon.com \
    --cc=kvm@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-kselftest@vger.kernel.org \
    --cc=mingo@redhat.com \
    --cc=nh-open-source@amazon.com \
    --cc=pbonzini@redhat.com \
    --cc=pdurrant@amazon.co.uk \
    --cc=seanjc@google.com \
    --cc=shuah@kernel.org \
    --cc=tglx@linutronix.de \
    --cc=x86@kernel.org \
    /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).