All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] KVM: x86: Ratelimit guest-triggerable IOAPIC/LAPIC log messages
@ 2026-10-17  9:30 Amirmohammad Eftekhar
  2026-10-17 14:13 ` Sean Christopherson
  2026-10-17 16:34 ` Amirmohammad Eftekhar
  0 siblings, 2 replies; 4+ messages in thread
From: Amirmohammad Eftekhar @ 2026-10-17  9:30 UTC (permalink / raw)
  To: seanjc, pbonzini; +Cc: kvm, linux-kernel

A guest can drive these kernel log writes at will -- the IOAPIC MMIO
read/write handlers log every access with an unsupported length, and the
LAPIC IRQ-delivery path logs each physical-broadcast lowest-priority IPI --
so a guest can flood the host dmesg/journal.  Use the _ratelimited()
variants, matching the ratelimited logging already used elsewhere in the
LAPIC.

Signed-off-by: Amirmohammad Eftekhar <amirmohammad.eftekhar@cispa.de>
---
 arch/x86/kvm/ioapic.c | 4 ++--
 arch/x86/kvm/lapic.c  | 2 +-
 2 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/arch/x86/kvm/ioapic.c b/arch/x86/kvm/ioapic.c
index 0d59b9c75..df15d9401 100644
--- a/arch/x86/kvm/ioapic.c
+++ b/arch/x86/kvm/ioapic.c
@@ -647,7 +647,7 @@ static int ioapic_mmio_read(struct kvm_vcpu *vcpu, struct kvm_io_device *this,
 		memcpy(val, (char *)&result, len);
 		break;
 	default:
-		printk(KERN_WARNING "ioapic: wrong length %d\n", len);
+		pr_warn_ratelimited("ioapic: wrong length %d\n", len);
 	}
 	return 0;
 }
@@ -672,7 +672,7 @@ static int ioapic_mmio_write(struct kvm_vcpu *vcpu, struct kvm_io_device *this,
 		data = *(u8  *) val;
 		break;
 	default:
-		printk(KERN_WARNING "ioapic: Unsupported size %d\n", len);
+		pr_warn_ratelimited("ioapic: Unsupported size %d\n", len);
 		return 0;
 	}
 
diff --git a/arch/x86/kvm/lapic.c b/arch/x86/kvm/lapic.c
index ecf611845..7d85a56b6 100644
--- a/arch/x86/kvm/lapic.c
+++ b/arch/x86/kvm/lapic.c
@@ -1359,7 +1359,7 @@ int __kvm_irq_delivery_to_apic(struct kvm *kvm, struct kvm_lapic *src,
 
 	if (irq->dest_mode == APIC_DEST_PHYSICAL &&
 	    irq->dest_id == 0xff && kvm_lowest_prio_delivery(irq)) {
-		pr_info("apic: phys broadcast and lowest prio\n");
+		pr_info_ratelimited("apic: phys broadcast and lowest prio\n");
 		irq->delivery_mode = APIC_DM_FIXED;
 	}
 
-- 
2.54.0 (Apple Git-157)


^ permalink raw reply related	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2026-10-17 16:34 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-10-17  9:30 [PATCH] KVM: x86: Ratelimit guest-triggerable IOAPIC/LAPIC log messages Amirmohammad Eftekhar
2026-10-17 14:13 ` Sean Christopherson
2026-10-17 15:34   ` Chris Mason
2026-10-17 16:34 ` Amirmohammad Eftekhar

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.