Skip to content

Commit 8f701b0

Browse files
jsun26intelwenlingz
authored andcommitted
HV: move NR_IOAPICS to platform acpi info
The I/O APIC number should be parsed from host ACPI table, so move the definition from Kconfig to platform_acpi_info.h. Tracked-On: #1500 Signed-off-by: Victor Sun <victor.sun@intel.com> Reviewed-by: Junjie Mao <junjie.mao@intel.com> Acked-by: Eddie Dong <eddie.dong@intel.com>
1 parent bf83407 commit 8f701b0

File tree

5 files changed

+11
-10
lines changed

5 files changed

+11
-10
lines changed

hypervisor/arch/x86/Kconfig

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -42,11 +42,6 @@ config MAX_VCPUS_PER_VM
4242
range 1 8
4343
default 4
4444

45-
config NR_IOAPICS
46-
int "Maximum number of IOAPICs supported"
47-
range 1 2
48-
default 1
49-
5045
config MAX_IOMMU_NUM
5146
int "Maximum number of iommu dev"
5247
range 1 2

hypervisor/arch/x86/ioapic.c

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ static struct gsi_table gsi_table[NR_MAX_GSI];
1818
static uint32_t nr_gsi;
1919
static spinlock_t ioapic_lock;
2020

21-
static union ioapic_rte saved_rte[CONFIG_NR_IOAPICS][IOAPIC_MAX_PIN];
21+
static union ioapic_rte saved_rte[NR_IOAPICS][IOAPIC_MAX_PIN];
2222

2323
/*
2424
* the irq to ioapic pin mapping should extract from ACPI MADT table
@@ -351,7 +351,7 @@ void setup_ioapic_irqs(void)
351351
spinlock_init(&ioapic_lock);
352352

353353
for (ioapic_id = 0U;
354-
ioapic_id < CONFIG_NR_IOAPICS; ioapic_id++) {
354+
ioapic_id < NR_IOAPICS; ioapic_id++) {
355355
void *addr;
356356
uint8_t pin, nr_pins;
357357

@@ -403,7 +403,7 @@ void suspend_ioapic(void)
403403
{
404404
uint8_t ioapic_id, ioapic_pin;
405405

406-
for (ioapic_id = 0U; ioapic_id < CONFIG_NR_IOAPICS; ioapic_id++) {
406+
for (ioapic_id = 0U; ioapic_id < NR_IOAPICS; ioapic_id++) {
407407
void *addr;
408408
uint8_t nr_pins;
409409

@@ -420,7 +420,7 @@ void resume_ioapic(void)
420420
{
421421
uint8_t ioapic_id, ioapic_pin;
422422

423-
for (ioapic_id = 0U; ioapic_id < CONFIG_NR_IOAPICS; ioapic_id++) {
423+
for (ioapic_id = 0U; ioapic_id < NR_IOAPICS; ioapic_id++) {
424424
void *addr;
425425
uint8_t nr_pins;
426426

hypervisor/bsp/include/sbl/platform_acpi_info.h

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,9 @@
1212

1313
#define ACPI_INFO_VALIDATED
1414

15+
/* APIC */
16+
#define NR_IOAPICS 1U
17+
1518
/* pm sstate data */
1619
#define PM1A_EVT_SPACE_ID SPACE_SYSTEM_IO
1720
#define PM1A_EVT_BIT_WIDTH 0x20U

hypervisor/bsp/include/uefi/platform_acpi_info.h

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,9 @@
1010
#ifndef PLATFORM_ACPI_INFO_H
1111
#define PLATFORM_ACPI_INFO_H
1212

13+
/* APIC */
14+
#define NR_IOAPICS 1U
15+
1316
/* pm sstate data */
1417
#define PM1A_EVT_SPACE_ID SPACE_SYSTEM_IO
1518
#define PM1A_EVT_BIT_WIDTH 0U

hypervisor/include/arch/x86/ioapic.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
#define IOAPIC_MAX_LINES 120U
1515
#define NR_LEGACY_IRQ 16U
1616
#define NR_LEGACY_PIN NR_LEGACY_IRQ
17-
#define NR_MAX_GSI (CONFIG_NR_IOAPICS * IOAPIC_MAX_LINES)
17+
#define NR_MAX_GSI (NR_IOAPICS * IOAPIC_MAX_LINES)
1818

1919
void setup_ioapic_irqs(void);
2020

0 commit comments

Comments
 (0)