[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <25254b24-c4d7-b5eb-d67d-1415c6625448@amd.com>
Date: Thu, 3 Mar 2022 21:41:19 +0700
From: Suravee Suthikulpanit <suravee.suthikulpanit@....com>
To: Maxim Levitsky <mlevitsk@...hat.com>, linux-kernel@...r.kernel.org,
kvm@...r.kernel.org
Cc: pbonzini@...hat.com, seanjc@...gle.com, joro@...tes.org,
jon.grimm@....com, wei.huang2@....com, terry.bowman@....com
Subject: Re: [RFC PATCH 07/13] KVM: SVM: Update avic_kick_target_vcpus to
support 32-bit APIC ID
Maxim,
On 2/25/22 12:35 AM, Maxim Levitsky wrote:
> On Sun, 2022-02-20 at 20:19 -0600, Suravee Suthikulpanit wrote:
>> In x2APIC mode, ICRH contains 32-bit destination APIC ID.
>> So, update the avic_kick_target_vcpus() accordingly.
>>
>> Signed-off-by: Suravee Suthikulpanit<suravee.suthikulpanit@....com>
>> ---
>> arch/x86/kvm/svm/avic.c | 13 +++++++++----
>> 1 file changed, 9 insertions(+), 4 deletions(-)
>>
>> diff --git a/arch/x86/kvm/svm/avic.c b/arch/x86/kvm/svm/avic.c
>> index 60f30e48d816..215d8a7dbc1d 100644
>> --- a/arch/x86/kvm/svm/avic.c
>> +++ b/arch/x86/kvm/svm/avic.c
>> @@ -307,10 +307,16 @@ void avic_ring_doorbell(struct kvm_vcpu *vcpu)
>> }
>>
>> static void avic_kick_target_vcpus(struct kvm *kvm, struct kvm_lapic *source,
>> - u32 icrl, u32 icrh)
>> + u32 icrl, u32 icrh, bool x2apic_enabled)
>> {
>> struct kvm_vcpu *vcpu;
>> unsigned long i;
>> + u32 dest;
>> +
>> + if (x2apic_enabled)
>> + dest = icrh;
>> + else
>> + dest = GET_APIC_DEST_FIELD(icrh);
>
> Just use 'apic_x2apic_mode(apic)', no need for x2apic_enabled parameter
> as I said in patch 6.
>
> Also maybe rename GET_APIC_DEST_FIELD to GET_XAPIC_DEST_FIELD or something as it is
> wrong for x2apic.
I'll send a separate patch to rename the macros as you suggested.
Regards,
Suravee
Powered by blists - more mailing lists