[SeaBIOS] Re: [PATCH 3/4] romlayout32flag.lds: Use `. +=` instead of `. =`

2020-04-06 Thread Kevin O'Connor
On Wed, Apr 01, 2020 at 10:29:14AM -0700, Fangrui Song wrote: > This improves the portability of the linker script and allows lld to link > rom.o > > Dot assignment inside an output section has an inconsistent behavior > which makes lld difficult to implement. > See

[SeaBIOS] Re: [PATCH 1/4] Make rom16.o linkable with lld

2020-04-06 Thread Fangrui Song
On 2020-04-06, Kevin O'Connor wrote: On Wed, Apr 01, 2020 at 10:29:12AM -0700, Fangrui Song wrote: (1) In romlayout.S, .fixedaddr.\addr sections do have not the SHF_ALLOC flag. It does not make sense to reference a SHF_ALLOC section from a non-SHF_ALLOC section via R_386_PC16. GNU ld allows it

[SeaBIOS] [PATCH v3 4/5] romlayout32flag.lds: Use `. +=` instead of `. =`

2020-04-06 Thread Fangrui Song
This improves the portability of the linker script and allows lld to link rom.o Dot assignment inside an output section has an inconsistent behavior which makes lld difficult to implement. See https://bugs.llvm.org/show_bug.cgi?id=43083 Dropping `. =` turns out to be beneficial to older GNU ld

[SeaBIOS] Re: [PATCH 7/9] acpi: add dsdt parser

2020-04-06 Thread Kevin O'Connor
On Fri, Apr 03, 2020 at 10:31:19AM +0200, Gerd Hoffmann wrote: > Create a list of devices found in the DSDT table. Add helper functions > to find devices, walk the list and figure device informations like mmio > ranges and irqs. > > Signed-off-by: Gerd Hoffmann > --- > src/util.h |

[SeaBIOS] Re: [PATCH 4/4] test-build.sh: Delete unneeded LD capability test

2020-04-06 Thread Fangrui Song
On 2020-04-06, Kevin O'Connor wrote: On Wed, Apr 01, 2020 at 10:29:15AM -0700, Fangrui Song wrote: The previous commit changed romlayout32flag.lds to use `. += ` instead of `. =`. We no longer need the LD capability test checking https://sourceware.org/bugzilla/show_bug.cgi?id=12726 Thanks.

[SeaBIOS] Re: [PATCH 2/4] Makefile: Change ET_EXEC to ET_REL so that lld can link bios.bin.elf

2020-04-06 Thread Fangrui Song
On 2020-04-06, Kevin O'Connor wrote: On Wed, Apr 01, 2020 at 10:29:13AM -0700, Fangrui Song wrote: Accepting ET_EXEC as an input file is an extremely rare GNU ld feature that lld does not intend to support, because this is error-prone. See Linux kernel commit

[SeaBIOS] Re: [PATCH 8/9] acpi: skip kbd init if not present

2020-04-06 Thread Kevin O'Connor
On Fri, Apr 03, 2020 at 10:31:20AM +0200, Gerd Hoffmann wrote: > Don't initialize the ps/2 keyboard in case the device is not > listed in the ACPi DSDT table. > > Signed-off-by: Gerd Hoffmann > --- > src/hw/ps2port.c | 4 > 1 file changed, 4 insertions(+) > > diff --git a/src/hw/ps2port.c

[SeaBIOS] Re: [PATCH 2/4] Makefile: Change ET_EXEC to ET_REL so that lld can link bios.bin.elf

2020-04-06 Thread Kevin O'Connor
On Wed, Apr 01, 2020 at 10:29:13AM -0700, Fangrui Song wrote: > Accepting ET_EXEC as an input file is an extremely rare GNU ld feature > that lld does not intend to support, because this is error-prone. > > See Linux kernel commit 90ceddcb495008ac8ba7a3dce297841efcd7d584 for > another use of the

[SeaBIOS] Re: [PATCH 4/4] test-build.sh: Delete unneeded LD capability test

2020-04-06 Thread Kevin O'Connor
On Wed, Apr 01, 2020 at 10:29:15AM -0700, Fangrui Song wrote: > The previous commit changed romlayout32flag.lds to use `. += ` instead > of `. =`. > We no longer need the LD capability test checking > https://sourceware.org/bugzilla/show_bug.cgi?id=12726 Thanks. It would be great to remove this

[SeaBIOS] Re: [PATCH 1/4] Make rom16.o linkable with lld

2020-04-06 Thread Kevin O'Connor
On Mon, Apr 06, 2020 at 05:26:35PM -0700, Fangrui Song wrote: > On 2020-04-06, Kevin O'Connor wrote: > > On Wed, Apr 01, 2020 at 10:29:12AM -0700, Fangrui Song wrote: > > > (1) In romlayout.S, .fixedaddr.\addr sections do have not the SHF_ALLOC > > > flag. > > > It does not make sense to

[SeaBIOS] Re: [PATCH 3/4] romlayout32flag.lds: Use `. +=` instead of `. =`

2020-04-06 Thread Fangrui Song
On 2020-04-06, Kevin O'Connor wrote: On Wed, Apr 01, 2020 at 10:29:14AM -0700, Fangrui Song wrote: This improves the portability of the linker script and allows lld to link rom.o Dot assignment inside an output section has an inconsistent behavior which makes lld difficult to implement. See

[SeaBIOS] Re: [PATCH 1/9] virtio-mmio: device registry

2020-04-06 Thread Kevin O'Connor
On Fri, Apr 03, 2020 at 10:31:13AM +0200, Gerd Hoffmann wrote: > Add a new virtio-mmio.c source file, providing a function > to register virtio-mmio devices. > > Signed-off-by: Gerd Hoffmann > --- > Makefile | 2 +- > src/hw/virtio-mmio.h | 6 ++ > src/hw/virtio-mmio.c | 30

[SeaBIOS] Re: [PATCH v2] Use readelf -WSrs instead of objdump -thr so that llvm-readelf can be used as a replacement

2020-04-06 Thread Kevin O'Connor
On Wed, Apr 01, 2020 at 06:12:09PM -0700, Fangrui Song wrote: > objdump -h relies heavily on BFD internals and the BFD flags are difficult to > emulate in llvm-objdump. > llvm-objdump -h has a different output (https://reviews.llvm.org/D57146) > > Switch to readelf, which is generally better

[SeaBIOS] Re: [PATCH 1/4] Make rom16.o linkable with lld

2020-04-06 Thread Kevin O'Connor
On Wed, Apr 01, 2020 at 10:29:12AM -0700, Fangrui Song wrote: > (1) In romlayout.S, .fixedaddr.\addr sections do have not the SHF_ALLOC flag. > It does not make sense to reference a SHF_ALLOC section from a non-SHF_ALLOC > section via R_386_PC16. > GNU ld allows it but lld will warn. Add the

[SeaBIOS] Re: [PATCH v2] Use readelf -WSrs instead of objdump -thr so that llvm-readelf can be used as a replacement

2020-04-06 Thread Fangrui Song
On 2020-04-06, Kevin O'Connor wrote: On Wed, Apr 01, 2020 at 06:12:09PM -0700, Fangrui Song wrote: objdump -h relies heavily on BFD internals and the BFD flags are difficult to emulate in llvm-objdump. llvm-objdump -h has a different output (https://reviews.llvm.org/D57146) Switch to readelf,

[SeaBIOS] [PATCH v3 3/5] Makefile: Change ET_EXEC to ET_REL so that lld can link bios.bin.elf

2020-04-06 Thread Fangrui Song
Accepting ET_EXEC as an input file is an extremely rare GNU ld feature that lld does not intend to support, because this is error-prone. See Linux kernel commit 90ceddcb495008ac8ba7a3dce297841efcd7d584 for another use of the dd trick. -- Changes v1 -> v2 * Add status=none to the dd command line.

[SeaBIOS] [PATCH v3 0/5] Make seabios linkable with lld

2020-04-06 Thread Fangrui Song
This patch series make seabios linkable with lld. This is beneficial for FreeBSD ports as well https://svnweb.freebsd.org/ports/head/misc/seabios/Makefile as they can drop an LLD_UNSAFE As a maintainer of lld ELF, I have triaged numerous pieces of software. seabios is the only one making use of

[SeaBIOS] [PATCH v3 5/5] test-build.sh: Delete unneeded LD capability test

2020-04-06 Thread Fangrui Song
The previous commit changed romlayout32flag.lds to use `. += ` instead of `. =`. We no longer need the LD capability test checking https://sourceware.org/bugzilla/show_bug.cgi?id=12726 Signed-off-by: Fangrui Song --- scripts/test-build.sh | 42 +- 1 file

[SeaBIOS] [PATCH v3 2/5] Make rom16.o linkable with lld

2020-04-06 Thread Fangrui Song
lld requires output section descriptions to be sorted by address. Just sort the addresses beforehand. -- Changes v2 -> v3 * Sort sections by finalloc unconditionally Signed-off-by: Fangrui Song --- scripts/layoutrom.py | 1 + 1 file changed, 1 insertion(+) diff --git a/scripts/layoutrom.py

[SeaBIOS] [PATCH v3 1/5] romlayout.S: Add missing SHF_ALLOC flag to .fixedaddr.\addr

2020-04-06 Thread Fangrui Song
It does not make sense to reference a SHF_ALLOC section from a non-SHF_ALLOC section via R_386_PC16. Conceptually, even if a non-SHF_ALLOC is loaded as part of the memory image, the distance between it and a SHF_ALLOC section may not be a constant, so the linker cannot reasonably resolve the

[SeaBIOS] Handling SMI problem

2020-04-06 Thread lowa-88
Hello, recently I've found the-sea-watcher project and now I'm trying to repeat it. https://scumjr.github.io/2016/01/10/from-smm-to-userland-in-a-few-bytes/ But I have a strange problem when I trigger a SMI my VM instantly reboot. I use that function to send SMI: #define PORT_SMI_CMD