[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <d3cc3cd1a90d7ee9a31e40fbe2db9f3f338d5004.camel@redhat.com>
Date: Thu, 13 Jan 2022 18:30:49 +0200
From: Maxim Levitsky <mlevitsk@...hat.com>
To: Sean Christopherson <seanjc@...gle.com>,
Vitaly Kuznetsov <vkuznets@...hat.com>
Cc: Paolo Bonzini <pbonzini@...hat.com>,
Igor Mammedov <imammedo@...hat.com>, kvm@...r.kernel.org,
Wanpeng Li <wanpengli@...cent.com>,
Jim Mattson <jmattson@...gle.com>, linux-kernel@...r.kernel.org
Subject: Re: [PATCH 2/2] KVM: x86: Forbid KVM_SET_CPUID{,2} after KVM_RUN
On Thu, 2022-01-13 at 16:26 +0000, Sean Christopherson wrote:
> On Thu, Jan 13, 2022, Vitaly Kuznetsov wrote:
> > Maxim Levitsky <mlevitsk@...hat.com> writes:
> > > For my nested AVIC work I would really want the APIC ID of a VCPU to be read-only
> > > and be equal to vcpu_id.
> > >
> >
> > Doesn't APIC ID have topology encoded in it?
>
> Yeah, APIC IDs are derived from the topology. From the SDM (this doesn't
> talk about core/SMT info, but that's included as well):
>
> The hardware assigned APIC ID is based on system topology and includes encoding
> for socket position and cluster information.
>
> The SDM also says:
>
> Some processors permit software to modify the APIC ID. However, the ability of
> software to modify the APIC ID is processor model specific.
>
> So I _think_ we could define KVM behavior to ignore writes from the _guest_, but
> the APIC_ID == vcpu_id requirement won't fly as userspace expects to be able to
> stuff virtual toplogy info into the APIC ID.
>
That is a very good piece of information! Thanks!
Best regards,
Maxim Levitsky
Powered by blists - more mailing lists