KVM: x86: Drop guest-triggerable ASSERT()s on I/O APIC access alignment

Drop the asserts on the guest-controlled address being 16-byte aligned
when emulating I/O APIC accesses, as the ASSERT()s are guest-triggerable
and ultimately pointless since KVM requires exact register matches, i.e.
will ultimately ignore unaligned accesses anyways.

Drop the ASSERT() definition itself now that all users are gone.

For all intents and purposes, no functional change intended.

Link: https://patch.msgid.link/20251206004311.479939-5-seanjc@google.com
Signed-off-by: Sean Christopherson <seanjc@google.com>
This commit is contained in:
Sean Christopherson 2025-12-05 16:43:06 -08:00
parent ca909f9ea8
commit 9eabb2a5e4
2 changed files with 0 additions and 17 deletions

View File

@ -618,8 +618,6 @@ static int ioapic_mmio_read(struct kvm_vcpu *vcpu, struct kvm_io_device *this,
if (!ioapic_in_range(ioapic, addr))
return -EOPNOTSUPP;
ASSERT(!(addr & 0xf)); /* check alignment */
addr &= 0xff;
spin_lock(&ioapic->lock);
switch (addr) {
@ -660,8 +658,6 @@ static int ioapic_mmio_write(struct kvm_vcpu *vcpu, struct kvm_io_device *this,
if (!ioapic_in_range(ioapic, addr))
return -EOPNOTSUPP;
ASSERT(!(addr & 0xf)); /* check alignment */
switch (len) {
case 8:
case 4:

View File

@ -104,19 +104,6 @@ void kvm_unregister_irq_mask_notifier(struct kvm *kvm, int irq,
void kvm_fire_mask_notifiers(struct kvm *kvm, unsigned irqchip, unsigned pin,
bool mask);
#ifdef DEBUG
#define ASSERT(x) \
do { \
if (!(x)) { \
printk(KERN_EMERG "assertion failed %s: %d: %s\n", \
__FILE__, __LINE__, #x); \
BUG(); \
} \
} while (0)
#else
#define ASSERT(x) do { } while (0)
#endif
static inline int ioapic_in_kernel(struct kvm *kvm)
{
return irqchip_full(kvm);