[SeaBIOS] Re: [QEMU] [PATCH v4 0/8] Add Qemu to SeaBIOS LCHS interface

2019-06-19 Thread Gerd Hoffmann
> === OUTPUT BEGIN === > 1/8 Checking commit cf2168a66dbd (block: Refactor macros - fix tabbing) > ERROR: Macros with complex values should be enclosed in parenthesis > #55: FILE: include/hw/block/block.h:65: > +#define DEFINE_BLOCK_CHS_PROPERTIES(_state, _conf) \ > +

[SeaBIOS] Re: [QEMU] [PATCH v4 7/8] bootdevice: FW_CFG interface for LCHS values

2019-06-19 Thread Gerd Hoffmann
On Wed, Jun 19, 2019 at 12:29:04PM +0300, Sam Eiderman wrote: > Using fw_cfg, supply logical CHS values directly from QEMU to the BIOS. > > Non-standard logical geometries break under QEMU. > > A virtual disk which contains an operating system which depends on > logical geometries (consistent

[SeaBIOS] Re: [PATCH v3 4/4] geometry: Apply LCHS values for boot devices

2019-06-19 Thread Gerd Hoffmann
> +static int > +overriden_lchs_supplied(struct drive_s *drive) > +{ > +return drive->lchs.cylinder || drive->lchs.head || drive->lchs.sector; > +} > +case TRANSLATION_MACHINE: Hmm, why this name? Doesn't look intuitive to me. > +desc = "overriden"; I'd name that

[SeaBIOS] [PATCH] csm: Fix boot priority translation

2019-06-19 Thread David Woodhouse
For CSM, the highest priority is zero. In SeaBIOS that means "don't", and the highest priority is 1. So we end up with the fun outcome that booting from NVMe worked only when it *wasn't* selected as the primary boot target, because we don't actually run the nvme_controller_setup() thread for an

[SeaBIOS] Re: [PATCH] scripts/buildversion.py: allow version to be overridden

2019-06-19 Thread David Woodhouse
On Tue, 2019-06-18 at 18:48 -0400, Kevin O'Connor wrote: > > The main project has an out-of-tree build, and currently *copies* > > everything from the SeaBIOS submodule (except .git) into the build > > directory and building it there. It creates a .version file with the > > overall version number

[SeaBIOS] [QEMU] [PATCH v4 0/8] Add Qemu to SeaBIOS LCHS interface

2019-06-19 Thread Sam Eiderman
v1: Non-standard logical geometries break under QEMU. A virtual disk which contains an operating system which depends on logical geometries (consistent values being reported from BIOS INT13 AH=08) will most likely break under QEMU/SeaBIOS if it has non-standard logical geometries - for example

[SeaBIOS] [QEMU] [PATCH v4 6/8] bootdevice: Refactor get_boot_devices_list

2019-06-19 Thread Sam Eiderman
Move device name construction to a separate function. We will reuse this function in the following commit to pass logical CHS parameters through fw_cfg much like we currently pass bootindex. Reviewed-by: Karl Heubaum Reviewed-by: Arbel Moshe Signed-off-by: Sam Eiderman --- bootdevice.c | 61

[SeaBIOS] [QEMU] [PATCH v4 7/8] bootdevice: FW_CFG interface for LCHS values

2019-06-19 Thread Sam Eiderman
Using fw_cfg, supply logical CHS values directly from QEMU to the BIOS. Non-standard logical geometries break under QEMU. A virtual disk which contains an operating system which depends on logical geometries (consistent values being reported from BIOS INT13 AH=08) will most likely break under

[SeaBIOS] [QEMU] [PATCH v4 1/8] block: Refactor macros - fix tabbing

2019-06-19 Thread Sam Eiderman
Fixing tabbing in block related macros. Reviewed-by: Karl Heubaum Reviewed-by: Arbel Moshe Signed-off-by: Sam Eiderman --- hw/ide/qdev.c| 2 +- include/hw/block/block.h | 16 2 files changed, 9 insertions(+), 9 deletions(-) diff --git a/hw/ide/qdev.c

[SeaBIOS] [QEMU] [PATCH v4 8/8] hd-geo-test: Add tests for lchs override

2019-06-19 Thread Sam Eiderman
Add QTest tests to check the logical geometry override option. The tests in hd-geo-test are out of date - they only test IDE and do not test interesting MBRs. I added a few helper functions which will make adding more tests easier. QTest's fw_cfg helper functions support only legacy fw_cfg, so

[SeaBIOS] [QEMU] [PATCH v4 5/8] bootdevice: Gather LCHS from all relevant devices

2019-06-19 Thread Sam Eiderman
Relevant devices are: * ide-hd (and ide-cd, ide-drive) * scsi-hd (and scsi-cd, scsi-disk, scsi-block) * virtio-blk-pci We do not call del_boot_device_lchs() for ide-* since we don't need to - IDE block devices do not support unplugging. Reviewed-by: Karl Heubaum Reviewed-by: Arbel

[SeaBIOS] [QEMU] [PATCH v4 4/8] scsi: Propagate unrealize() callback to scsi-hd

2019-06-19 Thread Sam Eiderman
We will need to add LCHS removal logic to scsi-hd's unrealize() in the next commit. Reviewed-by: Karl Heubaum Reviewed-by: Arbel Moshe Signed-off-by: Sam Eiderman --- hw/scsi/scsi-bus.c | 15 +++ include/hw/scsi/scsi.h | 1 + 2 files changed, 16 insertions(+) diff --git

[SeaBIOS] [QEMU] [PATCH v4 3/8] bootdevice: Add interface to gather LCHS

2019-06-19 Thread Sam Eiderman
Add an interface to provide direct logical CHS values for boot devices. We will use this interface in the next commits. Reviewed-by: Karl Heubaum Reviewed-by: Arbel Moshe Signed-off-by: Sam Eiderman --- bootdevice.c| 55 +

[SeaBIOS] [QEMU] [PATCH v4 2/8] block: Support providing LCHS from user

2019-06-19 Thread Sam Eiderman
Add logical geometry variables to BlockConf. A user can now supply "lcyls", "lheads" & "lsecs" for any HD device that supports CHS ("cyls", "heads", "secs"). These devices include: * ide-hd * scsi-hd * virtio-blk-pci In future commits we will use the provided LCHS and pass it to the

[SeaBIOS] [PATCH v3 0/4] Add Qemu to SeaBIOS LCHS interface

2019-06-19 Thread Sam Eiderman
v1: Non-standard logical geometries break under QEMU. A virtual disk which contains an operating system which depends on logical geometries (consistent values being reported from BIOS INT13 AH=08) will most likely break under QEMU/SeaBIOS if it has non-standard logical geometries - for example

[SeaBIOS] [PATCH v3 1/4] geometry: Read LCHS from fw_cfg

2019-06-19 Thread Sam Eiderman
Read bios geometry for boot devices from fw_cfg. By receiving LCHS values directly from QEMU through fw_cfg we will be able to support logical geometries which can not be inferred by SeaBIOS itself. (For instance: A 8GB virtio-blk hard drive which was originally created as an IDE and must report

[SeaBIOS] [PATCH v3 4/4] geometry: Apply LCHS values for boot devices

2019-06-19 Thread Sam Eiderman
Boot devices which use overriden LCHS values are: * ata * ahci * scsi * esp * lsi * megasas * mpt * pvscsi * virtio * virtio-blk We use these values in get_translation() and setup_translation() by introducing a new translation type:

[SeaBIOS] [PATCH v3 2/4] boot: Reorder functions in boot.c

2019-06-19 Thread Sam Eiderman
Currently glob_prefix() and build_pci_path() are under the "Boot priority ordering" section. Move them to a new "Helper search functions" section since we will reuse them in the next commit. Reviewed-by: Karl Heubaum Reviewed-by: Arbel Moshe Signed-off-by: Sam Eiderman --- src/boot.c | 94

[SeaBIOS] [PATCH v3 3/4] geometry: Add boot_lchs_find_*() utility functions

2019-06-19 Thread Sam Eiderman
Adding the following utility functions: * boot_lchs_find_pci_device * boot_lchs_find_scsi_device * boot_lchs_find_ata_device These will be used to apply LCHS values received through fw_cfg. Reviewed-by: Karl Heubaum Reviewed-by: Arbel Moshe Signed-off-by: Sam Eiderman ---