RE: irq_build_affinity_masks() allocates improper affinity if num_possible_cpus() > num_present_cpus()?

2020-10-06 Thread Dexuan Cui
> From: Thomas Gleixner > Sent: Tuesday, October 6, 2020 11:58 AM > > ... > > I pass through an MSI-X-capable PCI device to the Linux VM (which has > > only 1 virtual CPU), and the below code does *not* report any error > > (i.e. pci_alloc_irq_vectors_affinity() returns 2, and request_irq() > >

Re: irq_build_affinity_masks() allocates improper affinity if num_possible_cpus() > num_present_cpus()?

2020-10-06 Thread Thomas Gleixner
On Tue, Oct 06 2020 at 09:37, David Woodhouse wrote: > On Tue, 2020-10-06 at 06:47 +, Dexuan Cui wrote: >> PS2, the latest Hyper-V provides only one ACPI MADT entry to a 1-CPU VM, >> so the issue described above can not reproduce there. > > It seems fairly easy to reproduce in qemu with -smp

Re: irq_build_affinity_masks() allocates improper affinity if num_possible_cpus() > num_present_cpus()?

2020-10-06 Thread Thomas Gleixner
On Tue, Oct 06 2020 at 06:47, Dexuan Cui wrote: > I'm running a single-CPU Linux VM on Hyper-V. The Linux kernel is v5.9-rc7 > and I have CONFIG_NR_CPUS=256. > > The Hyper-V Host (Version 17763-10.0-1-0.1457) provides a guest firmware, > which always reports 128 Local APIC entries in the ACPI MADT

Re: irq_build_affinity_masks() allocates improper affinity if num_possible_cpus() > num_present_cpus()?

2020-10-06 Thread David Woodhouse
On Tue, 2020-10-06 at 09:37 +0100, David Woodhouse wrote: > On Tue, 2020-10-06 at 06:47 +, Dexuan Cui wrote: > > Hi all, > > I'm running a single-CPU Linux VM on Hyper-V. The Linux kernel is v5.9-rc7 > > and I have CONFIG_NR_CPUS=256. > > > > The Hyper-V Host (Version 17763-10.0-1-0.1457)

Re: irq_build_affinity_masks() allocates improper affinity if num_possible_cpus() > num_present_cpus()?

2020-10-06 Thread David Woodhouse
On Tue, 2020-10-06 at 06:47 +, Dexuan Cui wrote: > Hi all, > I'm running a single-CPU Linux VM on Hyper-V. The Linux kernel is v5.9-rc7 > and I have CONFIG_NR_CPUS=256. > > The Hyper-V Host (Version 17763-10.0-1-0.1457) provides a guest firmware, > which always reports 128 Local APIC entries

irq_build_affinity_masks() allocates improper affinity if num_possible_cpus() > num_present_cpus()?

2020-10-06 Thread Dexuan Cui
Hi all, I'm running a single-CPU Linux VM on Hyper-V. The Linux kernel is v5.9-rc7 and I have CONFIG_NR_CPUS=256. The Hyper-V Host (Version 17763-10.0-1-0.1457) provides a guest firmware, which always reports 128 Local APIC entries in the ACPI MADT table. Here only the first Local APIC entry's