Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

Fix VMI relocation processing logic error

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!

Signed-off-by: Zachary Amsden <zach@vmware.com>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>

authored by

Zachary Amsden and committed by
Linus Torvalds
0492c371 5a6d41b3

+6 -3
+6 -3
arch/i386/kernel/vmi.c
··· 712 712 do { \ 713 713 reloc = call_vrom_long_func(vmi_rom, get_reloc, \ 714 714 VMI_CALL_##vmicall); \ 715 - if (rel->type != VMI_RELOCATION_NONE) { \ 716 - BUG_ON(rel->type != VMI_RELOCATION_CALL_REL); \ 715 + if (rel->type == VMI_RELOCATION_CALL_REL) \ 717 716 paravirt_ops.opname = (void *)rel->eip; \ 718 - } else if (rel->type == VMI_RELOCATION_NOP) \ 717 + else if (rel->type == VMI_RELOCATION_NOP) \ 719 718 paravirt_ops.opname = (void *)vmi_nop; \ 719 + else if (rel->type != VMI_RELOCATION_NONE) \ 720 + printk(KERN_WARNING "VMI: Unknown relocation " \ 721 + "type %d for " #vmicall"\n",\ 722 + rel->type); \ 720 723 } while (0) 721 724 722 725 /*