From: Paul Durrant <xadimgnik@gmail.com>
To: David Woodhouse <dwmw2@infradead.org>,
kvm@vger.kernel.org, linux-kernel@vger.kernel.org
Cc: Paul Durrant <pdurrant@amazon.com>,
Sean Christopherson <seanjc@google.com>,
Paolo Bonzini <pbonzini@redhat.com>
Subject: Re: [PATCH v2 09/12] KVM: selftests / xen: set KVM_XEN_VCPU_ATTR_TYPE_VCPU_ID
Date: Mon, 18 Sep 2023 13:18:32 +0100 [thread overview]
Message-ID: <c91c5ec9-a917-6d20-1401-c11e27d16f90@xen.org> (raw)
In-Reply-To: <74077fcadd5ddc9dba742987e1419fc13713cd7a.camel@infradead.org>
On 18/09/2023 12:59, David Woodhouse wrote:
> On Mon, 2023-09-18 at 11:21 +0000, Paul Durrant wrote:
>> From: Paul Durrant <pdurrant@amazon.com>
>>
>> If the capability (KVM_XEN_HVM_CONFIG_EVTCHN_SEND) is present then set
>> the guest's vCPU id to match the chosen vcpu_info offset.
>
> I think from KVM's point of view, the vcpu_id is still zero. As is the
> vcpu_idx. What you're setting is the *Xen* vcpu_id.
Ok. I'll clarify the terminology; and I'll need to set it before the
shinfo as noted on another thread.
>
> I like that it's *different* to the vcpu_id; we should definitely be
> testing that case.
How so?
> I don't quite know why the code was using
> vcpu_info[1] in the shinfo before when we were explicitly setting the
> address from userspace; I suppose it didn't matter.
>
Yes, I think it was entirely arbitrary.
>> Also make some cosmetic fixes to the code for clarity.
>>
>> Signed-off-by: Paul Durrant <pdurrant@amazon.com>
>> ---
>> Cc: Sean Christopherson <seanjc@google.com>
>> Cc: Paolo Bonzini <pbonzini@redhat.com>
>> Cc: David Woodhouse <dwmw2@infradead.org>
>>
>> v2:
>> - New in this version.
>> ---
>> .../selftests/kvm/x86_64/xen_shinfo_test.c | 19 +++++++++++++++----
>> 1 file changed, 15 insertions(+), 4 deletions(-)
>>
>> diff --git a/tools/testing/selftests/kvm/x86_64/xen_shinfo_test.c b/tools/testing/selftests/kvm/x86_64/xen_shinfo_test.c
>> index 05898ad9f4d9..49d0c91ee078 100644
>> --- a/tools/testing/selftests/kvm/x86_64/xen_shinfo_test.c
>> +++ b/tools/testing/selftests/kvm/x86_64/xen_shinfo_test.c
>> @@ -38,6 +38,8 @@
>> #define VCPU_INFO_VADDR (SHINFO_REGION_GVA + 0x40)
>> #define RUNSTATE_VADDR (SHINFO_REGION_GVA + PAGE_SIZE + PAGE_SIZE - 15)
>>
>> +#define VCPU_ID 1 /* Must correspond to offset of VCPU_INFO_[V]ADDR */
>>
>
> As well as being a bit clearer in the commit comment as noted above,
> let's call this XEN_VCPU_ID ?
>
Ok.
> With that cleaned up,
>
> Reviewed-by: David Woodhouse <dwmw@amazon.co.uk>
>
Thanks,
Paul
next prev parent reply other threads:[~2023-09-18 12:19 UTC|newest]
Thread overview: 32+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-09-18 11:21 [PATCH v2 00/12] KVM: xen: update shared_info and vcpu_info handling Paul Durrant
2023-09-18 11:21 ` [PATCH v2 01/12] KVM: pfncache: add a map helper function Paul Durrant
2023-09-18 11:21 ` [PATCH v2 02/12] KVM: pfncache: add a mark-dirty helper Paul Durrant
2023-09-18 11:21 ` [PATCH v2 03/12] KVM: pfncache: add a helper to get the gpa Paul Durrant
2023-09-18 11:21 ` [PATCH v2 04/12] KVM: pfncache: base offset check on khva rather than gpa Paul Durrant
2023-09-18 11:21 ` [PATCH v2 05/12] KVM: pfncache: allow a cache to be activated with a fixed (userspace) HVA Paul Durrant
2023-09-18 11:34 ` David Woodhouse
2023-09-18 12:11 ` Paul Durrant
2023-09-18 12:59 ` David Woodhouse
2023-09-18 13:00 ` Paul Durrant
2023-09-18 11:21 ` [PATCH v2 06/12] KVM: xen: allow shared_info to be mapped by fixed HVA Paul Durrant
2023-09-18 11:21 ` [PATCH v2 07/12] KVM: xen: prepare for using 'default' vcpu_info Paul Durrant
2023-09-18 11:21 ` [PATCH v2 08/12] KVM: xen: automatically use the vcpu_info embedded in shared_info Paul Durrant
2023-09-18 11:49 ` David Woodhouse
2023-09-18 12:15 ` Paul Durrant
2023-09-18 11:21 ` [PATCH v2 09/12] KVM: selftests / xen: set KVM_XEN_VCPU_ATTR_TYPE_VCPU_ID Paul Durrant
2023-09-18 11:59 ` David Woodhouse
2023-09-18 12:18 ` Paul Durrant [this message]
2023-09-18 12:26 ` David Woodhouse
2023-09-18 11:21 ` [PATCH v2 10/12] KVM: selftests / xen: map shared_info using HVA rather than GFN Paul Durrant
2023-09-18 13:19 ` David Woodhouse
2023-09-18 13:24 ` Paul Durrant
2023-09-18 13:30 ` David Woodhouse
2023-09-18 11:21 ` [PATCH v2 11/12] KVM: selftests / xen: don't explicitly set the vcpu_info address Paul Durrant
2023-09-18 13:21 ` David Woodhouse
2023-09-18 13:26 ` Paul Durrant
2023-09-18 13:36 ` David Woodhouse
2023-09-18 13:41 ` Paul Durrant
2023-09-18 14:05 ` David Woodhouse
2023-09-18 14:14 ` Paul Durrant
2023-09-18 11:21 ` [PATCH v2 12/12] KVM: xen: advertize the KVM_XEN_HVM_CONFIG_SHARED_INFO_HVA capability Paul Durrant
2023-09-18 13:22 ` David Woodhouse
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=c91c5ec9-a917-6d20-1401-c11e27d16f90@xen.org \
--to=xadimgnik@gmail.com \
--cc=dwmw2@infradead.org \
--cc=kvm@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=paul@xen.org \
--cc=pbonzini@redhat.com \
--cc=pdurrant@amazon.com \
--cc=seanjc@google.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
all inboxes | Powered by JetHome®