From: Suravee Suthikulpanit <suravee.suthikulpanit@amd.com>
To: <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>,
<thomas.lendacky@amd.com>, <jon.grimm@amd.com>,
Suravee Suthikulpanit <suravee.suthikulpanit@amd.com>
Subject: [PATCH v2 2/3] x86/apic: Add helper function to get maximum physical APIC ID
Date: Thu, 2 Dec 2021 17:58:24 -0600 [thread overview]
Message-ID: <20211202235825.12562-3-suravee.suthikulpanit@amd.com> (raw)
In-Reply-To: <20211202235825.12562-1-suravee.suthikulpanit@amd.com>
Export the max_physical_apicid via a helper function since this information
is required by AMD SVM AVIC support.
Signed-off-by: Suravee Suthikulpanit <suravee.suthikulpanit@amd.com>
---
arch/x86/include/asm/apic.h | 1 +
arch/x86/kernel/apic/apic.c | 6 ++++++
2 files changed, 7 insertions(+)
diff --git a/arch/x86/include/asm/apic.h b/arch/x86/include/asm/apic.h
index 48067af94678..77d9cb2a7e28 100644
--- a/arch/x86/include/asm/apic.h
+++ b/arch/x86/include/asm/apic.h
@@ -435,6 +435,7 @@ static inline void apic_set_eoi_write(void (*eoi_write)(u32 reg, u32 v)) {}
#endif /* CONFIG_X86_LOCAL_APIC */
extern void apic_ack_irq(struct irq_data *data);
+extern u32 apic_get_max_phys_apicid(void);
static inline void ack_APIC_irq(void)
{
diff --git a/arch/x86/kernel/apic/apic.c b/arch/x86/kernel/apic/apic.c
index b70344bf6600..47653d8c05f2 100644
--- a/arch/x86/kernel/apic/apic.c
+++ b/arch/x86/kernel/apic/apic.c
@@ -2361,6 +2361,12 @@ bool apic_id_is_primary_thread(unsigned int apicid)
}
#endif
+u32 apic_get_max_phys_apicid(void)
+{
+ return max_physical_apicid;
+}
+EXPORT_SYMBOL_GPL(apic_get_max_phys_apicid);
+
/*
* Should use this API to allocate logical CPU IDs to keep nr_logical_cpuids
* and cpuid_to_apicid[] synchronized.
--
2.25.1
next prev parent reply other threads:[~2021-12-02 23:59 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 ` Suravee Suthikulpanit [this message]
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
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=20211202235825.12562-3-suravee.suthikulpanit@amd.com \
--to=suravee.suthikulpanit@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=pbonzini@redhat.com \
--cc=peterz@infradead.org \
--cc=seanjc@google.com \
--cc=tglx@linutronix.de \
--cc=thomas.lendacky@amd.com \
--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