RE: [PATCH v2 01/10] x86/Kconfig: enable X86_X2APIC by default and improve help text

From: Elliott, Robert (Servers)
Date: Thu Nov 03 2022 - 19:43:03 EST




> -----Original Message-----
> From: Dave Hansen <dave.hansen@xxxxxxxxx>
> Sent: Thursday, October 27, 2022 10:08 AM
...
> Subject: Re: [PATCH v2 01/10] x86/Kconfig: enable X86_X2APIC by default
> and improve help text
>
> On 10/27/22 07:45, Elliott, Robert (Servers) wrote:
> >> config X86_X2APIC
> >> - bool "Support x2apic"
> >> + bool "x2APIC interrupt controller architecture support"
> >> depends on X86_LOCAL_APIC && X86_64 && (IRQ_REMAP ||
> >> HYPERVISOR_GUEST)
> >> + default y
> > Could this option be added to
> > arch/x86/configs/x86_64_defconfig
> >
> > so defconfig builds don't crash on current platforms?
>
> Sounds reasonable. Care to send a patch?

How are the defconfig files supposed to keep up with valid
combinations of options?

arch/x86/Kconfig has this set of dependencies:
config X86_X2APIC
bool "Support x2apic"
depends on X86_LOCAL_APIC && X86_64 && (IRQ_REMAP || HYPERVISOR_GUEST)

config X86_LOCAL_APIC
def_bool y
depends on X86_64 || SMP || X86_32_NON_STANDARD || X86_UP_APIC || PCI_MSI
select IRQ_DOMAIN_HIERARCHY
select PCI_MSI_IRQ_DOMAIN if PCI_MSI

config X86_IO_APIC
def_bool y
depends on X86_LOCAL_APIC || X86_UP_IOAPIC

drivers/iommu/Kconfig has:
config IRQ_REMAP
bool "Support for Interrupt Remapping"
depends on X86_64 && X86_IO_APIC && PCI_MSI && ACPI
select DMAR_TABLE

Despite its filename, arch/x86/configs/x86_64_defconfig does not even have:
CONFIG_X86_64=y
which enables many options. That was added by:
commit 622e3f28e50f ("x86: 64-bit defconfig remake")
Sun May 4 19:57:19 2008 +0400
but removed by:
commit 8b1bb90701f9a51f ("defconfig reduction")
Sat Aug 14 22:05:58 2010 +0200

It does have
CONFIG_SMP=y

which should imply X86_LOCAL_APIC, but that's missing too.

It does have
CONFIG_HYPERVISOR_GUEST=y
so doesn't need IRQ_REMAP to enable X86_X2APIC.