[SeaBIOS] [PATCH] build: use -fcf-protection=none when available

2020-03-19 Thread Christian Ehrhardt
Some hardened gcc v9 compilers (such as the one in Ubuntu) default this option which for seabios leads to emulation errors when running in KVM (does not trigger in TCG) on older intel chips of the Penryn generation (~2006-2008). Symptom in KVM looks like: KVM internal error. Suberror: 1

[SeaBIOS] [PATCH 2/6] paravirt/qemu: virtio-mmio device discovery

2020-03-19 Thread Gerd Hoffmann
Use bootorder fw_cfg file to find bootable virtio-mmio devices. Also 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/fw/paravirt.c| 24

[SeaBIOS] [PATCH 0/6] Add virtio-mmio support

2020-03-19 Thread Gerd Hoffmann
qemu got a new "microvm" machine type which has no pci support. virtio-mmio is used for devices instead. This series adds support for virtio-mmio devices to seabios to allow booting from block and scsi devices. Gerd Hoffmann (6): string: add strtol() implementation paravirt/qemu: virtio-mmio

[SeaBIOS] [PATCH 4/6] virtio-mmio: add support to vp_*() functions

2020-03-19 Thread Gerd Hoffmann
Add support for virtio-mmio to the vp_*() helper functions. Both legacy and 1.0 virto-mmio versions are supported. They are very simliar anyway, only the virtqueue initialization is slightly different. Signed-off-by: Gerd Hoffmann --- src/hw/virtio-pci.c | 68

[SeaBIOS] [PATCH 6/6] virtio-mmio: add support for block devices.

2020-03-19 Thread Gerd Hoffmann
Add and use bootprio_find_mmio_device() to figure the boot priority of virtio-mmio block devices. Add init_virtio_blk_mmio to initialize one virtio-mmio block device. Signed-off-by: Gerd Hoffmann --- src/hw/virtio-blk.h | 1 + src/util.h | 1 + src/boot.c | 9 ++

[SeaBIOS] [PATCH] pci: add mmconfig support

2020-03-19 Thread Gerd Hoffmann
Add support for pci config space access via mmconfig bar. Enable for qemu q35 chipset. Main advantage is that we need only one instead of two io operations per config space access, which translates to one instead of two vmexits for virtualization. Signed-off-by: Gerd Hoffmann --- src/hw/pci.h

[SeaBIOS] Re: [PATCH] pci: add mmconfig support

2020-03-19 Thread Stefan Hajnoczi
On Thu, Mar 19, 2020 at 10:21:55AM +0100, Gerd Hoffmann wrote: > Add support for pci config space access via mmconfig bar. Enable for > qemu q35 chipset. Main advantage is that we need only one instead of > two io operations per config space access, which translates to one > instead of two

[SeaBIOS] [PATCH 3/6] virtio-mmio: device probing and initialization.

2020-03-19 Thread Gerd Hoffmann
Add virtio_mmio_setup() to probe virtio mmio devices. Add vp_init_mmio() to initialize device struct. Because virtio-pci and virtio-mmio are quite simliar we reuse the infrastructure we already have for virtio-pci and just setup struct vp_cap for virtio-mmio. Signed-off-by: Gerd Hoffmann ---

[SeaBIOS] [PATCH 5/6] virtio-mmio: add support for scsi devices.

2020-03-19 Thread Gerd Hoffmann
Add new fields to struct virtio_lun_s for mmio support, add mmio parameter to virtio_scsi_init_lun(), so both pci and mmio devices can be handled. Add and use bootprio_find_scsi_mmio_device() to figure boot priority of devices connected to a virtio-mmio scsi controller. Finally add

[SeaBIOS] [PATCH 1/6] string: add strtol() implementation

2020-03-19 Thread Gerd Hoffmann
Signed-off-by: Gerd Hoffmann --- src/string.h | 1 + src/string.c | 25 + 2 files changed, 26 insertions(+) diff --git a/src/string.h b/src/string.h index d069989db4b4..17ef3c6a1e89 100644 --- a/src/string.h +++ b/src/string.h @@ -27,5 +27,6 @@ void *memmove(void *d,

[SeaBIOS] Re: [PATCH 2/6] paravirt/qemu: virtio-mmio device discovery

2020-03-19 Thread Kevin O'Connor
On Thu, Mar 19, 2020 at 08:39:33AM +0100, Gerd Hoffmann wrote: > Use bootorder fw_cfg file to find bootable virtio-mmio devices. > Also add a new virtio-mmio.c source file, providing a function > to register virtio-mmio devices. Can you expand on this? I'm not sure I understand what this patch

[SeaBIOS] Re: [PATCH] pci: add mmconfig support

2020-03-19 Thread Gerd Hoffmann
> > +static void *pci_mmconfig_addr(u16 bdf, u32 addr) > > +{ > > +if (!mmconfig) > > +return NULL; > > +return (void*)(mmconfig + ((u32)bdf << 12) + addr); > > +} > > + > > void pci_config_writel(u16 bdf, u32 addr, u32 val) > > { > > -outl(0x8000 | (bdf << 8) | (addr &

[SeaBIOS] Re: [PATCH] build: use -fcf-protection=none when available

2020-03-19 Thread Fangrui Song
On 2020-03-19, Christian Ehrhardt wrote: Some hardened gcc v9 compilers (such as the one in Ubuntu) default this option which for seabios leads to emulation errors when running in KVM (does not trigger in TCG) on older intel chips of the Penryn generation (~2006-2008). Symptom in KVM looks

[SeaBIOS] Re: [PATCH] pci: add mmconfig support

2020-03-19 Thread Kevin O'Connor
On Thu, Mar 19, 2020 at 10:21:55AM +0100, Gerd Hoffmann wrote: > Add support for pci config space access via mmconfig bar. Enable for > qemu q35 chipset. Main advantage is that we need only one instead of > two io operations per config space access, which translates to one > instead of two