2.6.21 - VMI logic error
PATCH 1/1 2.6.21 - VMI logic error
So there is a logic error that would prevent us from ever using NOP relocations, thus stopping any unnecessary callouts into a VMI ROM. It doesn't affect us so much, but could conceivably affect open source implementations of a VMI ROM in the future. It is not absolutely critical, but it would be extremely nice to get it fixed in 2.6.21 so there are no broken older kernels floating around that mandate having a workaround for this or else breaking compatibility with these kernels.
Thanks,
Zach
Fix logic error in VMI relocation processing. NOPs would always cause a BUG_ON to fire because the != RELOCATION_NONE in the first if clause precluding the == VMI_RELOCATION_NOP in the second clause. Make these direct equality tests and just warn for unsupported relocation types (which should never happen), falling back to native in that case.
Thanks to Anthony Liguori for noting this!
arch/i386/kernel/vmi.c +6 -3
@@ -685,11 +685,14 @@ do { \ do { \ reloc = call_vrom_long_func(vmi_rom, get_reloc, \ VMI_CALL_##vmicall); \ -if (rel->type !=VMI_RELOCATION_NONE ) { \ -BUG_ON (rel->type !=VMI_RELOCATION_CALL_REL ); \ + if (rel->type == VMI_RELOCATION_CALL_REL) \ paravirt_ops.opname = (void *)rel->eip; \ - }else if (rel->type ==VMI_RELOCATION_NOP ) \ + else if (rel->type == VMI_RELOCATION_NOP) \ paravirt_ops.opname = (void *)vmi_nop; \ + else if (rel->type != VMI_RELOCATION_NONE) \ + printk(KERN_WARNING "VMI: Unknown relocation " \ + "type %d for " #vmicall"\n",\ + rel->type); \ } while (0) /*
_______________________________________________
Virtualization mailing list
[email protected]
https://lists.linux-foundation.org/mailman/listinfo/virtualization
Quoted 7 lines · On Friday 13 April 2007 04:28:46 Zachary Amsden wrote:
So there is a logic error that would prevent us from ever using NOP relocations, thus stopping any unnecessary callouts into a VMI ROM. It doesn't affect us so much, but could conceivably affect open source implementations of a VMI ROM in the future. It is not absolutely critical, but it would be extremely nice to get it fixed in 2.6.21 so there are no broken older kernels floating around that mandate having a workaround for this or else breaking compatibility with these kernels.
Patch is fine for me.
-Andi