Patrick Rudolph has uploaded this change for review. ( https://review.coreboot.org/c/coreboot/+/32020
Change subject: [WIP]x86: Introduce the blobolator ......................................................................
[WIP]x86: Introduce the blobolator
This is a PoC to run arbitrary code and blobs inside an emulated virtual machine using libx86emu, thus the name blobolator.
The libx86emu has been patched to the following: * redirect IO to the host machine it's running on * trace IO * start in protected mode * add mechanism to drop IO access * add Kconfig to debug code it is running
Implemented features: * Run ramstage in libx86emu * Run postcar in libx86emu
TODO: * Add support to trace only blobs, not stages. * Improve translation of known IO to human readable format ** COM ** PCI ** APIC ** PIT ** POST
Tested on qemu. Sucessfully run ramstage in blobolator.
Change-Id: I13e47f45e69376d046f35c04363fe3db1cfaa610 Signed-off-by: Patrick Rudolph patrick.rudolph@9elements.com --- M src/Kconfig M src/arch/x86/boot.c M src/mainboard/emulation/qemu-i440fx/romstage.c M src/mainboard/emulation/qemu-q35/romstage.c M src/vendorcode/Makefile.inc A src/vendorcode/libx86emu/Makefile.inc A src/vendorcode/libx86emu/blobolator.c A src/vendorcode/libx86emu/decode.c A src/vendorcode/libx86emu/include/decode.h A src/vendorcode/libx86emu/include/mem.h A src/vendorcode/libx86emu/include/ops.h A src/vendorcode/libx86emu/include/prim_ops.h A src/vendorcode/libx86emu/include/x86emu.h A src/vendorcode/libx86emu/include/x86emu_int.h A src/vendorcode/libx86emu/mem.c A src/vendorcode/libx86emu/ops.c A src/vendorcode/libx86emu/ops2.c A src/vendorcode/libx86emu/prim_ops.c 18 files changed, 14,512 insertions(+), 2 deletions(-)
git pull ssh://review.coreboot.org:29418/coreboot refs/changes/20/32020/1
Hello Arthur Heymans, Philipp Deppenwiese, build bot (Jenkins), Nico Huber, Patrick Georgi, Martin Roth,
I'd like you to reexamine a change. Please visit
https://review.coreboot.org/c/coreboot/+/32020
to look at the new patch set (#2).
Change subject: [WIP]x86: Introduce the blobolator ......................................................................
[WIP]x86: Introduce the blobolator
This is a PoC to run arbitrary code and blobs inside an emulated virtual machine using libx86emu, thus the name blobolator.
The libx86emu has been patched to the following: * redirect IO to the host machine it's running on * trace IO * start in protected mode * add mechanism to drop IO access * add Kconfig to debug code it is running
Implemented features: * Run ramstage in libx86emu * Run postcar in libx86emu
TODO: * Add support to trace only blobs, not stages. * Improve translation of known IO to human readable format ** COM ** PCI ** APIC ** PIT ** POST
Tested on qemu. Sucessfully run ramstage in blobolator.
Change-Id: I13e47f45e69376d046f35c04363fe3db1cfaa610 Signed-off-by: Patrick Rudolph patrick.rudolph@9elements.com --- M src/Kconfig M src/arch/x86/boot.c A src/include/blobolator.h M src/mainboard/emulation/qemu-i440fx/romstage.c M src/mainboard/emulation/qemu-q35/romstage.c M src/vendorcode/Makefile.inc A src/vendorcode/libx86emu/Makefile.inc A src/vendorcode/libx86emu/blobolator.c A src/vendorcode/libx86emu/decode.c A src/vendorcode/libx86emu/include/decode.h A src/vendorcode/libx86emu/include/mem.h A src/vendorcode/libx86emu/include/ops.h A src/vendorcode/libx86emu/include/prim_ops.h A src/vendorcode/libx86emu/include/x86emu.h A src/vendorcode/libx86emu/include/x86emu_int.h A src/vendorcode/libx86emu/mem.c A src/vendorcode/libx86emu/ops.c A src/vendorcode/libx86emu/ops2.c A src/vendorcode/libx86emu/prim_ops.c 19 files changed, 14,533 insertions(+), 2 deletions(-)
git pull ssh://review.coreboot.org:29418/coreboot refs/changes/20/32020/2
Angel Pons has posted comments on this change. ( https://review.coreboot.org/c/coreboot/+/32020 )
Change subject: [WIP]x86: Introduce the blobolator ......................................................................
Patch Set 2: Code-Review+1
I like the concept, especially its name
Patrick Georgi has posted comments on this change. ( https://review.coreboot.org/c/coreboot/+/32020 )
Change subject: [WIP]x86: Introduce the blobolator ......................................................................
Patch Set 2:
libx86emu seems to be similar to x86emu. Should the libx86emu vendorcode be deduplicated src/device/oprom/x86emu and src/device/oprom/include/x86emu?
Nico Huber has posted comments on this change. ( https://review.coreboot.org/c/coreboot/+/32020 )
Change subject: [WIP]x86: Introduce the blobolator ......................................................................
Patch Set 2: Code-Review+1
libx86emu seems to be similar to x86emu. Should the libx86emu vendorcode be deduplicated src/device/oprom/x86emu and src/device/oprom/include/x86emu?
It's on github, should we mirror the repo for `3rdparty/`?
Philipp Deppenwiese has posted comments on this change. ( https://review.coreboot.org/c/coreboot/+/32020 )
Change subject: [WIP]x86: Introduce the blobolator ......................................................................
Patch Set 2:
Patch Set 2: Code-Review+1
libx86emu seems to be similar to x86emu. Should the libx86emu vendorcode be deduplicated src/device/oprom/x86emu and src/device/oprom/include/x86emu?
It's on github, should we mirror the repo for `3rdparty/`?
We should do
Patrick Georgi has posted comments on this change. ( https://review.coreboot.org/c/coreboot/+/32020 )
Change subject: [WIP]x86: Introduce the blobolator ......................................................................
Patch Set 2:
Patch Set 2:
Patch Set 2: Code-Review+1
libx86emu seems to be similar to x86emu. Should the libx86emu vendorcode be deduplicated src/device/oprom/x86emu and src/device/oprom/include/x86emu?
It's on github, should we mirror the repo for `3rdparty/`?
We should do
done, see https://review.coreboot.org/cgit/libx86emu.git and https://github.com/coreboot/libx86emu
They're part of the hourly sync.
Daniel Maslowski has posted comments on this change. ( https://review.coreboot.org/c/coreboot/+/32020 )
Change subject: [WIP]x86: Introduce the blobolator ......................................................................
Patch Set 2: Code-Review+1
Awesome work! :)
Patrick Rudolph has posted comments on this change. ( https://review.coreboot.org/c/coreboot/+/32020 )
Change subject: [WIP]x86: Introduce the blobolator ......................................................................
Patch Set 2:
Patch Set 2:
libx86emu seems to be similar to x86emu. Should the libx86emu vendorcode be deduplicated src/device/oprom/x86emu and src/device/oprom/include/x86emu?
I couldn't find the original x86emu any more. It looks like libx86emu is the successor to x86emu.
Patrick Georgi has posted comments on this change. ( https://review.coreboot.org/c/coreboot/+/32020 )
Change subject: [WIP]x86: Introduce the blobolator ......................................................................
Patch Set 2:
Patch Set 2:
Patch Set 2:
libx86emu seems to be similar to x86emu. Should the libx86emu vendorcode be deduplicated src/device/oprom/x86emu and src/device/oprom/include/x86emu?
I couldn't find the original x86emu any more. It looks like libx86emu is the successor to x86emu.
The original is somewhere deep in the XFree86 (and likely Xorg) tree. We can use libx86emu, but we shouldn't keep two copies in our tree is all I'm saying.
Stefan Reinauer has posted comments on this change. ( https://review.coreboot.org/c/coreboot/+/32020 )
Change subject: [WIP]x86: Introduce the blobolator ......................................................................
Patch Set 2:
coreboot's version of x86emu has been significantly refactored for code size. It would be interesting to upstream these changes, albeit that's a lot of work as the original diffs have not been preserved (LinuxBIOS v1 timeframe, and only the final refactored product was posted back then)
- Please do not add a second copy of x86emu to the tree. - If we decide that this copy should replace the size optimized version, please make sure you test with yabel and the native bios emulation on a fair number of option roms to not break the existing code.
Stefan
Felix Singer has uploaded a new patch set (#3) to the change originally created by Patrick Rudolph. ( https://review.coreboot.org/c/coreboot/+/32020 )
Change subject: [WIP]x86: Introduce the blobolator ......................................................................
[WIP]x86: Introduce the blobolator
This is a PoC to run arbitrary code and blobs inside an emulated virtual machine using libx86emu, thus the name blobolator.
The libx86emu has been patched to the following: * redirect IO to the host machine it's running on * trace IO * start in protected mode * add mechanism to drop IO access * add Kconfig to debug code it is running
Implemented features: * Run ramstage in libx86emu * Run postcar in libx86emu
TODO: * Add support to trace only blobs, not stages. * Improve translation of known IO to human readable format ** COM ** PCI ** APIC ** PIT ** POST
Tested on qemu. Sucessfully run ramstage in blobolator.
Change-Id: I13e47f45e69376d046f35c04363fe3db1cfaa610 Signed-off-by: Patrick Rudolph patrick.rudolph@9elements.com --- M src/Kconfig M src/arch/x86/boot.c A src/include/blobolator.h M src/mainboard/emulation/qemu-i440fx/romstage.c M src/mainboard/emulation/qemu-q35/romstage.c M src/vendorcode/Makefile.inc A src/vendorcode/libx86emu/Makefile.inc A src/vendorcode/libx86emu/blobolator.c A src/vendorcode/libx86emu/decode.c A src/vendorcode/libx86emu/include/decode.h A src/vendorcode/libx86emu/include/mem.h A src/vendorcode/libx86emu/include/ops.h A src/vendorcode/libx86emu/include/prim_ops.h A src/vendorcode/libx86emu/include/x86emu.h A src/vendorcode/libx86emu/include/x86emu_int.h A src/vendorcode/libx86emu/mem.c A src/vendorcode/libx86emu/ops.c A src/vendorcode/libx86emu/ops2.c A src/vendorcode/libx86emu/prim_ops.c 19 files changed, 14,533 insertions(+), 2 deletions(-)
git pull ssh://review.coreboot.org:29418/coreboot refs/changes/20/32020/3
Felix Singer has uploaded a new patch set (#4) to the change originally created by Patrick Rudolph. ( https://review.coreboot.org/c/coreboot/+/32020 )
Change subject: [WIP]x86: Introduce the blobolator ......................................................................
[WIP]x86: Introduce the blobolator
This is a PoC to run arbitrary code and blobs inside an emulated virtual machine using libx86emu, thus the name blobolator.
The libx86emu has been patched to the following: * redirect IO to the host machine it's running on * trace IO * start in protected mode * add mechanism to drop IO access * add Kconfig to debug code it is running
Implemented features: * Run ramstage in libx86emu * Run postcar in libx86emu
TODO: * Add support to trace only blobs, not stages. * Improve translation of known IO to human readable format ** COM ** PCI ** APIC ** PIT ** POST
Tested on qemu. Sucessfully run ramstage in blobolator.
Change-Id: I13e47f45e69376d046f35c04363fe3db1cfaa610 Signed-off-by: Patrick Rudolph patrick.rudolph@9elements.com --- M src/Kconfig M src/arch/x86/boot.c A src/include/blobolator.h M src/mainboard/emulation/qemu-i440fx/romstage.c M src/mainboard/emulation/qemu-q35/romstage.c M src/vendorcode/Makefile.inc A src/vendorcode/libx86emu/Kconfig.debug A src/vendorcode/libx86emu/Makefile.inc A src/vendorcode/libx86emu/blobolator.c A src/vendorcode/libx86emu/decode.c A src/vendorcode/libx86emu/include/decode.h A src/vendorcode/libx86emu/include/mem.h A src/vendorcode/libx86emu/include/ops.h A src/vendorcode/libx86emu/include/prim_ops.h A src/vendorcode/libx86emu/include/x86emu.h A src/vendorcode/libx86emu/include/x86emu_int.h A src/vendorcode/libx86emu/mem.c A src/vendorcode/libx86emu/ops.c A src/vendorcode/libx86emu/ops2.c A src/vendorcode/libx86emu/prim_ops.c 20 files changed, 14,594 insertions(+), 2 deletions(-)
git pull ssh://review.coreboot.org:29418/coreboot refs/changes/20/32020/4
Hello Angel Pons, Arthur Heymans, Daniel Maslowski, Felix Singer, Philipp Deppenwiese, build bot (Jenkins), Nico Huber, Patrick Georgi, Martin Roth,
I'd like you to reexamine a change. Please visit
https://review.coreboot.org/c/coreboot/+/32020
to look at the new patch set (#5).
Change subject: [WIP]x86: Introduce the blobolator ......................................................................
[WIP]x86: Introduce the blobolator
This is a PoC to run arbitrary code and blobs inside an emulated virtual machine using libx86emu, thus the name blobolator.
The libx86emu has been patched to the following: * redirect IO to the host machine it's running on * trace IO * start in protected mode * add mechanism to drop IO access * add Kconfig to debug code it is running
Implemented features: * Run ramstage in libx86emu * Run postcar in libx86emu
TODO: * Add support to trace only blobs, not stages. * Improve translation of known IO to human readable format ** COM ** PCI ** APIC ** PIT ** POST
Tested on qemu. Sucessfully run ramstage in blobolator. Tested on X11SSH-TF. Sucessfully run ramstage in blobolator (requires additional libx86emu patches).
Change-Id: I13e47f45e69376d046f35c04363fe3db1cfaa610 Signed-off-by: Patrick Rudolph patrick.rudolph@9elements.com --- M src/Kconfig M src/arch/x86/Makefile.inc M src/arch/x86/boot.c A src/arch/x86/libx86emu/Kconfig.debug A src/arch/x86/libx86emu/Makefile.inc A src/arch/x86/libx86emu/blobolator.c A src/arch/x86/libx86emu/stdarg.h A src/arch/x86/libx86emu/stdio.h A src/arch/x86/libx86emu/time.h M src/arch/x86/postcar_loader.c A src/include/blobolator.h 11 files changed, 807 insertions(+), 0 deletions(-)
git pull ssh://review.coreboot.org:29418/coreboot refs/changes/20/32020/5
build bot (Jenkins) has posted comments on this change. ( https://review.coreboot.org/c/coreboot/+/32020 )
Change subject: [WIP]x86: Introduce the blobolator ......................................................................
Patch Set 5:
(65 comments)
https://review.coreboot.org/c/coreboot/+/32020/5/src/arch/x86/libx86emu/blob... File src/arch/x86/libx86emu/blobolator.c:
https://review.coreboot.org/c/coreboot/+/32020/5/src/arch/x86/libx86emu/blob... PS5, Line 40: x86emu_mem_t *emu_mem_new(unsigned perm) Prefer 'unsigned int' to bare use of 'unsigned'
https://review.coreboot.org/c/coreboot/+/32020/5/src/arch/x86/libx86emu/blob... PS5, Line 45: void x86emu_set_io_perm(x86emu_t *emu, unsigned start, unsigned end, unsigned perm) Prefer 'unsigned int' to bare use of 'unsigned'
https://review.coreboot.org/c/coreboot/+/32020/5/src/arch/x86/libx86emu/blob... PS5, Line 45: void x86emu_set_io_perm(x86emu_t *emu, unsigned start, unsigned end, unsigned perm) Prefer 'unsigned int' to bare use of 'unsigned'
https://review.coreboot.org/c/coreboot/+/32020/5/src/arch/x86/libx86emu/blob... PS5, Line 45: void x86emu_set_io_perm(x86emu_t *emu, unsigned start, unsigned end, unsigned perm) Prefer 'unsigned int' to bare use of 'unsigned'
https://review.coreboot.org/c/coreboot/+/32020/5/src/arch/x86/libx86emu/blob... PS5, Line 49: unsigned x86emu_read_byte(x86emu_t *emu, unsigned addr) Prefer 'unsigned int' to bare use of 'unsigned'
https://review.coreboot.org/c/coreboot/+/32020/5/src/arch/x86/libx86emu/blob... PS5, Line 49: unsigned x86emu_read_byte(x86emu_t *emu, unsigned addr) Prefer 'unsigned int' to bare use of 'unsigned'
https://review.coreboot.org/c/coreboot/+/32020/5/src/arch/x86/libx86emu/blob... PS5, Line 53: if(emu) space required before the open parenthesis '('
https://review.coreboot.org/c/coreboot/+/32020/5/src/arch/x86/libx86emu/blob... PS5, Line 59: unsigned x86emu_read_byte_noperm(x86emu_t *emu, unsigned addr) Prefer 'unsigned int' to bare use of 'unsigned'
https://review.coreboot.org/c/coreboot/+/32020/5/src/arch/x86/libx86emu/blob... PS5, Line 59: unsigned x86emu_read_byte_noperm(x86emu_t *emu, unsigned addr) Prefer 'unsigned int' to bare use of 'unsigned'
https://review.coreboot.org/c/coreboot/+/32020/5/src/arch/x86/libx86emu/blob... PS5, Line 63: if(emu) space required before the open parenthesis '('
https://review.coreboot.org/c/coreboot/+/32020/5/src/arch/x86/libx86emu/blob... PS5, Line 70: unsigned x86emu_read_word(x86emu_t *emu, unsigned addr) Prefer 'unsigned int' to bare use of 'unsigned'
https://review.coreboot.org/c/coreboot/+/32020/5/src/arch/x86/libx86emu/blob... PS5, Line 70: unsigned x86emu_read_word(x86emu_t *emu, unsigned addr) Prefer 'unsigned int' to bare use of 'unsigned'
https://review.coreboot.org/c/coreboot/+/32020/5/src/arch/x86/libx86emu/blob... PS5, Line 74: if(emu) space required before the open parenthesis '('
https://review.coreboot.org/c/coreboot/+/32020/5/src/arch/x86/libx86emu/blob... PS5, Line 80: unsigned x86emu_read_dword(x86emu_t *emu, unsigned addr) Prefer 'unsigned int' to bare use of 'unsigned'
https://review.coreboot.org/c/coreboot/+/32020/5/src/arch/x86/libx86emu/blob... PS5, Line 80: unsigned x86emu_read_dword(x86emu_t *emu, unsigned addr) Prefer 'unsigned int' to bare use of 'unsigned'
https://review.coreboot.org/c/coreboot/+/32020/5/src/arch/x86/libx86emu/blob... PS5, Line 84: if(emu) space required before the open parenthesis '('
https://review.coreboot.org/c/coreboot/+/32020/5/src/arch/x86/libx86emu/blob... PS5, Line 90: void x86emu_write_byte(x86emu_t *emu, unsigned addr, unsigned val) Prefer 'unsigned int' to bare use of 'unsigned'
https://review.coreboot.org/c/coreboot/+/32020/5/src/arch/x86/libx86emu/blob... PS5, Line 90: void x86emu_write_byte(x86emu_t *emu, unsigned addr, unsigned val) Prefer 'unsigned int' to bare use of 'unsigned'
https://review.coreboot.org/c/coreboot/+/32020/5/src/arch/x86/libx86emu/blob... PS5, Line 94: if(emu) space required before the open parenthesis '('
https://review.coreboot.org/c/coreboot/+/32020/5/src/arch/x86/libx86emu/blob... PS5, Line 98: void x86emu_write_byte_noperm(x86emu_t *emu, unsigned addr, unsigned val) Prefer 'unsigned int' to bare use of 'unsigned'
https://review.coreboot.org/c/coreboot/+/32020/5/src/arch/x86/libx86emu/blob... PS5, Line 98: void x86emu_write_byte_noperm(x86emu_t *emu, unsigned addr, unsigned val) Prefer 'unsigned int' to bare use of 'unsigned'
https://review.coreboot.org/c/coreboot/+/32020/5/src/arch/x86/libx86emu/blob... PS5, Line 102: if(emu) space required before the open parenthesis '('
https://review.coreboot.org/c/coreboot/+/32020/5/src/arch/x86/libx86emu/blob... PS5, Line 107: void x86emu_write_word(x86emu_t *emu, unsigned addr, unsigned val) Prefer 'unsigned int' to bare use of 'unsigned'
https://review.coreboot.org/c/coreboot/+/32020/5/src/arch/x86/libx86emu/blob... PS5, Line 107: void x86emu_write_word(x86emu_t *emu, unsigned addr, unsigned val) Prefer 'unsigned int' to bare use of 'unsigned'
https://review.coreboot.org/c/coreboot/+/32020/5/src/arch/x86/libx86emu/blob... PS5, Line 111: if(emu) space required before the open parenthesis '('
https://review.coreboot.org/c/coreboot/+/32020/5/src/arch/x86/libx86emu/blob... PS5, Line 115: void x86emu_write_dword(x86emu_t *emu, unsigned addr, unsigned val) Prefer 'unsigned int' to bare use of 'unsigned'
https://review.coreboot.org/c/coreboot/+/32020/5/src/arch/x86/libx86emu/blob... PS5, Line 115: void x86emu_write_dword(x86emu_t *emu, unsigned addr, unsigned val) Prefer 'unsigned int' to bare use of 'unsigned'
https://review.coreboot.org/c/coreboot/+/32020/5/src/arch/x86/libx86emu/blob... PS5, Line 119: if(emu) space required before the open parenthesis '('
https://review.coreboot.org/c/coreboot/+/32020/5/src/arch/x86/libx86emu/blob... PS5, Line 123: unsigned x86emu_clear_log(x86emu_t *emu, int flush) Prefer 'unsigned int' to bare use of 'unsigned'
https://review.coreboot.org/c/coreboot/+/32020/5/src/arch/x86/libx86emu/blob... PS5, Line 125: if(flush && emu->log.flush) { space required before the open parenthesis '('
https://review.coreboot.org/c/coreboot/+/32020/5/src/arch/x86/libx86emu/blob... PS5, Line 126: if(emu->log.ptr && emu->log.ptr != emu->log.buf) { space required before the open parenthesis '('
https://review.coreboot.org/c/coreboot/+/32020/5/src/arch/x86/libx86emu/blob... PS5, Line 131: if((emu->log.ptr = emu->log.buf)) *emu->log.ptr = 0; space required before the open parenthesis '('
https://review.coreboot.org/c/coreboot/+/32020/5/src/arch/x86/libx86emu/blob... PS5, Line 131: if((emu->log.ptr = emu->log.buf)) *emu->log.ptr = 0; do not use assignment in if condition
https://review.coreboot.org/c/coreboot/+/32020/5/src/arch/x86/libx86emu/blob... PS5, Line 131: if((emu->log.ptr = emu->log.buf)) *emu->log.ptr = 0; trailing statements should be on next line
https://review.coreboot.org/c/coreboot/+/32020/5/src/arch/x86/libx86emu/blob... PS5, Line 141: memset(x86, 0, sizeof *x86); sizeof *x86 should be sizeof(*x86)
https://review.coreboot.org/c/coreboot/+/32020/5/src/arch/x86/libx86emu/blob... PS5, Line 226: static void vm_traceio_w(x86emu_t *emu, u32 addr, u32 *val, unsigned type) Prefer 'unsigned int' to bare use of 'unsigned'
https://review.coreboot.org/c/coreboot/+/32020/5/src/arch/x86/libx86emu/blob... PS5, Line 228: unsigned bits = type & 0xff; Prefer 'unsigned int' to bare use of 'unsigned'
https://review.coreboot.org/c/coreboot/+/32020/5/src/arch/x86/libx86emu/blob... PS5, Line 239: switch(bits) { space required before the open parenthesis '('
https://review.coreboot.org/c/coreboot/+/32020/5/src/arch/x86/libx86emu/blob... PS5, Line 266: switch(bits) { space required before the open parenthesis '('
https://review.coreboot.org/c/coreboot/+/32020/5/src/arch/x86/libx86emu/blob... PS5, Line 281: static void vm_traceio_r(x86emu_t *emu, u32 addr, u32 *val, unsigned type) Prefer 'unsigned int' to bare use of 'unsigned'
https://review.coreboot.org/c/coreboot/+/32020/5/src/arch/x86/libx86emu/blob... PS5, Line 283: unsigned bits = type & 0xff; Prefer 'unsigned int' to bare use of 'unsigned'
https://review.coreboot.org/c/coreboot/+/32020/5/src/arch/x86/libx86emu/blob... PS5, Line 294: switch(bits) { space required before the open parenthesis '('
https://review.coreboot.org/c/coreboot/+/32020/5/src/arch/x86/libx86emu/blob... PS5, Line 318: switch(bits) { space required before the open parenthesis '('
https://review.coreboot.org/c/coreboot/+/32020/5/src/arch/x86/libx86emu/blob... PS5, Line 334: unsigned vm_memio(x86emu_t *emu, u32 addr, u32 *val, unsigned type) Prefer 'unsigned int' to bare use of 'unsigned'
https://review.coreboot.org/c/coreboot/+/32020/5/src/arch/x86/libx86emu/blob... PS5, Line 334: unsigned vm_memio(x86emu_t *emu, u32 addr, u32 *val, unsigned type) Prefer 'unsigned int' to bare use of 'unsigned'
https://review.coreboot.org/c/coreboot/+/32020/5/src/arch/x86/libx86emu/blob... PS5, Line 337: unsigned bits = type & 0xff; Prefer 'unsigned int' to bare use of 'unsigned'
https://review.coreboot.org/c/coreboot/+/32020/5/src/arch/x86/libx86emu/blob... PS5, Line 342: switch(type) { space required before the open parenthesis '('
https://review.coreboot.org/c/coreboot/+/32020/5/src/arch/x86/libx86emu/blob... PS5, Line 344: switch(bits) { space required before the open parenthesis '('
https://review.coreboot.org/c/coreboot/+/32020/5/src/arch/x86/libx86emu/blob... PS5, Line 358: switch(bits) { space required before the open parenthesis '('
https://review.coreboot.org/c/coreboot/+/32020/5/src/arch/x86/libx86emu/blob... PS5, Line 372: switch(bits) { space required before the open parenthesis '('
https://review.coreboot.org/c/coreboot/+/32020/5/src/arch/x86/libx86emu/blob... PS5, Line 387: switch(bits) { space required before the open parenthesis '('
https://review.coreboot.org/c/coreboot/+/32020/5/src/arch/x86/libx86emu/blob... PS5, Line 401: switch(bits) { space required before the open parenthesis '('
https://review.coreboot.org/c/coreboot/+/32020/5/src/arch/x86/libx86emu/blob... PS5, Line 422: static bool x86emu_memio_drop(struct x86emu_s *emu_s, u32 addr, u32 *val, unsigned type) Prefer 'unsigned int' to bare use of 'unsigned'
https://review.coreboot.org/c/coreboot/+/32020/5/src/arch/x86/libx86emu/blob... PS5, Line 424: switch(type) { space required before the open parenthesis '('
https://review.coreboot.org/c/coreboot/+/32020/5/src/arch/x86/libx86emu/blob... PS5, Line 439: static bool x86emu_memio_except(struct x86emu_s *emu_s, u32 addr, u32 *val, unsigned type) Prefer 'unsigned int' to bare use of 'unsigned'
https://review.coreboot.org/c/coreboot/+/32020/5/src/arch/x86/libx86emu/blob... PS5, Line 444: switch(type) { space required before the open parenthesis '('
https://review.coreboot.org/c/coreboot/+/32020/5/src/arch/x86/libx86emu/blob... PS5, Line 472: static unsigned x86emu_memio_handler(struct x86emu_s *emu_s, u32 addr, u32 *val, unsigned type) Prefer 'unsigned int' to bare use of 'unsigned'
https://review.coreboot.org/c/coreboot/+/32020/5/src/arch/x86/libx86emu/blob... PS5, Line 472: static unsigned x86emu_memio_handler(struct x86emu_s *emu_s, u32 addr, u32 *val, unsigned type) Prefer 'unsigned int' to bare use of 'unsigned'
https://review.coreboot.org/c/coreboot/+/32020/5/src/arch/x86/libx86emu/blob... PS5, Line 539: static int x86emu_intr_handler(x86emu_t *emu, u8 num, unsigned type) Prefer 'unsigned int' to bare use of 'unsigned'
https://review.coreboot.org/c/coreboot/+/32020/5/src/arch/x86/libx86emu/blob... PS5, Line 552: vm_memio(emu, emu->x86.R_EIP + i - 16, &val, X86EMU_MEMIO_R|X86EMU_MEMIO_8); line over 96 characters
https://review.coreboot.org/c/coreboot/+/32020/5/src/arch/x86/libx86emu/blob... PS5, Line 565: static void x86emu_flush_log(x86emu_t *emu, char *buf, unsigned size) Prefer 'unsigned int' to bare use of 'unsigned'
https://review.coreboot.org/c/coreboot/+/32020/5/src/arch/x86/libx86emu/blob... PS5, Line 576: unsigned stats_i[X86EMU_IO_PORTS]; Prefer 'unsigned int' to bare use of 'unsigned'
https://review.coreboot.org/c/coreboot/+/32020/5/src/arch/x86/libx86emu/blob... PS5, Line 577: unsigned stats_o[X86EMU_IO_PORTS]; Prefer 'unsigned int' to bare use of 'unsigned'
https://review.coreboot.org/c/coreboot/+/32020/5/src/arch/x86/libx86emu/blob... PS5, Line 582: unsigned def_mem_perm = X86EMU_PERM_X|X86EMU_PERM_W|X86EMU_PERM_R; Prefer 'unsigned int' to bare use of 'unsigned'
https://review.coreboot.org/c/coreboot/+/32020/5/src/arch/x86/libx86emu/blob... PS5, Line 583: unsigned def_io_perm = X86EMU_PERM_X|X86EMU_PERM_W|X86EMU_PERM_R; Prefer 'unsigned int' to bare use of 'unsigned'
Hello Angel Pons, Arthur Heymans, Daniel Maslowski, Christian Walter, Felix Singer, Philipp Deppenwiese, build bot (Jenkins), Nico Huber, Patrick Georgi, Martin Roth,
I'd like you to reexamine a change. Please visit
https://review.coreboot.org/c/coreboot/+/32020
to look at the new patch set (#6).
Change subject: [WIP]x86: Introduce the blobolator ......................................................................
[WIP]x86: Introduce the blobolator
This is a PoC to run arbitrary code and blobs inside an emulated virtual machine using libx86emu, thus the name blobolator.
The libx86emu has been patched to the following: * redirect IO to the host machine it's running on * trace IO * start in protected mode * add mechanism to drop IO access * add Kconfig to debug code it is running
Implemented features: * Run ramstage in libx86emu * Kconfig specific hooks by using _blobolator_drivers (same mechanism as __pci_driver) * PCI decoding and BAR tracing * POST code decoding * Unhandled IO tracing
TODO: * Add support to trace only blobs, not stages. * Improve translation of known IO to human readable format ** COM ** PCI ** APIC ** PIT ** POST
Tested on qemu. Sucessfully run ramstage in blobolator. Tested on X11SSH-TF. Sucessfully run ramstage in blobolator (requires additional libx86emu patches).
Change-Id: I13e47f45e69376d046f35c04363fe3db1cfaa610 Signed-off-by: Patrick Rudolph patrick.rudolph@9elements.com --- M Makefile.inc M src/Kconfig M src/arch/x86/Makefile.inc M src/arch/x86/boot.c A src/arch/x86/libx86emu/Kconfig.debug A src/arch/x86/libx86emu/Makefile.inc A src/arch/x86/libx86emu/blobolator.c A src/arch/x86/libx86emu/blobolator_internal.h A src/arch/x86/libx86emu/stdarg.h A src/arch/x86/libx86emu/stdio.h A src/arch/x86/libx86emu/time.h A src/arch/x86/libx86emu/trace-bios.c A src/arch/x86/libx86emu/trace-pci.c A src/arch/x86/libx86emu/trace-serial.c A src/arch/x86/libx86emu/trace-skl.c A src/arch/x86/libx86emu/trace.c M src/arch/x86/postcar_loader.c A src/include/blobolator.h M src/include/stddef.h M src/lib/Makefile.inc M src/lib/program.ld 21 files changed, 1,887 insertions(+), 1 deletion(-)
git pull ssh://review.coreboot.org:29418/coreboot refs/changes/20/32020/6
Hello Julius Werner, Angel Pons, Arthur Heymans, Daniel Maslowski, Christian Walter, Felix Singer, Philipp Deppenwiese, build bot (Jenkins), Nico Huber, Patrick Georgi, Martin Roth,
I'd like you to reexamine a change. Please visit
https://review.coreboot.org/c/coreboot/+/32020
to look at the new patch set (#7).
Change subject: [WIP]x86: Introduce the blobolator ......................................................................
[WIP]x86: Introduce the blobolator
This is a PoC to run arbitrary code and blobs inside an emulated virtual machine using libx86emu, thus the name blobolator.
The libx86emu has been patched to the following: * redirect IO to the host machine it's running on * trace IO * start in protected mode * add mechanism to drop IO access * add Kconfig to debug code it is running
Implemented features: * Run ramstage in libx86emu * Kconfig specific hooks by using _blobolator_drivers (same mechanism as __pci_driver) * PCI decoding and BAR tracing * POST code decoding * Unhandled IO tracing
TODO: * Add support to trace only blobs, not stages. * Improve translation of known IO to human readable format ** COM ** PCI ** APIC ** PIT ** POST
Tested on qemu. Sucessfully run ramstage in blobolator. Tested on X11SSH-TF. Sucessfully run ramstage in blobolator (requires additional libx86emu patches).
Change-Id: I13e47f45e69376d046f35c04363fe3db1cfaa610 Signed-off-by: Patrick Rudolph patrick.rudolph@9elements.com --- M Makefile.inc M src/Kconfig M src/arch/x86/Makefile.inc M src/arch/x86/boot.c A src/arch/x86/libx86emu/Kconfig.debug A src/arch/x86/libx86emu/Makefile.inc A src/arch/x86/libx86emu/blobolator.c A src/arch/x86/libx86emu/blobolator_internal.h A src/arch/x86/libx86emu/stdarg.h A src/arch/x86/libx86emu/stdio.h A src/arch/x86/libx86emu/time.h A src/arch/x86/libx86emu/trace-bios.c A src/arch/x86/libx86emu/trace-pci.c A src/arch/x86/libx86emu/trace-serial.c A src/arch/x86/libx86emu/trace-skl.c A src/arch/x86/libx86emu/trace.c M src/arch/x86/postcar_loader.c M src/commonlib/include/commonlib/cbmem_id.h A src/include/blobolator.h M src/include/rules.h M src/include/stddef.h M src/lib/Makefile.inc M src/lib/hardwaremain.c M src/lib/program.ld 24 files changed, 1,993 insertions(+), 2 deletions(-)
git pull ssh://review.coreboot.org:29418/coreboot refs/changes/20/32020/7
build bot (Jenkins) has posted comments on this change. ( https://review.coreboot.org/c/coreboot/+/32020 )
Change subject: [WIP]x86: Introduce the blobolator ......................................................................
Patch Set 7:
(144 comments)
https://review.coreboot.org/c/coreboot/+/32020/7/src/arch/x86/libx86emu/blob... File src/arch/x86/libx86emu/blobolator.c:
https://review.coreboot.org/c/coreboot/+/32020/7/src/arch/x86/libx86emu/blob... PS7, Line 42: x86emu_mem_t *emu_mem_new(unsigned perm) Prefer 'unsigned int' to bare use of 'unsigned'
https://review.coreboot.org/c/coreboot/+/32020/7/src/arch/x86/libx86emu/blob... PS7, Line 47: void x86emu_set_io_perm(x86emu_t *emu, unsigned start, unsigned end, unsigned perm) Prefer 'unsigned int' to bare use of 'unsigned'
https://review.coreboot.org/c/coreboot/+/32020/7/src/arch/x86/libx86emu/blob... PS7, Line 47: void x86emu_set_io_perm(x86emu_t *emu, unsigned start, unsigned end, unsigned perm) Prefer 'unsigned int' to bare use of 'unsigned'
https://review.coreboot.org/c/coreboot/+/32020/7/src/arch/x86/libx86emu/blob... PS7, Line 47: void x86emu_set_io_perm(x86emu_t *emu, unsigned start, unsigned end, unsigned perm) Prefer 'unsigned int' to bare use of 'unsigned'
https://review.coreboot.org/c/coreboot/+/32020/7/src/arch/x86/libx86emu/blob... PS7, Line 51: unsigned x86emu_read_byte(x86emu_t *emu, unsigned addr) Prefer 'unsigned int' to bare use of 'unsigned'
https://review.coreboot.org/c/coreboot/+/32020/7/src/arch/x86/libx86emu/blob... PS7, Line 51: unsigned x86emu_read_byte(x86emu_t *emu, unsigned addr) Prefer 'unsigned int' to bare use of 'unsigned'
https://review.coreboot.org/c/coreboot/+/32020/7/src/arch/x86/libx86emu/blob... PS7, Line 55: if(emu) space required before the open parenthesis '('
https://review.coreboot.org/c/coreboot/+/32020/7/src/arch/x86/libx86emu/blob... PS7, Line 61: unsigned x86emu_read_byte_noperm(x86emu_t *emu, unsigned addr) Prefer 'unsigned int' to bare use of 'unsigned'
https://review.coreboot.org/c/coreboot/+/32020/7/src/arch/x86/libx86emu/blob... PS7, Line 61: unsigned x86emu_read_byte_noperm(x86emu_t *emu, unsigned addr) Prefer 'unsigned int' to bare use of 'unsigned'
https://review.coreboot.org/c/coreboot/+/32020/7/src/arch/x86/libx86emu/blob... PS7, Line 65: if(emu) space required before the open parenthesis '('
https://review.coreboot.org/c/coreboot/+/32020/7/src/arch/x86/libx86emu/blob... PS7, Line 72: unsigned x86emu_read_word(x86emu_t *emu, unsigned addr) Prefer 'unsigned int' to bare use of 'unsigned'
https://review.coreboot.org/c/coreboot/+/32020/7/src/arch/x86/libx86emu/blob... PS7, Line 72: unsigned x86emu_read_word(x86emu_t *emu, unsigned addr) Prefer 'unsigned int' to bare use of 'unsigned'
https://review.coreboot.org/c/coreboot/+/32020/7/src/arch/x86/libx86emu/blob... PS7, Line 76: if(emu) space required before the open parenthesis '('
https://review.coreboot.org/c/coreboot/+/32020/7/src/arch/x86/libx86emu/blob... PS7, Line 82: unsigned x86emu_read_dword(x86emu_t *emu, unsigned addr) Prefer 'unsigned int' to bare use of 'unsigned'
https://review.coreboot.org/c/coreboot/+/32020/7/src/arch/x86/libx86emu/blob... PS7, Line 82: unsigned x86emu_read_dword(x86emu_t *emu, unsigned addr) Prefer 'unsigned int' to bare use of 'unsigned'
https://review.coreboot.org/c/coreboot/+/32020/7/src/arch/x86/libx86emu/blob... PS7, Line 86: if(emu) space required before the open parenthesis '('
https://review.coreboot.org/c/coreboot/+/32020/7/src/arch/x86/libx86emu/blob... PS7, Line 92: void x86emu_write_byte(x86emu_t *emu, unsigned addr, unsigned val) Prefer 'unsigned int' to bare use of 'unsigned'
https://review.coreboot.org/c/coreboot/+/32020/7/src/arch/x86/libx86emu/blob... PS7, Line 92: void x86emu_write_byte(x86emu_t *emu, unsigned addr, unsigned val) Prefer 'unsigned int' to bare use of 'unsigned'
https://review.coreboot.org/c/coreboot/+/32020/7/src/arch/x86/libx86emu/blob... PS7, Line 96: if(emu) space required before the open parenthesis '('
https://review.coreboot.org/c/coreboot/+/32020/7/src/arch/x86/libx86emu/blob... PS7, Line 100: void x86emu_write_byte_noperm(x86emu_t *emu, unsigned addr, unsigned val) Prefer 'unsigned int' to bare use of 'unsigned'
https://review.coreboot.org/c/coreboot/+/32020/7/src/arch/x86/libx86emu/blob... PS7, Line 100: void x86emu_write_byte_noperm(x86emu_t *emu, unsigned addr, unsigned val) Prefer 'unsigned int' to bare use of 'unsigned'
https://review.coreboot.org/c/coreboot/+/32020/7/src/arch/x86/libx86emu/blob... PS7, Line 104: if(emu) space required before the open parenthesis '('
https://review.coreboot.org/c/coreboot/+/32020/7/src/arch/x86/libx86emu/blob... PS7, Line 109: void x86emu_write_word(x86emu_t *emu, unsigned addr, unsigned val) Prefer 'unsigned int' to bare use of 'unsigned'
https://review.coreboot.org/c/coreboot/+/32020/7/src/arch/x86/libx86emu/blob... PS7, Line 109: void x86emu_write_word(x86emu_t *emu, unsigned addr, unsigned val) Prefer 'unsigned int' to bare use of 'unsigned'
https://review.coreboot.org/c/coreboot/+/32020/7/src/arch/x86/libx86emu/blob... PS7, Line 113: if(emu) space required before the open parenthesis '('
https://review.coreboot.org/c/coreboot/+/32020/7/src/arch/x86/libx86emu/blob... PS7, Line 117: void x86emu_write_dword(x86emu_t *emu, unsigned addr, unsigned val) Prefer 'unsigned int' to bare use of 'unsigned'
https://review.coreboot.org/c/coreboot/+/32020/7/src/arch/x86/libx86emu/blob... PS7, Line 117: void x86emu_write_dword(x86emu_t *emu, unsigned addr, unsigned val) Prefer 'unsigned int' to bare use of 'unsigned'
https://review.coreboot.org/c/coreboot/+/32020/7/src/arch/x86/libx86emu/blob... PS7, Line 121: if(emu) space required before the open parenthesis '('
https://review.coreboot.org/c/coreboot/+/32020/7/src/arch/x86/libx86emu/blob... PS7, Line 125: unsigned x86emu_clear_log(x86emu_t *emu, int flush) Prefer 'unsigned int' to bare use of 'unsigned'
https://review.coreboot.org/c/coreboot/+/32020/7/src/arch/x86/libx86emu/blob... PS7, Line 127: if(flush && emu->log.flush) { space required before the open parenthesis '('
https://review.coreboot.org/c/coreboot/+/32020/7/src/arch/x86/libx86emu/blob... PS7, Line 128: if(emu->log.ptr && emu->log.ptr != emu->log.buf) { space required before the open parenthesis '('
https://review.coreboot.org/c/coreboot/+/32020/7/src/arch/x86/libx86emu/blob... PS7, Line 133: if((emu->log.ptr = emu->log.buf)) *emu->log.ptr = 0; space required before the open parenthesis '('
https://review.coreboot.org/c/coreboot/+/32020/7/src/arch/x86/libx86emu/blob... PS7, Line 133: if((emu->log.ptr = emu->log.buf)) *emu->log.ptr = 0; do not use assignment in if condition
https://review.coreboot.org/c/coreboot/+/32020/7/src/arch/x86/libx86emu/blob... PS7, Line 133: if((emu->log.ptr = emu->log.buf)) *emu->log.ptr = 0; trailing statements should be on next line
https://review.coreboot.org/c/coreboot/+/32020/7/src/arch/x86/libx86emu/blob... PS7, Line 143: memset(x86, 0, sizeof *x86); sizeof *x86 should be sizeof(*x86)
https://review.coreboot.org/c/coreboot/+/32020/7/src/arch/x86/libx86emu/blob... PS7, Line 202: emu->x86.R_EIP, 's', 'O', emu->x86.R_ECX, emu->x86.R_EDX, emu->x86.R_EAX); line over 96 characters
https://review.coreboot.org/c/coreboot/+/32020/7/src/arch/x86/libx86emu/blob... PS7, Line 225: emu->x86.R_EIP, 's', 'I', emu->x86.R_ECX, msr.hi, msr.lo); line over 96 characters
https://review.coreboot.org/c/coreboot/+/32020/7/src/arch/x86/libx86emu/blob... PS7, Line 238: __weak void vm_traceio_w(x86emu_t *emu, u32 addr, u32 *val, unsigned type) Prefer 'unsigned int' to bare use of 'unsigned'
https://review.coreboot.org/c/coreboot/+/32020/7/src/arch/x86/libx86emu/blob... PS7, Line 242: __weak void vm_traceio_r(x86emu_t *emu, u32 addr, u32 *val, unsigned type) Prefer 'unsigned int' to bare use of 'unsigned'
https://review.coreboot.org/c/coreboot/+/32020/7/src/arch/x86/libx86emu/blob... PS7, Line 246: unsigned vm_memio(x86emu_t *emu, u32 addr, u32 *val, unsigned type) Prefer 'unsigned int' to bare use of 'unsigned'
https://review.coreboot.org/c/coreboot/+/32020/7/src/arch/x86/libx86emu/blob... PS7, Line 246: unsigned vm_memio(x86emu_t *emu, u32 addr, u32 *val, unsigned type) Prefer 'unsigned int' to bare use of 'unsigned'
https://review.coreboot.org/c/coreboot/+/32020/7/src/arch/x86/libx86emu/blob... PS7, Line 249: unsigned bits = type & 0xff; Prefer 'unsigned int' to bare use of 'unsigned'
https://review.coreboot.org/c/coreboot/+/32020/7/src/arch/x86/libx86emu/blob... PS7, Line 254: switch(type) { space required before the open parenthesis '('
https://review.coreboot.org/c/coreboot/+/32020/7/src/arch/x86/libx86emu/blob... PS7, Line 256: switch(bits) { space required before the open parenthesis '('
https://review.coreboot.org/c/coreboot/+/32020/7/src/arch/x86/libx86emu/blob... PS7, Line 270: switch(bits) { space required before the open parenthesis '('
https://review.coreboot.org/c/coreboot/+/32020/7/src/arch/x86/libx86emu/blob... PS7, Line 284: switch(bits) { space required before the open parenthesis '('
https://review.coreboot.org/c/coreboot/+/32020/7/src/arch/x86/libx86emu/blob... PS7, Line 299: switch(bits) { space required before the open parenthesis '('
https://review.coreboot.org/c/coreboot/+/32020/7/src/arch/x86/libx86emu/blob... PS7, Line 313: switch(bits) { space required before the open parenthesis '('
https://review.coreboot.org/c/coreboot/+/32020/7/src/arch/x86/libx86emu/blob... PS7, Line 334: static bool x86emu_memio_drop(struct x86emu_s *emu_s, u32 addr, u32 *val, unsigned type) Prefer 'unsigned int' to bare use of 'unsigned'
https://review.coreboot.org/c/coreboot/+/32020/7/src/arch/x86/libx86emu/blob... PS7, Line 336: switch(type) { space required before the open parenthesis '('
https://review.coreboot.org/c/coreboot/+/32020/7/src/arch/x86/libx86emu/blob... PS7, Line 351: static bool x86emu_memio_except(struct x86emu_s *emu_s, u32 addr, u32 *val, unsigned type) Prefer 'unsigned int' to bare use of 'unsigned'
https://review.coreboot.org/c/coreboot/+/32020/7/src/arch/x86/libx86emu/blob... PS7, Line 356: switch(type) { space required before the open parenthesis '('
https://review.coreboot.org/c/coreboot/+/32020/7/src/arch/x86/libx86emu/blob... PS7, Line 388: static unsigned x86emu_memio_handler(struct x86emu_s *emu_s, u32 addr, u32 *val, unsigned type) Prefer 'unsigned int' to bare use of 'unsigned'
https://review.coreboot.org/c/coreboot/+/32020/7/src/arch/x86/libx86emu/blob... PS7, Line 388: static unsigned x86emu_memio_handler(struct x86emu_s *emu_s, u32 addr, u32 *val, unsigned type) Prefer 'unsigned int' to bare use of 'unsigned'
https://review.coreboot.org/c/coreboot/+/32020/7/src/arch/x86/libx86emu/blob... PS7, Line 457: static int x86emu_intr_handler(x86emu_t *emu, u8 num, unsigned type) Prefer 'unsigned int' to bare use of 'unsigned'
https://review.coreboot.org/c/coreboot/+/32020/7/src/arch/x86/libx86emu/blob... PS7, Line 470: vm_memio(emu, emu->x86.R_EIP + i - 16, &val, X86EMU_MEMIO_R|X86EMU_MEMIO_8); line over 96 characters
https://review.coreboot.org/c/coreboot/+/32020/7/src/arch/x86/libx86emu/blob... PS7, Line 483: static void x86emu_flush_log(x86emu_t *emu, char *buf, unsigned size) Prefer 'unsigned int' to bare use of 'unsigned'
https://review.coreboot.org/c/coreboot/+/32020/7/src/arch/x86/libx86emu/blob... PS7, Line 494: unsigned stats_i[X86EMU_IO_PORTS]; Prefer 'unsigned int' to bare use of 'unsigned'
https://review.coreboot.org/c/coreboot/+/32020/7/src/arch/x86/libx86emu/blob... PS7, Line 495: unsigned stats_o[X86EMU_IO_PORTS]; Prefer 'unsigned int' to bare use of 'unsigned'
https://review.coreboot.org/c/coreboot/+/32020/7/src/arch/x86/libx86emu/blob... PS7, Line 500: unsigned def_mem_perm = X86EMU_PERM_X|X86EMU_PERM_W|X86EMU_PERM_R; Prefer 'unsigned int' to bare use of 'unsigned'
https://review.coreboot.org/c/coreboot/+/32020/7/src/arch/x86/libx86emu/blob... PS7, Line 501: unsigned def_io_perm = X86EMU_PERM_X|X86EMU_PERM_W|X86EMU_PERM_R; Prefer 'unsigned int' to bare use of 'unsigned'
https://review.coreboot.org/c/coreboot/+/32020/7/src/arch/x86/libx86emu/blob... File src/arch/x86/libx86emu/blobolator_internal.h:
https://review.coreboot.org/c/coreboot/+/32020/7/src/arch/x86/libx86emu/blob... PS7, Line 17: void vm_traceio_w(x86emu_t *emu, u32 addr, u32 *val, unsigned type); Prefer 'unsigned int' to bare use of 'unsigned'
https://review.coreboot.org/c/coreboot/+/32020/7/src/arch/x86/libx86emu/blob... PS7, Line 18: void vm_traceio_r(x86emu_t *emu, u32 addr, u32 *val, unsigned type); Prefer 'unsigned int' to bare use of 'unsigned'
https://review.coreboot.org/c/coreboot/+/32020/7/src/arch/x86/libx86emu/blob... PS7, Line 24: void (*init)(x86emu_t *emu); code indent should use tabs where possible
https://review.coreboot.org/c/coreboot/+/32020/7/src/arch/x86/libx86emu/blob... PS7, Line 24: void (*init)(x86emu_t *emu); please, no spaces at the start of a line
https://review.coreboot.org/c/coreboot/+/32020/7/src/arch/x86/libx86emu/blob... PS7, Line 25: bool (*ignore_addr_io)(x86emu_t *emu, u32 addr); code indent should use tabs where possible
https://review.coreboot.org/c/coreboot/+/32020/7/src/arch/x86/libx86emu/blob... PS7, Line 25: bool (*ignore_addr_io)(x86emu_t *emu, u32 addr); please, no spaces at the start of a line
https://review.coreboot.org/c/coreboot/+/32020/7/src/arch/x86/libx86emu/blob... PS7, Line 26: bool (*ignore_addr_mem)(x86emu_t *emu, u32 addr); code indent should use tabs where possible
https://review.coreboot.org/c/coreboot/+/32020/7/src/arch/x86/libx86emu/blob... PS7, Line 26: bool (*ignore_addr_mem)(x86emu_t *emu, u32 addr); please, no spaces at the start of a line
https://review.coreboot.org/c/coreboot/+/32020/7/src/arch/x86/libx86emu/trac... File src/arch/x86/libx86emu/trace-bios.c:
https://review.coreboot.org/c/coreboot/+/32020/7/src/arch/x86/libx86emu/trac... PS7, Line 28: if (addr > 0xffffffff - CONFIG_ROM_SIZE) { braces {} are not necessary for single statement blocks
https://review.coreboot.org/c/coreboot/+/32020/7/src/arch/x86/libx86emu/trac... File src/arch/x86/libx86emu/trace-pci.c:
https://review.coreboot.org/c/coreboot/+/32020/7/src/arch/x86/libx86emu/trac... PS7, Line 51: devfn >> 3, devfn & 7); code indent should use tabs where possible
https://review.coreboot.org/c/coreboot/+/32020/7/src/arch/x86/libx86emu/trac... PS7, Line 78: static struct bar_tracer *bar_trace_find(struct device *dev, unsigned int bar, unsigned int type) line over 96 characters
https://review.coreboot.org/c/coreboot/+/32020/7/src/arch/x86/libx86emu/trac... PS7, Line 162: DEVFN_T dev = ((bus << 20)| devfn << 12); need consistent spacing around '|' (ctx:VxW)
https://review.coreboot.org/c/coreboot/+/32020/7/src/arch/x86/libx86emu/trac... PS7, Line 166: if (!dev) { braces {} are not necessary for single statement blocks
https://review.coreboot.org/c/coreboot/+/32020/7/src/arch/x86/libx86emu/trac... PS7, Line 198: while (!(moving & size)) { braces {} are not necessary for single statement blocks
https://review.coreboot.org/c/coreboot/+/32020/7/src/arch/x86/libx86emu/trac... PS7, Line 207: tracer = bar_trace_add(dev_find_slot(bus, devfn), (index - 0x10) / 4, !!(attr & PCI_BASE_ADDRESS_SPACE_IO)); line over 96 characters
https://review.coreboot.org/c/coreboot/+/32020/7/src/arch/x86/libx86emu/trac... PS7, Line 229: switch(bits) { switch and case should be at the same indent
https://review.coreboot.org/c/coreboot/+/32020/7/src/arch/x86/libx86emu/trac... PS7, Line 229: switch(bits) { space required before the open parenthesis '('
https://review.coreboot.org/c/coreboot/+/32020/7/src/arch/x86/libx86emu/trac... PS7, Line 258: switch(bits) { switch and case should be at the same indent
https://review.coreboot.org/c/coreboot/+/32020/7/src/arch/x86/libx86emu/trac... PS7, Line 258: switch(bits) { space required before the open parenthesis '('
https://review.coreboot.org/c/coreboot/+/32020/7/src/arch/x86/libx86emu/trac... PS7, Line 287: switch(bits) { switch and case should be at the same indent
https://review.coreboot.org/c/coreboot/+/32020/7/src/arch/x86/libx86emu/trac... PS7, Line 287: switch(bits) { space required before the open parenthesis '('
https://review.coreboot.org/c/coreboot/+/32020/7/src/arch/x86/libx86emu/trac... PS7, Line 317: switch(bits) { switch and case should be at the same indent
https://review.coreboot.org/c/coreboot/+/32020/7/src/arch/x86/libx86emu/trac... PS7, Line 317: switch(bits) { space required before the open parenthesis '('
https://review.coreboot.org/c/coreboot/+/32020/7/src/arch/x86/libx86emu/trac... PS7, Line 378: switch(bits) { space required before the open parenthesis '('
https://review.coreboot.org/c/coreboot/+/32020/7/src/arch/x86/libx86emu/trac... PS7, Line 414: switch(bits) { space required before the open parenthesis '('
https://review.coreboot.org/c/coreboot/+/32020/7/src/arch/x86/libx86emu/trac... PS7, Line 457: switch(bits) { space required before the open parenthesis '('
https://review.coreboot.org/c/coreboot/+/32020/7/src/arch/x86/libx86emu/trac... PS7, Line 459: if (addr < 0xcfc) { braces {} are not necessary for any arm of this statement
https://review.coreboot.org/c/coreboot/+/32020/7/src/arch/x86/libx86emu/trac... PS7, Line 466: if (addr < 0xcfc) { braces {} are not necessary for any arm of this statement
https://review.coreboot.org/c/coreboot/+/32020/7/src/arch/x86/libx86emu/trac... PS7, Line 473: if (addr < 0xcfc) { braces {} are not necessary for any arm of this statement
https://review.coreboot.org/c/coreboot/+/32020/7/src/arch/x86/libx86emu/trac... PS7, Line 487: switch(bits) { space required before the open parenthesis '('
https://review.coreboot.org/c/coreboot/+/32020/7/src/arch/x86/libx86emu/trac... PS7, Line 503: if (conf >= PCI_BASE_ADDRESS_0 && conf < (PCI_BASE_ADDRESS_5 + 4) && !(conf & 3)) line over 96 characters
https://review.coreboot.org/c/coreboot/+/32020/7/src/arch/x86/libx86emu/trac... PS7, Line 520: switch(bits) { space required before the open parenthesis '('
https://review.coreboot.org/c/coreboot/+/32020/7/src/arch/x86/libx86emu/trac... PS7, Line 536: if (conf >= PCI_BASE_ADDRESS_0 && conf < (PCI_BASE_ADDRESS_5 + 4) && !(conf & 3)) line over 96 characters
https://review.coreboot.org/c/coreboot/+/32020/7/src/arch/x86/libx86emu/trac... File src/arch/x86/libx86emu/trace-skl.c:
https://review.coreboot.org/c/coreboot/+/32020/7/src/arch/x86/libx86emu/trac... PS7, Line 34: switch (devfn) { switch and case should be at the same indent
https://review.coreboot.org/c/coreboot/+/32020/7/src/arch/x86/libx86emu/trac... PS7, Line 87: devfn >> 3, devfn & 7); code indent should use tabs where possible
https://review.coreboot.org/c/coreboot/+/32020/7/src/arch/x86/libx86emu/trac... PS7, Line 95: if (addr > 0x78000000 && addr < 0x78510000) { braces {} are not necessary for single statement blocks
https://review.coreboot.org/c/coreboot/+/32020/7/src/arch/x86/libx86emu/trac... PS7, Line 129: bool pci_trace_p2sb_r(const int bus, const int devfn, const int off, u32 *val, unsigned int bits) line over 96 characters
https://review.coreboot.org/c/coreboot/+/32020/7/src/arch/x86/libx86emu/trac... PS7, Line 137: switch(bits) { space required before the open parenthesis '('
https://review.coreboot.org/c/coreboot/+/32020/7/src/arch/x86/libx86emu/trac... PS7, Line 139: if (off >= P2SB_CR_SBI_ADDR && off < (P2SB_CR_SBI_ADDR + 4)) { braces {} are not necessary for any arm of this statement
https://review.coreboot.org/c/coreboot/+/32020/7/src/arch/x86/libx86emu/trac... PS7, Line 148: if (off >= P2SB_CR_SBI_ADDR && off < (P2SB_CR_SBI_ADDR + 4)) { braces {} are not necessary for any arm of this statement
https://review.coreboot.org/c/coreboot/+/32020/7/src/arch/x86/libx86emu/trac... PS7, Line 157: if (off >= P2SB_CR_SBI_ADDR && off < (P2SB_CR_SBI_ADDR + 4)) { braces {} are not necessary for any arm of this statement
https://review.coreboot.org/c/coreboot/+/32020/7/src/arch/x86/libx86emu/trac... PS7, Line 167: if (!(sb_data.w & 1) && pending ) { space prohibited before that close parenthesis ')'
https://review.coreboot.org/c/coreboot/+/32020/7/src/arch/x86/libx86emu/trac... PS7, Line 167: if (!(sb_data.w & 1) && pending ) { braces {} are not necessary for single statement blocks
https://review.coreboot.org/c/coreboot/+/32020/7/src/arch/x86/libx86emu/trac... PS7, Line 172: bool pci_trace_p2sb_w(const int bus, const int devfn, const int off, u32 *val, unsigned int bits) line over 96 characters
https://review.coreboot.org/c/coreboot/+/32020/7/src/arch/x86/libx86emu/trac... PS7, Line 180: switch(bits) { space required before the open parenthesis '('
https://review.coreboot.org/c/coreboot/+/32020/7/src/arch/x86/libx86emu/trac... PS7, Line 182: if (off >= P2SB_CR_SBI_ADDR && off < (P2SB_CR_SBI_ADDR + 4)) { braces {} are not necessary for any arm of this statement
https://review.coreboot.org/c/coreboot/+/32020/7/src/arch/x86/libx86emu/trac... PS7, Line 191: if (off >= P2SB_CR_SBI_ADDR && off < (P2SB_CR_SBI_ADDR + 4)) { braces {} are not necessary for any arm of this statement
https://review.coreboot.org/c/coreboot/+/32020/7/src/arch/x86/libx86emu/trac... PS7, Line 200: if (off >= P2SB_CR_SBI_ADDR && off < (P2SB_CR_SBI_ADDR + 4)) { braces {} are not necessary for any arm of this statement
https://review.coreboot.org/c/coreboot/+/32020/7/src/arch/x86/libx86emu/trac... PS7, Line 210: if ((sb_data.w & 1) && !pending ) { space prohibited before that close parenthesis ')'
https://review.coreboot.org/c/coreboot/+/32020/7/src/arch/x86/libx86emu/trac... PS7, Line 210: if ((sb_data.w & 1) && !pending ) { braces {} are not necessary for single statement blocks
https://review.coreboot.org/c/coreboot/+/32020/7/src/arch/x86/libx86emu/trac... File src/arch/x86/libx86emu/trace.c:
https://review.coreboot.org/c/coreboot/+/32020/7/src/arch/x86/libx86emu/trac... PS7, Line 56: addr < ( (uintptr_t)baseptr + size)) { space prohibited after that open parenthesis '('
https://review.coreboot.org/c/coreboot/+/32020/7/src/arch/x86/libx86emu/trac... PS7, Line 62: addr < ((uintptr_t)cbmem_entry_start(ramstage_entry) + (uintptr_t)cbmem_entry_size(ramstage_entry))) { line over 96 characters
https://review.coreboot.org/c/coreboot/+/32020/7/src/arch/x86/libx86emu/trac... PS7, Line 91: void vm_traceio_r(x86emu_t *emu, u32 addr, u32 *val, unsigned type) Prefer 'unsigned int' to bare use of 'unsigned'
https://review.coreboot.org/c/coreboot/+/32020/7/src/arch/x86/libx86emu/trac... PS7, Line 102: for (driver = &_blobolator_drivers[0]; driver != &_eblobolator_drivers[0]; driver++) { line over 96 characters
https://review.coreboot.org/c/coreboot/+/32020/7/src/arch/x86/libx86emu/trac... PS7, Line 107: for (driver = &_blobolator_drivers[0]; driver != &_eblobolator_drivers[0]; driver++) { line over 96 characters
https://review.coreboot.org/c/coreboot/+/32020/7/src/arch/x86/libx86emu/trac... PS7, Line 119: switch(bits) { switch and case should be at the same indent
https://review.coreboot.org/c/coreboot/+/32020/7/src/arch/x86/libx86emu/trac... PS7, Line 119: switch(bits) { space required before the open parenthesis '('
https://review.coreboot.org/c/coreboot/+/32020/7/src/arch/x86/libx86emu/trac... PS7, Line 121: printk(BIOS_DEBUG, " read8(0x%08x) // = 0x%x\n", addr, *val); line over 96 characters
https://review.coreboot.org/c/coreboot/+/32020/7/src/arch/x86/libx86emu/trac... PS7, Line 124: printk(BIOS_DEBUG, " read16(0x%08x) // = 0x%x\n", addr, *val); line over 96 characters
https://review.coreboot.org/c/coreboot/+/32020/7/src/arch/x86/libx86emu/trac... PS7, Line 127: printk(BIOS_DEBUG, " read32(0x%08x) // = 0x%x\n", addr, *val); line over 96 characters
https://review.coreboot.org/c/coreboot/+/32020/7/src/arch/x86/libx86emu/trac... PS7, Line 133: for (driver = &_blobolator_drivers[0]; driver != &_eblobolator_drivers[0]; driver++) { line over 96 characters
https://review.coreboot.org/c/coreboot/+/32020/7/src/arch/x86/libx86emu/trac... PS7, Line 138: for (driver = &_blobolator_drivers[0]; driver != &_eblobolator_drivers[0]; driver++) { line over 96 characters
https://review.coreboot.org/c/coreboot/+/32020/7/src/arch/x86/libx86emu/trac... PS7, Line 150: switch(bits) { switch and case should be at the same indent
https://review.coreboot.org/c/coreboot/+/32020/7/src/arch/x86/libx86emu/trac... PS7, Line 150: switch(bits) { space required before the open parenthesis '('
https://review.coreboot.org/c/coreboot/+/32020/7/src/arch/x86/libx86emu/trac... PS7, Line 152: printk(BIOS_DEBUG, " inb(0x%04x) // = 0x%x\n", addr, *val); line over 96 characters
https://review.coreboot.org/c/coreboot/+/32020/7/src/arch/x86/libx86emu/trac... PS7, Line 155: printk(BIOS_DEBUG, " inw(0x%04x) // = 0x%x\n", addr, *val); line over 96 characters
https://review.coreboot.org/c/coreboot/+/32020/7/src/arch/x86/libx86emu/trac... PS7, Line 158: printk(BIOS_DEBUG, " inl(0x%04x) // = 0x%x\n", addr, *val); line over 96 characters
https://review.coreboot.org/c/coreboot/+/32020/7/src/arch/x86/libx86emu/trac... PS7, Line 166: void vm_traceio_w(x86emu_t *emu, u32 addr, u32 *val, unsigned type) Prefer 'unsigned int' to bare use of 'unsigned'
https://review.coreboot.org/c/coreboot/+/32020/7/src/arch/x86/libx86emu/trac... PS7, Line 168: const unsigned bits = type & 0xff; Prefer 'unsigned int' to bare use of 'unsigned'
https://review.coreboot.org/c/coreboot/+/32020/7/src/arch/x86/libx86emu/trac... PS7, Line 177: for (driver = &_blobolator_drivers[0]; driver != &_eblobolator_drivers[0]; driver++) { line over 96 characters
https://review.coreboot.org/c/coreboot/+/32020/7/src/arch/x86/libx86emu/trac... PS7, Line 182: for (driver = &_blobolator_drivers[0]; driver != &_eblobolator_drivers[0]; driver++) { line over 96 characters
https://review.coreboot.org/c/coreboot/+/32020/7/src/arch/x86/libx86emu/trac... PS7, Line 194: switch(bits) { switch and case should be at the same indent
https://review.coreboot.org/c/coreboot/+/32020/7/src/arch/x86/libx86emu/trac... PS7, Line 194: switch(bits) { space required before the open parenthesis '('
https://review.coreboot.org/c/coreboot/+/32020/7/src/arch/x86/libx86emu/trac... PS7, Line 196: printk(BIOS_DEBUG, " write8(0x%08x, 0x%x)\n", addr, *val); line over 96 characters
https://review.coreboot.org/c/coreboot/+/32020/7/src/arch/x86/libx86emu/trac... PS7, Line 199: printk(BIOS_DEBUG, "write16(0x%08x, 0x%x)\n", addr, *val); line over 96 characters
https://review.coreboot.org/c/coreboot/+/32020/7/src/arch/x86/libx86emu/trac... PS7, Line 202: printk(BIOS_DEBUG, "write32(0x%08x, 0x%x)\n", addr, *val); line over 96 characters
https://review.coreboot.org/c/coreboot/+/32020/7/src/arch/x86/libx86emu/trac... PS7, Line 208: for (driver = &_blobolator_drivers[0]; driver != &_eblobolator_drivers[0]; driver++) { line over 96 characters
https://review.coreboot.org/c/coreboot/+/32020/7/src/arch/x86/libx86emu/trac... PS7, Line 213: for (driver = &_blobolator_drivers[0]; driver != &_eblobolator_drivers[0]; driver++) { line over 96 characters
https://review.coreboot.org/c/coreboot/+/32020/7/src/arch/x86/libx86emu/trac... PS7, Line 225: switch(bits) { switch and case should be at the same indent
https://review.coreboot.org/c/coreboot/+/32020/7/src/arch/x86/libx86emu/trac... PS7, Line 225: switch(bits) { space required before the open parenthesis '('
https://review.coreboot.org/c/coreboot/+/32020/7/src/arch/x86/libx86emu/trac... PS7, Line 227: printk(BIOS_DEBUG, " outb(0x%04x, 0x%x))\n", addr, *val); line over 96 characters
https://review.coreboot.org/c/coreboot/+/32020/7/src/arch/x86/libx86emu/trac... PS7, Line 230: printk(BIOS_DEBUG, " outw(0x%04x, 0x%x)\n", addr, *val); line over 96 characters
https://review.coreboot.org/c/coreboot/+/32020/7/src/arch/x86/libx86emu/trac... PS7, Line 233: printk(BIOS_DEBUG, " outl(0x%04x, 0x%x)\n", addr, *val); line over 96 characters
Hello Julius Werner, Angel Pons, Arthur Heymans, Daniel Maslowski, Christian Walter, Felix Singer, Philipp Deppenwiese, build bot (Jenkins), Nico Huber, Patrick Georgi, Martin Roth,
I'd like you to reexamine a change. Please visit
https://review.coreboot.org/c/coreboot/+/32020
to look at the new patch set (#8).
Change subject: [WIP]x86: Introduce the blobolator ......................................................................
[WIP]x86: Introduce the blobolator
This is a PoC to run arbitrary code and blobs inside an emulated virtual machine using libx86emu, thus the name blobolator.
The libx86emu has been patched to the following: * redirect IO to the host machine it's running on * trace IO * start in protected mode * add mechanism to drop IO access * add Kconfig to debug code it is running
Implemented features: * Run ramstage in libx86emu * Kconfig specific hooks by using _blobolator_drivers (same mechanism as __pci_driver) * PCI decoding and BAR tracing * POST code decoding * Unhandled IO tracing
TODO: * Add support to trace only blobs, not stages. * Improve translation of known IO to human readable format ** COM ** PCI ** APIC ** PIT ** POST
Tested on qemu. Sucessfully run ramstage in blobolator. Tested on X11SSH-TF. Sucessfully run ramstage in blobolator (requires additional libx86emu patches).
Change-Id: I13e47f45e69376d046f35c04363fe3db1cfaa610 Signed-off-by: Patrick Rudolph patrick.rudolph@9elements.com --- M src/Kconfig M src/arch/x86/Makefile.inc M src/arch/x86/boot.c A src/arch/x86/libx86emu/Kconfig.debug A src/arch/x86/libx86emu/Makefile.inc A src/arch/x86/libx86emu/blobolator.c A src/arch/x86/libx86emu/blobolator_internal.h A src/arch/x86/libx86emu/stdarg.h A src/arch/x86/libx86emu/stdio.h A src/arch/x86/libx86emu/time.h A src/arch/x86/libx86emu/trace-bios.c A src/arch/x86/libx86emu/trace-pci.c A src/arch/x86/libx86emu/trace-serial.c A src/arch/x86/libx86emu/trace-skl.c A src/arch/x86/libx86emu/trace.c M src/arch/x86/postcar_loader.c M src/commonlib/include/commonlib/cbmem_id.h A src/include/blobolator.h M src/include/rules.h M src/include/stddef.h M src/lib/Makefile.inc M src/lib/hardwaremain.c M src/lib/program.ld 23 files changed, 2,024 insertions(+), 7 deletions(-)
git pull ssh://review.coreboot.org:29418/coreboot refs/changes/20/32020/8
build bot (Jenkins) has posted comments on this change. ( https://review.coreboot.org/c/coreboot/+/32020 )
Change subject: [WIP]x86: Introduce the blobolator ......................................................................
Patch Set 8:
(145 comments)
https://review.coreboot.org/c/coreboot/+/32020/8/src/arch/x86/libx86emu/Kcon... File src/arch/x86/libx86emu/Kconfig.debug:
https://review.coreboot.org/c/coreboot/+/32020/8/src/arch/x86/libx86emu/Kcon... PS8, Line 21: IO access can be traced, analysed, modified or droped. 'droped' may be misspelled - perhaps 'dropped'?
https://review.coreboot.org/c/coreboot/+/32020/8/src/arch/x86/libx86emu/blob... File src/arch/x86/libx86emu/blobolator.c:
https://review.coreboot.org/c/coreboot/+/32020/8/src/arch/x86/libx86emu/blob... PS8, Line 42: x86emu_mem_t *emu_mem_new(unsigned perm) Prefer 'unsigned int' to bare use of 'unsigned'
https://review.coreboot.org/c/coreboot/+/32020/8/src/arch/x86/libx86emu/blob... PS8, Line 47: void x86emu_set_io_perm(x86emu_t *emu, unsigned start, unsigned end, unsigned perm) Prefer 'unsigned int' to bare use of 'unsigned'
https://review.coreboot.org/c/coreboot/+/32020/8/src/arch/x86/libx86emu/blob... PS8, Line 47: void x86emu_set_io_perm(x86emu_t *emu, unsigned start, unsigned end, unsigned perm) Prefer 'unsigned int' to bare use of 'unsigned'
https://review.coreboot.org/c/coreboot/+/32020/8/src/arch/x86/libx86emu/blob... PS8, Line 47: void x86emu_set_io_perm(x86emu_t *emu, unsigned start, unsigned end, unsigned perm) Prefer 'unsigned int' to bare use of 'unsigned'
https://review.coreboot.org/c/coreboot/+/32020/8/src/arch/x86/libx86emu/blob... PS8, Line 51: unsigned x86emu_read_byte(x86emu_t *emu, unsigned addr) Prefer 'unsigned int' to bare use of 'unsigned'
https://review.coreboot.org/c/coreboot/+/32020/8/src/arch/x86/libx86emu/blob... PS8, Line 51: unsigned x86emu_read_byte(x86emu_t *emu, unsigned addr) Prefer 'unsigned int' to bare use of 'unsigned'
https://review.coreboot.org/c/coreboot/+/32020/8/src/arch/x86/libx86emu/blob... PS8, Line 55: if(emu) space required before the open parenthesis '('
https://review.coreboot.org/c/coreboot/+/32020/8/src/arch/x86/libx86emu/blob... PS8, Line 61: unsigned x86emu_read_byte_noperm(x86emu_t *emu, unsigned addr) Prefer 'unsigned int' to bare use of 'unsigned'
https://review.coreboot.org/c/coreboot/+/32020/8/src/arch/x86/libx86emu/blob... PS8, Line 61: unsigned x86emu_read_byte_noperm(x86emu_t *emu, unsigned addr) Prefer 'unsigned int' to bare use of 'unsigned'
https://review.coreboot.org/c/coreboot/+/32020/8/src/arch/x86/libx86emu/blob... PS8, Line 65: if(emu) space required before the open parenthesis '('
https://review.coreboot.org/c/coreboot/+/32020/8/src/arch/x86/libx86emu/blob... PS8, Line 72: unsigned x86emu_read_word(x86emu_t *emu, unsigned addr) Prefer 'unsigned int' to bare use of 'unsigned'
https://review.coreboot.org/c/coreboot/+/32020/8/src/arch/x86/libx86emu/blob... PS8, Line 72: unsigned x86emu_read_word(x86emu_t *emu, unsigned addr) Prefer 'unsigned int' to bare use of 'unsigned'
https://review.coreboot.org/c/coreboot/+/32020/8/src/arch/x86/libx86emu/blob... PS8, Line 76: if(emu) space required before the open parenthesis '('
https://review.coreboot.org/c/coreboot/+/32020/8/src/arch/x86/libx86emu/blob... PS8, Line 82: unsigned x86emu_read_dword(x86emu_t *emu, unsigned addr) Prefer 'unsigned int' to bare use of 'unsigned'
https://review.coreboot.org/c/coreboot/+/32020/8/src/arch/x86/libx86emu/blob... PS8, Line 82: unsigned x86emu_read_dword(x86emu_t *emu, unsigned addr) Prefer 'unsigned int' to bare use of 'unsigned'
https://review.coreboot.org/c/coreboot/+/32020/8/src/arch/x86/libx86emu/blob... PS8, Line 86: if(emu) space required before the open parenthesis '('
https://review.coreboot.org/c/coreboot/+/32020/8/src/arch/x86/libx86emu/blob... PS8, Line 92: void x86emu_write_byte(x86emu_t *emu, unsigned addr, unsigned val) Prefer 'unsigned int' to bare use of 'unsigned'
https://review.coreboot.org/c/coreboot/+/32020/8/src/arch/x86/libx86emu/blob... PS8, Line 92: void x86emu_write_byte(x86emu_t *emu, unsigned addr, unsigned val) Prefer 'unsigned int' to bare use of 'unsigned'
https://review.coreboot.org/c/coreboot/+/32020/8/src/arch/x86/libx86emu/blob... PS8, Line 96: if(emu) space required before the open parenthesis '('
https://review.coreboot.org/c/coreboot/+/32020/8/src/arch/x86/libx86emu/blob... PS8, Line 100: void x86emu_write_byte_noperm(x86emu_t *emu, unsigned addr, unsigned val) Prefer 'unsigned int' to bare use of 'unsigned'
https://review.coreboot.org/c/coreboot/+/32020/8/src/arch/x86/libx86emu/blob... PS8, Line 100: void x86emu_write_byte_noperm(x86emu_t *emu, unsigned addr, unsigned val) Prefer 'unsigned int' to bare use of 'unsigned'
https://review.coreboot.org/c/coreboot/+/32020/8/src/arch/x86/libx86emu/blob... PS8, Line 104: if(emu) space required before the open parenthesis '('
https://review.coreboot.org/c/coreboot/+/32020/8/src/arch/x86/libx86emu/blob... PS8, Line 109: void x86emu_write_word(x86emu_t *emu, unsigned addr, unsigned val) Prefer 'unsigned int' to bare use of 'unsigned'
https://review.coreboot.org/c/coreboot/+/32020/8/src/arch/x86/libx86emu/blob... PS8, Line 109: void x86emu_write_word(x86emu_t *emu, unsigned addr, unsigned val) Prefer 'unsigned int' to bare use of 'unsigned'
https://review.coreboot.org/c/coreboot/+/32020/8/src/arch/x86/libx86emu/blob... PS8, Line 113: if(emu) space required before the open parenthesis '('
https://review.coreboot.org/c/coreboot/+/32020/8/src/arch/x86/libx86emu/blob... PS8, Line 117: void x86emu_write_dword(x86emu_t *emu, unsigned addr, unsigned val) Prefer 'unsigned int' to bare use of 'unsigned'
https://review.coreboot.org/c/coreboot/+/32020/8/src/arch/x86/libx86emu/blob... PS8, Line 117: void x86emu_write_dword(x86emu_t *emu, unsigned addr, unsigned val) Prefer 'unsigned int' to bare use of 'unsigned'
https://review.coreboot.org/c/coreboot/+/32020/8/src/arch/x86/libx86emu/blob... PS8, Line 121: if(emu) space required before the open parenthesis '('
https://review.coreboot.org/c/coreboot/+/32020/8/src/arch/x86/libx86emu/blob... PS8, Line 125: unsigned x86emu_clear_log(x86emu_t *emu, int flush) Prefer 'unsigned int' to bare use of 'unsigned'
https://review.coreboot.org/c/coreboot/+/32020/8/src/arch/x86/libx86emu/blob... PS8, Line 127: if(flush && emu->log.flush) { space required before the open parenthesis '('
https://review.coreboot.org/c/coreboot/+/32020/8/src/arch/x86/libx86emu/blob... PS8, Line 128: if(emu->log.ptr && emu->log.ptr != emu->log.buf) { space required before the open parenthesis '('
https://review.coreboot.org/c/coreboot/+/32020/8/src/arch/x86/libx86emu/blob... PS8, Line 133: if((emu->log.ptr = emu->log.buf)) *emu->log.ptr = 0; space required before the open parenthesis '('
https://review.coreboot.org/c/coreboot/+/32020/8/src/arch/x86/libx86emu/blob... PS8, Line 133: if((emu->log.ptr = emu->log.buf)) *emu->log.ptr = 0; do not use assignment in if condition
https://review.coreboot.org/c/coreboot/+/32020/8/src/arch/x86/libx86emu/blob... PS8, Line 133: if((emu->log.ptr = emu->log.buf)) *emu->log.ptr = 0; trailing statements should be on next line
https://review.coreboot.org/c/coreboot/+/32020/8/src/arch/x86/libx86emu/blob... PS8, Line 143: memset(x86, 0, sizeof *x86); sizeof *x86 should be sizeof(*x86)
https://review.coreboot.org/c/coreboot/+/32020/8/src/arch/x86/libx86emu/blob... PS8, Line 202: emu->x86.R_EIP, 's', 'O', emu->x86.R_ECX, emu->x86.R_EDX, emu->x86.R_EAX); line over 96 characters
https://review.coreboot.org/c/coreboot/+/32020/8/src/arch/x86/libx86emu/blob... PS8, Line 225: emu->x86.R_EIP, 's', 'I', emu->x86.R_ECX, msr.hi, msr.lo); line over 96 characters
https://review.coreboot.org/c/coreboot/+/32020/8/src/arch/x86/libx86emu/blob... PS8, Line 238: __weak void vm_traceio_w(x86emu_t *emu, u32 addr, u32 *val, unsigned type) Prefer 'unsigned int' to bare use of 'unsigned'
https://review.coreboot.org/c/coreboot/+/32020/8/src/arch/x86/libx86emu/blob... PS8, Line 242: __weak void vm_traceio_r(x86emu_t *emu, u32 addr, u32 *val, unsigned type) Prefer 'unsigned int' to bare use of 'unsigned'
https://review.coreboot.org/c/coreboot/+/32020/8/src/arch/x86/libx86emu/blob... PS8, Line 246: unsigned vm_memio(x86emu_t *emu, u32 addr, u32 *val, unsigned type) Prefer 'unsigned int' to bare use of 'unsigned'
https://review.coreboot.org/c/coreboot/+/32020/8/src/arch/x86/libx86emu/blob... PS8, Line 246: unsigned vm_memio(x86emu_t *emu, u32 addr, u32 *val, unsigned type) Prefer 'unsigned int' to bare use of 'unsigned'
https://review.coreboot.org/c/coreboot/+/32020/8/src/arch/x86/libx86emu/blob... PS8, Line 249: unsigned bits = type & 0xff; Prefer 'unsigned int' to bare use of 'unsigned'
https://review.coreboot.org/c/coreboot/+/32020/8/src/arch/x86/libx86emu/blob... PS8, Line 254: switch(type) { space required before the open parenthesis '('
https://review.coreboot.org/c/coreboot/+/32020/8/src/arch/x86/libx86emu/blob... PS8, Line 256: switch(bits) { space required before the open parenthesis '('
https://review.coreboot.org/c/coreboot/+/32020/8/src/arch/x86/libx86emu/blob... PS8, Line 270: switch(bits) { space required before the open parenthesis '('
https://review.coreboot.org/c/coreboot/+/32020/8/src/arch/x86/libx86emu/blob... PS8, Line 284: switch(bits) { space required before the open parenthesis '('
https://review.coreboot.org/c/coreboot/+/32020/8/src/arch/x86/libx86emu/blob... PS8, Line 299: switch(bits) { space required before the open parenthesis '('
https://review.coreboot.org/c/coreboot/+/32020/8/src/arch/x86/libx86emu/blob... PS8, Line 313: switch(bits) { space required before the open parenthesis '('
https://review.coreboot.org/c/coreboot/+/32020/8/src/arch/x86/libx86emu/blob... PS8, Line 343: static bool x86emu_memio_drop(struct x86emu_s *emu_s, u32 addr, u32 *val, unsigned type) Prefer 'unsigned int' to bare use of 'unsigned'
https://review.coreboot.org/c/coreboot/+/32020/8/src/arch/x86/libx86emu/blob... PS8, Line 345: switch(type) { space required before the open parenthesis '('
https://review.coreboot.org/c/coreboot/+/32020/8/src/arch/x86/libx86emu/blob... PS8, Line 360: static bool x86emu_memio_except(struct x86emu_s *emu_s, u32 addr, u32 *val, unsigned type) Prefer 'unsigned int' to bare use of 'unsigned'
https://review.coreboot.org/c/coreboot/+/32020/8/src/arch/x86/libx86emu/blob... PS8, Line 365: switch(type) { space required before the open parenthesis '('
https://review.coreboot.org/c/coreboot/+/32020/8/src/arch/x86/libx86emu/blob... PS8, Line 397: static unsigned x86emu_memio_handler(struct x86emu_s *emu_s, u32 addr, u32 *val, unsigned type) Prefer 'unsigned int' to bare use of 'unsigned'
https://review.coreboot.org/c/coreboot/+/32020/8/src/arch/x86/libx86emu/blob... PS8, Line 397: static unsigned x86emu_memio_handler(struct x86emu_s *emu_s, u32 addr, u32 *val, unsigned type) Prefer 'unsigned int' to bare use of 'unsigned'
https://review.coreboot.org/c/coreboot/+/32020/8/src/arch/x86/libx86emu/blob... PS8, Line 466: static int x86emu_intr_handler(x86emu_t *emu, u8 num, unsigned type) Prefer 'unsigned int' to bare use of 'unsigned'
https://review.coreboot.org/c/coreboot/+/32020/8/src/arch/x86/libx86emu/blob... PS8, Line 479: vm_memio(emu, emu->x86.R_EIP + i - 16, &val, X86EMU_MEMIO_R|X86EMU_MEMIO_8); line over 96 characters
https://review.coreboot.org/c/coreboot/+/32020/8/src/arch/x86/libx86emu/blob... PS8, Line 492: static void x86emu_flush_log(x86emu_t *emu, char *buf, unsigned size) Prefer 'unsigned int' to bare use of 'unsigned'
https://review.coreboot.org/c/coreboot/+/32020/8/src/arch/x86/libx86emu/blob... PS8, Line 503: unsigned stats_i[X86EMU_IO_PORTS]; Prefer 'unsigned int' to bare use of 'unsigned'
https://review.coreboot.org/c/coreboot/+/32020/8/src/arch/x86/libx86emu/blob... PS8, Line 504: unsigned stats_o[X86EMU_IO_PORTS]; Prefer 'unsigned int' to bare use of 'unsigned'
https://review.coreboot.org/c/coreboot/+/32020/8/src/arch/x86/libx86emu/blob... PS8, Line 509: unsigned def_mem_perm = X86EMU_PERM_X|X86EMU_PERM_W|X86EMU_PERM_R; Prefer 'unsigned int' to bare use of 'unsigned'
https://review.coreboot.org/c/coreboot/+/32020/8/src/arch/x86/libx86emu/blob... PS8, Line 510: unsigned def_io_perm = X86EMU_PERM_X|X86EMU_PERM_W|X86EMU_PERM_R; Prefer 'unsigned int' to bare use of 'unsigned'
https://review.coreboot.org/c/coreboot/+/32020/8/src/arch/x86/libx86emu/blob... File src/arch/x86/libx86emu/blobolator_internal.h:
https://review.coreboot.org/c/coreboot/+/32020/8/src/arch/x86/libx86emu/blob... PS8, Line 18: void vm_traceio_w(x86emu_t *emu, u32 addr, u32 *val, unsigned type); Prefer 'unsigned int' to bare use of 'unsigned'
https://review.coreboot.org/c/coreboot/+/32020/8/src/arch/x86/libx86emu/blob... PS8, Line 19: void vm_traceio_r(x86emu_t *emu, u32 addr, u32 *val, unsigned type); Prefer 'unsigned int' to bare use of 'unsigned'
https://review.coreboot.org/c/coreboot/+/32020/8/src/arch/x86/libx86emu/blob... PS8, Line 25: void (*init)(x86emu_t *emu); code indent should use tabs where possible
https://review.coreboot.org/c/coreboot/+/32020/8/src/arch/x86/libx86emu/blob... PS8, Line 25: void (*init)(x86emu_t *emu); please, no spaces at the start of a line
https://review.coreboot.org/c/coreboot/+/32020/8/src/arch/x86/libx86emu/blob... PS8, Line 26: bool (*ignore_addr_io)(x86emu_t *emu, u32 addr); code indent should use tabs where possible
https://review.coreboot.org/c/coreboot/+/32020/8/src/arch/x86/libx86emu/blob... PS8, Line 26: bool (*ignore_addr_io)(x86emu_t *emu, u32 addr); please, no spaces at the start of a line
https://review.coreboot.org/c/coreboot/+/32020/8/src/arch/x86/libx86emu/blob... PS8, Line 27: bool (*ignore_addr_mem)(x86emu_t *emu, u32 addr); code indent should use tabs where possible
https://review.coreboot.org/c/coreboot/+/32020/8/src/arch/x86/libx86emu/blob... PS8, Line 27: bool (*ignore_addr_mem)(x86emu_t *emu, u32 addr); please, no spaces at the start of a line
https://review.coreboot.org/c/coreboot/+/32020/8/src/arch/x86/libx86emu/trac... File src/arch/x86/libx86emu/trace-bios.c:
https://review.coreboot.org/c/coreboot/+/32020/8/src/arch/x86/libx86emu/trac... PS8, Line 28: if (addr > 0xffffffff - CONFIG_ROM_SIZE) { braces {} are not necessary for single statement blocks
https://review.coreboot.org/c/coreboot/+/32020/8/src/arch/x86/libx86emu/trac... File src/arch/x86/libx86emu/trace-pci.c:
https://review.coreboot.org/c/coreboot/+/32020/8/src/arch/x86/libx86emu/trac... PS8, Line 51: devfn >> 3, devfn & 7); code indent should use tabs where possible
https://review.coreboot.org/c/coreboot/+/32020/8/src/arch/x86/libx86emu/trac... PS8, Line 78: static struct bar_tracer *bar_trace_find(struct device *dev, unsigned int bar, unsigned int type) line over 96 characters
https://review.coreboot.org/c/coreboot/+/32020/8/src/arch/x86/libx86emu/trac... PS8, Line 162: DEVFN_T dev = ((bus << 20)| devfn << 12); need consistent spacing around '|' (ctx:VxW)
https://review.coreboot.org/c/coreboot/+/32020/8/src/arch/x86/libx86emu/trac... PS8, Line 166: if (!dev) { braces {} are not necessary for single statement blocks
https://review.coreboot.org/c/coreboot/+/32020/8/src/arch/x86/libx86emu/trac... PS8, Line 198: while (!(moving & size)) { braces {} are not necessary for single statement blocks
https://review.coreboot.org/c/coreboot/+/32020/8/src/arch/x86/libx86emu/trac... PS8, Line 207: tracer = bar_trace_add(dev_find_slot(bus, devfn), (index - 0x10) / 4, !!(attr & PCI_BASE_ADDRESS_SPACE_IO)); line over 96 characters
https://review.coreboot.org/c/coreboot/+/32020/8/src/arch/x86/libx86emu/trac... PS8, Line 229: switch(bits) { switch and case should be at the same indent
https://review.coreboot.org/c/coreboot/+/32020/8/src/arch/x86/libx86emu/trac... PS8, Line 229: switch(bits) { space required before the open parenthesis '('
https://review.coreboot.org/c/coreboot/+/32020/8/src/arch/x86/libx86emu/trac... PS8, Line 258: switch(bits) { switch and case should be at the same indent
https://review.coreboot.org/c/coreboot/+/32020/8/src/arch/x86/libx86emu/trac... PS8, Line 258: switch(bits) { space required before the open parenthesis '('
https://review.coreboot.org/c/coreboot/+/32020/8/src/arch/x86/libx86emu/trac... PS8, Line 287: switch(bits) { switch and case should be at the same indent
https://review.coreboot.org/c/coreboot/+/32020/8/src/arch/x86/libx86emu/trac... PS8, Line 287: switch(bits) { space required before the open parenthesis '('
https://review.coreboot.org/c/coreboot/+/32020/8/src/arch/x86/libx86emu/trac... PS8, Line 317: switch(bits) { switch and case should be at the same indent
https://review.coreboot.org/c/coreboot/+/32020/8/src/arch/x86/libx86emu/trac... PS8, Line 317: switch(bits) { space required before the open parenthesis '('
https://review.coreboot.org/c/coreboot/+/32020/8/src/arch/x86/libx86emu/trac... PS8, Line 378: switch(bits) { space required before the open parenthesis '('
https://review.coreboot.org/c/coreboot/+/32020/8/src/arch/x86/libx86emu/trac... PS8, Line 414: switch(bits) { space required before the open parenthesis '('
https://review.coreboot.org/c/coreboot/+/32020/8/src/arch/x86/libx86emu/trac... PS8, Line 457: switch(bits) { space required before the open parenthesis '('
https://review.coreboot.org/c/coreboot/+/32020/8/src/arch/x86/libx86emu/trac... PS8, Line 459: if (addr < 0xcfc) { braces {} are not necessary for any arm of this statement
https://review.coreboot.org/c/coreboot/+/32020/8/src/arch/x86/libx86emu/trac... PS8, Line 466: if (addr < 0xcfc) { braces {} are not necessary for any arm of this statement
https://review.coreboot.org/c/coreboot/+/32020/8/src/arch/x86/libx86emu/trac... PS8, Line 473: if (addr < 0xcfc) { braces {} are not necessary for any arm of this statement
https://review.coreboot.org/c/coreboot/+/32020/8/src/arch/x86/libx86emu/trac... PS8, Line 487: switch(bits) { space required before the open parenthesis '('
https://review.coreboot.org/c/coreboot/+/32020/8/src/arch/x86/libx86emu/trac... PS8, Line 503: if (conf >= PCI_BASE_ADDRESS_0 && conf < (PCI_BASE_ADDRESS_5 + 4) && !(conf & 3)) line over 96 characters
https://review.coreboot.org/c/coreboot/+/32020/8/src/arch/x86/libx86emu/trac... PS8, Line 520: switch(bits) { space required before the open parenthesis '('
https://review.coreboot.org/c/coreboot/+/32020/8/src/arch/x86/libx86emu/trac... PS8, Line 536: if (conf >= PCI_BASE_ADDRESS_0 && conf < (PCI_BASE_ADDRESS_5 + 4) && !(conf & 3)) line over 96 characters
https://review.coreboot.org/c/coreboot/+/32020/8/src/arch/x86/libx86emu/trac... File src/arch/x86/libx86emu/trace-skl.c:
https://review.coreboot.org/c/coreboot/+/32020/8/src/arch/x86/libx86emu/trac... PS8, Line 34: switch (devfn) { switch and case should be at the same indent
https://review.coreboot.org/c/coreboot/+/32020/8/src/arch/x86/libx86emu/trac... PS8, Line 87: devfn >> 3, devfn & 7); code indent should use tabs where possible
https://review.coreboot.org/c/coreboot/+/32020/8/src/arch/x86/libx86emu/trac... PS8, Line 95: if (addr > 0x78000000 && addr < 0x78510000) { braces {} are not necessary for single statement blocks
https://review.coreboot.org/c/coreboot/+/32020/8/src/arch/x86/libx86emu/trac... PS8, Line 129: bool pci_trace_p2sb_r(const int bus, const int devfn, const int off, u32 *val, unsigned int bits) line over 96 characters
https://review.coreboot.org/c/coreboot/+/32020/8/src/arch/x86/libx86emu/trac... PS8, Line 137: switch(bits) { space required before the open parenthesis '('
https://review.coreboot.org/c/coreboot/+/32020/8/src/arch/x86/libx86emu/trac... PS8, Line 139: if (off >= P2SB_CR_SBI_ADDR && off < (P2SB_CR_SBI_ADDR + 4)) { braces {} are not necessary for any arm of this statement
https://review.coreboot.org/c/coreboot/+/32020/8/src/arch/x86/libx86emu/trac... PS8, Line 148: if (off >= P2SB_CR_SBI_ADDR && off < (P2SB_CR_SBI_ADDR + 4)) { braces {} are not necessary for any arm of this statement
https://review.coreboot.org/c/coreboot/+/32020/8/src/arch/x86/libx86emu/trac... PS8, Line 157: if (off >= P2SB_CR_SBI_ADDR && off < (P2SB_CR_SBI_ADDR + 4)) { braces {} are not necessary for any arm of this statement
https://review.coreboot.org/c/coreboot/+/32020/8/src/arch/x86/libx86emu/trac... PS8, Line 167: if (!(sb_data.w & 1) && pending ) { space prohibited before that close parenthesis ')'
https://review.coreboot.org/c/coreboot/+/32020/8/src/arch/x86/libx86emu/trac... PS8, Line 167: if (!(sb_data.w & 1) && pending ) { braces {} are not necessary for single statement blocks
https://review.coreboot.org/c/coreboot/+/32020/8/src/arch/x86/libx86emu/trac... PS8, Line 172: bool pci_trace_p2sb_w(const int bus, const int devfn, const int off, u32 *val, unsigned int bits) line over 96 characters
https://review.coreboot.org/c/coreboot/+/32020/8/src/arch/x86/libx86emu/trac... PS8, Line 180: switch(bits) { space required before the open parenthesis '('
https://review.coreboot.org/c/coreboot/+/32020/8/src/arch/x86/libx86emu/trac... PS8, Line 182: if (off >= P2SB_CR_SBI_ADDR && off < (P2SB_CR_SBI_ADDR + 4)) { braces {} are not necessary for any arm of this statement
https://review.coreboot.org/c/coreboot/+/32020/8/src/arch/x86/libx86emu/trac... PS8, Line 191: if (off >= P2SB_CR_SBI_ADDR && off < (P2SB_CR_SBI_ADDR + 4)) { braces {} are not necessary for any arm of this statement
https://review.coreboot.org/c/coreboot/+/32020/8/src/arch/x86/libx86emu/trac... PS8, Line 200: if (off >= P2SB_CR_SBI_ADDR && off < (P2SB_CR_SBI_ADDR + 4)) { braces {} are not necessary for any arm of this statement
https://review.coreboot.org/c/coreboot/+/32020/8/src/arch/x86/libx86emu/trac... PS8, Line 210: if ((sb_data.w & 1) && !pending ) { space prohibited before that close parenthesis ')'
https://review.coreboot.org/c/coreboot/+/32020/8/src/arch/x86/libx86emu/trac... PS8, Line 210: if ((sb_data.w & 1) && !pending ) { braces {} are not necessary for single statement blocks
https://review.coreboot.org/c/coreboot/+/32020/8/src/arch/x86/libx86emu/trac... File src/arch/x86/libx86emu/trace.c:
https://review.coreboot.org/c/coreboot/+/32020/8/src/arch/x86/libx86emu/trac... PS8, Line 56: addr < ( (uintptr_t)baseptr + size)) { space prohibited after that open parenthesis '('
https://review.coreboot.org/c/coreboot/+/32020/8/src/arch/x86/libx86emu/trac... PS8, Line 62: addr < ((uintptr_t)cbmem_entry_start(ramstage_entry) + (uintptr_t)cbmem_entry_size(ramstage_entry))) { line over 96 characters
https://review.coreboot.org/c/coreboot/+/32020/8/src/arch/x86/libx86emu/trac... PS8, Line 91: void vm_traceio_r(x86emu_t *emu, u32 addr, u32 *val, unsigned type) Prefer 'unsigned int' to bare use of 'unsigned'
https://review.coreboot.org/c/coreboot/+/32020/8/src/arch/x86/libx86emu/trac... PS8, Line 102: for (driver = &_blobolator_drivers[0]; driver != &_eblobolator_drivers[0]; driver++) { line over 96 characters
https://review.coreboot.org/c/coreboot/+/32020/8/src/arch/x86/libx86emu/trac... PS8, Line 107: for (driver = &_blobolator_drivers[0]; driver != &_eblobolator_drivers[0]; driver++) { line over 96 characters
https://review.coreboot.org/c/coreboot/+/32020/8/src/arch/x86/libx86emu/trac... PS8, Line 119: switch(bits) { switch and case should be at the same indent
https://review.coreboot.org/c/coreboot/+/32020/8/src/arch/x86/libx86emu/trac... PS8, Line 119: switch(bits) { space required before the open parenthesis '('
https://review.coreboot.org/c/coreboot/+/32020/8/src/arch/x86/libx86emu/trac... PS8, Line 121: printk(BIOS_DEBUG, " read8(0x%08x) // = 0x%x\n", addr, *val); line over 96 characters
https://review.coreboot.org/c/coreboot/+/32020/8/src/arch/x86/libx86emu/trac... PS8, Line 124: printk(BIOS_DEBUG, " read16(0x%08x) // = 0x%x\n", addr, *val); line over 96 characters
https://review.coreboot.org/c/coreboot/+/32020/8/src/arch/x86/libx86emu/trac... PS8, Line 127: printk(BIOS_DEBUG, " read32(0x%08x) // = 0x%x\n", addr, *val); line over 96 characters
https://review.coreboot.org/c/coreboot/+/32020/8/src/arch/x86/libx86emu/trac... PS8, Line 133: for (driver = &_blobolator_drivers[0]; driver != &_eblobolator_drivers[0]; driver++) { line over 96 characters
https://review.coreboot.org/c/coreboot/+/32020/8/src/arch/x86/libx86emu/trac... PS8, Line 138: for (driver = &_blobolator_drivers[0]; driver != &_eblobolator_drivers[0]; driver++) { line over 96 characters
https://review.coreboot.org/c/coreboot/+/32020/8/src/arch/x86/libx86emu/trac... PS8, Line 150: switch(bits) { switch and case should be at the same indent
https://review.coreboot.org/c/coreboot/+/32020/8/src/arch/x86/libx86emu/trac... PS8, Line 150: switch(bits) { space required before the open parenthesis '('
https://review.coreboot.org/c/coreboot/+/32020/8/src/arch/x86/libx86emu/trac... PS8, Line 152: printk(BIOS_DEBUG, " inb(0x%04x) // = 0x%x\n", addr, *val); line over 96 characters
https://review.coreboot.org/c/coreboot/+/32020/8/src/arch/x86/libx86emu/trac... PS8, Line 155: printk(BIOS_DEBUG, " inw(0x%04x) // = 0x%x\n", addr, *val); line over 96 characters
https://review.coreboot.org/c/coreboot/+/32020/8/src/arch/x86/libx86emu/trac... PS8, Line 158: printk(BIOS_DEBUG, " inl(0x%04x) // = 0x%x\n", addr, *val); line over 96 characters
https://review.coreboot.org/c/coreboot/+/32020/8/src/arch/x86/libx86emu/trac... PS8, Line 166: void vm_traceio_w(x86emu_t *emu, u32 addr, u32 *val, unsigned type) Prefer 'unsigned int' to bare use of 'unsigned'
https://review.coreboot.org/c/coreboot/+/32020/8/src/arch/x86/libx86emu/trac... PS8, Line 168: const unsigned bits = type & 0xff; Prefer 'unsigned int' to bare use of 'unsigned'
https://review.coreboot.org/c/coreboot/+/32020/8/src/arch/x86/libx86emu/trac... PS8, Line 177: for (driver = &_blobolator_drivers[0]; driver != &_eblobolator_drivers[0]; driver++) { line over 96 characters
https://review.coreboot.org/c/coreboot/+/32020/8/src/arch/x86/libx86emu/trac... PS8, Line 182: for (driver = &_blobolator_drivers[0]; driver != &_eblobolator_drivers[0]; driver++) { line over 96 characters
https://review.coreboot.org/c/coreboot/+/32020/8/src/arch/x86/libx86emu/trac... PS8, Line 194: switch(bits) { switch and case should be at the same indent
https://review.coreboot.org/c/coreboot/+/32020/8/src/arch/x86/libx86emu/trac... PS8, Line 194: switch(bits) { space required before the open parenthesis '('
https://review.coreboot.org/c/coreboot/+/32020/8/src/arch/x86/libx86emu/trac... PS8, Line 196: printk(BIOS_DEBUG, " write8(0x%08x, 0x%x)\n", addr, *val); line over 96 characters
https://review.coreboot.org/c/coreboot/+/32020/8/src/arch/x86/libx86emu/trac... PS8, Line 199: printk(BIOS_DEBUG, "write16(0x%08x, 0x%x)\n", addr, *val); line over 96 characters
https://review.coreboot.org/c/coreboot/+/32020/8/src/arch/x86/libx86emu/trac... PS8, Line 202: printk(BIOS_DEBUG, "write32(0x%08x, 0x%x)\n", addr, *val); line over 96 characters
https://review.coreboot.org/c/coreboot/+/32020/8/src/arch/x86/libx86emu/trac... PS8, Line 208: for (driver = &_blobolator_drivers[0]; driver != &_eblobolator_drivers[0]; driver++) { line over 96 characters
https://review.coreboot.org/c/coreboot/+/32020/8/src/arch/x86/libx86emu/trac... PS8, Line 213: for (driver = &_blobolator_drivers[0]; driver != &_eblobolator_drivers[0]; driver++) { line over 96 characters
https://review.coreboot.org/c/coreboot/+/32020/8/src/arch/x86/libx86emu/trac... PS8, Line 225: switch(bits) { switch and case should be at the same indent
https://review.coreboot.org/c/coreboot/+/32020/8/src/arch/x86/libx86emu/trac... PS8, Line 225: switch(bits) { space required before the open parenthesis '('
https://review.coreboot.org/c/coreboot/+/32020/8/src/arch/x86/libx86emu/trac... PS8, Line 227: printk(BIOS_DEBUG, " outb(0x%04x, 0x%x))\n", addr, *val); line over 96 characters
https://review.coreboot.org/c/coreboot/+/32020/8/src/arch/x86/libx86emu/trac... PS8, Line 230: printk(BIOS_DEBUG, " outw(0x%04x, 0x%x)\n", addr, *val); line over 96 characters
https://review.coreboot.org/c/coreboot/+/32020/8/src/arch/x86/libx86emu/trac... PS8, Line 233: printk(BIOS_DEBUG, " outl(0x%04x, 0x%x)\n", addr, *val); line over 96 characters
Hello Julius Werner, Angel Pons, Arthur Heymans, Daniel Maslowski, Christian Walter, Felix Singer, Philipp Deppenwiese, build bot (Jenkins), Nico Huber, Patrick Georgi, Martin Roth,
I'd like you to reexamine a change. Please visit
https://review.coreboot.org/c/coreboot/+/32020
to look at the new patch set (#9).
Change subject: [WIP]x86: Introduce the blobolator ......................................................................
[WIP]x86: Introduce the blobolator
This is a PoC to run arbitrary code and blobs inside an emulated virtual machine using libx86emu, thus the name blobolator.
The libx86emu has been patched to the following: * redirect IO to the host machine it's running on * trace IO * start in protected mode * add mechanism to drop IO access * add Kconfig to debug code it is running
Implemented features: * Run ramstage in libx86emu * Kconfig specific hooks by using _blobolator_drivers (same mechanism as __pci_driver) * PCI decoding and BAR tracing * POST code decoding * Unhandled IO tracing * Added test code in qemu emulation/q35
TODO: * Add support to trace only blobs, not stages. * Improve translation of known IO to human readable format ** COM ** PCI ** APIC ** PIT ** POST
Tested on qemu. Sucessfully run ramstage in blobolator. Tested on X11SSH-TF. Sucessfully run ramstage in blobolator (requires additional libx86emu patches).
Change-Id: I13e47f45e69376d046f35c04363fe3db1cfaa610 Signed-off-by: Patrick Rudolph patrick.rudolph@9elements.com --- M src/Kconfig M src/arch/x86/Makefile.inc M src/arch/x86/boot.c A src/arch/x86/libx86emu/Kconfig.debug A src/arch/x86/libx86emu/Makefile.inc A src/arch/x86/libx86emu/blobolator.c A src/arch/x86/libx86emu/blobolator_internal.h A src/arch/x86/libx86emu/stdarg.h A src/arch/x86/libx86emu/stdio.h A src/arch/x86/libx86emu/time.h A src/arch/x86/libx86emu/trace-bios.c A src/arch/x86/libx86emu/trace-pci.c A src/arch/x86/libx86emu/trace-serial.c A src/arch/x86/libx86emu/trace-skl.c A src/arch/x86/libx86emu/trace.c M src/arch/x86/postcar_loader.c M src/commonlib/include/commonlib/cbmem_id.h A src/include/blobolator.h M src/include/rules.h M src/include/stddef.h M src/lib/Makefile.inc M src/lib/hardwaremain.c M src/lib/program.ld M src/mainboard/emulation/qemu-q35/mainboard.c 24 files changed, 2,065 insertions(+), 7 deletions(-)
git pull ssh://review.coreboot.org:29418/coreboot refs/changes/20/32020/9
build bot (Jenkins) has posted comments on this change. ( https://review.coreboot.org/c/coreboot/+/32020 )
Change subject: [WIP]x86: Introduce the blobolator ......................................................................
Patch Set 9:
(150 comments)
https://review.coreboot.org/c/coreboot/+/32020/9/src/arch/x86/libx86emu/Kcon... File src/arch/x86/libx86emu/Kconfig.debug:
https://review.coreboot.org/c/coreboot/+/32020/9/src/arch/x86/libx86emu/Kcon... PS9, Line 21: IO access can be traced, analysed, modified or droped. 'droped' may be misspelled - perhaps 'dropped'?
https://review.coreboot.org/c/coreboot/+/32020/9/src/arch/x86/libx86emu/blob... File src/arch/x86/libx86emu/blobolator.c:
https://review.coreboot.org/c/coreboot/+/32020/9/src/arch/x86/libx86emu/blob... PS9, Line 42: x86emu_mem_t *emu_mem_new(unsigned perm) Prefer 'unsigned int' to bare use of 'unsigned'
https://review.coreboot.org/c/coreboot/+/32020/9/src/arch/x86/libx86emu/blob... PS9, Line 47: void x86emu_set_io_perm(x86emu_t *emu, unsigned start, unsigned end, unsigned perm) Prefer 'unsigned int' to bare use of 'unsigned'
https://review.coreboot.org/c/coreboot/+/32020/9/src/arch/x86/libx86emu/blob... PS9, Line 47: void x86emu_set_io_perm(x86emu_t *emu, unsigned start, unsigned end, unsigned perm) Prefer 'unsigned int' to bare use of 'unsigned'
https://review.coreboot.org/c/coreboot/+/32020/9/src/arch/x86/libx86emu/blob... PS9, Line 47: void x86emu_set_io_perm(x86emu_t *emu, unsigned start, unsigned end, unsigned perm) Prefer 'unsigned int' to bare use of 'unsigned'
https://review.coreboot.org/c/coreboot/+/32020/9/src/arch/x86/libx86emu/blob... PS9, Line 51: unsigned x86emu_read_byte(x86emu_t *emu, unsigned addr) Prefer 'unsigned int' to bare use of 'unsigned'
https://review.coreboot.org/c/coreboot/+/32020/9/src/arch/x86/libx86emu/blob... PS9, Line 51: unsigned x86emu_read_byte(x86emu_t *emu, unsigned addr) Prefer 'unsigned int' to bare use of 'unsigned'
https://review.coreboot.org/c/coreboot/+/32020/9/src/arch/x86/libx86emu/blob... PS9, Line 55: if(emu) space required before the open parenthesis '('
https://review.coreboot.org/c/coreboot/+/32020/9/src/arch/x86/libx86emu/blob... PS9, Line 61: unsigned x86emu_read_byte_noperm(x86emu_t *emu, unsigned addr) Prefer 'unsigned int' to bare use of 'unsigned'
https://review.coreboot.org/c/coreboot/+/32020/9/src/arch/x86/libx86emu/blob... PS9, Line 61: unsigned x86emu_read_byte_noperm(x86emu_t *emu, unsigned addr) Prefer 'unsigned int' to bare use of 'unsigned'
https://review.coreboot.org/c/coreboot/+/32020/9/src/arch/x86/libx86emu/blob... PS9, Line 65: if(emu) space required before the open parenthesis '('
https://review.coreboot.org/c/coreboot/+/32020/9/src/arch/x86/libx86emu/blob... PS9, Line 72: unsigned x86emu_read_word(x86emu_t *emu, unsigned addr) Prefer 'unsigned int' to bare use of 'unsigned'
https://review.coreboot.org/c/coreboot/+/32020/9/src/arch/x86/libx86emu/blob... PS9, Line 72: unsigned x86emu_read_word(x86emu_t *emu, unsigned addr) Prefer 'unsigned int' to bare use of 'unsigned'
https://review.coreboot.org/c/coreboot/+/32020/9/src/arch/x86/libx86emu/blob... PS9, Line 76: if(emu) space required before the open parenthesis '('
https://review.coreboot.org/c/coreboot/+/32020/9/src/arch/x86/libx86emu/blob... PS9, Line 82: unsigned x86emu_read_dword(x86emu_t *emu, unsigned addr) Prefer 'unsigned int' to bare use of 'unsigned'
https://review.coreboot.org/c/coreboot/+/32020/9/src/arch/x86/libx86emu/blob... PS9, Line 82: unsigned x86emu_read_dword(x86emu_t *emu, unsigned addr) Prefer 'unsigned int' to bare use of 'unsigned'
https://review.coreboot.org/c/coreboot/+/32020/9/src/arch/x86/libx86emu/blob... PS9, Line 86: if(emu) space required before the open parenthesis '('
https://review.coreboot.org/c/coreboot/+/32020/9/src/arch/x86/libx86emu/blob... PS9, Line 92: void x86emu_write_byte(x86emu_t *emu, unsigned addr, unsigned val) Prefer 'unsigned int' to bare use of 'unsigned'
https://review.coreboot.org/c/coreboot/+/32020/9/src/arch/x86/libx86emu/blob... PS9, Line 92: void x86emu_write_byte(x86emu_t *emu, unsigned addr, unsigned val) Prefer 'unsigned int' to bare use of 'unsigned'
https://review.coreboot.org/c/coreboot/+/32020/9/src/arch/x86/libx86emu/blob... PS9, Line 96: if(emu) space required before the open parenthesis '('
https://review.coreboot.org/c/coreboot/+/32020/9/src/arch/x86/libx86emu/blob... PS9, Line 100: void x86emu_write_byte_noperm(x86emu_t *emu, unsigned addr, unsigned val) Prefer 'unsigned int' to bare use of 'unsigned'
https://review.coreboot.org/c/coreboot/+/32020/9/src/arch/x86/libx86emu/blob... PS9, Line 100: void x86emu_write_byte_noperm(x86emu_t *emu, unsigned addr, unsigned val) Prefer 'unsigned int' to bare use of 'unsigned'
https://review.coreboot.org/c/coreboot/+/32020/9/src/arch/x86/libx86emu/blob... PS9, Line 104: if(emu) space required before the open parenthesis '('
https://review.coreboot.org/c/coreboot/+/32020/9/src/arch/x86/libx86emu/blob... PS9, Line 109: void x86emu_write_word(x86emu_t *emu, unsigned addr, unsigned val) Prefer 'unsigned int' to bare use of 'unsigned'
https://review.coreboot.org/c/coreboot/+/32020/9/src/arch/x86/libx86emu/blob... PS9, Line 109: void x86emu_write_word(x86emu_t *emu, unsigned addr, unsigned val) Prefer 'unsigned int' to bare use of 'unsigned'
https://review.coreboot.org/c/coreboot/+/32020/9/src/arch/x86/libx86emu/blob... PS9, Line 113: if(emu) space required before the open parenthesis '('
https://review.coreboot.org/c/coreboot/+/32020/9/src/arch/x86/libx86emu/blob... PS9, Line 117: void x86emu_write_dword(x86emu_t *emu, unsigned addr, unsigned val) Prefer 'unsigned int' to bare use of 'unsigned'
https://review.coreboot.org/c/coreboot/+/32020/9/src/arch/x86/libx86emu/blob... PS9, Line 117: void x86emu_write_dword(x86emu_t *emu, unsigned addr, unsigned val) Prefer 'unsigned int' to bare use of 'unsigned'
https://review.coreboot.org/c/coreboot/+/32020/9/src/arch/x86/libx86emu/blob... PS9, Line 121: if(emu) space required before the open parenthesis '('
https://review.coreboot.org/c/coreboot/+/32020/9/src/arch/x86/libx86emu/blob... PS9, Line 125: unsigned x86emu_clear_log(x86emu_t *emu, int flush) Prefer 'unsigned int' to bare use of 'unsigned'
https://review.coreboot.org/c/coreboot/+/32020/9/src/arch/x86/libx86emu/blob... PS9, Line 127: if(flush && emu->log.flush) { space required before the open parenthesis '('
https://review.coreboot.org/c/coreboot/+/32020/9/src/arch/x86/libx86emu/blob... PS9, Line 128: if(emu->log.ptr && emu->log.ptr != emu->log.buf) { space required before the open parenthesis '('
https://review.coreboot.org/c/coreboot/+/32020/9/src/arch/x86/libx86emu/blob... PS9, Line 133: if((emu->log.ptr = emu->log.buf)) *emu->log.ptr = 0; space required before the open parenthesis '('
https://review.coreboot.org/c/coreboot/+/32020/9/src/arch/x86/libx86emu/blob... PS9, Line 133: if((emu->log.ptr = emu->log.buf)) *emu->log.ptr = 0; do not use assignment in if condition
https://review.coreboot.org/c/coreboot/+/32020/9/src/arch/x86/libx86emu/blob... PS9, Line 133: if((emu->log.ptr = emu->log.buf)) *emu->log.ptr = 0; trailing statements should be on next line
https://review.coreboot.org/c/coreboot/+/32020/9/src/arch/x86/libx86emu/blob... PS9, Line 143: memset(x86, 0, sizeof *x86); sizeof *x86 should be sizeof(*x86)
https://review.coreboot.org/c/coreboot/+/32020/9/src/arch/x86/libx86emu/blob... PS9, Line 202: emu->x86.R_EIP, 's', 'O', emu->x86.R_ECX, emu->x86.R_EDX, emu->x86.R_EAX); line over 96 characters
https://review.coreboot.org/c/coreboot/+/32020/9/src/arch/x86/libx86emu/blob... PS9, Line 225: emu->x86.R_EIP, 's', 'I', emu->x86.R_ECX, msr.hi, msr.lo); line over 96 characters
https://review.coreboot.org/c/coreboot/+/32020/9/src/arch/x86/libx86emu/blob... PS9, Line 238: __weak void vm_traceio_w(x86emu_t *emu, u32 addr, u32 *val, unsigned type) Prefer 'unsigned int' to bare use of 'unsigned'
https://review.coreboot.org/c/coreboot/+/32020/9/src/arch/x86/libx86emu/blob... PS9, Line 242: __weak void vm_traceio_r(x86emu_t *emu, u32 addr, u32 *val, unsigned type) Prefer 'unsigned int' to bare use of 'unsigned'
https://review.coreboot.org/c/coreboot/+/32020/9/src/arch/x86/libx86emu/blob... PS9, Line 246: unsigned vm_memio(x86emu_t *emu, u32 addr, u32 *val, unsigned type) Prefer 'unsigned int' to bare use of 'unsigned'
https://review.coreboot.org/c/coreboot/+/32020/9/src/arch/x86/libx86emu/blob... PS9, Line 246: unsigned vm_memio(x86emu_t *emu, u32 addr, u32 *val, unsigned type) Prefer 'unsigned int' to bare use of 'unsigned'
https://review.coreboot.org/c/coreboot/+/32020/9/src/arch/x86/libx86emu/blob... PS9, Line 249: unsigned bits = type & 0xff; Prefer 'unsigned int' to bare use of 'unsigned'
https://review.coreboot.org/c/coreboot/+/32020/9/src/arch/x86/libx86emu/blob... PS9, Line 254: switch(type) { space required before the open parenthesis '('
https://review.coreboot.org/c/coreboot/+/32020/9/src/arch/x86/libx86emu/blob... PS9, Line 256: switch(bits) { space required before the open parenthesis '('
https://review.coreboot.org/c/coreboot/+/32020/9/src/arch/x86/libx86emu/blob... PS9, Line 270: switch(bits) { space required before the open parenthesis '('
https://review.coreboot.org/c/coreboot/+/32020/9/src/arch/x86/libx86emu/blob... PS9, Line 284: switch(bits) { space required before the open parenthesis '('
https://review.coreboot.org/c/coreboot/+/32020/9/src/arch/x86/libx86emu/blob... PS9, Line 299: switch(bits) { space required before the open parenthesis '('
https://review.coreboot.org/c/coreboot/+/32020/9/src/arch/x86/libx86emu/blob... PS9, Line 313: switch(bits) { space required before the open parenthesis '('
https://review.coreboot.org/c/coreboot/+/32020/9/src/arch/x86/libx86emu/blob... PS9, Line 343: static bool x86emu_memio_drop(struct x86emu_s *emu_s, u32 addr, u32 *val, unsigned type) Prefer 'unsigned int' to bare use of 'unsigned'
https://review.coreboot.org/c/coreboot/+/32020/9/src/arch/x86/libx86emu/blob... PS9, Line 345: switch(type) { space required before the open parenthesis '('
https://review.coreboot.org/c/coreboot/+/32020/9/src/arch/x86/libx86emu/blob... PS9, Line 360: static bool x86emu_memio_except(struct x86emu_s *emu_s, u32 addr, u32 *val, unsigned type) Prefer 'unsigned int' to bare use of 'unsigned'
https://review.coreboot.org/c/coreboot/+/32020/9/src/arch/x86/libx86emu/blob... PS9, Line 365: switch(type) { space required before the open parenthesis '('
https://review.coreboot.org/c/coreboot/+/32020/9/src/arch/x86/libx86emu/blob... PS9, Line 397: static unsigned x86emu_memio_handler(struct x86emu_s *emu_s, u32 addr, u32 *val, unsigned type) Prefer 'unsigned int' to bare use of 'unsigned'
https://review.coreboot.org/c/coreboot/+/32020/9/src/arch/x86/libx86emu/blob... PS9, Line 397: static unsigned x86emu_memio_handler(struct x86emu_s *emu_s, u32 addr, u32 *val, unsigned type) Prefer 'unsigned int' to bare use of 'unsigned'
https://review.coreboot.org/c/coreboot/+/32020/9/src/arch/x86/libx86emu/blob... PS9, Line 466: static int x86emu_intr_handler(x86emu_t *emu, u8 num, unsigned type) Prefer 'unsigned int' to bare use of 'unsigned'
https://review.coreboot.org/c/coreboot/+/32020/9/src/arch/x86/libx86emu/blob... PS9, Line 479: vm_memio(emu, emu->x86.R_EIP + i - 16, &val, X86EMU_MEMIO_R|X86EMU_MEMIO_8); line over 96 characters
https://review.coreboot.org/c/coreboot/+/32020/9/src/arch/x86/libx86emu/blob... PS9, Line 492: static void x86emu_flush_log(x86emu_t *emu, char *buf, unsigned size) Prefer 'unsigned int' to bare use of 'unsigned'
https://review.coreboot.org/c/coreboot/+/32020/9/src/arch/x86/libx86emu/blob... PS9, Line 503: unsigned stats_i[X86EMU_IO_PORTS]; Prefer 'unsigned int' to bare use of 'unsigned'
https://review.coreboot.org/c/coreboot/+/32020/9/src/arch/x86/libx86emu/blob... PS9, Line 504: unsigned stats_o[X86EMU_IO_PORTS]; Prefer 'unsigned int' to bare use of 'unsigned'
https://review.coreboot.org/c/coreboot/+/32020/9/src/arch/x86/libx86emu/blob... PS9, Line 509: unsigned def_mem_perm = X86EMU_PERM_X|X86EMU_PERM_W|X86EMU_PERM_R; Prefer 'unsigned int' to bare use of 'unsigned'
https://review.coreboot.org/c/coreboot/+/32020/9/src/arch/x86/libx86emu/blob... PS9, Line 510: unsigned def_io_perm = X86EMU_PERM_X|X86EMU_PERM_W|X86EMU_PERM_R; Prefer 'unsigned int' to bare use of 'unsigned'
https://review.coreboot.org/c/coreboot/+/32020/9/src/arch/x86/libx86emu/blob... File src/arch/x86/libx86emu/blobolator_internal.h:
https://review.coreboot.org/c/coreboot/+/32020/9/src/arch/x86/libx86emu/blob... PS9, Line 18: void vm_traceio_w(x86emu_t *emu, u32 addr, u32 *val, unsigned type); Prefer 'unsigned int' to bare use of 'unsigned'
https://review.coreboot.org/c/coreboot/+/32020/9/src/arch/x86/libx86emu/blob... PS9, Line 19: void vm_traceio_r(x86emu_t *emu, u32 addr, u32 *val, unsigned type); Prefer 'unsigned int' to bare use of 'unsigned'
https://review.coreboot.org/c/coreboot/+/32020/9/src/arch/x86/libx86emu/blob... PS9, Line 25: void (*init)(x86emu_t *emu); code indent should use tabs where possible
https://review.coreboot.org/c/coreboot/+/32020/9/src/arch/x86/libx86emu/blob... PS9, Line 25: void (*init)(x86emu_t *emu); please, no spaces at the start of a line
https://review.coreboot.org/c/coreboot/+/32020/9/src/arch/x86/libx86emu/blob... PS9, Line 26: bool (*ignore_addr_io)(x86emu_t *emu, u32 addr); code indent should use tabs where possible
https://review.coreboot.org/c/coreboot/+/32020/9/src/arch/x86/libx86emu/blob... PS9, Line 26: bool (*ignore_addr_io)(x86emu_t *emu, u32 addr); please, no spaces at the start of a line
https://review.coreboot.org/c/coreboot/+/32020/9/src/arch/x86/libx86emu/blob... PS9, Line 27: bool (*ignore_addr_mem)(x86emu_t *emu, u32 addr); code indent should use tabs where possible
https://review.coreboot.org/c/coreboot/+/32020/9/src/arch/x86/libx86emu/blob... PS9, Line 27: bool (*ignore_addr_mem)(x86emu_t *emu, u32 addr); please, no spaces at the start of a line
https://review.coreboot.org/c/coreboot/+/32020/9/src/arch/x86/libx86emu/trac... File src/arch/x86/libx86emu/trace-bios.c:
https://review.coreboot.org/c/coreboot/+/32020/9/src/arch/x86/libx86emu/trac... PS9, Line 28: if (addr > 0xffffffff - CONFIG_ROM_SIZE) { braces {} are not necessary for single statement blocks
https://review.coreboot.org/c/coreboot/+/32020/9/src/arch/x86/libx86emu/trac... File src/arch/x86/libx86emu/trace-pci.c:
https://review.coreboot.org/c/coreboot/+/32020/9/src/arch/x86/libx86emu/trac... PS9, Line 51: devfn >> 3, devfn & 7); code indent should use tabs where possible
https://review.coreboot.org/c/coreboot/+/32020/9/src/arch/x86/libx86emu/trac... PS9, Line 78: static struct bar_tracer *bar_trace_find(struct device *dev, unsigned int bar, unsigned int type) line over 96 characters
https://review.coreboot.org/c/coreboot/+/32020/9/src/arch/x86/libx86emu/trac... PS9, Line 163: DEVFN_T dev = ((bus << 20)| devfn << 12); need consistent spacing around '|' (ctx:VxW)
https://review.coreboot.org/c/coreboot/+/32020/9/src/arch/x86/libx86emu/trac... PS9, Line 167: if (!dev) { braces {} are not necessary for single statement blocks
https://review.coreboot.org/c/coreboot/+/32020/9/src/arch/x86/libx86emu/trac... PS9, Line 199: while (!(moving & size)) { braces {} are not necessary for single statement blocks
https://review.coreboot.org/c/coreboot/+/32020/9/src/arch/x86/libx86emu/trac... PS9, Line 208: tracer = bar_trace_add(pcidev_path_on_root(devfn), (index - 0x10) / 4, !!(attr & PCI_BASE_ADDRESS_SPACE_IO)); line over 96 characters
https://review.coreboot.org/c/coreboot/+/32020/9/src/arch/x86/libx86emu/trac... PS9, Line 230: switch(bits) { switch and case should be at the same indent
https://review.coreboot.org/c/coreboot/+/32020/9/src/arch/x86/libx86emu/trac... PS9, Line 230: switch(bits) { space required before the open parenthesis '('
https://review.coreboot.org/c/coreboot/+/32020/9/src/arch/x86/libx86emu/trac... PS9, Line 259: switch(bits) { switch and case should be at the same indent
https://review.coreboot.org/c/coreboot/+/32020/9/src/arch/x86/libx86emu/trac... PS9, Line 259: switch(bits) { space required before the open parenthesis '('
https://review.coreboot.org/c/coreboot/+/32020/9/src/arch/x86/libx86emu/trac... PS9, Line 288: switch(bits) { switch and case should be at the same indent
https://review.coreboot.org/c/coreboot/+/32020/9/src/arch/x86/libx86emu/trac... PS9, Line 288: switch(bits) { space required before the open parenthesis '('
https://review.coreboot.org/c/coreboot/+/32020/9/src/arch/x86/libx86emu/trac... PS9, Line 318: switch(bits) { switch and case should be at the same indent
https://review.coreboot.org/c/coreboot/+/32020/9/src/arch/x86/libx86emu/trac... PS9, Line 318: switch(bits) { space required before the open parenthesis '('
https://review.coreboot.org/c/coreboot/+/32020/9/src/arch/x86/libx86emu/trac... PS9, Line 379: switch(bits) { space required before the open parenthesis '('
https://review.coreboot.org/c/coreboot/+/32020/9/src/arch/x86/libx86emu/trac... PS9, Line 415: switch(bits) { space required before the open parenthesis '('
https://review.coreboot.org/c/coreboot/+/32020/9/src/arch/x86/libx86emu/trac... PS9, Line 458: switch(bits) { space required before the open parenthesis '('
https://review.coreboot.org/c/coreboot/+/32020/9/src/arch/x86/libx86emu/trac... PS9, Line 460: if (addr < 0xcfc) { braces {} are not necessary for any arm of this statement
https://review.coreboot.org/c/coreboot/+/32020/9/src/arch/x86/libx86emu/trac... PS9, Line 467: if (addr < 0xcfc) { braces {} are not necessary for any arm of this statement
https://review.coreboot.org/c/coreboot/+/32020/9/src/arch/x86/libx86emu/trac... PS9, Line 474: if (addr < 0xcfc) { braces {} are not necessary for any arm of this statement
https://review.coreboot.org/c/coreboot/+/32020/9/src/arch/x86/libx86emu/trac... PS9, Line 488: switch(bits) { space required before the open parenthesis '('
https://review.coreboot.org/c/coreboot/+/32020/9/src/arch/x86/libx86emu/trac... PS9, Line 504: if (conf >= PCI_BASE_ADDRESS_0 && conf < (PCI_BASE_ADDRESS_5 + 4) && !(conf & 3)) line over 96 characters
https://review.coreboot.org/c/coreboot/+/32020/9/src/arch/x86/libx86emu/trac... PS9, Line 521: switch(bits) { space required before the open parenthesis '('
https://review.coreboot.org/c/coreboot/+/32020/9/src/arch/x86/libx86emu/trac... PS9, Line 537: if (conf >= PCI_BASE_ADDRESS_0 && conf < (PCI_BASE_ADDRESS_5 + 4) && !(conf & 3)) line over 96 characters
https://review.coreboot.org/c/coreboot/+/32020/9/src/arch/x86/libx86emu/trac... File src/arch/x86/libx86emu/trace-skl.c:
https://review.coreboot.org/c/coreboot/+/32020/9/src/arch/x86/libx86emu/trac... PS9, Line 34: switch (devfn) { switch and case should be at the same indent
https://review.coreboot.org/c/coreboot/+/32020/9/src/arch/x86/libx86emu/trac... PS9, Line 87: devfn >> 3, devfn & 7); code indent should use tabs where possible
https://review.coreboot.org/c/coreboot/+/32020/9/src/arch/x86/libx86emu/trac... PS9, Line 95: if (addr > 0x78000000 && addr < 0x78510000) { braces {} are not necessary for single statement blocks
https://review.coreboot.org/c/coreboot/+/32020/9/src/arch/x86/libx86emu/trac... PS9, Line 129: bool pci_trace_p2sb_r(const int bus, const int devfn, const int off, u32 *val, unsigned int bits) line over 96 characters
https://review.coreboot.org/c/coreboot/+/32020/9/src/arch/x86/libx86emu/trac... PS9, Line 137: switch(bits) { space required before the open parenthesis '('
https://review.coreboot.org/c/coreboot/+/32020/9/src/arch/x86/libx86emu/trac... PS9, Line 139: if (off >= P2SB_CR_SBI_ADDR && off < (P2SB_CR_SBI_ADDR + 4)) { braces {} are not necessary for any arm of this statement
https://review.coreboot.org/c/coreboot/+/32020/9/src/arch/x86/libx86emu/trac... PS9, Line 148: if (off >= P2SB_CR_SBI_ADDR && off < (P2SB_CR_SBI_ADDR + 4)) { braces {} are not necessary for any arm of this statement
https://review.coreboot.org/c/coreboot/+/32020/9/src/arch/x86/libx86emu/trac... PS9, Line 157: if (off >= P2SB_CR_SBI_ADDR && off < (P2SB_CR_SBI_ADDR + 4)) { braces {} are not necessary for any arm of this statement
https://review.coreboot.org/c/coreboot/+/32020/9/src/arch/x86/libx86emu/trac... PS9, Line 167: if (!(sb_data.w & 1) && pending ) { space prohibited before that close parenthesis ')'
https://review.coreboot.org/c/coreboot/+/32020/9/src/arch/x86/libx86emu/trac... PS9, Line 167: if (!(sb_data.w & 1) && pending ) { braces {} are not necessary for single statement blocks
https://review.coreboot.org/c/coreboot/+/32020/9/src/arch/x86/libx86emu/trac... PS9, Line 172: bool pci_trace_p2sb_w(const int bus, const int devfn, const int off, u32 *val, unsigned int bits) line over 96 characters
https://review.coreboot.org/c/coreboot/+/32020/9/src/arch/x86/libx86emu/trac... PS9, Line 180: switch(bits) { space required before the open parenthesis '('
https://review.coreboot.org/c/coreboot/+/32020/9/src/arch/x86/libx86emu/trac... PS9, Line 182: if (off >= P2SB_CR_SBI_ADDR && off < (P2SB_CR_SBI_ADDR + 4)) { braces {} are not necessary for any arm of this statement
https://review.coreboot.org/c/coreboot/+/32020/9/src/arch/x86/libx86emu/trac... PS9, Line 191: if (off >= P2SB_CR_SBI_ADDR && off < (P2SB_CR_SBI_ADDR + 4)) { braces {} are not necessary for any arm of this statement
https://review.coreboot.org/c/coreboot/+/32020/9/src/arch/x86/libx86emu/trac... PS9, Line 200: if (off >= P2SB_CR_SBI_ADDR && off < (P2SB_CR_SBI_ADDR + 4)) { braces {} are not necessary for any arm of this statement
https://review.coreboot.org/c/coreboot/+/32020/9/src/arch/x86/libx86emu/trac... PS9, Line 210: if ((sb_data.w & 1) && !pending ) { space prohibited before that close parenthesis ')'
https://review.coreboot.org/c/coreboot/+/32020/9/src/arch/x86/libx86emu/trac... PS9, Line 210: if ((sb_data.w & 1) && !pending ) { braces {} are not necessary for single statement blocks
https://review.coreboot.org/c/coreboot/+/32020/9/src/arch/x86/libx86emu/trac... File src/arch/x86/libx86emu/trace.c:
https://review.coreboot.org/c/coreboot/+/32020/9/src/arch/x86/libx86emu/trac... PS9, Line 56: addr < ( (uintptr_t)baseptr + size)) { space prohibited after that open parenthesis '('
https://review.coreboot.org/c/coreboot/+/32020/9/src/arch/x86/libx86emu/trac... PS9, Line 62: addr < ((uintptr_t)cbmem_entry_start(ramstage_entry) + (uintptr_t)cbmem_entry_size(ramstage_entry))) { line over 96 characters
https://review.coreboot.org/c/coreboot/+/32020/9/src/arch/x86/libx86emu/trac... PS9, Line 91: void vm_traceio_r(x86emu_t *emu, u32 addr, u32 *val, unsigned type) Prefer 'unsigned int' to bare use of 'unsigned'
https://review.coreboot.org/c/coreboot/+/32020/9/src/arch/x86/libx86emu/trac... PS9, Line 102: for (driver = &_blobolator_drivers[0]; driver != &_eblobolator_drivers[0]; driver++) { line over 96 characters
https://review.coreboot.org/c/coreboot/+/32020/9/src/arch/x86/libx86emu/trac... PS9, Line 107: for (driver = &_blobolator_drivers[0]; driver != &_eblobolator_drivers[0]; driver++) { line over 96 characters
https://review.coreboot.org/c/coreboot/+/32020/9/src/arch/x86/libx86emu/trac... PS9, Line 119: switch(bits) { switch and case should be at the same indent
https://review.coreboot.org/c/coreboot/+/32020/9/src/arch/x86/libx86emu/trac... PS9, Line 119: switch(bits) { space required before the open parenthesis '('
https://review.coreboot.org/c/coreboot/+/32020/9/src/arch/x86/libx86emu/trac... PS9, Line 121: printk(BIOS_DEBUG, " read8(0x%08x) // = 0x%x\n", addr, *val); line over 96 characters
https://review.coreboot.org/c/coreboot/+/32020/9/src/arch/x86/libx86emu/trac... PS9, Line 124: printk(BIOS_DEBUG, " read16(0x%08x) // = 0x%x\n", addr, *val); line over 96 characters
https://review.coreboot.org/c/coreboot/+/32020/9/src/arch/x86/libx86emu/trac... PS9, Line 127: printk(BIOS_DEBUG, " read32(0x%08x) // = 0x%x\n", addr, *val); line over 96 characters
https://review.coreboot.org/c/coreboot/+/32020/9/src/arch/x86/libx86emu/trac... PS9, Line 133: for (driver = &_blobolator_drivers[0]; driver != &_eblobolator_drivers[0]; driver++) { line over 96 characters
https://review.coreboot.org/c/coreboot/+/32020/9/src/arch/x86/libx86emu/trac... PS9, Line 138: for (driver = &_blobolator_drivers[0]; driver != &_eblobolator_drivers[0]; driver++) { line over 96 characters
https://review.coreboot.org/c/coreboot/+/32020/9/src/arch/x86/libx86emu/trac... PS9, Line 150: switch(bits) { switch and case should be at the same indent
https://review.coreboot.org/c/coreboot/+/32020/9/src/arch/x86/libx86emu/trac... PS9, Line 150: switch(bits) { space required before the open parenthesis '('
https://review.coreboot.org/c/coreboot/+/32020/9/src/arch/x86/libx86emu/trac... PS9, Line 152: printk(BIOS_DEBUG, " inb(0x%04x) // = 0x%x\n", addr, *val); line over 96 characters
https://review.coreboot.org/c/coreboot/+/32020/9/src/arch/x86/libx86emu/trac... PS9, Line 155: printk(BIOS_DEBUG, " inw(0x%04x) // = 0x%x\n", addr, *val); line over 96 characters
https://review.coreboot.org/c/coreboot/+/32020/9/src/arch/x86/libx86emu/trac... PS9, Line 158: printk(BIOS_DEBUG, " inl(0x%04x) // = 0x%x\n", addr, *val); line over 96 characters
https://review.coreboot.org/c/coreboot/+/32020/9/src/arch/x86/libx86emu/trac... PS9, Line 166: void vm_traceio_w(x86emu_t *emu, u32 addr, u32 *val, unsigned type) Prefer 'unsigned int' to bare use of 'unsigned'
https://review.coreboot.org/c/coreboot/+/32020/9/src/arch/x86/libx86emu/trac... PS9, Line 168: const unsigned bits = type & 0xff; Prefer 'unsigned int' to bare use of 'unsigned'
https://review.coreboot.org/c/coreboot/+/32020/9/src/arch/x86/libx86emu/trac... PS9, Line 177: for (driver = &_blobolator_drivers[0]; driver != &_eblobolator_drivers[0]; driver++) { line over 96 characters
https://review.coreboot.org/c/coreboot/+/32020/9/src/arch/x86/libx86emu/trac... PS9, Line 182: for (driver = &_blobolator_drivers[0]; driver != &_eblobolator_drivers[0]; driver++) { line over 96 characters
https://review.coreboot.org/c/coreboot/+/32020/9/src/arch/x86/libx86emu/trac... PS9, Line 194: switch(bits) { switch and case should be at the same indent
https://review.coreboot.org/c/coreboot/+/32020/9/src/arch/x86/libx86emu/trac... PS9, Line 194: switch(bits) { space required before the open parenthesis '('
https://review.coreboot.org/c/coreboot/+/32020/9/src/arch/x86/libx86emu/trac... PS9, Line 196: printk(BIOS_DEBUG, " write8(0x%08x, 0x%x)\n", addr, *val); line over 96 characters
https://review.coreboot.org/c/coreboot/+/32020/9/src/arch/x86/libx86emu/trac... PS9, Line 199: printk(BIOS_DEBUG, "write16(0x%08x, 0x%x)\n", addr, *val); line over 96 characters
https://review.coreboot.org/c/coreboot/+/32020/9/src/arch/x86/libx86emu/trac... PS9, Line 202: printk(BIOS_DEBUG, "write32(0x%08x, 0x%x)\n", addr, *val); line over 96 characters
https://review.coreboot.org/c/coreboot/+/32020/9/src/arch/x86/libx86emu/trac... PS9, Line 208: for (driver = &_blobolator_drivers[0]; driver != &_eblobolator_drivers[0]; driver++) { line over 96 characters
https://review.coreboot.org/c/coreboot/+/32020/9/src/arch/x86/libx86emu/trac... PS9, Line 213: for (driver = &_blobolator_drivers[0]; driver != &_eblobolator_drivers[0]; driver++) { line over 96 characters
https://review.coreboot.org/c/coreboot/+/32020/9/src/arch/x86/libx86emu/trac... PS9, Line 225: switch(bits) { switch and case should be at the same indent
https://review.coreboot.org/c/coreboot/+/32020/9/src/arch/x86/libx86emu/trac... PS9, Line 225: switch(bits) { space required before the open parenthesis '('
https://review.coreboot.org/c/coreboot/+/32020/9/src/arch/x86/libx86emu/trac... PS9, Line 227: printk(BIOS_DEBUG, " outb(0x%04x, 0x%x))\n", addr, *val); line over 96 characters
https://review.coreboot.org/c/coreboot/+/32020/9/src/arch/x86/libx86emu/trac... PS9, Line 230: printk(BIOS_DEBUG, " outw(0x%04x, 0x%x)\n", addr, *val); line over 96 characters
https://review.coreboot.org/c/coreboot/+/32020/9/src/arch/x86/libx86emu/trac... PS9, Line 233: printk(BIOS_DEBUG, " outl(0x%04x, 0x%x)\n", addr, *val); line over 96 characters
https://review.coreboot.org/c/coreboot/+/32020/9/src/mainboard/emulation/qem... File src/mainboard/emulation/qemu-q35/mainboard.c:
https://review.coreboot.org/c/coreboot/+/32020/9/src/mainboard/emulation/qem... PS9, Line 85: if (myconfig->config1 || myconfig->config2) { braces {} are not necessary for single statement blocks
https://review.coreboot.org/c/coreboot/+/32020/9/src/mainboard/emulation/qem... PS9, Line 88: if (myconfig->config3 != 0 && myconfig->config3 != 2) { braces {} are not necessary for single statement blocks
https://review.coreboot.org/c/coreboot/+/32020/9/src/mainboard/emulation/qem... PS9, Line 91: if (myconfig->config1) { braces {} are not necessary for single statement blocks
https://review.coreboot.org/c/coreboot/+/32020/9/src/mainboard/emulation/qem... PS9, Line 94: if (myconfig->config2) { braces {} are not necessary for single statement blocks
https://review.coreboot.org/c/coreboot/+/32020/9/src/mainboard/emulation/qem... PS9, Line 98: if (myconfig->config5) { braces {} are not necessary for single statement blocks
Hello Julius Werner, Angel Pons, Arthur Heymans, Daniel Maslowski, Christian Walter, Felix Singer, Philipp Deppenwiese, build bot (Jenkins), Nico Huber, Patrick Georgi, Martin Roth,
I'd like you to reexamine a change. Please visit
https://review.coreboot.org/c/coreboot/+/32020
to look at the new patch set (#10).
Change subject: [WIP]x86: Introduce the blobolator ......................................................................
[WIP]x86: Introduce the blobolator
This is a PoC to run arbitrary code and blobs inside an emulated virtual machine using libx86emu, thus the name blobolator.
The libx86emu has been patched to the following: * redirect IO to the host machine it's running on * trace IO * start in protected mode * add mechanism to drop IO access * add Kconfig to debug code it is running
Implemented features: * Run ramstage in libx86emu * Kconfig specific hooks by using _blobolator_drivers (same mechanism as __pci_driver) * PCI decoding and BAR tracing * POST code decoding * Unhandled IO tracing * Added test code in qemu emulation/q35 * Machine parseable format
TODO: * Add support to trace only blobs, not stages. * Improve translation of known IO to human readable format ** COM ** PCI ** APIC ** PIT ** POST
Tested on qemu. Sucessfully run ramstage in blobolator. Tested on X11SSH-TF. Sucessfully run ramstage in blobolator (requires additional libx86emu patches).
You need to install 3rdparty/libx86emu from https://github.com/PatrickRudolph/libx86emu/tree/cpuid_msr_callback
Change-Id: I13e47f45e69376d046f35c04363fe3db1cfaa610 Signed-off-by: Patrick Rudolph patrick.rudolph@9elements.com --- M src/Kconfig M src/arch/x86/Makefile.inc M src/arch/x86/boot.c A src/arch/x86/libx86emu/Kconfig.debug A src/arch/x86/libx86emu/Makefile.inc A src/arch/x86/libx86emu/blobolator.c A src/arch/x86/libx86emu/blobolator_internal.h A src/arch/x86/libx86emu/stdarg.h A src/arch/x86/libx86emu/stdio.h A src/arch/x86/libx86emu/time.h A src/arch/x86/libx86emu/trace-bios.c A src/arch/x86/libx86emu/trace-pci.c A src/arch/x86/libx86emu/trace-serial.c A src/arch/x86/libx86emu/trace-skl.c A src/arch/x86/libx86emu/trace.c M src/arch/x86/postcar_loader.c M src/commonlib/include/commonlib/cbmem_id.h A src/include/blobolator.h M src/include/rules.h M src/include/stddef.h M src/lib/Makefile.inc M src/lib/hardwaremain.c M src/lib/program.ld M src/mainboard/emulation/qemu-q35/mainboard.c 24 files changed, 2,065 insertions(+), 7 deletions(-)
git pull ssh://review.coreboot.org:29418/coreboot refs/changes/20/32020/10
Hello Julius Werner, Arthur Heymans, Daniel Maslowski, Christian Walter, Felix Singer, Philipp Deppenwiese, build bot (Jenkins), Nico Huber, Patrick Georgi, Martin Roth,
I'd like you to reexamine a change. Please visit
https://review.coreboot.org/c/coreboot/+/32020
to look at the new patch set (#11).
Change subject: [WIP]x86: Introduce the blobolator ......................................................................
[WIP]x86: Introduce the blobolator
This is a PoC to run arbitrary code and blobs inside an emulated virtual machine using libx86emu, thus the name blobolator.
The libx86emu has been patched to the following: * redirect IO to the host machine it's running on * trace IO * start in protected mode * add mechanism to drop IO access * add Kconfig to debug code it is running
Implemented features: * Run ramstage in libx86emu * Kconfig specific hooks by using _blobolator_drivers (same mechanism as __pci_driver) * PCI decoding and BAR tracing * POST code decoding * Unhandled IO tracing * Added test code in qemu emulation/q35 * Machine parseable format
TODO: * Add support to trace only blobs, not stages. * Improve translation of known IO to human readable format ** COM ** PCI ** APIC ** PIT ** POST
Tested on qemu. Sucessfully run ramstage in blobolator. Tested on X11SSH-TF. Sucessfully run ramstage in blobolator (requires additional libx86emu patches).
You need to install 3rdparty/libx86emu from https://github.com/PatrickRudolph/libx86emu/tree/cpuid_msr_callback
Change-Id: I13e47f45e69376d046f35c04363fe3db1cfaa610 Signed-off-by: Patrick Rudolph patrick.rudolph@9elements.com --- M src/Kconfig M src/arch/x86/Makefile.inc M src/arch/x86/boot.c A src/arch/x86/libx86emu/Kconfig.debug A src/arch/x86/libx86emu/Makefile.inc A src/arch/x86/libx86emu/blobolator.c A src/arch/x86/libx86emu/blobolator_internal.h A src/arch/x86/libx86emu/stdarg.h A src/arch/x86/libx86emu/stdio.h A src/arch/x86/libx86emu/time.h A src/arch/x86/libx86emu/trace-bios.c A src/arch/x86/libx86emu/trace-pci.c A src/arch/x86/libx86emu/trace-serial.c A src/arch/x86/libx86emu/trace-skl.c A src/arch/x86/libx86emu/trace.c M src/arch/x86/postcar_loader.c M src/commonlib/include/commonlib/cbmem_id.h A src/include/blobolator.h M src/include/rules.h M src/include/stddef.h M src/lib/Makefile.inc M src/lib/hardwaremain.c M src/lib/program.ld M src/mainboard/emulation/qemu-q35/mainboard.c 24 files changed, 2,065 insertions(+), 2 deletions(-)
git pull ssh://review.coreboot.org:29418/coreboot refs/changes/20/32020/11
build bot (Jenkins) has posted comments on this change. ( https://review.coreboot.org/c/coreboot/+/32020 )
Change subject: [WIP]x86: Introduce the blobolator ......................................................................
Patch Set 11:
(150 comments)
https://review.coreboot.org/c/coreboot/+/32020/11/src/arch/x86/libx86emu/Kco... File src/arch/x86/libx86emu/Kconfig.debug:
https://review.coreboot.org/c/coreboot/+/32020/11/src/arch/x86/libx86emu/Kco... PS11, Line 21: IO access can be traced, analysed, modified or droped. 'droped' may be misspelled - perhaps 'dropped'?
https://review.coreboot.org/c/coreboot/+/32020/11/src/arch/x86/libx86emu/blo... File src/arch/x86/libx86emu/blobolator.c:
https://review.coreboot.org/c/coreboot/+/32020/11/src/arch/x86/libx86emu/blo... PS11, Line 42: x86emu_mem_t *emu_mem_new(unsigned perm) Prefer 'unsigned int' to bare use of 'unsigned'
https://review.coreboot.org/c/coreboot/+/32020/11/src/arch/x86/libx86emu/blo... PS11, Line 47: void x86emu_set_io_perm(x86emu_t *emu, unsigned start, unsigned end, unsigned perm) Prefer 'unsigned int' to bare use of 'unsigned'
https://review.coreboot.org/c/coreboot/+/32020/11/src/arch/x86/libx86emu/blo... PS11, Line 47: void x86emu_set_io_perm(x86emu_t *emu, unsigned start, unsigned end, unsigned perm) Prefer 'unsigned int' to bare use of 'unsigned'
https://review.coreboot.org/c/coreboot/+/32020/11/src/arch/x86/libx86emu/blo... PS11, Line 47: void x86emu_set_io_perm(x86emu_t *emu, unsigned start, unsigned end, unsigned perm) Prefer 'unsigned int' to bare use of 'unsigned'
https://review.coreboot.org/c/coreboot/+/32020/11/src/arch/x86/libx86emu/blo... PS11, Line 51: unsigned x86emu_read_byte(x86emu_t *emu, unsigned addr) Prefer 'unsigned int' to bare use of 'unsigned'
https://review.coreboot.org/c/coreboot/+/32020/11/src/arch/x86/libx86emu/blo... PS11, Line 51: unsigned x86emu_read_byte(x86emu_t *emu, unsigned addr) Prefer 'unsigned int' to bare use of 'unsigned'
https://review.coreboot.org/c/coreboot/+/32020/11/src/arch/x86/libx86emu/blo... PS11, Line 55: if(emu) space required before the open parenthesis '('
https://review.coreboot.org/c/coreboot/+/32020/11/src/arch/x86/libx86emu/blo... PS11, Line 61: unsigned x86emu_read_byte_noperm(x86emu_t *emu, unsigned addr) Prefer 'unsigned int' to bare use of 'unsigned'
https://review.coreboot.org/c/coreboot/+/32020/11/src/arch/x86/libx86emu/blo... PS11, Line 61: unsigned x86emu_read_byte_noperm(x86emu_t *emu, unsigned addr) Prefer 'unsigned int' to bare use of 'unsigned'
https://review.coreboot.org/c/coreboot/+/32020/11/src/arch/x86/libx86emu/blo... PS11, Line 65: if(emu) space required before the open parenthesis '('
https://review.coreboot.org/c/coreboot/+/32020/11/src/arch/x86/libx86emu/blo... PS11, Line 72: unsigned x86emu_read_word(x86emu_t *emu, unsigned addr) Prefer 'unsigned int' to bare use of 'unsigned'
https://review.coreboot.org/c/coreboot/+/32020/11/src/arch/x86/libx86emu/blo... PS11, Line 72: unsigned x86emu_read_word(x86emu_t *emu, unsigned addr) Prefer 'unsigned int' to bare use of 'unsigned'
https://review.coreboot.org/c/coreboot/+/32020/11/src/arch/x86/libx86emu/blo... PS11, Line 76: if(emu) space required before the open parenthesis '('
https://review.coreboot.org/c/coreboot/+/32020/11/src/arch/x86/libx86emu/blo... PS11, Line 82: unsigned x86emu_read_dword(x86emu_t *emu, unsigned addr) Prefer 'unsigned int' to bare use of 'unsigned'
https://review.coreboot.org/c/coreboot/+/32020/11/src/arch/x86/libx86emu/blo... PS11, Line 82: unsigned x86emu_read_dword(x86emu_t *emu, unsigned addr) Prefer 'unsigned int' to bare use of 'unsigned'
https://review.coreboot.org/c/coreboot/+/32020/11/src/arch/x86/libx86emu/blo... PS11, Line 86: if(emu) space required before the open parenthesis '('
https://review.coreboot.org/c/coreboot/+/32020/11/src/arch/x86/libx86emu/blo... PS11, Line 92: void x86emu_write_byte(x86emu_t *emu, unsigned addr, unsigned val) Prefer 'unsigned int' to bare use of 'unsigned'
https://review.coreboot.org/c/coreboot/+/32020/11/src/arch/x86/libx86emu/blo... PS11, Line 92: void x86emu_write_byte(x86emu_t *emu, unsigned addr, unsigned val) Prefer 'unsigned int' to bare use of 'unsigned'
https://review.coreboot.org/c/coreboot/+/32020/11/src/arch/x86/libx86emu/blo... PS11, Line 96: if(emu) space required before the open parenthesis '('
https://review.coreboot.org/c/coreboot/+/32020/11/src/arch/x86/libx86emu/blo... PS11, Line 100: void x86emu_write_byte_noperm(x86emu_t *emu, unsigned addr, unsigned val) Prefer 'unsigned int' to bare use of 'unsigned'
https://review.coreboot.org/c/coreboot/+/32020/11/src/arch/x86/libx86emu/blo... PS11, Line 100: void x86emu_write_byte_noperm(x86emu_t *emu, unsigned addr, unsigned val) Prefer 'unsigned int' to bare use of 'unsigned'
https://review.coreboot.org/c/coreboot/+/32020/11/src/arch/x86/libx86emu/blo... PS11, Line 104: if(emu) space required before the open parenthesis '('
https://review.coreboot.org/c/coreboot/+/32020/11/src/arch/x86/libx86emu/blo... PS11, Line 109: void x86emu_write_word(x86emu_t *emu, unsigned addr, unsigned val) Prefer 'unsigned int' to bare use of 'unsigned'
https://review.coreboot.org/c/coreboot/+/32020/11/src/arch/x86/libx86emu/blo... PS11, Line 109: void x86emu_write_word(x86emu_t *emu, unsigned addr, unsigned val) Prefer 'unsigned int' to bare use of 'unsigned'
https://review.coreboot.org/c/coreboot/+/32020/11/src/arch/x86/libx86emu/blo... PS11, Line 113: if(emu) space required before the open parenthesis '('
https://review.coreboot.org/c/coreboot/+/32020/11/src/arch/x86/libx86emu/blo... PS11, Line 117: void x86emu_write_dword(x86emu_t *emu, unsigned addr, unsigned val) Prefer 'unsigned int' to bare use of 'unsigned'
https://review.coreboot.org/c/coreboot/+/32020/11/src/arch/x86/libx86emu/blo... PS11, Line 117: void x86emu_write_dword(x86emu_t *emu, unsigned addr, unsigned val) Prefer 'unsigned int' to bare use of 'unsigned'
https://review.coreboot.org/c/coreboot/+/32020/11/src/arch/x86/libx86emu/blo... PS11, Line 121: if(emu) space required before the open parenthesis '('
https://review.coreboot.org/c/coreboot/+/32020/11/src/arch/x86/libx86emu/blo... PS11, Line 125: unsigned x86emu_clear_log(x86emu_t *emu, int flush) Prefer 'unsigned int' to bare use of 'unsigned'
https://review.coreboot.org/c/coreboot/+/32020/11/src/arch/x86/libx86emu/blo... PS11, Line 127: if(flush && emu->log.flush) { space required before the open parenthesis '('
https://review.coreboot.org/c/coreboot/+/32020/11/src/arch/x86/libx86emu/blo... PS11, Line 128: if(emu->log.ptr && emu->log.ptr != emu->log.buf) { space required before the open parenthesis '('
https://review.coreboot.org/c/coreboot/+/32020/11/src/arch/x86/libx86emu/blo... PS11, Line 133: if((emu->log.ptr = emu->log.buf)) *emu->log.ptr = 0; space required before the open parenthesis '('
https://review.coreboot.org/c/coreboot/+/32020/11/src/arch/x86/libx86emu/blo... PS11, Line 133: if((emu->log.ptr = emu->log.buf)) *emu->log.ptr = 0; do not use assignment in if condition
https://review.coreboot.org/c/coreboot/+/32020/11/src/arch/x86/libx86emu/blo... PS11, Line 133: if((emu->log.ptr = emu->log.buf)) *emu->log.ptr = 0; trailing statements should be on next line
https://review.coreboot.org/c/coreboot/+/32020/11/src/arch/x86/libx86emu/blo... PS11, Line 143: memset(x86, 0, sizeof *x86); sizeof *x86 should be sizeof(*x86)
https://review.coreboot.org/c/coreboot/+/32020/11/src/arch/x86/libx86emu/blo... PS11, Line 202: emu->x86.R_EIP, 's', 'O', emu->x86.R_ECX, emu->x86.R_EDX, emu->x86.R_EAX); line over 96 characters
https://review.coreboot.org/c/coreboot/+/32020/11/src/arch/x86/libx86emu/blo... PS11, Line 225: emu->x86.R_EIP, 's', 'I', emu->x86.R_ECX, msr.hi, msr.lo); line over 96 characters
https://review.coreboot.org/c/coreboot/+/32020/11/src/arch/x86/libx86emu/blo... PS11, Line 238: __weak void vm_traceio_w(x86emu_t *emu, u32 addr, u32 *val, unsigned type) Prefer 'unsigned int' to bare use of 'unsigned'
https://review.coreboot.org/c/coreboot/+/32020/11/src/arch/x86/libx86emu/blo... PS11, Line 242: __weak void vm_traceio_r(x86emu_t *emu, u32 addr, u32 *val, unsigned type) Prefer 'unsigned int' to bare use of 'unsigned'
https://review.coreboot.org/c/coreboot/+/32020/11/src/arch/x86/libx86emu/blo... PS11, Line 246: unsigned vm_memio(x86emu_t *emu, u32 addr, u32 *val, unsigned type) Prefer 'unsigned int' to bare use of 'unsigned'
https://review.coreboot.org/c/coreboot/+/32020/11/src/arch/x86/libx86emu/blo... PS11, Line 246: unsigned vm_memio(x86emu_t *emu, u32 addr, u32 *val, unsigned type) Prefer 'unsigned int' to bare use of 'unsigned'
https://review.coreboot.org/c/coreboot/+/32020/11/src/arch/x86/libx86emu/blo... PS11, Line 249: unsigned bits = type & 0xff; Prefer 'unsigned int' to bare use of 'unsigned'
https://review.coreboot.org/c/coreboot/+/32020/11/src/arch/x86/libx86emu/blo... PS11, Line 254: switch(type) { space required before the open parenthesis '('
https://review.coreboot.org/c/coreboot/+/32020/11/src/arch/x86/libx86emu/blo... PS11, Line 256: switch(bits) { space required before the open parenthesis '('
https://review.coreboot.org/c/coreboot/+/32020/11/src/arch/x86/libx86emu/blo... PS11, Line 270: switch(bits) { space required before the open parenthesis '('
https://review.coreboot.org/c/coreboot/+/32020/11/src/arch/x86/libx86emu/blo... PS11, Line 284: switch(bits) { space required before the open parenthesis '('
https://review.coreboot.org/c/coreboot/+/32020/11/src/arch/x86/libx86emu/blo... PS11, Line 299: switch(bits) { space required before the open parenthesis '('
https://review.coreboot.org/c/coreboot/+/32020/11/src/arch/x86/libx86emu/blo... PS11, Line 313: switch(bits) { space required before the open parenthesis '('
https://review.coreboot.org/c/coreboot/+/32020/11/src/arch/x86/libx86emu/blo... PS11, Line 343: static bool x86emu_memio_drop(struct x86emu_s *emu_s, u32 addr, u32 *val, unsigned type) Prefer 'unsigned int' to bare use of 'unsigned'
https://review.coreboot.org/c/coreboot/+/32020/11/src/arch/x86/libx86emu/blo... PS11, Line 345: switch(type) { space required before the open parenthesis '('
https://review.coreboot.org/c/coreboot/+/32020/11/src/arch/x86/libx86emu/blo... PS11, Line 360: static bool x86emu_memio_except(struct x86emu_s *emu_s, u32 addr, u32 *val, unsigned type) Prefer 'unsigned int' to bare use of 'unsigned'
https://review.coreboot.org/c/coreboot/+/32020/11/src/arch/x86/libx86emu/blo... PS11, Line 365: switch(type) { space required before the open parenthesis '('
https://review.coreboot.org/c/coreboot/+/32020/11/src/arch/x86/libx86emu/blo... PS11, Line 397: static unsigned x86emu_memio_handler(struct x86emu_s *emu_s, u32 addr, u32 *val, unsigned type) Prefer 'unsigned int' to bare use of 'unsigned'
https://review.coreboot.org/c/coreboot/+/32020/11/src/arch/x86/libx86emu/blo... PS11, Line 397: static unsigned x86emu_memio_handler(struct x86emu_s *emu_s, u32 addr, u32 *val, unsigned type) Prefer 'unsigned int' to bare use of 'unsigned'
https://review.coreboot.org/c/coreboot/+/32020/11/src/arch/x86/libx86emu/blo... PS11, Line 466: static int x86emu_intr_handler(x86emu_t *emu, u8 num, unsigned type) Prefer 'unsigned int' to bare use of 'unsigned'
https://review.coreboot.org/c/coreboot/+/32020/11/src/arch/x86/libx86emu/blo... PS11, Line 479: vm_memio(emu, emu->x86.R_EIP + i - 16, &val, X86EMU_MEMIO_R|X86EMU_MEMIO_8); line over 96 characters
https://review.coreboot.org/c/coreboot/+/32020/11/src/arch/x86/libx86emu/blo... PS11, Line 492: static void x86emu_flush_log(x86emu_t *emu, char *buf, unsigned size) Prefer 'unsigned int' to bare use of 'unsigned'
https://review.coreboot.org/c/coreboot/+/32020/11/src/arch/x86/libx86emu/blo... PS11, Line 503: unsigned stats_i[X86EMU_IO_PORTS]; Prefer 'unsigned int' to bare use of 'unsigned'
https://review.coreboot.org/c/coreboot/+/32020/11/src/arch/x86/libx86emu/blo... PS11, Line 504: unsigned stats_o[X86EMU_IO_PORTS]; Prefer 'unsigned int' to bare use of 'unsigned'
https://review.coreboot.org/c/coreboot/+/32020/11/src/arch/x86/libx86emu/blo... PS11, Line 509: unsigned def_mem_perm = X86EMU_PERM_X|X86EMU_PERM_W|X86EMU_PERM_R; Prefer 'unsigned int' to bare use of 'unsigned'
https://review.coreboot.org/c/coreboot/+/32020/11/src/arch/x86/libx86emu/blo... PS11, Line 510: unsigned def_io_perm = X86EMU_PERM_X|X86EMU_PERM_W|X86EMU_PERM_R; Prefer 'unsigned int' to bare use of 'unsigned'
https://review.coreboot.org/c/coreboot/+/32020/11/src/arch/x86/libx86emu/blo... File src/arch/x86/libx86emu/blobolator_internal.h:
https://review.coreboot.org/c/coreboot/+/32020/11/src/arch/x86/libx86emu/blo... PS11, Line 18: void vm_traceio_w(x86emu_t *emu, u32 addr, u32 *val, unsigned type); Prefer 'unsigned int' to bare use of 'unsigned'
https://review.coreboot.org/c/coreboot/+/32020/11/src/arch/x86/libx86emu/blo... PS11, Line 19: void vm_traceio_r(x86emu_t *emu, u32 addr, u32 *val, unsigned type); Prefer 'unsigned int' to bare use of 'unsigned'
https://review.coreboot.org/c/coreboot/+/32020/11/src/arch/x86/libx86emu/blo... PS11, Line 25: void (*init)(x86emu_t *emu); code indent should use tabs where possible
https://review.coreboot.org/c/coreboot/+/32020/11/src/arch/x86/libx86emu/blo... PS11, Line 25: void (*init)(x86emu_t *emu); please, no spaces at the start of a line
https://review.coreboot.org/c/coreboot/+/32020/11/src/arch/x86/libx86emu/blo... PS11, Line 26: bool (*ignore_addr_io)(x86emu_t *emu, u32 addr); code indent should use tabs where possible
https://review.coreboot.org/c/coreboot/+/32020/11/src/arch/x86/libx86emu/blo... PS11, Line 26: bool (*ignore_addr_io)(x86emu_t *emu, u32 addr); please, no spaces at the start of a line
https://review.coreboot.org/c/coreboot/+/32020/11/src/arch/x86/libx86emu/blo... PS11, Line 27: bool (*ignore_addr_mem)(x86emu_t *emu, u32 addr); code indent should use tabs where possible
https://review.coreboot.org/c/coreboot/+/32020/11/src/arch/x86/libx86emu/blo... PS11, Line 27: bool (*ignore_addr_mem)(x86emu_t *emu, u32 addr); please, no spaces at the start of a line
https://review.coreboot.org/c/coreboot/+/32020/11/src/arch/x86/libx86emu/tra... File src/arch/x86/libx86emu/trace-bios.c:
https://review.coreboot.org/c/coreboot/+/32020/11/src/arch/x86/libx86emu/tra... PS11, Line 28: if (addr > 0xffffffff - CONFIG_ROM_SIZE) { braces {} are not necessary for single statement blocks
https://review.coreboot.org/c/coreboot/+/32020/11/src/arch/x86/libx86emu/tra... File src/arch/x86/libx86emu/trace-pci.c:
https://review.coreboot.org/c/coreboot/+/32020/11/src/arch/x86/libx86emu/tra... PS11, Line 51: devfn >> 3, devfn & 7); code indent should use tabs where possible
https://review.coreboot.org/c/coreboot/+/32020/11/src/arch/x86/libx86emu/tra... PS11, Line 78: static struct bar_tracer *bar_trace_find(struct device *dev, unsigned int bar, unsigned int type) line over 96 characters
https://review.coreboot.org/c/coreboot/+/32020/11/src/arch/x86/libx86emu/tra... PS11, Line 163: DEVFN_T dev = ((bus << 20)| devfn << 12); need consistent spacing around '|' (ctx:VxW)
https://review.coreboot.org/c/coreboot/+/32020/11/src/arch/x86/libx86emu/tra... PS11, Line 167: if (!dev) { braces {} are not necessary for single statement blocks
https://review.coreboot.org/c/coreboot/+/32020/11/src/arch/x86/libx86emu/tra... PS11, Line 199: while (!(moving & size)) { braces {} are not necessary for single statement blocks
https://review.coreboot.org/c/coreboot/+/32020/11/src/arch/x86/libx86emu/tra... PS11, Line 208: tracer = bar_trace_add(pcidev_path_on_root(devfn), (index - 0x10) / 4, !!(attr & PCI_BASE_ADDRESS_SPACE_IO)); line over 96 characters
https://review.coreboot.org/c/coreboot/+/32020/11/src/arch/x86/libx86emu/tra... PS11, Line 230: switch(bits) { switch and case should be at the same indent
https://review.coreboot.org/c/coreboot/+/32020/11/src/arch/x86/libx86emu/tra... PS11, Line 230: switch(bits) { space required before the open parenthesis '('
https://review.coreboot.org/c/coreboot/+/32020/11/src/arch/x86/libx86emu/tra... PS11, Line 259: switch(bits) { switch and case should be at the same indent
https://review.coreboot.org/c/coreboot/+/32020/11/src/arch/x86/libx86emu/tra... PS11, Line 259: switch(bits) { space required before the open parenthesis '('
https://review.coreboot.org/c/coreboot/+/32020/11/src/arch/x86/libx86emu/tra... PS11, Line 288: switch(bits) { switch and case should be at the same indent
https://review.coreboot.org/c/coreboot/+/32020/11/src/arch/x86/libx86emu/tra... PS11, Line 288: switch(bits) { space required before the open parenthesis '('
https://review.coreboot.org/c/coreboot/+/32020/11/src/arch/x86/libx86emu/tra... PS11, Line 318: switch(bits) { switch and case should be at the same indent
https://review.coreboot.org/c/coreboot/+/32020/11/src/arch/x86/libx86emu/tra... PS11, Line 318: switch(bits) { space required before the open parenthesis '('
https://review.coreboot.org/c/coreboot/+/32020/11/src/arch/x86/libx86emu/tra... PS11, Line 379: switch(bits) { space required before the open parenthesis '('
https://review.coreboot.org/c/coreboot/+/32020/11/src/arch/x86/libx86emu/tra... PS11, Line 415: switch(bits) { space required before the open parenthesis '('
https://review.coreboot.org/c/coreboot/+/32020/11/src/arch/x86/libx86emu/tra... PS11, Line 458: switch(bits) { space required before the open parenthesis '('
https://review.coreboot.org/c/coreboot/+/32020/11/src/arch/x86/libx86emu/tra... PS11, Line 460: if (addr < 0xcfc) { braces {} are not necessary for any arm of this statement
https://review.coreboot.org/c/coreboot/+/32020/11/src/arch/x86/libx86emu/tra... PS11, Line 467: if (addr < 0xcfc) { braces {} are not necessary for any arm of this statement
https://review.coreboot.org/c/coreboot/+/32020/11/src/arch/x86/libx86emu/tra... PS11, Line 474: if (addr < 0xcfc) { braces {} are not necessary for any arm of this statement
https://review.coreboot.org/c/coreboot/+/32020/11/src/arch/x86/libx86emu/tra... PS11, Line 488: switch(bits) { space required before the open parenthesis '('
https://review.coreboot.org/c/coreboot/+/32020/11/src/arch/x86/libx86emu/tra... PS11, Line 504: if (conf >= PCI_BASE_ADDRESS_0 && conf < (PCI_BASE_ADDRESS_5 + 4) && !(conf & 3)) line over 96 characters
https://review.coreboot.org/c/coreboot/+/32020/11/src/arch/x86/libx86emu/tra... PS11, Line 521: switch(bits) { space required before the open parenthesis '('
https://review.coreboot.org/c/coreboot/+/32020/11/src/arch/x86/libx86emu/tra... PS11, Line 537: if (conf >= PCI_BASE_ADDRESS_0 && conf < (PCI_BASE_ADDRESS_5 + 4) && !(conf & 3)) line over 96 characters
https://review.coreboot.org/c/coreboot/+/32020/11/src/arch/x86/libx86emu/tra... File src/arch/x86/libx86emu/trace-skl.c:
https://review.coreboot.org/c/coreboot/+/32020/11/src/arch/x86/libx86emu/tra... PS11, Line 34: switch (devfn) { switch and case should be at the same indent
https://review.coreboot.org/c/coreboot/+/32020/11/src/arch/x86/libx86emu/tra... PS11, Line 87: devfn >> 3, devfn & 7); code indent should use tabs where possible
https://review.coreboot.org/c/coreboot/+/32020/11/src/arch/x86/libx86emu/tra... PS11, Line 95: if (addr > 0x78000000 && addr < 0x78510000) { braces {} are not necessary for single statement blocks
https://review.coreboot.org/c/coreboot/+/32020/11/src/arch/x86/libx86emu/tra... PS11, Line 129: bool pci_trace_p2sb_r(const int bus, const int devfn, const int off, u32 *val, unsigned int bits) line over 96 characters
https://review.coreboot.org/c/coreboot/+/32020/11/src/arch/x86/libx86emu/tra... PS11, Line 137: switch(bits) { space required before the open parenthesis '('
https://review.coreboot.org/c/coreboot/+/32020/11/src/arch/x86/libx86emu/tra... PS11, Line 139: if (off >= P2SB_CR_SBI_ADDR && off < (P2SB_CR_SBI_ADDR + 4)) { braces {} are not necessary for any arm of this statement
https://review.coreboot.org/c/coreboot/+/32020/11/src/arch/x86/libx86emu/tra... PS11, Line 148: if (off >= P2SB_CR_SBI_ADDR && off < (P2SB_CR_SBI_ADDR + 4)) { braces {} are not necessary for any arm of this statement
https://review.coreboot.org/c/coreboot/+/32020/11/src/arch/x86/libx86emu/tra... PS11, Line 157: if (off >= P2SB_CR_SBI_ADDR && off < (P2SB_CR_SBI_ADDR + 4)) { braces {} are not necessary for any arm of this statement
https://review.coreboot.org/c/coreboot/+/32020/11/src/arch/x86/libx86emu/tra... PS11, Line 167: if (!(sb_data.w & 1) && pending ) { space prohibited before that close parenthesis ')'
https://review.coreboot.org/c/coreboot/+/32020/11/src/arch/x86/libx86emu/tra... PS11, Line 167: if (!(sb_data.w & 1) && pending ) { braces {} are not necessary for single statement blocks
https://review.coreboot.org/c/coreboot/+/32020/11/src/arch/x86/libx86emu/tra... PS11, Line 172: bool pci_trace_p2sb_w(const int bus, const int devfn, const int off, u32 *val, unsigned int bits) line over 96 characters
https://review.coreboot.org/c/coreboot/+/32020/11/src/arch/x86/libx86emu/tra... PS11, Line 180: switch(bits) { space required before the open parenthesis '('
https://review.coreboot.org/c/coreboot/+/32020/11/src/arch/x86/libx86emu/tra... PS11, Line 182: if (off >= P2SB_CR_SBI_ADDR && off < (P2SB_CR_SBI_ADDR + 4)) { braces {} are not necessary for any arm of this statement
https://review.coreboot.org/c/coreboot/+/32020/11/src/arch/x86/libx86emu/tra... PS11, Line 191: if (off >= P2SB_CR_SBI_ADDR && off < (P2SB_CR_SBI_ADDR + 4)) { braces {} are not necessary for any arm of this statement
https://review.coreboot.org/c/coreboot/+/32020/11/src/arch/x86/libx86emu/tra... PS11, Line 200: if (off >= P2SB_CR_SBI_ADDR && off < (P2SB_CR_SBI_ADDR + 4)) { braces {} are not necessary for any arm of this statement
https://review.coreboot.org/c/coreboot/+/32020/11/src/arch/x86/libx86emu/tra... PS11, Line 210: if ((sb_data.w & 1) && !pending ) { space prohibited before that close parenthesis ')'
https://review.coreboot.org/c/coreboot/+/32020/11/src/arch/x86/libx86emu/tra... PS11, Line 210: if ((sb_data.w & 1) && !pending ) { braces {} are not necessary for single statement blocks
https://review.coreboot.org/c/coreboot/+/32020/11/src/arch/x86/libx86emu/tra... File src/arch/x86/libx86emu/trace.c:
https://review.coreboot.org/c/coreboot/+/32020/11/src/arch/x86/libx86emu/tra... PS11, Line 56: addr < ( (uintptr_t)baseptr + size)) { space prohibited after that open parenthesis '('
https://review.coreboot.org/c/coreboot/+/32020/11/src/arch/x86/libx86emu/tra... PS11, Line 62: addr < ((uintptr_t)cbmem_entry_start(ramstage_entry) + (uintptr_t)cbmem_entry_size(ramstage_entry))) { line over 96 characters
https://review.coreboot.org/c/coreboot/+/32020/11/src/arch/x86/libx86emu/tra... PS11, Line 91: void vm_traceio_r(x86emu_t *emu, u32 addr, u32 *val, unsigned type) Prefer 'unsigned int' to bare use of 'unsigned'
https://review.coreboot.org/c/coreboot/+/32020/11/src/arch/x86/libx86emu/tra... PS11, Line 102: for (driver = &_blobolator_drivers[0]; driver != &_eblobolator_drivers[0]; driver++) { line over 96 characters
https://review.coreboot.org/c/coreboot/+/32020/11/src/arch/x86/libx86emu/tra... PS11, Line 107: for (driver = &_blobolator_drivers[0]; driver != &_eblobolator_drivers[0]; driver++) { line over 96 characters
https://review.coreboot.org/c/coreboot/+/32020/11/src/arch/x86/libx86emu/tra... PS11, Line 119: switch(bits) { switch and case should be at the same indent
https://review.coreboot.org/c/coreboot/+/32020/11/src/arch/x86/libx86emu/tra... PS11, Line 119: switch(bits) { space required before the open parenthesis '('
https://review.coreboot.org/c/coreboot/+/32020/11/src/arch/x86/libx86emu/tra... PS11, Line 121: printk(BIOS_DEBUG, " read8(0x%08x) // = 0x%x\n", addr, *val); line over 96 characters
https://review.coreboot.org/c/coreboot/+/32020/11/src/arch/x86/libx86emu/tra... PS11, Line 124: printk(BIOS_DEBUG, " read16(0x%08x) // = 0x%x\n", addr, *val); line over 96 characters
https://review.coreboot.org/c/coreboot/+/32020/11/src/arch/x86/libx86emu/tra... PS11, Line 127: printk(BIOS_DEBUG, " read32(0x%08x) // = 0x%x\n", addr, *val); line over 96 characters
https://review.coreboot.org/c/coreboot/+/32020/11/src/arch/x86/libx86emu/tra... PS11, Line 133: for (driver = &_blobolator_drivers[0]; driver != &_eblobolator_drivers[0]; driver++) { line over 96 characters
https://review.coreboot.org/c/coreboot/+/32020/11/src/arch/x86/libx86emu/tra... PS11, Line 138: for (driver = &_blobolator_drivers[0]; driver != &_eblobolator_drivers[0]; driver++) { line over 96 characters
https://review.coreboot.org/c/coreboot/+/32020/11/src/arch/x86/libx86emu/tra... PS11, Line 150: switch(bits) { switch and case should be at the same indent
https://review.coreboot.org/c/coreboot/+/32020/11/src/arch/x86/libx86emu/tra... PS11, Line 150: switch(bits) { space required before the open parenthesis '('
https://review.coreboot.org/c/coreboot/+/32020/11/src/arch/x86/libx86emu/tra... PS11, Line 152: printk(BIOS_DEBUG, " inb(0x%04x) // = 0x%x\n", addr, *val); line over 96 characters
https://review.coreboot.org/c/coreboot/+/32020/11/src/arch/x86/libx86emu/tra... PS11, Line 155: printk(BIOS_DEBUG, " inw(0x%04x) // = 0x%x\n", addr, *val); line over 96 characters
https://review.coreboot.org/c/coreboot/+/32020/11/src/arch/x86/libx86emu/tra... PS11, Line 158: printk(BIOS_DEBUG, " inl(0x%04x) // = 0x%x\n", addr, *val); line over 96 characters
https://review.coreboot.org/c/coreboot/+/32020/11/src/arch/x86/libx86emu/tra... PS11, Line 166: void vm_traceio_w(x86emu_t *emu, u32 addr, u32 *val, unsigned type) Prefer 'unsigned int' to bare use of 'unsigned'
https://review.coreboot.org/c/coreboot/+/32020/11/src/arch/x86/libx86emu/tra... PS11, Line 168: const unsigned bits = type & 0xff; Prefer 'unsigned int' to bare use of 'unsigned'
https://review.coreboot.org/c/coreboot/+/32020/11/src/arch/x86/libx86emu/tra... PS11, Line 177: for (driver = &_blobolator_drivers[0]; driver != &_eblobolator_drivers[0]; driver++) { line over 96 characters
https://review.coreboot.org/c/coreboot/+/32020/11/src/arch/x86/libx86emu/tra... PS11, Line 182: for (driver = &_blobolator_drivers[0]; driver != &_eblobolator_drivers[0]; driver++) { line over 96 characters
https://review.coreboot.org/c/coreboot/+/32020/11/src/arch/x86/libx86emu/tra... PS11, Line 194: switch(bits) { switch and case should be at the same indent
https://review.coreboot.org/c/coreboot/+/32020/11/src/arch/x86/libx86emu/tra... PS11, Line 194: switch(bits) { space required before the open parenthesis '('
https://review.coreboot.org/c/coreboot/+/32020/11/src/arch/x86/libx86emu/tra... PS11, Line 196: printk(BIOS_DEBUG, " write8(0x%08x, 0x%x)\n", addr, *val); line over 96 characters
https://review.coreboot.org/c/coreboot/+/32020/11/src/arch/x86/libx86emu/tra... PS11, Line 199: printk(BIOS_DEBUG, "write16(0x%08x, 0x%x)\n", addr, *val); line over 96 characters
https://review.coreboot.org/c/coreboot/+/32020/11/src/arch/x86/libx86emu/tra... PS11, Line 202: printk(BIOS_DEBUG, "write32(0x%08x, 0x%x)\n", addr, *val); line over 96 characters
https://review.coreboot.org/c/coreboot/+/32020/11/src/arch/x86/libx86emu/tra... PS11, Line 208: for (driver = &_blobolator_drivers[0]; driver != &_eblobolator_drivers[0]; driver++) { line over 96 characters
https://review.coreboot.org/c/coreboot/+/32020/11/src/arch/x86/libx86emu/tra... PS11, Line 213: for (driver = &_blobolator_drivers[0]; driver != &_eblobolator_drivers[0]; driver++) { line over 96 characters
https://review.coreboot.org/c/coreboot/+/32020/11/src/arch/x86/libx86emu/tra... PS11, Line 225: switch(bits) { switch and case should be at the same indent
https://review.coreboot.org/c/coreboot/+/32020/11/src/arch/x86/libx86emu/tra... PS11, Line 225: switch(bits) { space required before the open parenthesis '('
https://review.coreboot.org/c/coreboot/+/32020/11/src/arch/x86/libx86emu/tra... PS11, Line 227: printk(BIOS_DEBUG, " outb(0x%04x, 0x%x))\n", addr, *val); line over 96 characters
https://review.coreboot.org/c/coreboot/+/32020/11/src/arch/x86/libx86emu/tra... PS11, Line 230: printk(BIOS_DEBUG, " outw(0x%04x, 0x%x)\n", addr, *val); line over 96 characters
https://review.coreboot.org/c/coreboot/+/32020/11/src/arch/x86/libx86emu/tra... PS11, Line 233: printk(BIOS_DEBUG, " outl(0x%04x, 0x%x)\n", addr, *val); line over 96 characters
https://review.coreboot.org/c/coreboot/+/32020/11/src/mainboard/emulation/qe... File src/mainboard/emulation/qemu-q35/mainboard.c:
https://review.coreboot.org/c/coreboot/+/32020/11/src/mainboard/emulation/qe... PS11, Line 85: if (myconfig->config1 || myconfig->config2) { braces {} are not necessary for single statement blocks
https://review.coreboot.org/c/coreboot/+/32020/11/src/mainboard/emulation/qe... PS11, Line 88: if (myconfig->config3 != 0 && myconfig->config3 != 2) { braces {} are not necessary for single statement blocks
https://review.coreboot.org/c/coreboot/+/32020/11/src/mainboard/emulation/qe... PS11, Line 91: if (myconfig->config1) { braces {} are not necessary for single statement blocks
https://review.coreboot.org/c/coreboot/+/32020/11/src/mainboard/emulation/qe... PS11, Line 94: if (myconfig->config2) { braces {} are not necessary for single statement blocks
https://review.coreboot.org/c/coreboot/+/32020/11/src/mainboard/emulation/qe... PS11, Line 98: if (myconfig->config5) { braces {} are not necessary for single statement blocks
Hello Julius Werner, Arthur Heymans, Daniel Maslowski, Christian Walter, Felix Singer, Philipp Deppenwiese, build bot (Jenkins), Nico Huber, Patrick Georgi, Martin Roth,
I'd like you to reexamine a change. Please visit
https://review.coreboot.org/c/coreboot/+/32020
to look at the new patch set (#12).
Change subject: [WIP]x86: Introduce the blobolator ......................................................................
[WIP]x86: Introduce the blobolator
This is a PoC to run arbitrary code and blobs inside an emulated virtual machine using libx86emu, thus the name blobolator.
The libx86emu has been patched to the following: * redirect IO to the host machine it's running on * trace IO * start in protected mode * add mechanism to drop IO access * add Kconfig to debug code it is running
Implemented features: * Run ramstage in libx86emu * Kconfig specific hooks by using _blobolator_drivers (same mechanism as __pci_driver) * PCI decoding and BAR tracing * POST code decoding * Unhandled IO tracing * Added test code in qemu emulation/q35 * Machine parseable format
TODO: * Add support to trace only blobs, not stages. * Improve translation of known IO to human readable format ** COM ** PCI ** APIC ** PIT ** POST
Tested on qemu. Sucessfully run ramstage in blobolator. Tested on X11SSH-TF. Sucessfully run ramstage in blobolator (requires additional libx86emu patches).
You need to install 3rdparty/libx86emu from https://github.com/PatrickRudolph/libx86emu/tree/cpuid_msr_callback
Change-Id: I13e47f45e69376d046f35c04363fe3db1cfaa610 Signed-off-by: Patrick Rudolph patrick.rudolph@9elements.com --- M Makefile.inc M src/Kconfig M src/arch/x86/Makefile.inc M src/arch/x86/boot.c A src/arch/x86/libx86emu/Kconfig.debug A src/arch/x86/libx86emu/Makefile.inc A src/arch/x86/libx86emu/blobolator.c A src/arch/x86/libx86emu/blobolator_internal.h A src/arch/x86/libx86emu/stdarg.h A src/arch/x86/libx86emu/stdio.h A src/arch/x86/libx86emu/time.h A src/arch/x86/libx86emu/trace-bios.c A src/arch/x86/libx86emu/trace-pci.c A src/arch/x86/libx86emu/trace-serial.c A src/arch/x86/libx86emu/trace-skl.c A src/arch/x86/libx86emu/trace.c M src/arch/x86/postcar_loader.c M src/commonlib/include/commonlib/cbmem_id.h M src/console/printk.c A src/include/blobolator.h M src/include/rules.h M src/include/stddef.h M src/lib/Makefile.inc M src/lib/hardwaremain.c M src/lib/program.ld M src/mainboard/emulation/qemu-q35/mainboard.c 26 files changed, 2,085 insertions(+), 4 deletions(-)
git pull ssh://review.coreboot.org:29418/coreboot refs/changes/20/32020/12
build bot (Jenkins) has posted comments on this change. ( https://review.coreboot.org/c/coreboot/+/32020 )
Change subject: [WIP]x86: Introduce the blobolator ......................................................................
Patch Set 12:
(145 comments)
https://review.coreboot.org/c/coreboot/+/32020/12/src/arch/x86/libx86emu/Kco... File src/arch/x86/libx86emu/Kconfig.debug:
https://review.coreboot.org/c/coreboot/+/32020/12/src/arch/x86/libx86emu/Kco... PS12, Line 21: IO access can be traced, analysed, modified or droped. 'droped' may be misspelled - perhaps 'dropped'?
https://review.coreboot.org/c/coreboot/+/32020/12/src/arch/x86/libx86emu/blo... File src/arch/x86/libx86emu/blobolator.c:
https://review.coreboot.org/c/coreboot/+/32020/12/src/arch/x86/libx86emu/blo... PS12, Line 43: x86emu_mem_t *emu_mem_new(unsigned perm) Prefer 'unsigned int' to bare use of 'unsigned'
https://review.coreboot.org/c/coreboot/+/32020/12/src/arch/x86/libx86emu/blo... PS12, Line 48: void x86emu_set_io_perm(x86emu_t *emu, unsigned start, unsigned end, unsigned perm) Prefer 'unsigned int' to bare use of 'unsigned'
https://review.coreboot.org/c/coreboot/+/32020/12/src/arch/x86/libx86emu/blo... PS12, Line 48: void x86emu_set_io_perm(x86emu_t *emu, unsigned start, unsigned end, unsigned perm) Prefer 'unsigned int' to bare use of 'unsigned'
https://review.coreboot.org/c/coreboot/+/32020/12/src/arch/x86/libx86emu/blo... PS12, Line 48: void x86emu_set_io_perm(x86emu_t *emu, unsigned start, unsigned end, unsigned perm) Prefer 'unsigned int' to bare use of 'unsigned'
https://review.coreboot.org/c/coreboot/+/32020/12/src/arch/x86/libx86emu/blo... PS12, Line 52: unsigned x86emu_read_byte(x86emu_t *emu, unsigned addr) Prefer 'unsigned int' to bare use of 'unsigned'
https://review.coreboot.org/c/coreboot/+/32020/12/src/arch/x86/libx86emu/blo... PS12, Line 52: unsigned x86emu_read_byte(x86emu_t *emu, unsigned addr) Prefer 'unsigned int' to bare use of 'unsigned'
https://review.coreboot.org/c/coreboot/+/32020/12/src/arch/x86/libx86emu/blo... PS12, Line 56: if(emu) space required before the open parenthesis '('
https://review.coreboot.org/c/coreboot/+/32020/12/src/arch/x86/libx86emu/blo... PS12, Line 62: unsigned x86emu_read_byte_noperm(x86emu_t *emu, unsigned addr) Prefer 'unsigned int' to bare use of 'unsigned'
https://review.coreboot.org/c/coreboot/+/32020/12/src/arch/x86/libx86emu/blo... PS12, Line 62: unsigned x86emu_read_byte_noperm(x86emu_t *emu, unsigned addr) Prefer 'unsigned int' to bare use of 'unsigned'
https://review.coreboot.org/c/coreboot/+/32020/12/src/arch/x86/libx86emu/blo... PS12, Line 66: if(emu) space required before the open parenthesis '('
https://review.coreboot.org/c/coreboot/+/32020/12/src/arch/x86/libx86emu/blo... PS12, Line 73: unsigned x86emu_read_word(x86emu_t *emu, unsigned addr) Prefer 'unsigned int' to bare use of 'unsigned'
https://review.coreboot.org/c/coreboot/+/32020/12/src/arch/x86/libx86emu/blo... PS12, Line 73: unsigned x86emu_read_word(x86emu_t *emu, unsigned addr) Prefer 'unsigned int' to bare use of 'unsigned'
https://review.coreboot.org/c/coreboot/+/32020/12/src/arch/x86/libx86emu/blo... PS12, Line 77: if(emu) space required before the open parenthesis '('
https://review.coreboot.org/c/coreboot/+/32020/12/src/arch/x86/libx86emu/blo... PS12, Line 83: unsigned x86emu_read_dword(x86emu_t *emu, unsigned addr) Prefer 'unsigned int' to bare use of 'unsigned'
https://review.coreboot.org/c/coreboot/+/32020/12/src/arch/x86/libx86emu/blo... PS12, Line 83: unsigned x86emu_read_dword(x86emu_t *emu, unsigned addr) Prefer 'unsigned int' to bare use of 'unsigned'
https://review.coreboot.org/c/coreboot/+/32020/12/src/arch/x86/libx86emu/blo... PS12, Line 87: if(emu) space required before the open parenthesis '('
https://review.coreboot.org/c/coreboot/+/32020/12/src/arch/x86/libx86emu/blo... PS12, Line 93: void x86emu_write_byte(x86emu_t *emu, unsigned addr, unsigned val) Prefer 'unsigned int' to bare use of 'unsigned'
https://review.coreboot.org/c/coreboot/+/32020/12/src/arch/x86/libx86emu/blo... PS12, Line 93: void x86emu_write_byte(x86emu_t *emu, unsigned addr, unsigned val) Prefer 'unsigned int' to bare use of 'unsigned'
https://review.coreboot.org/c/coreboot/+/32020/12/src/arch/x86/libx86emu/blo... PS12, Line 97: if(emu) space required before the open parenthesis '('
https://review.coreboot.org/c/coreboot/+/32020/12/src/arch/x86/libx86emu/blo... PS12, Line 101: void x86emu_write_byte_noperm(x86emu_t *emu, unsigned addr, unsigned val) Prefer 'unsigned int' to bare use of 'unsigned'
https://review.coreboot.org/c/coreboot/+/32020/12/src/arch/x86/libx86emu/blo... PS12, Line 101: void x86emu_write_byte_noperm(x86emu_t *emu, unsigned addr, unsigned val) Prefer 'unsigned int' to bare use of 'unsigned'
https://review.coreboot.org/c/coreboot/+/32020/12/src/arch/x86/libx86emu/blo... PS12, Line 105: if(emu) space required before the open parenthesis '('
https://review.coreboot.org/c/coreboot/+/32020/12/src/arch/x86/libx86emu/blo... PS12, Line 110: void x86emu_write_word(x86emu_t *emu, unsigned addr, unsigned val) Prefer 'unsigned int' to bare use of 'unsigned'
https://review.coreboot.org/c/coreboot/+/32020/12/src/arch/x86/libx86emu/blo... PS12, Line 110: void x86emu_write_word(x86emu_t *emu, unsigned addr, unsigned val) Prefer 'unsigned int' to bare use of 'unsigned'
https://review.coreboot.org/c/coreboot/+/32020/12/src/arch/x86/libx86emu/blo... PS12, Line 114: if(emu) space required before the open parenthesis '('
https://review.coreboot.org/c/coreboot/+/32020/12/src/arch/x86/libx86emu/blo... PS12, Line 118: void x86emu_write_dword(x86emu_t *emu, unsigned addr, unsigned val) Prefer 'unsigned int' to bare use of 'unsigned'
https://review.coreboot.org/c/coreboot/+/32020/12/src/arch/x86/libx86emu/blo... PS12, Line 118: void x86emu_write_dword(x86emu_t *emu, unsigned addr, unsigned val) Prefer 'unsigned int' to bare use of 'unsigned'
https://review.coreboot.org/c/coreboot/+/32020/12/src/arch/x86/libx86emu/blo... PS12, Line 122: if(emu) space required before the open parenthesis '('
https://review.coreboot.org/c/coreboot/+/32020/12/src/arch/x86/libx86emu/blo... PS12, Line 126: unsigned x86emu_clear_log(x86emu_t *emu, int flush) Prefer 'unsigned int' to bare use of 'unsigned'
https://review.coreboot.org/c/coreboot/+/32020/12/src/arch/x86/libx86emu/blo... PS12, Line 128: if(flush && emu->log.flush) { space required before the open parenthesis '('
https://review.coreboot.org/c/coreboot/+/32020/12/src/arch/x86/libx86emu/blo... PS12, Line 129: if(emu->log.ptr && emu->log.ptr != emu->log.buf) { space required before the open parenthesis '('
https://review.coreboot.org/c/coreboot/+/32020/12/src/arch/x86/libx86emu/blo... PS12, Line 134: if((emu->log.ptr = emu->log.buf)) *emu->log.ptr = 0; space required before the open parenthesis '('
https://review.coreboot.org/c/coreboot/+/32020/12/src/arch/x86/libx86emu/blo... PS12, Line 134: if((emu->log.ptr = emu->log.buf)) *emu->log.ptr = 0; do not use assignment in if condition
https://review.coreboot.org/c/coreboot/+/32020/12/src/arch/x86/libx86emu/blo... PS12, Line 134: if((emu->log.ptr = emu->log.buf)) *emu->log.ptr = 0; trailing statements should be on next line
https://review.coreboot.org/c/coreboot/+/32020/12/src/arch/x86/libx86emu/blo... PS12, Line 171: emu->x86.R_EIP, 's', 'O', emu->x86.R_ECX, emu->x86.R_EDX, emu->x86.R_EAX); line over 96 characters
https://review.coreboot.org/c/coreboot/+/32020/12/src/arch/x86/libx86emu/blo... PS12, Line 207: memset(x86, 0, sizeof *x86); sizeof *x86 should be sizeof(*x86)
https://review.coreboot.org/c/coreboot/+/32020/12/src/arch/x86/libx86emu/blo... PS12, Line 262: __weak void vm_traceio_w(x86emu_t *emu, u32 addr, u32 *val, unsigned type) Prefer 'unsigned int' to bare use of 'unsigned'
https://review.coreboot.org/c/coreboot/+/32020/12/src/arch/x86/libx86emu/blo... PS12, Line 266: __weak void vm_traceio_r(x86emu_t *emu, u32 addr, u32 *val, unsigned type) Prefer 'unsigned int' to bare use of 'unsigned'
https://review.coreboot.org/c/coreboot/+/32020/12/src/arch/x86/libx86emu/blo... PS12, Line 270: unsigned vm_memio(x86emu_t *emu, u32 addr, u32 *val, unsigned type) Prefer 'unsigned int' to bare use of 'unsigned'
https://review.coreboot.org/c/coreboot/+/32020/12/src/arch/x86/libx86emu/blo... PS12, Line 270: unsigned vm_memio(x86emu_t *emu, u32 addr, u32 *val, unsigned type) Prefer 'unsigned int' to bare use of 'unsigned'
https://review.coreboot.org/c/coreboot/+/32020/12/src/arch/x86/libx86emu/blo... PS12, Line 273: unsigned bits = type & 0xff; Prefer 'unsigned int' to bare use of 'unsigned'
https://review.coreboot.org/c/coreboot/+/32020/12/src/arch/x86/libx86emu/blo... PS12, Line 278: switch(type) { space required before the open parenthesis '('
https://review.coreboot.org/c/coreboot/+/32020/12/src/arch/x86/libx86emu/blo... PS12, Line 280: switch(bits) { space required before the open parenthesis '('
https://review.coreboot.org/c/coreboot/+/32020/12/src/arch/x86/libx86emu/blo... PS12, Line 294: switch(bits) { space required before the open parenthesis '('
https://review.coreboot.org/c/coreboot/+/32020/12/src/arch/x86/libx86emu/blo... PS12, Line 308: switch(bits) { space required before the open parenthesis '('
https://review.coreboot.org/c/coreboot/+/32020/12/src/arch/x86/libx86emu/blo... PS12, Line 323: switch(bits) { space required before the open parenthesis '('
https://review.coreboot.org/c/coreboot/+/32020/12/src/arch/x86/libx86emu/blo... PS12, Line 337: switch(bits) { space required before the open parenthesis '('
https://review.coreboot.org/c/coreboot/+/32020/12/src/arch/x86/libx86emu/blo... PS12, Line 367: static bool x86emu_memio_drop(struct x86emu_s *emu_s, u32 addr, u32 *val, unsigned type) Prefer 'unsigned int' to bare use of 'unsigned'
https://review.coreboot.org/c/coreboot/+/32020/12/src/arch/x86/libx86emu/blo... PS12, Line 369: switch(type) { space required before the open parenthesis '('
https://review.coreboot.org/c/coreboot/+/32020/12/src/arch/x86/libx86emu/blo... PS12, Line 384: static bool x86emu_memio_except(struct x86emu_s *emu_s, u32 addr, u32 *val, unsigned type) Prefer 'unsigned int' to bare use of 'unsigned'
https://review.coreboot.org/c/coreboot/+/32020/12/src/arch/x86/libx86emu/blo... PS12, Line 389: switch(type) { space required before the open parenthesis '('
https://review.coreboot.org/c/coreboot/+/32020/12/src/arch/x86/libx86emu/blo... PS12, Line 421: static unsigned x86emu_memio_handler(struct x86emu_s *emu_s, u32 addr, u32 *val, unsigned type) Prefer 'unsigned int' to bare use of 'unsigned'
https://review.coreboot.org/c/coreboot/+/32020/12/src/arch/x86/libx86emu/blo... PS12, Line 421: static unsigned x86emu_memio_handler(struct x86emu_s *emu_s, u32 addr, u32 *val, unsigned type) Prefer 'unsigned int' to bare use of 'unsigned'
https://review.coreboot.org/c/coreboot/+/32020/12/src/arch/x86/libx86emu/blo... PS12, Line 490: static int x86emu_intr_handler(x86emu_t *emu, u8 num, unsigned type) Prefer 'unsigned int' to bare use of 'unsigned'
https://review.coreboot.org/c/coreboot/+/32020/12/src/arch/x86/libx86emu/blo... PS12, Line 503: vm_memio(emu, emu->x86.R_EIP + i - 16, &val, X86EMU_MEMIO_R|X86EMU_MEMIO_8); line over 96 characters
https://review.coreboot.org/c/coreboot/+/32020/12/src/arch/x86/libx86emu/blo... PS12, Line 516: static void x86emu_flush_log(x86emu_t *emu, char *buf, unsigned size) Prefer 'unsigned int' to bare use of 'unsigned'
https://review.coreboot.org/c/coreboot/+/32020/12/src/arch/x86/libx86emu/blo... File src/arch/x86/libx86emu/blobolator_internal.h:
https://review.coreboot.org/c/coreboot/+/32020/12/src/arch/x86/libx86emu/blo... PS12, Line 18: void vm_traceio_w(x86emu_t *emu, u32 addr, u32 *val, unsigned type); Prefer 'unsigned int' to bare use of 'unsigned'
https://review.coreboot.org/c/coreboot/+/32020/12/src/arch/x86/libx86emu/blo... PS12, Line 19: void vm_traceio_r(x86emu_t *emu, u32 addr, u32 *val, unsigned type); Prefer 'unsigned int' to bare use of 'unsigned'
https://review.coreboot.org/c/coreboot/+/32020/12/src/arch/x86/libx86emu/blo... PS12, Line 25: void (*init)(x86emu_t *emu); code indent should use tabs where possible
https://review.coreboot.org/c/coreboot/+/32020/12/src/arch/x86/libx86emu/blo... PS12, Line 25: void (*init)(x86emu_t *emu); please, no spaces at the start of a line
https://review.coreboot.org/c/coreboot/+/32020/12/src/arch/x86/libx86emu/blo... PS12, Line 26: bool (*ignore_addr_io)(x86emu_t *emu, u32 addr); code indent should use tabs where possible
https://review.coreboot.org/c/coreboot/+/32020/12/src/arch/x86/libx86emu/blo... PS12, Line 26: bool (*ignore_addr_io)(x86emu_t *emu, u32 addr); please, no spaces at the start of a line
https://review.coreboot.org/c/coreboot/+/32020/12/src/arch/x86/libx86emu/blo... PS12, Line 27: bool (*ignore_addr_mem)(x86emu_t *emu, u32 addr); code indent should use tabs where possible
https://review.coreboot.org/c/coreboot/+/32020/12/src/arch/x86/libx86emu/blo... PS12, Line 27: bool (*ignore_addr_mem)(x86emu_t *emu, u32 addr); please, no spaces at the start of a line
https://review.coreboot.org/c/coreboot/+/32020/12/src/arch/x86/libx86emu/tra... File src/arch/x86/libx86emu/trace-bios.c:
https://review.coreboot.org/c/coreboot/+/32020/12/src/arch/x86/libx86emu/tra... PS12, Line 28: if (addr > 0xffffffff - CONFIG_ROM_SIZE) { braces {} are not necessary for single statement blocks
https://review.coreboot.org/c/coreboot/+/32020/12/src/arch/x86/libx86emu/tra... File src/arch/x86/libx86emu/trace-pci.c:
https://review.coreboot.org/c/coreboot/+/32020/12/src/arch/x86/libx86emu/tra... PS12, Line 51: devfn >> 3, devfn & 7); code indent should use tabs where possible
https://review.coreboot.org/c/coreboot/+/32020/12/src/arch/x86/libx86emu/tra... PS12, Line 78: static struct bar_tracer *bar_trace_find(struct device *dev, unsigned int bar, unsigned int type) line over 96 characters
https://review.coreboot.org/c/coreboot/+/32020/12/src/arch/x86/libx86emu/tra... PS12, Line 163: DEVFN_T dev = ((bus << 20)| devfn << 12); need consistent spacing around '|' (ctx:VxW)
https://review.coreboot.org/c/coreboot/+/32020/12/src/arch/x86/libx86emu/tra... PS12, Line 167: if (!dev) { braces {} are not necessary for single statement blocks
https://review.coreboot.org/c/coreboot/+/32020/12/src/arch/x86/libx86emu/tra... PS12, Line 199: while (!(moving & size)) { braces {} are not necessary for single statement blocks
https://review.coreboot.org/c/coreboot/+/32020/12/src/arch/x86/libx86emu/tra... PS12, Line 208: tracer = bar_trace_add(pcidev_path_on_root(devfn), (index - 0x10) / 4, !!(attr & PCI_BASE_ADDRESS_SPACE_IO)); line over 96 characters
https://review.coreboot.org/c/coreboot/+/32020/12/src/arch/x86/libx86emu/tra... PS12, Line 230: switch(bits) { switch and case should be at the same indent
https://review.coreboot.org/c/coreboot/+/32020/12/src/arch/x86/libx86emu/tra... PS12, Line 230: switch(bits) { space required before the open parenthesis '('
https://review.coreboot.org/c/coreboot/+/32020/12/src/arch/x86/libx86emu/tra... PS12, Line 259: switch(bits) { switch and case should be at the same indent
https://review.coreboot.org/c/coreboot/+/32020/12/src/arch/x86/libx86emu/tra... PS12, Line 259: switch(bits) { space required before the open parenthesis '('
https://review.coreboot.org/c/coreboot/+/32020/12/src/arch/x86/libx86emu/tra... PS12, Line 288: switch(bits) { switch and case should be at the same indent
https://review.coreboot.org/c/coreboot/+/32020/12/src/arch/x86/libx86emu/tra... PS12, Line 288: switch(bits) { space required before the open parenthesis '('
https://review.coreboot.org/c/coreboot/+/32020/12/src/arch/x86/libx86emu/tra... PS12, Line 318: switch(bits) { switch and case should be at the same indent
https://review.coreboot.org/c/coreboot/+/32020/12/src/arch/x86/libx86emu/tra... PS12, Line 318: switch(bits) { space required before the open parenthesis '('
https://review.coreboot.org/c/coreboot/+/32020/12/src/arch/x86/libx86emu/tra... PS12, Line 379: switch(bits) { space required before the open parenthesis '('
https://review.coreboot.org/c/coreboot/+/32020/12/src/arch/x86/libx86emu/tra... PS12, Line 415: switch(bits) { space required before the open parenthesis '('
https://review.coreboot.org/c/coreboot/+/32020/12/src/arch/x86/libx86emu/tra... PS12, Line 458: switch(bits) { space required before the open parenthesis '('
https://review.coreboot.org/c/coreboot/+/32020/12/src/arch/x86/libx86emu/tra... PS12, Line 460: if (addr < 0xcfc) { braces {} are not necessary for any arm of this statement
https://review.coreboot.org/c/coreboot/+/32020/12/src/arch/x86/libx86emu/tra... PS12, Line 467: if (addr < 0xcfc) { braces {} are not necessary for any arm of this statement
https://review.coreboot.org/c/coreboot/+/32020/12/src/arch/x86/libx86emu/tra... PS12, Line 474: if (addr < 0xcfc) { braces {} are not necessary for any arm of this statement
https://review.coreboot.org/c/coreboot/+/32020/12/src/arch/x86/libx86emu/tra... PS12, Line 488: switch(bits) { space required before the open parenthesis '('
https://review.coreboot.org/c/coreboot/+/32020/12/src/arch/x86/libx86emu/tra... PS12, Line 504: if (conf >= PCI_BASE_ADDRESS_0 && conf < (PCI_BASE_ADDRESS_5 + 4) && !(conf & 3)) line over 96 characters
https://review.coreboot.org/c/coreboot/+/32020/12/src/arch/x86/libx86emu/tra... PS12, Line 521: switch(bits) { space required before the open parenthesis '('
https://review.coreboot.org/c/coreboot/+/32020/12/src/arch/x86/libx86emu/tra... PS12, Line 537: if (conf >= PCI_BASE_ADDRESS_0 && conf < (PCI_BASE_ADDRESS_5 + 4) && !(conf & 3)) line over 96 characters
https://review.coreboot.org/c/coreboot/+/32020/12/src/arch/x86/libx86emu/tra... File src/arch/x86/libx86emu/trace-skl.c:
https://review.coreboot.org/c/coreboot/+/32020/12/src/arch/x86/libx86emu/tra... PS12, Line 34: switch (devfn) { switch and case should be at the same indent
https://review.coreboot.org/c/coreboot/+/32020/12/src/arch/x86/libx86emu/tra... PS12, Line 87: devfn >> 3, devfn & 7); code indent should use tabs where possible
https://review.coreboot.org/c/coreboot/+/32020/12/src/arch/x86/libx86emu/tra... PS12, Line 95: if (addr > 0x78000000 && addr < 0x78510000) { braces {} are not necessary for single statement blocks
https://review.coreboot.org/c/coreboot/+/32020/12/src/arch/x86/libx86emu/tra... PS12, Line 129: bool pci_trace_p2sb_r(const int bus, const int devfn, const int off, u32 *val, unsigned int bits) line over 96 characters
https://review.coreboot.org/c/coreboot/+/32020/12/src/arch/x86/libx86emu/tra... PS12, Line 137: switch(bits) { space required before the open parenthesis '('
https://review.coreboot.org/c/coreboot/+/32020/12/src/arch/x86/libx86emu/tra... PS12, Line 139: if (off >= P2SB_CR_SBI_ADDR && off < (P2SB_CR_SBI_ADDR + 4)) { braces {} are not necessary for any arm of this statement
https://review.coreboot.org/c/coreboot/+/32020/12/src/arch/x86/libx86emu/tra... PS12, Line 148: if (off >= P2SB_CR_SBI_ADDR && off < (P2SB_CR_SBI_ADDR + 4)) { braces {} are not necessary for any arm of this statement
https://review.coreboot.org/c/coreboot/+/32020/12/src/arch/x86/libx86emu/tra... PS12, Line 157: if (off >= P2SB_CR_SBI_ADDR && off < (P2SB_CR_SBI_ADDR + 4)) { braces {} are not necessary for any arm of this statement
https://review.coreboot.org/c/coreboot/+/32020/12/src/arch/x86/libx86emu/tra... PS12, Line 167: if (!(sb_data.w & 1) && pending ) { space prohibited before that close parenthesis ')'
https://review.coreboot.org/c/coreboot/+/32020/12/src/arch/x86/libx86emu/tra... PS12, Line 167: if (!(sb_data.w & 1) && pending ) { braces {} are not necessary for single statement blocks
https://review.coreboot.org/c/coreboot/+/32020/12/src/arch/x86/libx86emu/tra... PS12, Line 172: bool pci_trace_p2sb_w(const int bus, const int devfn, const int off, u32 *val, unsigned int bits) line over 96 characters
https://review.coreboot.org/c/coreboot/+/32020/12/src/arch/x86/libx86emu/tra... PS12, Line 180: switch(bits) { space required before the open parenthesis '('
https://review.coreboot.org/c/coreboot/+/32020/12/src/arch/x86/libx86emu/tra... PS12, Line 182: if (off >= P2SB_CR_SBI_ADDR && off < (P2SB_CR_SBI_ADDR + 4)) { braces {} are not necessary for any arm of this statement
https://review.coreboot.org/c/coreboot/+/32020/12/src/arch/x86/libx86emu/tra... PS12, Line 191: if (off >= P2SB_CR_SBI_ADDR && off < (P2SB_CR_SBI_ADDR + 4)) { braces {} are not necessary for any arm of this statement
https://review.coreboot.org/c/coreboot/+/32020/12/src/arch/x86/libx86emu/tra... PS12, Line 200: if (off >= P2SB_CR_SBI_ADDR && off < (P2SB_CR_SBI_ADDR + 4)) { braces {} are not necessary for any arm of this statement
https://review.coreboot.org/c/coreboot/+/32020/12/src/arch/x86/libx86emu/tra... PS12, Line 210: if ((sb_data.w & 1) && !pending ) { space prohibited before that close parenthesis ')'
https://review.coreboot.org/c/coreboot/+/32020/12/src/arch/x86/libx86emu/tra... PS12, Line 210: if ((sb_data.w & 1) && !pending ) { braces {} are not necessary for single statement blocks
https://review.coreboot.org/c/coreboot/+/32020/12/src/arch/x86/libx86emu/tra... File src/arch/x86/libx86emu/trace.c:
https://review.coreboot.org/c/coreboot/+/32020/12/src/arch/x86/libx86emu/tra... PS12, Line 56: addr < ( (uintptr_t)baseptr + size)) { space prohibited after that open parenthesis '('
https://review.coreboot.org/c/coreboot/+/32020/12/src/arch/x86/libx86emu/tra... PS12, Line 62: addr < ((uintptr_t)cbmem_entry_start(ramstage_entry) + (uintptr_t)cbmem_entry_size(ramstage_entry))) { line over 96 characters
https://review.coreboot.org/c/coreboot/+/32020/12/src/arch/x86/libx86emu/tra... PS12, Line 91: void vm_traceio_r(x86emu_t *emu, u32 addr, u32 *val, unsigned type) Prefer 'unsigned int' to bare use of 'unsigned'
https://review.coreboot.org/c/coreboot/+/32020/12/src/arch/x86/libx86emu/tra... PS12, Line 102: for (driver = &_blobolator_drivers[0]; driver != &_eblobolator_drivers[0]; driver++) { line over 96 characters
https://review.coreboot.org/c/coreboot/+/32020/12/src/arch/x86/libx86emu/tra... PS12, Line 107: for (driver = &_blobolator_drivers[0]; driver != &_eblobolator_drivers[0]; driver++) { line over 96 characters
https://review.coreboot.org/c/coreboot/+/32020/12/src/arch/x86/libx86emu/tra... PS12, Line 119: switch(bits) { switch and case should be at the same indent
https://review.coreboot.org/c/coreboot/+/32020/12/src/arch/x86/libx86emu/tra... PS12, Line 119: switch(bits) { space required before the open parenthesis '('
https://review.coreboot.org/c/coreboot/+/32020/12/src/arch/x86/libx86emu/tra... PS12, Line 121: printk(BIOS_DEBUG, " read8(0x%08x) // = 0x%x\n", addr, *val); line over 96 characters
https://review.coreboot.org/c/coreboot/+/32020/12/src/arch/x86/libx86emu/tra... PS12, Line 124: printk(BIOS_DEBUG, " read16(0x%08x) // = 0x%x\n", addr, *val); line over 96 characters
https://review.coreboot.org/c/coreboot/+/32020/12/src/arch/x86/libx86emu/tra... PS12, Line 127: printk(BIOS_DEBUG, " read32(0x%08x) // = 0x%x\n", addr, *val); line over 96 characters
https://review.coreboot.org/c/coreboot/+/32020/12/src/arch/x86/libx86emu/tra... PS12, Line 133: for (driver = &_blobolator_drivers[0]; driver != &_eblobolator_drivers[0]; driver++) { line over 96 characters
https://review.coreboot.org/c/coreboot/+/32020/12/src/arch/x86/libx86emu/tra... PS12, Line 138: for (driver = &_blobolator_drivers[0]; driver != &_eblobolator_drivers[0]; driver++) { line over 96 characters
https://review.coreboot.org/c/coreboot/+/32020/12/src/arch/x86/libx86emu/tra... PS12, Line 150: switch(bits) { switch and case should be at the same indent
https://review.coreboot.org/c/coreboot/+/32020/12/src/arch/x86/libx86emu/tra... PS12, Line 150: switch(bits) { space required before the open parenthesis '('
https://review.coreboot.org/c/coreboot/+/32020/12/src/arch/x86/libx86emu/tra... PS12, Line 152: printk(BIOS_DEBUG, " inb(0x%04x) // = 0x%x\n", addr, *val); line over 96 characters
https://review.coreboot.org/c/coreboot/+/32020/12/src/arch/x86/libx86emu/tra... PS12, Line 155: printk(BIOS_DEBUG, " inw(0x%04x) // = 0x%x\n", addr, *val); line over 96 characters
https://review.coreboot.org/c/coreboot/+/32020/12/src/arch/x86/libx86emu/tra... PS12, Line 158: printk(BIOS_DEBUG, " inl(0x%04x) // = 0x%x\n", addr, *val); line over 96 characters
https://review.coreboot.org/c/coreboot/+/32020/12/src/arch/x86/libx86emu/tra... PS12, Line 166: void vm_traceio_w(x86emu_t *emu, u32 addr, u32 *val, unsigned type) Prefer 'unsigned int' to bare use of 'unsigned'
https://review.coreboot.org/c/coreboot/+/32020/12/src/arch/x86/libx86emu/tra... PS12, Line 168: const unsigned bits = type & 0xff; Prefer 'unsigned int' to bare use of 'unsigned'
https://review.coreboot.org/c/coreboot/+/32020/12/src/arch/x86/libx86emu/tra... PS12, Line 177: for (driver = &_blobolator_drivers[0]; driver != &_eblobolator_drivers[0]; driver++) { line over 96 characters
https://review.coreboot.org/c/coreboot/+/32020/12/src/arch/x86/libx86emu/tra... PS12, Line 182: for (driver = &_blobolator_drivers[0]; driver != &_eblobolator_drivers[0]; driver++) { line over 96 characters
https://review.coreboot.org/c/coreboot/+/32020/12/src/arch/x86/libx86emu/tra... PS12, Line 194: switch(bits) { switch and case should be at the same indent
https://review.coreboot.org/c/coreboot/+/32020/12/src/arch/x86/libx86emu/tra... PS12, Line 194: switch(bits) { space required before the open parenthesis '('
https://review.coreboot.org/c/coreboot/+/32020/12/src/arch/x86/libx86emu/tra... PS12, Line 196: printk(BIOS_DEBUG, " write8(0x%08x, 0x%x)\n", addr, *val); line over 96 characters
https://review.coreboot.org/c/coreboot/+/32020/12/src/arch/x86/libx86emu/tra... PS12, Line 199: printk(BIOS_DEBUG, "write16(0x%08x, 0x%x)\n", addr, *val); line over 96 characters
https://review.coreboot.org/c/coreboot/+/32020/12/src/arch/x86/libx86emu/tra... PS12, Line 202: printk(BIOS_DEBUG, "write32(0x%08x, 0x%x)\n", addr, *val); line over 96 characters
https://review.coreboot.org/c/coreboot/+/32020/12/src/arch/x86/libx86emu/tra... PS12, Line 208: for (driver = &_blobolator_drivers[0]; driver != &_eblobolator_drivers[0]; driver++) { line over 96 characters
https://review.coreboot.org/c/coreboot/+/32020/12/src/arch/x86/libx86emu/tra... PS12, Line 213: for (driver = &_blobolator_drivers[0]; driver != &_eblobolator_drivers[0]; driver++) { line over 96 characters
https://review.coreboot.org/c/coreboot/+/32020/12/src/arch/x86/libx86emu/tra... PS12, Line 225: switch(bits) { switch and case should be at the same indent
https://review.coreboot.org/c/coreboot/+/32020/12/src/arch/x86/libx86emu/tra... PS12, Line 225: switch(bits) { space required before the open parenthesis '('
https://review.coreboot.org/c/coreboot/+/32020/12/src/arch/x86/libx86emu/tra... PS12, Line 227: printk(BIOS_DEBUG, " outb(0x%04x, 0x%x))\n", addr, *val); line over 96 characters
https://review.coreboot.org/c/coreboot/+/32020/12/src/arch/x86/libx86emu/tra... PS12, Line 230: printk(BIOS_DEBUG, " outw(0x%04x, 0x%x)\n", addr, *val); line over 96 characters
https://review.coreboot.org/c/coreboot/+/32020/12/src/arch/x86/libx86emu/tra... PS12, Line 233: printk(BIOS_DEBUG, " outl(0x%04x, 0x%x)\n", addr, *val); line over 96 characters
https://review.coreboot.org/c/coreboot/+/32020/12/src/mainboard/emulation/qe... File src/mainboard/emulation/qemu-q35/mainboard.c:
https://review.coreboot.org/c/coreboot/+/32020/12/src/mainboard/emulation/qe... PS12, Line 85: if (myconfig->config1 || myconfig->config2) { braces {} are not necessary for single statement blocks
https://review.coreboot.org/c/coreboot/+/32020/12/src/mainboard/emulation/qe... PS12, Line 88: if (myconfig->config3 != 0 && myconfig->config3 != 2) { braces {} are not necessary for single statement blocks
https://review.coreboot.org/c/coreboot/+/32020/12/src/mainboard/emulation/qe... PS12, Line 91: if (myconfig->config1) { braces {} are not necessary for single statement blocks
https://review.coreboot.org/c/coreboot/+/32020/12/src/mainboard/emulation/qe... PS12, Line 94: if (myconfig->config2) { braces {} are not necessary for single statement blocks
https://review.coreboot.org/c/coreboot/+/32020/12/src/mainboard/emulation/qe... PS12, Line 98: if (myconfig->config5) { braces {} are not necessary for single statement blocks
Hello Julius Werner, Arthur Heymans, Daniel Maslowski, Christian Walter, Felix Singer, Philipp Deppenwiese, build bot (Jenkins), Nico Huber, Patrick Georgi, Martin Roth,
I'd like you to reexamine a change. Please visit
https://review.coreboot.org/c/coreboot/+/32020
to look at the new patch set (#13).
Change subject: [WIP]x86: Introduce the blobolator ......................................................................
[WIP]x86: Introduce the blobolator
This is a PoC to run arbitrary code and blobs inside an emulated virtual machine using libx86emu, thus the name blobolator.
The libx86emu has been patched to the following: * redirect IO to the host machine it's running on * trace IO * start in protected mode * add mechanism to drop IO access * add Kconfig to debug code it is running
Implemented features: * Run ramstage in libx86emu * Kconfig specific hooks by using _blobolator_drivers (same mechanism as __pci_driver) * PCI decoding and BAR tracing * POST code decoding * Unhandled IO tracing * Added test code in qemu emulation/q35 * Machine parseable format
TODO: * Add support to trace only blobs, not stages. * Improve translation of known IO to human readable format ** COM ** PCI ** APIC ** PIT ** POST
Tested on qemu. Sucessfully run ramstage in blobolator. Tested on X11SSH-TF. Sucessfully run ramstage in blobolator (requires additional libx86emu patches).
You need to install 3rdparty/libx86emu from https://github.com/PatrickRudolph/libx86emu/tree/cpuid_msr_callback
Change-Id: I13e47f45e69376d046f35c04363fe3db1cfaa610 Signed-off-by: Patrick Rudolph patrick.rudolph@9elements.com --- M src/Kconfig M src/arch/x86/Makefile.inc M src/arch/x86/boot.c A src/arch/x86/libx86emu/Kconfig.debug A src/arch/x86/libx86emu/Makefile.inc A src/arch/x86/libx86emu/blobolator.c A src/arch/x86/libx86emu/blobolator_internal.h A src/arch/x86/libx86emu/stdarg.h A src/arch/x86/libx86emu/stdio.h A src/arch/x86/libx86emu/time.h A src/arch/x86/libx86emu/trace-bios.c A src/arch/x86/libx86emu/trace-pci.c A src/arch/x86/libx86emu/trace-serial.c A src/arch/x86/libx86emu/trace-skl.c A src/arch/x86/libx86emu/trace.c M src/arch/x86/postcar_loader.c M src/commonlib/include/commonlib/cbmem_id.h M src/console/printk.c M src/drivers/intel/fsp2_0/silicon_init.c A src/include/blobolator.h M src/include/rules.h M src/include/stddef.h M src/lib/Makefile.inc M src/lib/hardwaremain.c M src/lib/program.ld M src/mainboard/emulation/qemu-q35/mainboard.c 26 files changed, 2,099 insertions(+), 4 deletions(-)
git pull ssh://review.coreboot.org:29418/coreboot refs/changes/20/32020/13
build bot (Jenkins) has posted comments on this change. ( https://review.coreboot.org/c/coreboot/+/32020 )
Change subject: [WIP]x86: Introduce the blobolator ......................................................................
Patch Set 13:
(146 comments)
https://review.coreboot.org/c/coreboot/+/32020/13/src/arch/x86/libx86emu/Kco... File src/arch/x86/libx86emu/Kconfig.debug:
https://review.coreboot.org/c/coreboot/+/32020/13/src/arch/x86/libx86emu/Kco... PS13, Line 21: IO access can be traced, analysed, modified or droped. 'droped' may be misspelled - perhaps 'dropped'?
https://review.coreboot.org/c/coreboot/+/32020/13/src/arch/x86/libx86emu/blo... File src/arch/x86/libx86emu/blobolator.c:
https://review.coreboot.org/c/coreboot/+/32020/13/src/arch/x86/libx86emu/blo... PS13, Line 43: x86emu_mem_t *emu_mem_new(unsigned perm) Prefer 'unsigned int' to bare use of 'unsigned'
https://review.coreboot.org/c/coreboot/+/32020/13/src/arch/x86/libx86emu/blo... PS13, Line 48: void x86emu_set_io_perm(x86emu_t *emu, unsigned start, unsigned end, unsigned perm) Prefer 'unsigned int' to bare use of 'unsigned'
https://review.coreboot.org/c/coreboot/+/32020/13/src/arch/x86/libx86emu/blo... PS13, Line 48: void x86emu_set_io_perm(x86emu_t *emu, unsigned start, unsigned end, unsigned perm) Prefer 'unsigned int' to bare use of 'unsigned'
https://review.coreboot.org/c/coreboot/+/32020/13/src/arch/x86/libx86emu/blo... PS13, Line 48: void x86emu_set_io_perm(x86emu_t *emu, unsigned start, unsigned end, unsigned perm) Prefer 'unsigned int' to bare use of 'unsigned'
https://review.coreboot.org/c/coreboot/+/32020/13/src/arch/x86/libx86emu/blo... PS13, Line 52: unsigned x86emu_read_byte(x86emu_t *emu, unsigned addr) Prefer 'unsigned int' to bare use of 'unsigned'
https://review.coreboot.org/c/coreboot/+/32020/13/src/arch/x86/libx86emu/blo... PS13, Line 52: unsigned x86emu_read_byte(x86emu_t *emu, unsigned addr) Prefer 'unsigned int' to bare use of 'unsigned'
https://review.coreboot.org/c/coreboot/+/32020/13/src/arch/x86/libx86emu/blo... PS13, Line 56: if(emu) space required before the open parenthesis '('
https://review.coreboot.org/c/coreboot/+/32020/13/src/arch/x86/libx86emu/blo... PS13, Line 62: unsigned x86emu_read_byte_noperm(x86emu_t *emu, unsigned addr) Prefer 'unsigned int' to bare use of 'unsigned'
https://review.coreboot.org/c/coreboot/+/32020/13/src/arch/x86/libx86emu/blo... PS13, Line 62: unsigned x86emu_read_byte_noperm(x86emu_t *emu, unsigned addr) Prefer 'unsigned int' to bare use of 'unsigned'
https://review.coreboot.org/c/coreboot/+/32020/13/src/arch/x86/libx86emu/blo... PS13, Line 66: if(emu) space required before the open parenthesis '('
https://review.coreboot.org/c/coreboot/+/32020/13/src/arch/x86/libx86emu/blo... PS13, Line 73: unsigned x86emu_read_word(x86emu_t *emu, unsigned addr) Prefer 'unsigned int' to bare use of 'unsigned'
https://review.coreboot.org/c/coreboot/+/32020/13/src/arch/x86/libx86emu/blo... PS13, Line 73: unsigned x86emu_read_word(x86emu_t *emu, unsigned addr) Prefer 'unsigned int' to bare use of 'unsigned'
https://review.coreboot.org/c/coreboot/+/32020/13/src/arch/x86/libx86emu/blo... PS13, Line 77: if(emu) space required before the open parenthesis '('
https://review.coreboot.org/c/coreboot/+/32020/13/src/arch/x86/libx86emu/blo... PS13, Line 83: unsigned x86emu_read_dword(x86emu_t *emu, unsigned addr) Prefer 'unsigned int' to bare use of 'unsigned'
https://review.coreboot.org/c/coreboot/+/32020/13/src/arch/x86/libx86emu/blo... PS13, Line 83: unsigned x86emu_read_dword(x86emu_t *emu, unsigned addr) Prefer 'unsigned int' to bare use of 'unsigned'
https://review.coreboot.org/c/coreboot/+/32020/13/src/arch/x86/libx86emu/blo... PS13, Line 87: if(emu) space required before the open parenthesis '('
https://review.coreboot.org/c/coreboot/+/32020/13/src/arch/x86/libx86emu/blo... PS13, Line 93: void x86emu_write_byte(x86emu_t *emu, unsigned addr, unsigned val) Prefer 'unsigned int' to bare use of 'unsigned'
https://review.coreboot.org/c/coreboot/+/32020/13/src/arch/x86/libx86emu/blo... PS13, Line 93: void x86emu_write_byte(x86emu_t *emu, unsigned addr, unsigned val) Prefer 'unsigned int' to bare use of 'unsigned'
https://review.coreboot.org/c/coreboot/+/32020/13/src/arch/x86/libx86emu/blo... PS13, Line 97: if(emu) space required before the open parenthesis '('
https://review.coreboot.org/c/coreboot/+/32020/13/src/arch/x86/libx86emu/blo... PS13, Line 101: void x86emu_write_byte_noperm(x86emu_t *emu, unsigned addr, unsigned val) Prefer 'unsigned int' to bare use of 'unsigned'
https://review.coreboot.org/c/coreboot/+/32020/13/src/arch/x86/libx86emu/blo... PS13, Line 101: void x86emu_write_byte_noperm(x86emu_t *emu, unsigned addr, unsigned val) Prefer 'unsigned int' to bare use of 'unsigned'
https://review.coreboot.org/c/coreboot/+/32020/13/src/arch/x86/libx86emu/blo... PS13, Line 105: if(emu) space required before the open parenthesis '('
https://review.coreboot.org/c/coreboot/+/32020/13/src/arch/x86/libx86emu/blo... PS13, Line 110: void x86emu_write_word(x86emu_t *emu, unsigned addr, unsigned val) Prefer 'unsigned int' to bare use of 'unsigned'
https://review.coreboot.org/c/coreboot/+/32020/13/src/arch/x86/libx86emu/blo... PS13, Line 110: void x86emu_write_word(x86emu_t *emu, unsigned addr, unsigned val) Prefer 'unsigned int' to bare use of 'unsigned'
https://review.coreboot.org/c/coreboot/+/32020/13/src/arch/x86/libx86emu/blo... PS13, Line 114: if(emu) space required before the open parenthesis '('
https://review.coreboot.org/c/coreboot/+/32020/13/src/arch/x86/libx86emu/blo... PS13, Line 118: void x86emu_write_dword(x86emu_t *emu, unsigned addr, unsigned val) Prefer 'unsigned int' to bare use of 'unsigned'
https://review.coreboot.org/c/coreboot/+/32020/13/src/arch/x86/libx86emu/blo... PS13, Line 118: void x86emu_write_dword(x86emu_t *emu, unsigned addr, unsigned val) Prefer 'unsigned int' to bare use of 'unsigned'
https://review.coreboot.org/c/coreboot/+/32020/13/src/arch/x86/libx86emu/blo... PS13, Line 122: if(emu) space required before the open parenthesis '('
https://review.coreboot.org/c/coreboot/+/32020/13/src/arch/x86/libx86emu/blo... PS13, Line 126: unsigned x86emu_clear_log(x86emu_t *emu, int flush) Prefer 'unsigned int' to bare use of 'unsigned'
https://review.coreboot.org/c/coreboot/+/32020/13/src/arch/x86/libx86emu/blo... PS13, Line 128: if(flush && emu->log.flush) { space required before the open parenthesis '('
https://review.coreboot.org/c/coreboot/+/32020/13/src/arch/x86/libx86emu/blo... PS13, Line 129: if(emu->log.ptr && emu->log.ptr != emu->log.buf) { space required before the open parenthesis '('
https://review.coreboot.org/c/coreboot/+/32020/13/src/arch/x86/libx86emu/blo... PS13, Line 134: if((emu->log.ptr = emu->log.buf)) *emu->log.ptr = 0; space required before the open parenthesis '('
https://review.coreboot.org/c/coreboot/+/32020/13/src/arch/x86/libx86emu/blo... PS13, Line 134: if((emu->log.ptr = emu->log.buf)) *emu->log.ptr = 0; do not use assignment in if condition
https://review.coreboot.org/c/coreboot/+/32020/13/src/arch/x86/libx86emu/blo... PS13, Line 134: if((emu->log.ptr = emu->log.buf)) *emu->log.ptr = 0; trailing statements should be on next line
https://review.coreboot.org/c/coreboot/+/32020/13/src/arch/x86/libx86emu/blo... PS13, Line 171: emu->x86.R_EIP, 's', 'O', emu->x86.R_ECX, emu->x86.R_EDX, emu->x86.R_EAX); line over 96 characters
https://review.coreboot.org/c/coreboot/+/32020/13/src/arch/x86/libx86emu/blo... PS13, Line 207: memset(x86, 0, sizeof *x86); sizeof *x86 should be sizeof(*x86)
https://review.coreboot.org/c/coreboot/+/32020/13/src/arch/x86/libx86emu/blo... PS13, Line 262: __weak void vm_traceio_w(x86emu_t *emu, u32 addr, u32 *val, unsigned type) Prefer 'unsigned int' to bare use of 'unsigned'
https://review.coreboot.org/c/coreboot/+/32020/13/src/arch/x86/libx86emu/blo... PS13, Line 266: __weak void vm_traceio_r(x86emu_t *emu, u32 addr, u32 *val, unsigned type) Prefer 'unsigned int' to bare use of 'unsigned'
https://review.coreboot.org/c/coreboot/+/32020/13/src/arch/x86/libx86emu/blo... PS13, Line 270: unsigned vm_memio(x86emu_t *emu, u32 addr, u32 *val, unsigned type) Prefer 'unsigned int' to bare use of 'unsigned'
https://review.coreboot.org/c/coreboot/+/32020/13/src/arch/x86/libx86emu/blo... PS13, Line 270: unsigned vm_memio(x86emu_t *emu, u32 addr, u32 *val, unsigned type) Prefer 'unsigned int' to bare use of 'unsigned'
https://review.coreboot.org/c/coreboot/+/32020/13/src/arch/x86/libx86emu/blo... PS13, Line 273: unsigned bits = type & 0xff; Prefer 'unsigned int' to bare use of 'unsigned'
https://review.coreboot.org/c/coreboot/+/32020/13/src/arch/x86/libx86emu/blo... PS13, Line 278: switch(type) { space required before the open parenthesis '('
https://review.coreboot.org/c/coreboot/+/32020/13/src/arch/x86/libx86emu/blo... PS13, Line 280: switch(bits) { space required before the open parenthesis '('
https://review.coreboot.org/c/coreboot/+/32020/13/src/arch/x86/libx86emu/blo... PS13, Line 294: switch(bits) { space required before the open parenthesis '('
https://review.coreboot.org/c/coreboot/+/32020/13/src/arch/x86/libx86emu/blo... PS13, Line 308: switch(bits) { space required before the open parenthesis '('
https://review.coreboot.org/c/coreboot/+/32020/13/src/arch/x86/libx86emu/blo... PS13, Line 323: switch(bits) { space required before the open parenthesis '('
https://review.coreboot.org/c/coreboot/+/32020/13/src/arch/x86/libx86emu/blo... PS13, Line 337: switch(bits) { space required before the open parenthesis '('
https://review.coreboot.org/c/coreboot/+/32020/13/src/arch/x86/libx86emu/blo... PS13, Line 367: static bool x86emu_memio_drop(struct x86emu_s *emu_s, u32 addr, u32 *val, unsigned type) Prefer 'unsigned int' to bare use of 'unsigned'
https://review.coreboot.org/c/coreboot/+/32020/13/src/arch/x86/libx86emu/blo... PS13, Line 369: switch(type) { space required before the open parenthesis '('
https://review.coreboot.org/c/coreboot/+/32020/13/src/arch/x86/libx86emu/blo... PS13, Line 384: static bool x86emu_memio_except(struct x86emu_s *emu_s, u32 addr, u32 *val, unsigned type) Prefer 'unsigned int' to bare use of 'unsigned'
https://review.coreboot.org/c/coreboot/+/32020/13/src/arch/x86/libx86emu/blo... PS13, Line 389: switch(type) { space required before the open parenthesis '('
https://review.coreboot.org/c/coreboot/+/32020/13/src/arch/x86/libx86emu/blo... PS13, Line 421: static unsigned x86emu_memio_handler(struct x86emu_s *emu_s, u32 addr, u32 *val, unsigned type) Prefer 'unsigned int' to bare use of 'unsigned'
https://review.coreboot.org/c/coreboot/+/32020/13/src/arch/x86/libx86emu/blo... PS13, Line 421: static unsigned x86emu_memio_handler(struct x86emu_s *emu_s, u32 addr, u32 *val, unsigned type) Prefer 'unsigned int' to bare use of 'unsigned'
https://review.coreboot.org/c/coreboot/+/32020/13/src/arch/x86/libx86emu/blo... PS13, Line 490: static int x86emu_intr_handler(x86emu_t *emu, u8 num, unsigned type) Prefer 'unsigned int' to bare use of 'unsigned'
https://review.coreboot.org/c/coreboot/+/32020/13/src/arch/x86/libx86emu/blo... PS13, Line 503: vm_memio(emu, emu->x86.R_EIP + i - 16, &val, X86EMU_MEMIO_R|X86EMU_MEMIO_8); line over 96 characters
https://review.coreboot.org/c/coreboot/+/32020/13/src/arch/x86/libx86emu/blo... PS13, Line 516: static void x86emu_flush_log(x86emu_t *emu, char *buf, unsigned size) Prefer 'unsigned int' to bare use of 'unsigned'
https://review.coreboot.org/c/coreboot/+/32020/13/src/arch/x86/libx86emu/blo... PS13, Line 615: for (int j = 0; j < length; j++) { braces {} are not necessary for single statement blocks
https://review.coreboot.org/c/coreboot/+/32020/13/src/arch/x86/libx86emu/blo... File src/arch/x86/libx86emu/blobolator_internal.h:
https://review.coreboot.org/c/coreboot/+/32020/13/src/arch/x86/libx86emu/blo... PS13, Line 18: void vm_traceio_w(x86emu_t *emu, u32 addr, u32 *val, unsigned type); Prefer 'unsigned int' to bare use of 'unsigned'
https://review.coreboot.org/c/coreboot/+/32020/13/src/arch/x86/libx86emu/blo... PS13, Line 19: void vm_traceio_r(x86emu_t *emu, u32 addr, u32 *val, unsigned type); Prefer 'unsigned int' to bare use of 'unsigned'
https://review.coreboot.org/c/coreboot/+/32020/13/src/arch/x86/libx86emu/blo... PS13, Line 25: void (*init)(x86emu_t *emu); code indent should use tabs where possible
https://review.coreboot.org/c/coreboot/+/32020/13/src/arch/x86/libx86emu/blo... PS13, Line 25: void (*init)(x86emu_t *emu); please, no spaces at the start of a line
https://review.coreboot.org/c/coreboot/+/32020/13/src/arch/x86/libx86emu/blo... PS13, Line 26: bool (*ignore_addr_io)(x86emu_t *emu, u32 addr); code indent should use tabs where possible
https://review.coreboot.org/c/coreboot/+/32020/13/src/arch/x86/libx86emu/blo... PS13, Line 26: bool (*ignore_addr_io)(x86emu_t *emu, u32 addr); please, no spaces at the start of a line
https://review.coreboot.org/c/coreboot/+/32020/13/src/arch/x86/libx86emu/blo... PS13, Line 27: bool (*ignore_addr_mem)(x86emu_t *emu, u32 addr); code indent should use tabs where possible
https://review.coreboot.org/c/coreboot/+/32020/13/src/arch/x86/libx86emu/blo... PS13, Line 27: bool (*ignore_addr_mem)(x86emu_t *emu, u32 addr); please, no spaces at the start of a line
https://review.coreboot.org/c/coreboot/+/32020/13/src/arch/x86/libx86emu/tra... File src/arch/x86/libx86emu/trace-bios.c:
https://review.coreboot.org/c/coreboot/+/32020/13/src/arch/x86/libx86emu/tra... PS13, Line 28: if (addr > 0xffffffff - CONFIG_ROM_SIZE) { braces {} are not necessary for single statement blocks
https://review.coreboot.org/c/coreboot/+/32020/13/src/arch/x86/libx86emu/tra... File src/arch/x86/libx86emu/trace-pci.c:
https://review.coreboot.org/c/coreboot/+/32020/13/src/arch/x86/libx86emu/tra... PS13, Line 52: devfn >> 3, devfn & 7); code indent should use tabs where possible
https://review.coreboot.org/c/coreboot/+/32020/13/src/arch/x86/libx86emu/tra... PS13, Line 79: static struct bar_tracer *bar_trace_find(struct device *dev, unsigned int bar, unsigned int type) line over 96 characters
https://review.coreboot.org/c/coreboot/+/32020/13/src/arch/x86/libx86emu/tra... PS13, Line 165: DEVFN_T dev = ((bus << 20)| devfn << 12); need consistent spacing around '|' (ctx:VxW)
https://review.coreboot.org/c/coreboot/+/32020/13/src/arch/x86/libx86emu/tra... PS13, Line 169: if (!dev) { braces {} are not necessary for single statement blocks
https://review.coreboot.org/c/coreboot/+/32020/13/src/arch/x86/libx86emu/tra... PS13, Line 201: while (!(moving & size)) { braces {} are not necessary for single statement blocks
https://review.coreboot.org/c/coreboot/+/32020/13/src/arch/x86/libx86emu/tra... PS13, Line 210: tracer = bar_trace_add(pcidev_path_on_root(devfn), (index - 0x10) / 4, !!(attr & PCI_BASE_ADDRESS_SPACE_IO)); line over 96 characters
https://review.coreboot.org/c/coreboot/+/32020/13/src/arch/x86/libx86emu/tra... PS13, Line 232: switch(bits) { switch and case should be at the same indent
https://review.coreboot.org/c/coreboot/+/32020/13/src/arch/x86/libx86emu/tra... PS13, Line 232: switch(bits) { space required before the open parenthesis '('
https://review.coreboot.org/c/coreboot/+/32020/13/src/arch/x86/libx86emu/tra... PS13, Line 261: switch(bits) { switch and case should be at the same indent
https://review.coreboot.org/c/coreboot/+/32020/13/src/arch/x86/libx86emu/tra... PS13, Line 261: switch(bits) { space required before the open parenthesis '('
https://review.coreboot.org/c/coreboot/+/32020/13/src/arch/x86/libx86emu/tra... PS13, Line 290: switch(bits) { switch and case should be at the same indent
https://review.coreboot.org/c/coreboot/+/32020/13/src/arch/x86/libx86emu/tra... PS13, Line 290: switch(bits) { space required before the open parenthesis '('
https://review.coreboot.org/c/coreboot/+/32020/13/src/arch/x86/libx86emu/tra... PS13, Line 320: switch(bits) { switch and case should be at the same indent
https://review.coreboot.org/c/coreboot/+/32020/13/src/arch/x86/libx86emu/tra... PS13, Line 320: switch(bits) { space required before the open parenthesis '('
https://review.coreboot.org/c/coreboot/+/32020/13/src/arch/x86/libx86emu/tra... PS13, Line 381: switch(bits) { space required before the open parenthesis '('
https://review.coreboot.org/c/coreboot/+/32020/13/src/arch/x86/libx86emu/tra... PS13, Line 417: switch(bits) { space required before the open parenthesis '('
https://review.coreboot.org/c/coreboot/+/32020/13/src/arch/x86/libx86emu/tra... PS13, Line 460: switch(bits) { space required before the open parenthesis '('
https://review.coreboot.org/c/coreboot/+/32020/13/src/arch/x86/libx86emu/tra... PS13, Line 462: if (addr < 0xcfc) { braces {} are not necessary for any arm of this statement
https://review.coreboot.org/c/coreboot/+/32020/13/src/arch/x86/libx86emu/tra... PS13, Line 469: if (addr < 0xcfc) { braces {} are not necessary for any arm of this statement
https://review.coreboot.org/c/coreboot/+/32020/13/src/arch/x86/libx86emu/tra... PS13, Line 476: if (addr < 0xcfc) { braces {} are not necessary for any arm of this statement
https://review.coreboot.org/c/coreboot/+/32020/13/src/arch/x86/libx86emu/tra... PS13, Line 490: switch(bits) { space required before the open parenthesis '('
https://review.coreboot.org/c/coreboot/+/32020/13/src/arch/x86/libx86emu/tra... PS13, Line 506: if (conf >= PCI_BASE_ADDRESS_0 && conf < (PCI_BASE_ADDRESS_5 + 4) && !(conf & 3)) line over 96 characters
https://review.coreboot.org/c/coreboot/+/32020/13/src/arch/x86/libx86emu/tra... PS13, Line 523: switch(bits) { space required before the open parenthesis '('
https://review.coreboot.org/c/coreboot/+/32020/13/src/arch/x86/libx86emu/tra... PS13, Line 539: if (conf >= PCI_BASE_ADDRESS_0 && conf < (PCI_BASE_ADDRESS_5 + 4) && !(conf & 3)) line over 96 characters
https://review.coreboot.org/c/coreboot/+/32020/13/src/arch/x86/libx86emu/tra... File src/arch/x86/libx86emu/trace-skl.c:
https://review.coreboot.org/c/coreboot/+/32020/13/src/arch/x86/libx86emu/tra... PS13, Line 34: switch (devfn) { switch and case should be at the same indent
https://review.coreboot.org/c/coreboot/+/32020/13/src/arch/x86/libx86emu/tra... PS13, Line 87: devfn >> 3, devfn & 7); code indent should use tabs where possible
https://review.coreboot.org/c/coreboot/+/32020/13/src/arch/x86/libx86emu/tra... PS13, Line 95: if (addr > 0x78000000 && addr < 0x78510000) { braces {} are not necessary for single statement blocks
https://review.coreboot.org/c/coreboot/+/32020/13/src/arch/x86/libx86emu/tra... PS13, Line 129: bool pci_trace_p2sb_r(const int bus, const int devfn, const int off, u32 *val, unsigned int bits) line over 96 characters
https://review.coreboot.org/c/coreboot/+/32020/13/src/arch/x86/libx86emu/tra... PS13, Line 137: switch(bits) { space required before the open parenthesis '('
https://review.coreboot.org/c/coreboot/+/32020/13/src/arch/x86/libx86emu/tra... PS13, Line 139: if (off >= P2SB_CR_SBI_ADDR && off < (P2SB_CR_SBI_ADDR + 4)) { braces {} are not necessary for any arm of this statement
https://review.coreboot.org/c/coreboot/+/32020/13/src/arch/x86/libx86emu/tra... PS13, Line 148: if (off >= P2SB_CR_SBI_ADDR && off < (P2SB_CR_SBI_ADDR + 4)) { braces {} are not necessary for any arm of this statement
https://review.coreboot.org/c/coreboot/+/32020/13/src/arch/x86/libx86emu/tra... PS13, Line 157: if (off >= P2SB_CR_SBI_ADDR && off < (P2SB_CR_SBI_ADDR + 4)) { braces {} are not necessary for any arm of this statement
https://review.coreboot.org/c/coreboot/+/32020/13/src/arch/x86/libx86emu/tra... PS13, Line 167: if (!(sb_data.w & 1) && pending ) { space prohibited before that close parenthesis ')'
https://review.coreboot.org/c/coreboot/+/32020/13/src/arch/x86/libx86emu/tra... PS13, Line 167: if (!(sb_data.w & 1) && pending ) { braces {} are not necessary for single statement blocks
https://review.coreboot.org/c/coreboot/+/32020/13/src/arch/x86/libx86emu/tra... PS13, Line 172: bool pci_trace_p2sb_w(const int bus, const int devfn, const int off, u32 *val, unsigned int bits) line over 96 characters
https://review.coreboot.org/c/coreboot/+/32020/13/src/arch/x86/libx86emu/tra... PS13, Line 180: switch(bits) { space required before the open parenthesis '('
https://review.coreboot.org/c/coreboot/+/32020/13/src/arch/x86/libx86emu/tra... PS13, Line 182: if (off >= P2SB_CR_SBI_ADDR && off < (P2SB_CR_SBI_ADDR + 4)) { braces {} are not necessary for any arm of this statement
https://review.coreboot.org/c/coreboot/+/32020/13/src/arch/x86/libx86emu/tra... PS13, Line 191: if (off >= P2SB_CR_SBI_ADDR && off < (P2SB_CR_SBI_ADDR + 4)) { braces {} are not necessary for any arm of this statement
https://review.coreboot.org/c/coreboot/+/32020/13/src/arch/x86/libx86emu/tra... PS13, Line 200: if (off >= P2SB_CR_SBI_ADDR && off < (P2SB_CR_SBI_ADDR + 4)) { braces {} are not necessary for any arm of this statement
https://review.coreboot.org/c/coreboot/+/32020/13/src/arch/x86/libx86emu/tra... PS13, Line 210: if ((sb_data.w & 1) && !pending ) { space prohibited before that close parenthesis ')'
https://review.coreboot.org/c/coreboot/+/32020/13/src/arch/x86/libx86emu/tra... PS13, Line 210: if ((sb_data.w & 1) && !pending ) { braces {} are not necessary for single statement blocks
https://review.coreboot.org/c/coreboot/+/32020/13/src/arch/x86/libx86emu/tra... File src/arch/x86/libx86emu/trace.c:
https://review.coreboot.org/c/coreboot/+/32020/13/src/arch/x86/libx86emu/tra... PS13, Line 56: addr < ( (uintptr_t)baseptr + size)) { space prohibited after that open parenthesis '('
https://review.coreboot.org/c/coreboot/+/32020/13/src/arch/x86/libx86emu/tra... PS13, Line 62: addr < ((uintptr_t)cbmem_entry_start(ramstage_entry) + (uintptr_t)cbmem_entry_size(ramstage_entry))) { line over 96 characters
https://review.coreboot.org/c/coreboot/+/32020/13/src/arch/x86/libx86emu/tra... PS13, Line 91: void vm_traceio_r(x86emu_t *emu, u32 addr, u32 *val, unsigned type) Prefer 'unsigned int' to bare use of 'unsigned'
https://review.coreboot.org/c/coreboot/+/32020/13/src/arch/x86/libx86emu/tra... PS13, Line 102: for (driver = &_blobolator_drivers[0]; driver != &_eblobolator_drivers[0]; driver++) { line over 96 characters
https://review.coreboot.org/c/coreboot/+/32020/13/src/arch/x86/libx86emu/tra... PS13, Line 107: for (driver = &_blobolator_drivers[0]; driver != &_eblobolator_drivers[0]; driver++) { line over 96 characters
https://review.coreboot.org/c/coreboot/+/32020/13/src/arch/x86/libx86emu/tra... PS13, Line 119: switch(bits) { switch and case should be at the same indent
https://review.coreboot.org/c/coreboot/+/32020/13/src/arch/x86/libx86emu/tra... PS13, Line 119: switch(bits) { space required before the open parenthesis '('
https://review.coreboot.org/c/coreboot/+/32020/13/src/arch/x86/libx86emu/tra... PS13, Line 121: printk(BIOS_DEBUG, " read8(0x%08x) // = 0x%x\n", addr, *val); line over 96 characters
https://review.coreboot.org/c/coreboot/+/32020/13/src/arch/x86/libx86emu/tra... PS13, Line 124: printk(BIOS_DEBUG, " read16(0x%08x) // = 0x%x\n", addr, *val); line over 96 characters
https://review.coreboot.org/c/coreboot/+/32020/13/src/arch/x86/libx86emu/tra... PS13, Line 127: printk(BIOS_DEBUG, " read32(0x%08x) // = 0x%x\n", addr, *val); line over 96 characters
https://review.coreboot.org/c/coreboot/+/32020/13/src/arch/x86/libx86emu/tra... PS13, Line 133: for (driver = &_blobolator_drivers[0]; driver != &_eblobolator_drivers[0]; driver++) { line over 96 characters
https://review.coreboot.org/c/coreboot/+/32020/13/src/arch/x86/libx86emu/tra... PS13, Line 138: for (driver = &_blobolator_drivers[0]; driver != &_eblobolator_drivers[0]; driver++) { line over 96 characters
https://review.coreboot.org/c/coreboot/+/32020/13/src/arch/x86/libx86emu/tra... PS13, Line 150: switch(bits) { switch and case should be at the same indent
https://review.coreboot.org/c/coreboot/+/32020/13/src/arch/x86/libx86emu/tra... PS13, Line 150: switch(bits) { space required before the open parenthesis '('
https://review.coreboot.org/c/coreboot/+/32020/13/src/arch/x86/libx86emu/tra... PS13, Line 152: printk(BIOS_DEBUG, " inb(0x%04x) // = 0x%x\n", addr, *val); line over 96 characters
https://review.coreboot.org/c/coreboot/+/32020/13/src/arch/x86/libx86emu/tra... PS13, Line 155: printk(BIOS_DEBUG, " inw(0x%04x) // = 0x%x\n", addr, *val); line over 96 characters
https://review.coreboot.org/c/coreboot/+/32020/13/src/arch/x86/libx86emu/tra... PS13, Line 158: printk(BIOS_DEBUG, " inl(0x%04x) // = 0x%x\n", addr, *val); line over 96 characters
https://review.coreboot.org/c/coreboot/+/32020/13/src/arch/x86/libx86emu/tra... PS13, Line 166: void vm_traceio_w(x86emu_t *emu, u32 addr, u32 *val, unsigned type) Prefer 'unsigned int' to bare use of 'unsigned'
https://review.coreboot.org/c/coreboot/+/32020/13/src/arch/x86/libx86emu/tra... PS13, Line 168: const unsigned bits = type & 0xff; Prefer 'unsigned int' to bare use of 'unsigned'
https://review.coreboot.org/c/coreboot/+/32020/13/src/arch/x86/libx86emu/tra... PS13, Line 177: for (driver = &_blobolator_drivers[0]; driver != &_eblobolator_drivers[0]; driver++) { line over 96 characters
https://review.coreboot.org/c/coreboot/+/32020/13/src/arch/x86/libx86emu/tra... PS13, Line 182: for (driver = &_blobolator_drivers[0]; driver != &_eblobolator_drivers[0]; driver++) { line over 96 characters
https://review.coreboot.org/c/coreboot/+/32020/13/src/arch/x86/libx86emu/tra... PS13, Line 194: switch(bits) { switch and case should be at the same indent
https://review.coreboot.org/c/coreboot/+/32020/13/src/arch/x86/libx86emu/tra... PS13, Line 194: switch(bits) { space required before the open parenthesis '('
https://review.coreboot.org/c/coreboot/+/32020/13/src/arch/x86/libx86emu/tra... PS13, Line 196: printk(BIOS_DEBUG, " write8(0x%08x, 0x%x)\n", addr, *val); line over 96 characters
https://review.coreboot.org/c/coreboot/+/32020/13/src/arch/x86/libx86emu/tra... PS13, Line 199: printk(BIOS_DEBUG, "write16(0x%08x, 0x%x)\n", addr, *val); line over 96 characters
https://review.coreboot.org/c/coreboot/+/32020/13/src/arch/x86/libx86emu/tra... PS13, Line 202: printk(BIOS_DEBUG, "write32(0x%08x, 0x%x)\n", addr, *val); line over 96 characters
https://review.coreboot.org/c/coreboot/+/32020/13/src/arch/x86/libx86emu/tra... PS13, Line 208: for (driver = &_blobolator_drivers[0]; driver != &_eblobolator_drivers[0]; driver++) { line over 96 characters
https://review.coreboot.org/c/coreboot/+/32020/13/src/arch/x86/libx86emu/tra... PS13, Line 213: for (driver = &_blobolator_drivers[0]; driver != &_eblobolator_drivers[0]; driver++) { line over 96 characters
https://review.coreboot.org/c/coreboot/+/32020/13/src/arch/x86/libx86emu/tra... PS13, Line 225: switch(bits) { switch and case should be at the same indent
https://review.coreboot.org/c/coreboot/+/32020/13/src/arch/x86/libx86emu/tra... PS13, Line 225: switch(bits) { space required before the open parenthesis '('
https://review.coreboot.org/c/coreboot/+/32020/13/src/arch/x86/libx86emu/tra... PS13, Line 227: printk(BIOS_DEBUG, " outb(0x%04x, 0x%x))\n", addr, *val); line over 96 characters
https://review.coreboot.org/c/coreboot/+/32020/13/src/arch/x86/libx86emu/tra... PS13, Line 230: printk(BIOS_DEBUG, " outw(0x%04x, 0x%x)\n", addr, *val); line over 96 characters
https://review.coreboot.org/c/coreboot/+/32020/13/src/arch/x86/libx86emu/tra... PS13, Line 233: printk(BIOS_DEBUG, " outl(0x%04x, 0x%x)\n", addr, *val); line over 96 characters
https://review.coreboot.org/c/coreboot/+/32020/13/src/mainboard/emulation/qe... File src/mainboard/emulation/qemu-q35/mainboard.c:
https://review.coreboot.org/c/coreboot/+/32020/13/src/mainboard/emulation/qe... PS13, Line 85: if (myconfig->config1 || myconfig->config2) { braces {} are not necessary for single statement blocks
https://review.coreboot.org/c/coreboot/+/32020/13/src/mainboard/emulation/qe... PS13, Line 88: if (myconfig->config3 != 0 && myconfig->config3 != 2) { braces {} are not necessary for single statement blocks
https://review.coreboot.org/c/coreboot/+/32020/13/src/mainboard/emulation/qe... PS13, Line 91: if (myconfig->config1) { braces {} are not necessary for single statement blocks
https://review.coreboot.org/c/coreboot/+/32020/13/src/mainboard/emulation/qe... PS13, Line 94: if (myconfig->config2) { braces {} are not necessary for single statement blocks
https://review.coreboot.org/c/coreboot/+/32020/13/src/mainboard/emulation/qe... PS13, Line 98: if (myconfig->config5) { braces {} are not necessary for single statement blocks
Hello Felix Singer, Philipp Deppenwiese, build bot (Jenkins), Nico Huber, Patrick Georgi, Martin Roth, Daniel Maslowski, Christian Walter, Julius Werner, Arthur Heymans, Patrick Rudolph,
I'd like you to reexamine a change. Please visit
https://review.coreboot.org/c/coreboot/+/32020
to look at the new patch set (#14).
Change subject: [WIP]x86: Introduce the blobolator ......................................................................
[WIP]x86: Introduce the blobolator
This is a PoC to run arbitrary code and blobs inside an emulated virtual machine using libx86emu, thus the name blobolator.
The libx86emu has been patched to the following: * redirect IO to the host machine it's running on * trace IO * start in protected mode * add mechanism to drop IO access * add Kconfig to debug code it is running
Implemented features: * Run ramstage in libx86emu * Kconfig specific hooks by using _blobolator_drivers (same mechanism as __pci_driver) * PCI decoding and BAR tracing * POST code decoding * Unhandled IO tracing * Added test code in qemu emulation/q35 * Machine parseable format
TODO: * Add support to trace only blobs, not stages. * Improve translation of known IO to human readable format ** COM ** PCI ** APIC ** PIT ** POST
Tested on qemu. Sucessfully run ramstage in blobolator. Tested on X11SSH-TF. Sucessfully run ramstage in blobolator (requires additional libx86emu patches).
You need to install 3rdparty/libx86emu from https://github.com/PatrickRudolph/libx86emu/tree/cpuid_msr_callback
Change-Id: I13e47f45e69376d046f35c04363fe3db1cfaa610 Signed-off-by: Patrick Rudolph patrick.rudolph@9elements.com --- M src/Kconfig M src/arch/x86/Makefile.inc M src/arch/x86/boot.c A src/arch/x86/libx86emu/Kconfig.debug A src/arch/x86/libx86emu/Makefile.inc A src/arch/x86/libx86emu/blobolator.c A src/arch/x86/libx86emu/blobolator_internal.h A src/arch/x86/libx86emu/stdarg.h A src/arch/x86/libx86emu/stdio.h A src/arch/x86/libx86emu/time.h A src/arch/x86/libx86emu/trace-bios.c A src/arch/x86/libx86emu/trace-pci.c A src/arch/x86/libx86emu/trace-serial.c A src/arch/x86/libx86emu/trace-skl.c A src/arch/x86/libx86emu/trace.c M src/arch/x86/postcar_loader.c M src/commonlib/include/commonlib/cbmem_id.h M src/console/printk.c M src/drivers/intel/fsp2_0/memory_init.c M src/drivers/intel/fsp2_0/silicon_init.c A src/include/blobolator.h M src/include/rules.h M src/include/stddef.h M src/lib/Makefile.inc M src/lib/hardwaremain.c M src/lib/program.ld M src/mainboard/emulation/qemu-q35/mainboard.c 27 files changed, 2,128 insertions(+), 5 deletions(-)
git pull ssh://review.coreboot.org:29418/coreboot refs/changes/20/32020/14
build bot (Jenkins) has posted comments on this change. ( https://review.coreboot.org/c/coreboot/+/32020 )
Change subject: [WIP]x86: Introduce the blobolator ......................................................................
Patch Set 14:
(150 comments)
https://review.coreboot.org/c/coreboot/+/32020/14/src/arch/x86/libx86emu/Kco... File src/arch/x86/libx86emu/Kconfig.debug:
https://review.coreboot.org/c/coreboot/+/32020/14/src/arch/x86/libx86emu/Kco... PS14, Line 21: IO access can be traced, analysed, modified or droped. 'droped' may be misspelled - perhaps 'dropped'?
https://review.coreboot.org/c/coreboot/+/32020/14/src/arch/x86/libx86emu/blo... File src/arch/x86/libx86emu/blobolator.c:
https://review.coreboot.org/c/coreboot/+/32020/14/src/arch/x86/libx86emu/blo... PS14, Line 43: x86emu_mem_t *emu_mem_new(unsigned perm) Prefer 'unsigned int' to bare use of 'unsigned'
https://review.coreboot.org/c/coreboot/+/32020/14/src/arch/x86/libx86emu/blo... PS14, Line 48: void x86emu_set_io_perm(x86emu_t *emu, unsigned start, unsigned end, unsigned perm) Prefer 'unsigned int' to bare use of 'unsigned'
https://review.coreboot.org/c/coreboot/+/32020/14/src/arch/x86/libx86emu/blo... PS14, Line 48: void x86emu_set_io_perm(x86emu_t *emu, unsigned start, unsigned end, unsigned perm) Prefer 'unsigned int' to bare use of 'unsigned'
https://review.coreboot.org/c/coreboot/+/32020/14/src/arch/x86/libx86emu/blo... PS14, Line 48: void x86emu_set_io_perm(x86emu_t *emu, unsigned start, unsigned end, unsigned perm) Prefer 'unsigned int' to bare use of 'unsigned'
https://review.coreboot.org/c/coreboot/+/32020/14/src/arch/x86/libx86emu/blo... PS14, Line 52: unsigned x86emu_read_byte(x86emu_t *emu, unsigned addr) Prefer 'unsigned int' to bare use of 'unsigned'
https://review.coreboot.org/c/coreboot/+/32020/14/src/arch/x86/libx86emu/blo... PS14, Line 52: unsigned x86emu_read_byte(x86emu_t *emu, unsigned addr) Prefer 'unsigned int' to bare use of 'unsigned'
https://review.coreboot.org/c/coreboot/+/32020/14/src/arch/x86/libx86emu/blo... PS14, Line 56: if(emu) space required before the open parenthesis '('
https://review.coreboot.org/c/coreboot/+/32020/14/src/arch/x86/libx86emu/blo... PS14, Line 62: unsigned x86emu_read_byte_noperm(x86emu_t *emu, unsigned addr) Prefer 'unsigned int' to bare use of 'unsigned'
https://review.coreboot.org/c/coreboot/+/32020/14/src/arch/x86/libx86emu/blo... PS14, Line 62: unsigned x86emu_read_byte_noperm(x86emu_t *emu, unsigned addr) Prefer 'unsigned int' to bare use of 'unsigned'
https://review.coreboot.org/c/coreboot/+/32020/14/src/arch/x86/libx86emu/blo... PS14, Line 66: if(emu) space required before the open parenthesis '('
https://review.coreboot.org/c/coreboot/+/32020/14/src/arch/x86/libx86emu/blo... PS14, Line 73: unsigned x86emu_read_word(x86emu_t *emu, unsigned addr) Prefer 'unsigned int' to bare use of 'unsigned'
https://review.coreboot.org/c/coreboot/+/32020/14/src/arch/x86/libx86emu/blo... PS14, Line 73: unsigned x86emu_read_word(x86emu_t *emu, unsigned addr) Prefer 'unsigned int' to bare use of 'unsigned'
https://review.coreboot.org/c/coreboot/+/32020/14/src/arch/x86/libx86emu/blo... PS14, Line 77: if(emu) space required before the open parenthesis '('
https://review.coreboot.org/c/coreboot/+/32020/14/src/arch/x86/libx86emu/blo... PS14, Line 83: unsigned x86emu_read_dword(x86emu_t *emu, unsigned addr) Prefer 'unsigned int' to bare use of 'unsigned'
https://review.coreboot.org/c/coreboot/+/32020/14/src/arch/x86/libx86emu/blo... PS14, Line 83: unsigned x86emu_read_dword(x86emu_t *emu, unsigned addr) Prefer 'unsigned int' to bare use of 'unsigned'
https://review.coreboot.org/c/coreboot/+/32020/14/src/arch/x86/libx86emu/blo... PS14, Line 87: if(emu) space required before the open parenthesis '('
https://review.coreboot.org/c/coreboot/+/32020/14/src/arch/x86/libx86emu/blo... PS14, Line 93: void x86emu_write_byte(x86emu_t *emu, unsigned addr, unsigned val) Prefer 'unsigned int' to bare use of 'unsigned'
https://review.coreboot.org/c/coreboot/+/32020/14/src/arch/x86/libx86emu/blo... PS14, Line 93: void x86emu_write_byte(x86emu_t *emu, unsigned addr, unsigned val) Prefer 'unsigned int' to bare use of 'unsigned'
https://review.coreboot.org/c/coreboot/+/32020/14/src/arch/x86/libx86emu/blo... PS14, Line 97: if(emu) space required before the open parenthesis '('
https://review.coreboot.org/c/coreboot/+/32020/14/src/arch/x86/libx86emu/blo... PS14, Line 101: void x86emu_write_byte_noperm(x86emu_t *emu, unsigned addr, unsigned val) Prefer 'unsigned int' to bare use of 'unsigned'
https://review.coreboot.org/c/coreboot/+/32020/14/src/arch/x86/libx86emu/blo... PS14, Line 101: void x86emu_write_byte_noperm(x86emu_t *emu, unsigned addr, unsigned val) Prefer 'unsigned int' to bare use of 'unsigned'
https://review.coreboot.org/c/coreboot/+/32020/14/src/arch/x86/libx86emu/blo... PS14, Line 105: if(emu) space required before the open parenthesis '('
https://review.coreboot.org/c/coreboot/+/32020/14/src/arch/x86/libx86emu/blo... PS14, Line 110: void x86emu_write_word(x86emu_t *emu, unsigned addr, unsigned val) Prefer 'unsigned int' to bare use of 'unsigned'
https://review.coreboot.org/c/coreboot/+/32020/14/src/arch/x86/libx86emu/blo... PS14, Line 110: void x86emu_write_word(x86emu_t *emu, unsigned addr, unsigned val) Prefer 'unsigned int' to bare use of 'unsigned'
https://review.coreboot.org/c/coreboot/+/32020/14/src/arch/x86/libx86emu/blo... PS14, Line 114: if(emu) space required before the open parenthesis '('
https://review.coreboot.org/c/coreboot/+/32020/14/src/arch/x86/libx86emu/blo... PS14, Line 118: void x86emu_write_dword(x86emu_t *emu, unsigned addr, unsigned val) Prefer 'unsigned int' to bare use of 'unsigned'
https://review.coreboot.org/c/coreboot/+/32020/14/src/arch/x86/libx86emu/blo... PS14, Line 118: void x86emu_write_dword(x86emu_t *emu, unsigned addr, unsigned val) Prefer 'unsigned int' to bare use of 'unsigned'
https://review.coreboot.org/c/coreboot/+/32020/14/src/arch/x86/libx86emu/blo... PS14, Line 122: if(emu) space required before the open parenthesis '('
https://review.coreboot.org/c/coreboot/+/32020/14/src/arch/x86/libx86emu/blo... PS14, Line 126: unsigned x86emu_clear_log(x86emu_t *emu, int flush) Prefer 'unsigned int' to bare use of 'unsigned'
https://review.coreboot.org/c/coreboot/+/32020/14/src/arch/x86/libx86emu/blo... PS14, Line 128: if(flush && emu->log.flush) { space required before the open parenthesis '('
https://review.coreboot.org/c/coreboot/+/32020/14/src/arch/x86/libx86emu/blo... PS14, Line 129: if(emu->log.ptr && emu->log.ptr != emu->log.buf) { space required before the open parenthesis '('
https://review.coreboot.org/c/coreboot/+/32020/14/src/arch/x86/libx86emu/blo... PS14, Line 134: if((emu->log.ptr = emu->log.buf)) *emu->log.ptr = 0; space required before the open parenthesis '('
https://review.coreboot.org/c/coreboot/+/32020/14/src/arch/x86/libx86emu/blo... PS14, Line 134: if((emu->log.ptr = emu->log.buf)) *emu->log.ptr = 0; do not use assignment in if condition
https://review.coreboot.org/c/coreboot/+/32020/14/src/arch/x86/libx86emu/blo... PS14, Line 134: if((emu->log.ptr = emu->log.buf)) *emu->log.ptr = 0; trailing statements should be on next line
https://review.coreboot.org/c/coreboot/+/32020/14/src/arch/x86/libx86emu/blo... PS14, Line 171: emu->x86.R_EIP, 's', 'O', emu->x86.R_ECX, emu->x86.R_EDX, emu->x86.R_EAX); line over 96 characters
https://review.coreboot.org/c/coreboot/+/32020/14/src/arch/x86/libx86emu/blo... PS14, Line 207: memset(x86, 0, sizeof *x86); sizeof *x86 should be sizeof(*x86)
https://review.coreboot.org/c/coreboot/+/32020/14/src/arch/x86/libx86emu/blo... PS14, Line 262: __weak void vm_traceio_w(x86emu_t *emu, u32 addr, u32 *val, unsigned type) Prefer 'unsigned int' to bare use of 'unsigned'
https://review.coreboot.org/c/coreboot/+/32020/14/src/arch/x86/libx86emu/blo... PS14, Line 266: __weak void vm_traceio_r(x86emu_t *emu, u32 addr, u32 *val, unsigned type) Prefer 'unsigned int' to bare use of 'unsigned'
https://review.coreboot.org/c/coreboot/+/32020/14/src/arch/x86/libx86emu/blo... PS14, Line 270: unsigned vm_memio(x86emu_t *emu, u32 addr, u32 *val, unsigned type) Prefer 'unsigned int' to bare use of 'unsigned'
https://review.coreboot.org/c/coreboot/+/32020/14/src/arch/x86/libx86emu/blo... PS14, Line 270: unsigned vm_memio(x86emu_t *emu, u32 addr, u32 *val, unsigned type) Prefer 'unsigned int' to bare use of 'unsigned'
https://review.coreboot.org/c/coreboot/+/32020/14/src/arch/x86/libx86emu/blo... PS14, Line 273: unsigned bits = type & 0xff; Prefer 'unsigned int' to bare use of 'unsigned'
https://review.coreboot.org/c/coreboot/+/32020/14/src/arch/x86/libx86emu/blo... PS14, Line 278: switch(type) { space required before the open parenthesis '('
https://review.coreboot.org/c/coreboot/+/32020/14/src/arch/x86/libx86emu/blo... PS14, Line 280: switch(bits) { space required before the open parenthesis '('
https://review.coreboot.org/c/coreboot/+/32020/14/src/arch/x86/libx86emu/blo... PS14, Line 294: switch(bits) { space required before the open parenthesis '('
https://review.coreboot.org/c/coreboot/+/32020/14/src/arch/x86/libx86emu/blo... PS14, Line 308: switch(bits) { space required before the open parenthesis '('
https://review.coreboot.org/c/coreboot/+/32020/14/src/arch/x86/libx86emu/blo... PS14, Line 323: switch(bits) { space required before the open parenthesis '('
https://review.coreboot.org/c/coreboot/+/32020/14/src/arch/x86/libx86emu/blo... PS14, Line 337: switch(bits) { space required before the open parenthesis '('
https://review.coreboot.org/c/coreboot/+/32020/14/src/arch/x86/libx86emu/blo... PS14, Line 367: static bool x86emu_memio_drop(struct x86emu_s *emu_s, u32 addr, u32 *val, unsigned type) Prefer 'unsigned int' to bare use of 'unsigned'
https://review.coreboot.org/c/coreboot/+/32020/14/src/arch/x86/libx86emu/blo... PS14, Line 369: switch(type) { space required before the open parenthesis '('
https://review.coreboot.org/c/coreboot/+/32020/14/src/arch/x86/libx86emu/blo... PS14, Line 384: static bool x86emu_memio_except(struct x86emu_s *emu_s, u32 addr, u32 *val, unsigned type) Prefer 'unsigned int' to bare use of 'unsigned'
https://review.coreboot.org/c/coreboot/+/32020/14/src/arch/x86/libx86emu/blo... PS14, Line 389: switch(type) { space required before the open parenthesis '('
https://review.coreboot.org/c/coreboot/+/32020/14/src/arch/x86/libx86emu/blo... PS14, Line 421: static unsigned x86emu_memio_handler(struct x86emu_s *emu_s, u32 addr, u32 *val, unsigned type) Prefer 'unsigned int' to bare use of 'unsigned'
https://review.coreboot.org/c/coreboot/+/32020/14/src/arch/x86/libx86emu/blo... PS14, Line 421: static unsigned x86emu_memio_handler(struct x86emu_s *emu_s, u32 addr, u32 *val, unsigned type) Prefer 'unsigned int' to bare use of 'unsigned'
https://review.coreboot.org/c/coreboot/+/32020/14/src/arch/x86/libx86emu/blo... PS14, Line 490: static int x86emu_intr_handler(x86emu_t *emu, u8 num, unsigned type) Prefer 'unsigned int' to bare use of 'unsigned'
https://review.coreboot.org/c/coreboot/+/32020/14/src/arch/x86/libx86emu/blo... PS14, Line 503: vm_memio(emu, emu->x86.R_EIP + i - 16, &val, X86EMU_MEMIO_R|X86EMU_MEMIO_8); line over 96 characters
https://review.coreboot.org/c/coreboot/+/32020/14/src/arch/x86/libx86emu/blo... PS14, Line 516: static void x86emu_flush_log(x86emu_t *emu, char *buf, unsigned size) Prefer 'unsigned int' to bare use of 'unsigned'
https://review.coreboot.org/c/coreboot/+/32020/14/src/arch/x86/libx86emu/blo... PS14, Line 563: for (int i = 0; i < num_args; i++) { braces {} are not necessary for single statement blocks
https://review.coreboot.org/c/coreboot/+/32020/14/src/arch/x86/libx86emu/blo... PS14, Line 617: for (int j = 0; j < length; j++) { braces {} are not necessary for single statement blocks
https://review.coreboot.org/c/coreboot/+/32020/14/src/arch/x86/libx86emu/blo... File src/arch/x86/libx86emu/blobolator_internal.h:
https://review.coreboot.org/c/coreboot/+/32020/14/src/arch/x86/libx86emu/blo... PS14, Line 18: void vm_traceio_w(x86emu_t *emu, u32 addr, u32 *val, unsigned type); Prefer 'unsigned int' to bare use of 'unsigned'
https://review.coreboot.org/c/coreboot/+/32020/14/src/arch/x86/libx86emu/blo... PS14, Line 19: void vm_traceio_r(x86emu_t *emu, u32 addr, u32 *val, unsigned type); Prefer 'unsigned int' to bare use of 'unsigned'
https://review.coreboot.org/c/coreboot/+/32020/14/src/arch/x86/libx86emu/blo... PS14, Line 25: void (*init)(x86emu_t *emu); code indent should use tabs where possible
https://review.coreboot.org/c/coreboot/+/32020/14/src/arch/x86/libx86emu/blo... PS14, Line 25: void (*init)(x86emu_t *emu); please, no spaces at the start of a line
https://review.coreboot.org/c/coreboot/+/32020/14/src/arch/x86/libx86emu/blo... PS14, Line 26: bool (*ignore_addr_io)(x86emu_t *emu, u32 addr); code indent should use tabs where possible
https://review.coreboot.org/c/coreboot/+/32020/14/src/arch/x86/libx86emu/blo... PS14, Line 26: bool (*ignore_addr_io)(x86emu_t *emu, u32 addr); please, no spaces at the start of a line
https://review.coreboot.org/c/coreboot/+/32020/14/src/arch/x86/libx86emu/blo... PS14, Line 27: bool (*ignore_addr_mem)(x86emu_t *emu, u32 addr); code indent should use tabs where possible
https://review.coreboot.org/c/coreboot/+/32020/14/src/arch/x86/libx86emu/blo... PS14, Line 27: bool (*ignore_addr_mem)(x86emu_t *emu, u32 addr); please, no spaces at the start of a line
https://review.coreboot.org/c/coreboot/+/32020/14/src/arch/x86/libx86emu/tra... File src/arch/x86/libx86emu/trace-bios.c:
https://review.coreboot.org/c/coreboot/+/32020/14/src/arch/x86/libx86emu/tra... PS14, Line 28: if (addr > 0xffffffff - CONFIG_ROM_SIZE) { braces {} are not necessary for single statement blocks
https://review.coreboot.org/c/coreboot/+/32020/14/src/arch/x86/libx86emu/tra... File src/arch/x86/libx86emu/trace-pci.c:
https://review.coreboot.org/c/coreboot/+/32020/14/src/arch/x86/libx86emu/tra... PS14, Line 52: devfn >> 3, devfn & 7); code indent should use tabs where possible
https://review.coreboot.org/c/coreboot/+/32020/14/src/arch/x86/libx86emu/tra... PS14, Line 79: static struct bar_tracer *bar_trace_find(DEVTREE_CONST struct device *dev, unsigned int bar, unsigned int type) line over 96 characters
https://review.coreboot.org/c/coreboot/+/32020/14/src/arch/x86/libx86emu/tra... PS14, Line 89: static struct bar_tracer *bar_trace_add(DEVTREE_CONST struct device *dev, unsigned int bar, unsigned int type) line over 96 characters
https://review.coreboot.org/c/coreboot/+/32020/14/src/arch/x86/libx86emu/tra... PS14, Line 165: DEVFN_T dev = ((bus << 20)| devfn << 12); need consistent spacing around '|' (ctx:VxW)
https://review.coreboot.org/c/coreboot/+/32020/14/src/arch/x86/libx86emu/tra... PS14, Line 169: if (!dev) { braces {} are not necessary for single statement blocks
https://review.coreboot.org/c/coreboot/+/32020/14/src/arch/x86/libx86emu/tra... PS14, Line 201: while (!(moving & size)) { braces {} are not necessary for single statement blocks
https://review.coreboot.org/c/coreboot/+/32020/14/src/arch/x86/libx86emu/tra... PS14, Line 210: tracer = bar_trace_add(pcidev_path_on_root(devfn), (index - 0x10) / 4, !!(attr & PCI_BASE_ADDRESS_SPACE_IO)); line over 96 characters
https://review.coreboot.org/c/coreboot/+/32020/14/src/arch/x86/libx86emu/tra... PS14, Line 232: switch(bits) { switch and case should be at the same indent
https://review.coreboot.org/c/coreboot/+/32020/14/src/arch/x86/libx86emu/tra... PS14, Line 232: switch(bits) { space required before the open parenthesis '('
https://review.coreboot.org/c/coreboot/+/32020/14/src/arch/x86/libx86emu/tra... PS14, Line 261: switch(bits) { switch and case should be at the same indent
https://review.coreboot.org/c/coreboot/+/32020/14/src/arch/x86/libx86emu/tra... PS14, Line 261: switch(bits) { space required before the open parenthesis '('
https://review.coreboot.org/c/coreboot/+/32020/14/src/arch/x86/libx86emu/tra... PS14, Line 290: switch(bits) { switch and case should be at the same indent
https://review.coreboot.org/c/coreboot/+/32020/14/src/arch/x86/libx86emu/tra... PS14, Line 290: switch(bits) { space required before the open parenthesis '('
https://review.coreboot.org/c/coreboot/+/32020/14/src/arch/x86/libx86emu/tra... PS14, Line 320: switch(bits) { switch and case should be at the same indent
https://review.coreboot.org/c/coreboot/+/32020/14/src/arch/x86/libx86emu/tra... PS14, Line 320: switch(bits) { space required before the open parenthesis '('
https://review.coreboot.org/c/coreboot/+/32020/14/src/arch/x86/libx86emu/tra... PS14, Line 341: DEVTREE_CONST struct device *dev = pcidev_path_on_root(i); trailing whitespace
https://review.coreboot.org/c/coreboot/+/32020/14/src/arch/x86/libx86emu/tra... PS14, Line 381: switch(bits) { space required before the open parenthesis '('
https://review.coreboot.org/c/coreboot/+/32020/14/src/arch/x86/libx86emu/tra... PS14, Line 417: switch(bits) { space required before the open parenthesis '('
https://review.coreboot.org/c/coreboot/+/32020/14/src/arch/x86/libx86emu/tra... PS14, Line 460: switch(bits) { space required before the open parenthesis '('
https://review.coreboot.org/c/coreboot/+/32020/14/src/arch/x86/libx86emu/tra... PS14, Line 462: if (addr < 0xcfc) { braces {} are not necessary for any arm of this statement
https://review.coreboot.org/c/coreboot/+/32020/14/src/arch/x86/libx86emu/tra... PS14, Line 469: if (addr < 0xcfc) { braces {} are not necessary for any arm of this statement
https://review.coreboot.org/c/coreboot/+/32020/14/src/arch/x86/libx86emu/tra... PS14, Line 476: if (addr < 0xcfc) { braces {} are not necessary for any arm of this statement
https://review.coreboot.org/c/coreboot/+/32020/14/src/arch/x86/libx86emu/tra... PS14, Line 490: switch(bits) { space required before the open parenthesis '('
https://review.coreboot.org/c/coreboot/+/32020/14/src/arch/x86/libx86emu/tra... PS14, Line 506: if (conf >= PCI_BASE_ADDRESS_0 && conf < (PCI_BASE_ADDRESS_5 + 4) && !(conf & 3)) line over 96 characters
https://review.coreboot.org/c/coreboot/+/32020/14/src/arch/x86/libx86emu/tra... PS14, Line 523: switch(bits) { space required before the open parenthesis '('
https://review.coreboot.org/c/coreboot/+/32020/14/src/arch/x86/libx86emu/tra... PS14, Line 539: if (conf >= PCI_BASE_ADDRESS_0 && conf < (PCI_BASE_ADDRESS_5 + 4) && !(conf & 3)) line over 96 characters
https://review.coreboot.org/c/coreboot/+/32020/14/src/arch/x86/libx86emu/tra... File src/arch/x86/libx86emu/trace-skl.c:
https://review.coreboot.org/c/coreboot/+/32020/14/src/arch/x86/libx86emu/tra... PS14, Line 34: switch (devfn) { switch and case should be at the same indent
https://review.coreboot.org/c/coreboot/+/32020/14/src/arch/x86/libx86emu/tra... PS14, Line 87: devfn >> 3, devfn & 7); code indent should use tabs where possible
https://review.coreboot.org/c/coreboot/+/32020/14/src/arch/x86/libx86emu/tra... PS14, Line 95: if (addr > 0x78000000 && addr < 0x78510000) { braces {} are not necessary for single statement blocks
https://review.coreboot.org/c/coreboot/+/32020/14/src/arch/x86/libx86emu/tra... PS14, Line 129: bool pci_trace_p2sb_r(const int bus, const int devfn, const int off, u32 *val, unsigned int bits) line over 96 characters
https://review.coreboot.org/c/coreboot/+/32020/14/src/arch/x86/libx86emu/tra... PS14, Line 137: switch(bits) { space required before the open parenthesis '('
https://review.coreboot.org/c/coreboot/+/32020/14/src/arch/x86/libx86emu/tra... PS14, Line 139: if (off >= P2SB_CR_SBI_ADDR && off < (P2SB_CR_SBI_ADDR + 4)) { braces {} are not necessary for any arm of this statement
https://review.coreboot.org/c/coreboot/+/32020/14/src/arch/x86/libx86emu/tra... PS14, Line 148: if (off >= P2SB_CR_SBI_ADDR && off < (P2SB_CR_SBI_ADDR + 4)) { braces {} are not necessary for any arm of this statement
https://review.coreboot.org/c/coreboot/+/32020/14/src/arch/x86/libx86emu/tra... PS14, Line 157: if (off >= P2SB_CR_SBI_ADDR && off < (P2SB_CR_SBI_ADDR + 4)) { braces {} are not necessary for any arm of this statement
https://review.coreboot.org/c/coreboot/+/32020/14/src/arch/x86/libx86emu/tra... PS14, Line 167: if (!(sb_data.w & 1) && pending ) { space prohibited before that close parenthesis ')'
https://review.coreboot.org/c/coreboot/+/32020/14/src/arch/x86/libx86emu/tra... PS14, Line 167: if (!(sb_data.w & 1) && pending ) { braces {} are not necessary for single statement blocks
https://review.coreboot.org/c/coreboot/+/32020/14/src/arch/x86/libx86emu/tra... PS14, Line 172: bool pci_trace_p2sb_w(const int bus, const int devfn, const int off, u32 *val, unsigned int bits) line over 96 characters
https://review.coreboot.org/c/coreboot/+/32020/14/src/arch/x86/libx86emu/tra... PS14, Line 180: switch(bits) { space required before the open parenthesis '('
https://review.coreboot.org/c/coreboot/+/32020/14/src/arch/x86/libx86emu/tra... PS14, Line 182: if (off >= P2SB_CR_SBI_ADDR && off < (P2SB_CR_SBI_ADDR + 4)) { braces {} are not necessary for any arm of this statement
https://review.coreboot.org/c/coreboot/+/32020/14/src/arch/x86/libx86emu/tra... PS14, Line 191: if (off >= P2SB_CR_SBI_ADDR && off < (P2SB_CR_SBI_ADDR + 4)) { braces {} are not necessary for any arm of this statement
https://review.coreboot.org/c/coreboot/+/32020/14/src/arch/x86/libx86emu/tra... PS14, Line 200: if (off >= P2SB_CR_SBI_ADDR && off < (P2SB_CR_SBI_ADDR + 4)) { braces {} are not necessary for any arm of this statement
https://review.coreboot.org/c/coreboot/+/32020/14/src/arch/x86/libx86emu/tra... PS14, Line 210: if ((sb_data.w & 1) && !pending ) { space prohibited before that close parenthesis ')'
https://review.coreboot.org/c/coreboot/+/32020/14/src/arch/x86/libx86emu/tra... PS14, Line 210: if ((sb_data.w & 1) && !pending ) { braces {} are not necessary for single statement blocks
https://review.coreboot.org/c/coreboot/+/32020/14/src/arch/x86/libx86emu/tra... File src/arch/x86/libx86emu/trace.c:
https://review.coreboot.org/c/coreboot/+/32020/14/src/arch/x86/libx86emu/tra... PS14, Line 56: addr < ( (uintptr_t)baseptr + size)) { space prohibited after that open parenthesis '('
https://review.coreboot.org/c/coreboot/+/32020/14/src/arch/x86/libx86emu/tra... PS14, Line 62: addr < ((uintptr_t)cbmem_entry_start(ramstage_entry) + (uintptr_t)cbmem_entry_size(ramstage_entry))) { line over 96 characters
https://review.coreboot.org/c/coreboot/+/32020/14/src/arch/x86/libx86emu/tra... PS14, Line 91: void vm_traceio_r(x86emu_t *emu, u32 addr, u32 *val, unsigned type) Prefer 'unsigned int' to bare use of 'unsigned'
https://review.coreboot.org/c/coreboot/+/32020/14/src/arch/x86/libx86emu/tra... PS14, Line 102: for (driver = &_blobolator_drivers[0]; driver != &_eblobolator_drivers[0]; driver++) { line over 96 characters
https://review.coreboot.org/c/coreboot/+/32020/14/src/arch/x86/libx86emu/tra... PS14, Line 107: for (driver = &_blobolator_drivers[0]; driver != &_eblobolator_drivers[0]; driver++) { line over 96 characters
https://review.coreboot.org/c/coreboot/+/32020/14/src/arch/x86/libx86emu/tra... PS14, Line 119: switch(bits) { switch and case should be at the same indent
https://review.coreboot.org/c/coreboot/+/32020/14/src/arch/x86/libx86emu/tra... PS14, Line 119: switch(bits) { space required before the open parenthesis '('
https://review.coreboot.org/c/coreboot/+/32020/14/src/arch/x86/libx86emu/tra... PS14, Line 121: printk(BIOS_DEBUG, " read8(0x%08x) // = 0x%x\n", addr, *val); line over 96 characters
https://review.coreboot.org/c/coreboot/+/32020/14/src/arch/x86/libx86emu/tra... PS14, Line 124: printk(BIOS_DEBUG, " read16(0x%08x) // = 0x%x\n", addr, *val); line over 96 characters
https://review.coreboot.org/c/coreboot/+/32020/14/src/arch/x86/libx86emu/tra... PS14, Line 127: printk(BIOS_DEBUG, " read32(0x%08x) // = 0x%x\n", addr, *val); line over 96 characters
https://review.coreboot.org/c/coreboot/+/32020/14/src/arch/x86/libx86emu/tra... PS14, Line 133: for (driver = &_blobolator_drivers[0]; driver != &_eblobolator_drivers[0]; driver++) { line over 96 characters
https://review.coreboot.org/c/coreboot/+/32020/14/src/arch/x86/libx86emu/tra... PS14, Line 138: for (driver = &_blobolator_drivers[0]; driver != &_eblobolator_drivers[0]; driver++) { line over 96 characters
https://review.coreboot.org/c/coreboot/+/32020/14/src/arch/x86/libx86emu/tra... PS14, Line 150: switch(bits) { switch and case should be at the same indent
https://review.coreboot.org/c/coreboot/+/32020/14/src/arch/x86/libx86emu/tra... PS14, Line 150: switch(bits) { space required before the open parenthesis '('
https://review.coreboot.org/c/coreboot/+/32020/14/src/arch/x86/libx86emu/tra... PS14, Line 152: printk(BIOS_DEBUG, " inb(0x%04x) // = 0x%x\n", addr, *val); line over 96 characters
https://review.coreboot.org/c/coreboot/+/32020/14/src/arch/x86/libx86emu/tra... PS14, Line 155: printk(BIOS_DEBUG, " inw(0x%04x) // = 0x%x\n", addr, *val); line over 96 characters
https://review.coreboot.org/c/coreboot/+/32020/14/src/arch/x86/libx86emu/tra... PS14, Line 158: printk(BIOS_DEBUG, " inl(0x%04x) // = 0x%x\n", addr, *val); line over 96 characters
https://review.coreboot.org/c/coreboot/+/32020/14/src/arch/x86/libx86emu/tra... PS14, Line 166: void vm_traceio_w(x86emu_t *emu, u32 addr, u32 *val, unsigned type) Prefer 'unsigned int' to bare use of 'unsigned'
https://review.coreboot.org/c/coreboot/+/32020/14/src/arch/x86/libx86emu/tra... PS14, Line 168: const unsigned bits = type & 0xff; Prefer 'unsigned int' to bare use of 'unsigned'
https://review.coreboot.org/c/coreboot/+/32020/14/src/arch/x86/libx86emu/tra... PS14, Line 177: for (driver = &_blobolator_drivers[0]; driver != &_eblobolator_drivers[0]; driver++) { line over 96 characters
https://review.coreboot.org/c/coreboot/+/32020/14/src/arch/x86/libx86emu/tra... PS14, Line 182: for (driver = &_blobolator_drivers[0]; driver != &_eblobolator_drivers[0]; driver++) { line over 96 characters
https://review.coreboot.org/c/coreboot/+/32020/14/src/arch/x86/libx86emu/tra... PS14, Line 194: switch(bits) { switch and case should be at the same indent
https://review.coreboot.org/c/coreboot/+/32020/14/src/arch/x86/libx86emu/tra... PS14, Line 194: switch(bits) { space required before the open parenthesis '('
https://review.coreboot.org/c/coreboot/+/32020/14/src/arch/x86/libx86emu/tra... PS14, Line 196: printk(BIOS_DEBUG, " write8(0x%08x, 0x%x)\n", addr, *val); line over 96 characters
https://review.coreboot.org/c/coreboot/+/32020/14/src/arch/x86/libx86emu/tra... PS14, Line 199: printk(BIOS_DEBUG, "write16(0x%08x, 0x%x)\n", addr, *val); line over 96 characters
https://review.coreboot.org/c/coreboot/+/32020/14/src/arch/x86/libx86emu/tra... PS14, Line 202: printk(BIOS_DEBUG, "write32(0x%08x, 0x%x)\n", addr, *val); line over 96 characters
https://review.coreboot.org/c/coreboot/+/32020/14/src/arch/x86/libx86emu/tra... PS14, Line 208: for (driver = &_blobolator_drivers[0]; driver != &_eblobolator_drivers[0]; driver++) { line over 96 characters
https://review.coreboot.org/c/coreboot/+/32020/14/src/arch/x86/libx86emu/tra... PS14, Line 213: for (driver = &_blobolator_drivers[0]; driver != &_eblobolator_drivers[0]; driver++) { line over 96 characters
https://review.coreboot.org/c/coreboot/+/32020/14/src/arch/x86/libx86emu/tra... PS14, Line 225: switch(bits) { switch and case should be at the same indent
https://review.coreboot.org/c/coreboot/+/32020/14/src/arch/x86/libx86emu/tra... PS14, Line 225: switch(bits) { space required before the open parenthesis '('
https://review.coreboot.org/c/coreboot/+/32020/14/src/arch/x86/libx86emu/tra... PS14, Line 227: printk(BIOS_DEBUG, " outb(0x%04x, 0x%x))\n", addr, *val); line over 96 characters
https://review.coreboot.org/c/coreboot/+/32020/14/src/arch/x86/libx86emu/tra... PS14, Line 230: printk(BIOS_DEBUG, " outw(0x%04x, 0x%x)\n", addr, *val); line over 96 characters
https://review.coreboot.org/c/coreboot/+/32020/14/src/arch/x86/libx86emu/tra... PS14, Line 233: printk(BIOS_DEBUG, " outl(0x%04x, 0x%x)\n", addr, *val); line over 96 characters
https://review.coreboot.org/c/coreboot/+/32020/14/src/drivers/intel/fsp2_0/m... File src/drivers/intel/fsp2_0/memory_init.c:
https://review.coreboot.org/c/coreboot/+/32020/14/src/drivers/intel/fsp2_0/m... PS14, Line 324: else else should follow close brace '}'
https://review.coreboot.org/c/coreboot/+/32020/14/src/mainboard/emulation/qe... File src/mainboard/emulation/qemu-q35/mainboard.c:
https://review.coreboot.org/c/coreboot/+/32020/14/src/mainboard/emulation/qe... PS14, Line 85: if (myconfig->config1 || myconfig->config2) { braces {} are not necessary for single statement blocks
https://review.coreboot.org/c/coreboot/+/32020/14/src/mainboard/emulation/qe... PS14, Line 88: if (myconfig->config3 != 0 && myconfig->config3 != 2) { braces {} are not necessary for single statement blocks
https://review.coreboot.org/c/coreboot/+/32020/14/src/mainboard/emulation/qe... PS14, Line 91: if (myconfig->config1) { braces {} are not necessary for single statement blocks
https://review.coreboot.org/c/coreboot/+/32020/14/src/mainboard/emulation/qe... PS14, Line 94: if (myconfig->config2) { braces {} are not necessary for single statement blocks
https://review.coreboot.org/c/coreboot/+/32020/14/src/mainboard/emulation/qe... PS14, Line 98: if (myconfig->config5) { braces {} are not necessary for single statement blocks
Martin L Roth has abandoned this change. ( https://review.coreboot.org/c/coreboot/+/32020?usp=email )
Change subject: [WIP]x86: Introduce the blobolator ......................................................................
Abandoned
This patch has not been touched in over 12 months. Anyone who wants to take over work on this patch, please feel free to restore it and do any work needed to get it merged. If you create a new patch based on this work, please credit the original author.