mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Tom Lendacky <thomas.lendacky@amd.com>
To: Maxim Levitsky <mlevitsk@redhat.com>,
	Suravee Suthikulpanit <suravee.suthikulpanit@amd.com>,
	linux-kernel@vger.kernel.org, kvm@vger.kernel.org,
	x86@kernel.org
Cc: pbonzini@redhat.com, joro@8bytes.org, seanjc@google.com,
	tglx@linutronix.de, mingo@redhat.com, bp@alien8.de,
	peterz@infradead.org, hpa@zytor.com, jon.grimm@amd.com
Subject: Re: [PATCH v2 3/3] KVM: SVM: Extend host physical APIC ID field to support more than 8-bit
Date: Fri, 3 Dec 2021 10:34:56 -0600	[thread overview]
Message-ID: <6cc9848a-9f04-b923-453a-6dbe03b73e58@amd.com> (raw)
In-Reply-To: <7dd1e7d1510f17f1140b7174dd42fed752eefc38.camel@redhat.com>

On 12/3/21 1:46 AM, Maxim Levitsky wrote:
> On Thu, 2021-12-02 at 17:58 -0600, Suravee Suthikulpanit wrote:

>> @@ -63,6 +64,7 @@
>>   static DEFINE_HASHTABLE(svm_vm_data_hash, SVM_VM_DATA_HASH_BITS);
>>   static u32 next_vm_id = 0;
>>   static bool next_vm_id_wrapped = 0;
>> +static u64 avic_host_physical_id_mask;
>>   static DEFINE_SPINLOCK(svm_vm_data_hash_lock);
>>   
>>   /*
>> @@ -133,6 +135,20 @@ void avic_vm_destroy(struct kvm *kvm)
>>   	spin_unlock_irqrestore(&svm_vm_data_hash_lock, flags);
>>   }
>>   
>> +static void avic_init_host_physical_apicid_mask(void)
>> +{
>> +	if (!x2apic_mode) {
> Wonder why this is a exported  global variable and not function.
> Not the patch fault though.
>> +		/* If host is in xAPIC mode, default to only 8-bit mask. */
>> +		avic_host_physical_id_mask = 0xffULL;
>> +	} else {
>> +		u32 count = get_count_order(apic_get_max_phys_apicid());
>> +
>> +		avic_host_physical_id_mask = BIT(count) - 1;
> I think that there were some complains about using this macro and instead encouraged
> to use 1 << x directly, but I see it used already in other places in avic.c so I don't know.

And I think it should be BIT_ULL() since avic_host_physical_id_mask is a u64.

Thanks,
Tom

> 

  reply	other threads:[~2021-12-03 16:35 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-12-02 23:58 [PATCH v2 0/3] svm: avic: Allow AVIC support on system w/ physical APIC ID > 255 Suravee Suthikulpanit
2021-12-02 23:58 ` [PATCH v2 1/3] KVM: SVM: Refactor AVIC hardware setup logic into helper function Suravee Suthikulpanit
2021-12-03  7:39   ` Maxim Levitsky
2021-12-07 13:01     ` Suthikulpanit, Suravee
2021-12-02 23:58 ` [PATCH v2 2/3] x86/apic: Add helper function to get maximum physical APIC ID Suravee Suthikulpanit
2021-12-02 23:58 ` [PATCH v2 3/3] KVM: SVM: Extend host physical APIC ID field to support more than 8-bit Suravee Suthikulpanit
2021-12-03  7:46   ` Maxim Levitsky
2021-12-03 16:34     ` Tom Lendacky [this message]
2021-12-13 10:46       ` Suthikulpanit, Suravee
2021-12-13 10:45     ` Suthikulpanit, Suravee

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=6cc9848a-9f04-b923-453a-6dbe03b73e58@amd.com \
    --to=thomas.lendacky@amd.com \
    --cc=bp@alien8.de \
    --cc=hpa@zytor.com \
    --cc=jon.grimm@amd.com \
    --cc=joro@8bytes.org \
    --cc=kvm@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mingo@redhat.com \
    --cc=mlevitsk@redhat.com \
    --cc=pbonzini@redhat.com \
    --cc=peterz@infradead.org \
    --cc=seanjc@google.com \
    --cc=suravee.suthikulpanit@amd.com \
    --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

all inboxes | Powered by JetHome®