mirror of
https://github.com/Motorhead1991/qemu.git
synced 2025-08-07 01:33:56 -06:00
target/i386: Support up to 32768 CPUs without IRQ remapping
The IOAPIC has an 'Extended Destination ID' field in its RTE, which maps to bits 11-4 of the MSI address. Since those address bits fall within a given 4KiB page they were historically non-trivial to use on real hardware. The Intel IOMMU uses the lowest bit to indicate a remappable format MSI, and then the remaining 7 bits are part of the index. Where the remappable format bit isn't set, we can actually use the other seven to allow external (IOAPIC and MSI) interrupts to reach up to 32768 CPUs instead of just the 255 permitted on bare metal. Signed-off-by: David Woodhouse <dwmw@amazon.co.uk> Message-Id: <78097f9218300e63e751e077a0a5ca029b56ba46.camel@infradead.org> [Fix UBSAN warning. - Paolo] Signed-off-by: Paolo Bonzini <pbonzini@redhat.com> Signed-off-by: David Woodhouse <dwmw2@infradead.org>
This commit is contained in:
parent
75b208c283
commit
c1bb5418e3
6 changed files with 79 additions and 31 deletions
|
@ -183,6 +183,13 @@ static void kvm_send_msi(MSIMessage *msg)
|
|||
{
|
||||
int ret;
|
||||
|
||||
/*
|
||||
* The message has already passed through interrupt remapping if enabled,
|
||||
* but the legacy extended destination ID in low bits still needs to be
|
||||
* handled.
|
||||
*/
|
||||
msg->address = kvm_swizzle_msi_ext_dest_id(msg->address);
|
||||
|
||||
ret = kvm_irqchip_send_msi(kvm_state, *msg);
|
||||
if (ret < 0) {
|
||||
fprintf(stderr, "KVM: injection failed, MSI lost (%s)\n",
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue