[SeaBIOS] [PATCH 2/6] bios_date: Make bios date appear once in the ROM

2019-05-17 Thread Sam Eiderman
-by: Sam Eiderman Signed-off-by: Liran Alon --- src/fw/biostables.c | 14 +++--- src/util.h | 4 2 files changed, 15 insertions(+), 3 deletions(-) diff --git a/src/fw/biostables.c b/src/fw/biostables.c index b055c9b2..546e83c6 100644 --- a/src/fw/biostables.c +++ b/src/fw

[SeaBIOS] [PATCH 1/2] bios_date: Clean FSEG from unwanted date strings

2019-05-28 Thread Sam Eiderman
Reviewed-by: Konrad Rzeszutek Wilk Reviewed-by: Arbel Moshe Signed-off-by: Sam Eiderman Signed-off-by: Liran Alon --- src/fw/biostables.c | 2 +- src/fw/smbios.c | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/fw/biostables.c b/src/fw/biostables.c index

[SeaBIOS] [PATCH 2/2] bios_date: Introduce fw_cfg to set SystemBiosDate

2019-05-28 Thread Sam Eiderman
ion of nt!CmpGetBiosDate(), see ReactOS: https://doxygen.reactos.org/d5/dd2/i386_2cmhardwr_8c.html Reviewed-by: Konrad Rzeszutek Wilk Reviewed-by: Arbel Moshe Signed-off-by: Sam Eiderman Signed-off-by: Liran Alon --- src/boot.c | 9 + src/fw/biostables.c | 2 +- src/fw/smbio

[SeaBIOS] Re: [PATCH 3/6] bios_date: Change BiosDate to SMBIOS bios date

2019-05-28 Thread Sam Eiderman
Kevin, I have used your method to clean FSEG from unwanted date strings and added a new fw_cfg to control the date that will eventually appear in SystemBiosDate. New patches submitted. Thanks, Sam > On 24 May 2019, at 19:35, Sam Eiderman wrote: > > Kevin, > > Notice that you

[SeaBIOS] Re: [PATCH 2/2] bios_date: Introduce fw_cfg to set SystemBiosDate

2019-05-29 Thread Sam Eiderman
So what do you suggest? If qemu supplies a date in legacy/non-legacy we override the date in FSEG(0xfff5) with it (or make sure it appears in FSEG and is greater than 06/23/99)? Do we wish to support cases where: wmic bios get releasedate HKLM/HARDWARE/DESCRIPTION/System SystemBiosDate

[SeaBIOS] Re: [PATCH 2/2] bios_date: Introduce fw_cfg to set SystemBiosDate

2019-05-29 Thread Sam Eiderman
, 2019 at 09:39:05AM +0300, Sam Eiderman wrote: >> So what do you suggest? >> >> If qemu supplies a date in legacy/non-legacy we override the date in >> FSEG(0xfff5) with it > > I think that makes sense, yes. > > cheers, > Gerd > __

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

2019-06-13 Thread Sam Eiderman
typo: ddb.geometry.biosCylinders = “83257” * Sam > On 13 Jun 2019, at 10:41, Sam Eiderman wrote: > > > >> On 12 Jun 2019, at 22:18, Gerd Hoffmann > <mailto:kra...@redhat.com>> wrote: >> >> On Wed, Jun 12, 2019 at 04:30:03PM +0300, Sam Eiderman wrot

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

2019-06-13 Thread Sam Eiderman
> On 13 Jun 2019, at 12:38, Gerd Hoffmann wrote: > > Hi, > >> Yes they are pretty rare. >> Windows 2000 and Windows XP guests migrated from VMware to Qemu/KVM >> would not boot due to incorrect disk geometries (some had 32/56 spt instead >> of >> 56. Also number of heads was not entirely

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

2019-06-13 Thread Sam Eiderman
> On 12 Jun 2019, at 22:18, Gerd Hoffmann wrote: > > On Wed, Jun 12, 2019 at 04:30:03PM +0300, Sam Eiderman wrote: >> >> >>> On 12 Jun 2019, at 16:06, Gerd Hoffmann wrote: >>> >>> On Wed, Jun 12, 2019 at 02:59:31PM +0300, Sam Eiderman

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

2019-06-12 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 --- src

[SeaBIOS] [PATCH 4/5] config: Add toggle for bootdevice information

2019-06-12 Thread Sam Eiderman
Reviewed-by: Arbel Moshe Signed-off-by: Sam Eiderman --- src/Kconfig | 7 +++ src/boot.c | 9 + 2 files changed, 16 insertions(+) diff --git a/src/Kconfig b/src/Kconfig index 55a87cb7..b3645b33 100644 --- a/src/Kconfig +++ b/src/Kconfig @@ -72,6 +72,13 @@ endchoice

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

2019-06-12 Thread Sam Eiderman
: "TRANSLATION_MACHINE". We treat this translation as TRANSLATION_NONE in fill_ata_edd(), although this does not really matter since now the translation between physical and logical geometry does not exist. Reviewed-by: Karl Heubaum Reviewed-by: Arbel Moshe Signed-off-by: Sam Eiderman

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

2019-06-12 Thread Sam Eiderman
ize) ... * device path (sz string) * device information (struct_size) Device path is a null terminated string in the "Open Firmware" device path format, the same path as used in bootorder. Reviewed-by: Karl Heubaum Reviewed-by: Arbel Moshe Signed-off-by: Sam Eiderman --- sr

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

2019-06-12 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 + include

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

2019-06-12 Thread Sam Eiderman
ix missing parenthesis check in "hd-geo-test: Add tests for lchs override" Sam Eiderman (8): block: Refactor macros - fix tabbing block: Support providing LCHS from user bootdevice: Add interface to gather LCHS scsi: Propagate unrealize() callback to scsi-hd bootdevice: Gather LC

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

2019-06-12 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 b/hw/ide

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

2019-06-12 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 a/hw

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

2019-06-12 Thread Sam Eiderman
Moshe Signed-off-by: Sam Eiderman --- hw/block/virtio-blk.c | 6 ++ hw/ide/qdev.c | 5 + hw/scsi/scsi-disk.c | 14 ++ 3 files changed, 25 insertions(+) diff --git a/hw/block/virtio-blk.c b/hw/block/virtio-blk.c index 06e57a4d39..787bbd768a 100644 --- a/hw/block

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

2019-06-12 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 v2 7/8] bootdevice: FW_CFG interface for LCHS values

2019-06-12 Thread Sam Eiderman
e/%s/logical_geometry" where %s is the device name QEMU produces - but this implementation would require much more code refactoring, both in QEMU and SeaBIOS, so the current implementation was chosen. Reviewed-by: Karl Heubaum Reviewed-by: Arbel Moshe Si

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

2019-06-12 Thread Sam Eiderman
lk-pci In future commits we will use the provided LCHS and pass it to the BIOS through fw_cfg to be supplied using INT13 routines. Reviewed-by: Karl Heubaum Reviewed-by: Arbel Moshe Signed-off-by: Sam Eiderman --- include/hw/block/block.h | 6 +- 1 file changed, 5 insertions(+), 1 deletion(-)

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

2019-06-12 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

[SeaBIOS] [PATCH 0/5] Add Qemu to SeaBIOS LCHS interface

2019-06-12 Thread Sam Eiderman
more than 16 physical heads when moved to an IDE controller, the ATA spec allows a maximum of 16 heads - this is an artifact of virtualization. By supplying the logical geometies directly we are able to support such "exotic" disks. We will use fw_cfg to do just that. Sam Eiderman (5):

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

2019-06-12 Thread Sam Eiderman
I had to read the new fw_cfg layout on my own. Creating qcow2 disks with specific size and MBR layout is currently unused - we only use a default empty MBR. Reviewed-by: Karl Heubaum Reviewed-by: Arbel Moshe Signed-off-by: Sam Eiderman --- tests/Makefile.include | 2 +- tests/hd-geo-test.c

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

2019-06-12 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 a/hw

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

2019-06-12 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 + include

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

2019-06-12 Thread Sam Eiderman
lk-pci In future commits we will use the provided LCHS and pass it to the BIOS through fw_cfg to be supplied using INT13 routines. Reviewed-by: Karl Heubaum Reviewed-by: Arbel Moshe Signed-off-by: Sam Eiderman --- include/hw/block/block.h | 6 +- 1 file changed, 5 insertions(+), 1 deletion(-)

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

2019-06-12 Thread Sam Eiderman
more than 16 physical heads when moved to an IDE controller, the ATA spec allows a maximum of 16 heads - this is an artifact of virtualization. By supplying the logical geometies directly we are able to support such "exotic" disks. We will use fw_cfg to do just that. Sam Eiderman (8

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

2019-06-12 Thread Sam Eiderman
I had to read the new fw_cfg layout on my own. Creating qcow2 disks with specific size and MBR layout is currently unused - we only use a default empty MBR. Reviewed-by: Karl Heubaum Reviewed-by: Arbel Moshe Signed-off-by: Sam Eiderman --- tests/Makefile.include | 2 +- tests/hd-geo-test.c

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

2019-06-12 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 b/hw/ide

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

2019-06-12 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 7/8] bootdevice: FW_CFG interface for LCHS values

2019-06-12 Thread Sam Eiderman
e/%s/logical_geometry" where %s is the device name QEMU produces - but this implementation would require much more code refactoring, both in QEMU and SeaBIOS, so the current implementation was chosen. Reviewed-by: Karl Heubaum Reviewed-by: Arbel Moshe Si

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

2019-06-12 Thread Sam Eiderman
Moshe Signed-off-by: Sam Eiderman --- hw/block/virtio-blk.c | 6 ++ hw/ide/qdev.c | 5 + hw/scsi/scsi-disk.c | 14 ++ 3 files changed, 25 insertions(+) diff --git a/hw/block/virtio-blk.c b/hw/block/virtio-blk.c index 06e57a4d39..787bbd768a 100644 --- a/hw/block

[SeaBIOS] Re: [Qemu-devel] [QEMU] [PATCH v2 7/8] bootdevice: FW_CFG interface for LCHS values

2019-06-17 Thread Sam Eiderman
> On 17 Jun 2019, at 17:48, Kevin O'Connor wrote: > > On Mon, Jun 17, 2019 at 10:36:54AM +0300, Sam Eiderman wrote: >> So overall, WDYT? >> Keep it extendible for a low price of ABI + “bootdevices” name. >> Or go strict and rename to “bios-geometries”? > > I

[SeaBIOS] [PATCH v2 0/5] Add Qemu to SeaBIOS LCHS interface

2019-06-17 Thread Sam Eiderman
ootdevices fw_cfg key to bios-geoemtry Sam Eiderman (5): geometry: Read LCHS from fw_cfg boot: Reorder functions in boot.c geometry: Add boot_lchs_find_*() utility functions config: Add toggle for bootdevice information geometry: Apply LCHS values for boot devices src/Kconfig |

[SeaBIOS] [PATCH v2 4/5] config: Add toggle for bootdevice information

2019-06-17 Thread Sam Eiderman
Reviewed-by: Arbel Moshe Signed-off-by: Sam Eiderman --- src/Kconfig | 7 +++ src/boot.c | 8 2 files changed, 15 insertions(+) diff --git a/src/Kconfig b/src/Kconfig index 55a87cb7..0b4c1c0d 100644 --- a/src/Kconfig +++ b/src/Kconfig @@ -72,6 +72,13 @@ endchoice

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

2019-06-17 Thread Sam Eiderman
I had to read the new fw_cfg layout on my own. Creating qcow2 disks with specific size and MBR layout is currently unused - we only use a default empty MBR. Reviewed-by: Karl Heubaum Reviewed-by: Arbel Moshe Signed-off-by: Sam Eiderman --- tests/Makefile.include | 2 +- tests/hd-geo-test.c

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

2019-06-17 Thread Sam Eiderman
Moshe Signed-off-by: Sam Eiderman --- hw/block/virtio-blk.c | 6 ++ hw/ide/qdev.c | 5 + hw/scsi/scsi-disk.c | 14 ++ 3 files changed, 25 insertions(+) diff --git a/hw/block/virtio-blk.c b/hw/block/virtio-blk.c index 06e57a4d39..787bbd768a 100644 --- a/hw/block

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

2019-06-17 Thread Sam Eiderman
xotic" disks. We serialize this information in a similar way to the "bootorder" interface. The new fw_cfg entry is "bios-geometry". Reviewed-by: Karl Heubaum Reviewed-by: Arbel Moshe Signed-off-by: Sam Eiderman --- bootdevice.c| 38 +++

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

2019-06-17 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 v3 2/8] block: Support providing LCHS from user

2019-06-17 Thread Sam Eiderman
lk-pci In future commits we will use the provided LCHS and pass it to the BIOS through fw_cfg to be supplied using INT13 routines. Reviewed-by: Karl Heubaum Reviewed-by: Arbel Moshe Signed-off-by: Sam Eiderman --- include/hw/block/block.h | 6 +- 1 file changed, 5 insertions(+), 1 deletion(-)

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

2019-06-17 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 b/hw/ide

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

2019-06-22 Thread Sam Eiderman
> On 22 Jun 2019, at 18:27, Kevin O'Connor wrote: > > On Sat, Jun 22, 2019 at 11:51:48AM +0300, Sam Eiderman wrote: >> But maybe someone wants bootorder but doesn’t want to override legacy disk >> translations… >> >> I’m thinking of maybe ad

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

2019-06-12 Thread Sam Eiderman
> On 12 Jun 2019, at 15:27, Laszlo Ersek wrote: > > On 06/12/19 11:42, 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 con

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

2019-06-12 Thread Sam Eiderman
> On 12 Jun 2019, at 16:06, Gerd Hoffmann wrote: > > On Wed, Jun 12, 2019 at 02:59:31PM +0300, Sam Eiderman wrote: >> v1: >> >> Non-standard logical geometries break under QEMU. >> >> A virtual disk which contains an operating system which depends on &

[SeaBIOS] Re: [PATCH 2/2] virtio-pci: Use %pP format in dprintf() calls

2019-06-10 Thread Sam Eiderman
Hey, What is the status on these patches? Sam > On 23 May 2019, at 18:39, Kevin O'Connor wrote: > > Signed-off-by: Kevin O'Connor > --- > src/hw/virtio-pci.c | 10 -- > 1 file changed, 4 insertions(+), 6 deletions(-) > > diff --git a/src/hw/virtio-pci.c b/src/hw/virtio-pci.c > index

[SeaBIOS] [PATCH v2 1/5] geometry: Read LCHS from fw_cfg

2019-06-17 Thread Sam Eiderman
ice path (sz string) * device lchs ... * device path (sz string) * device lchs Device path is a null terminated string in the "Open Firmware" device path format, the same path as used in bootorder. Reviewed-by: Karl Heubaum Reviewed-by: Arbel Moshe Signed-off-by: Sam Eider

[SeaBIOS] [PATCH v2 5/5] geometry: Apply LCHS values for boot devices

2019-06-17 Thread Sam Eiderman
: "TRANSLATION_MACHINE". We treat this translation as TRANSLATION_NONE in fill_ata_edd(), although this does not really matter since now the translation between physical and logical geometry does not exist. Reviewed-by: Karl Heubaum Reviewed-by: Arbel Moshe Signed-off-by: Sam Eiderman

[SeaBIOS] [PATCH v2 3/5] geometry: Add boot_lchs_find_*() utility functions

2019-06-17 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 --- src

[SeaBIOS] [PATCH v2 2/5] boot: Reorder functions in boot.c

2019-06-17 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

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

2019-06-17 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 + include

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

2019-06-17 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 a/hw

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

2019-06-17 Thread Sam Eiderman
ix missing parenthesis check in "hd-geo-test: Add tests for lchs override" v3: * Rename fw_cfg key to "bios-geometry". * Remove "extendible" interface. * Add cpu_to_le32 fix as Laszlo suggested or big endian hosts * Fix last qtest commit - automatic docker tester for some

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

2019-06-20 Thread Sam Eiderman
> On 20 Jun 2019, at 8:50, Gerd Hoffmann wrote: > >> === 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

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

2019-06-20 Thread Sam Eiderman
> On 20 Jun 2019, at 8:42, Gerd Hoffmann wrote: > >> +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

[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 b/hw/ide

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

2019-06-19 Thread Sam Eiderman
I had to read the new fw_cfg layout on my own. Creating qcow2 disks with specific size and MBR layout is currently unused - we only use a default empty MBR. Reviewed-by: Karl Heubaum Reviewed-by: Arbel Moshe Signed-off-by: Sam Eiderman --- tests/Makefile.include | 2 +- tests/hd-geo-test.c

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

2019-06-19 Thread Sam Eiderman
Moshe Signed-off-by: Sam Eiderman --- hw/block/virtio-blk.c | 6 ++ hw/ide/qdev.c | 5 + hw/scsi/scsi-disk.c | 14 ++ 3 files changed, 25 insertions(+) diff --git a/hw/block/virtio-blk.c b/hw/block/virtio-blk.c index 06e57a4d39..787bbd768a 100644 --- a/hw/block

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

2019-06-19 Thread Sam Eiderman
xotic" disks. We serialize this information in a similar way to the "bootorder" interface. The new fw_cfg entry is "bios-geometry". Reviewed-by: Karl Heubaum Reviewed-by: Arbel Moshe Signed-off-by: Sam Eiderman --- bootdevice.c| 32 +

[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 a/hw

[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 + include

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

2019-06-19 Thread Sam Eiderman
lk-pci In future commits we will use the provided LCHS and pass it to the BIOS through fw_cfg to be supplied using INT13 routines. Reviewed-by: Karl Heubaum Reviewed-by: Arbel Moshe Signed-off-by: Sam Eiderman --- include/hw/block/block.h | 6 +- 1 file changed, 5 insertions(+), 1 deletion(-)

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

2019-06-19 Thread Sam Eiderman
e reason does not have qemu-img set v4: * Change fw_cfg interface from mixed textual/binary to textual only Sam Eiderman (8): block: Refactor macros - fix tabbing block: Support providing LCHS from user bootdevice: Add interface to gather LCHS scsi: Propagate unrealize() callback to sc

[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] [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

[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 --- src

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

2019-06-19 Thread Sam Eiderman
way: * device_path lcyls lheads lsecs\n ... * device_path lcyls lheads lsecs\0 Device path is a null terminated string in the "Open Firmware" device path format, the same path as used in bootorder. Reviewed-by: Karl Heubaum Reviewed-by: Arbel Moshe Signed-off-by: Sam Eiderman --- sr

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

2019-06-19 Thread Sam Eiderman
: "TRANSLATION_MACHINE". We treat this translation as TRANSLATION_NONE in fill_ata_edd(), although this does not really matter since now the translation between physical and logical geometry does not exist. Reviewed-by: Karl Heubaum Reviewed-by: Arbel Moshe Signed-off-by: Sam Eiderman

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

2019-06-19 Thread Sam Eiderman
ootdevices fw_cfg key to bios-geoemtry v3: Change fw_cfg interface from mixed binary/textual to textual only Squash commit "config: Add toggle for bootdevice information" Sam Eiderman (4): geometry: Read LCHS from fw_cfg boot: Reorder functions in boot.c geometry: Add boot_lchs_find_*

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

2019-06-21 Thread Sam Eiderman
O'Connor wrote: > > On Wed, Jun 19, 2019 at 12:23:51PM +0300, Sam Eiderman wrote: >> Adding the following utility functions: >> >>* boot_lchs_find_pci_device >>* boot_lchs_find_scsi_device >>* boot_lchs_find_ata_device > > FWIW, this lea

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

2019-06-22 Thread Sam Eiderman
in the Kconfig file. Sam > On 21 Jun 2019, at 21:59, Kevin O'Connor wrote: > > On Fri, Jun 21, 2019 at 08:42:28PM +0300, Sam Eiderman wrote: >> Sounds reasonable, how do purpose to deal with: >> >> config BIOS_GEOMETRY >> config BOOTORDER >> >> precomp

[SeaBIOS] Re: [Qemu-devel] [QEMU] [PATCH v2 7/8] bootdevice: FW_CFG interface for LCHS values

2019-06-17 Thread Sam Eiderman
Ok, I’ll resubmit this patch series in v3, as well as v2 for SeaBIOS soon enough. * Change “bootdevices” to “bios-geometry”, and remove the struct size * Add cpu_to_le32 fix as Laszlo suggested or big endian hosts * Fix last qtest commit - automatic docker tester for some reason does not have

[SeaBIOS] Re: [Qemu-devel] [QEMU] [PATCH v2 0/8] Add Qemu to SeaBIOS LCHS interface

2019-06-17 Thread Sam Eiderman
> On 17 Jun 2019, at 9:50, Gerd Hoffmann wrote: > > Hi, > >>> Ok, given that seabios has no setup any manual configuration needs to be >>> done via qemu. >>> >>> But why do we need a new interface for that? IDE can pass the geometry >>> to the guest. virtio-blk has support too

[SeaBIOS] [PATCH v2 1/6] bios_date: Make all dates in BIOS consistent

2019-05-18 Thread Sam Eiderman
and make sure all relevant places in code use it. Reviewed-by: Konrad Rzeszutek Wilk Reviewed-by: Arbel Moshe Signed-off-by: Sam Eiderman Signed-off-by: Liran Alon --- src/config.h| 11 +++ src/fw/biostables.c | 1 - src/fw/smbios.c | 3 +-- src/misc.c | 2 +- 4

[SeaBIOS] [PATCH v2 4/6] bios_date: Add bios date checks in checkrom.py

2019-05-18 Thread Sam Eiderman
Rzeszutek Wilk Reviewed-by: Arbel Moshe Signed-off-by: Sam Eiderman Signed-off-by: Liran Alon --- scripts/checkrom.py | 19 +++ 1 file changed, 19 insertions(+) diff --git a/scripts/checkrom.py b/scripts/checkrom.py index aced5e2c..98cdfa7f 100755 --- a/scripts/checkrom.py

[SeaBIOS] [PATCH v2 0/6] Fix reported version and date for Windows guests

2019-05-18 Thread Sam Eiderman
he Windows OS and report correct date & version values. Liran Alon (4): bios_date: Make all dates in BIOS consistent bios_date: Make bios date appear once in the ROM bios_date: Change BiosDate to SMBIOS bios date bios_version: Remove misinterpreted version string Sam Eide

[SeaBIOS] [PATCH v2 3/6] bios_date: Change BiosDate to SMBIOS bios date

2019-05-18 Thread Sam Eiderman
she Signed-off-by: Sam Eiderman Signed-off-by: Liran Alon --- src/fw/biostables.c | 36 src/fw/smbios.c | 20 +++- src/util.h | 1 + 3 files changed, 56 insertions(+), 1 deletion(-) diff --git a/src/fw/biostables.c b/src

[SeaBIOS] [PATCH v2 5/6] bios_version: Remove misinterpreted version string

2019-05-18 Thread Sam Eiderman
dynamically, like in the rest of the file. For reference implementation of nt!CmpGetBiosVersion(), see ReactOS: https://doxygen.reactos.org/d5/dd2/i386_2cmhardwr_8c.html Reviewed-by: Konrad Rzeszutek Wilk Reviewed-by: Arbel Moshe Signed-off-by: Sam Eiderman Signed-off-by: Liran Alon --- src/fw/p

[SeaBIOS] [PATCH v2 2/6] bios_date: Make bios date appear once in the ROM

2019-05-18 Thread Sam Eiderman
-by: Sam Eiderman Signed-off-by: Liran Alon --- src/fw/biostables.c | 14 +++--- src/util.h | 4 2 files changed, 15 insertions(+), 3 deletions(-) diff --git a/src/fw/biostables.c b/src/fw/biostables.c index b055c9b2..546e83c6 100644 --- a/src/fw/biostables.c +++ b/src/fw

[SeaBIOS] [PATCH v2 6/6] bios_version: Add bios version checks in checkrom.py

2019-05-18 Thread Sam Eiderman
-by: Konrad Rzeszutek Wilk Reviewed-by: Arbel Moshe Signed-off-by: Sam Eiderman Signed-off-by: Liran Alon --- scripts/checkrom.py | 26 ++ 1 file changed, 26 insertions(+) diff --git a/scripts/checkrom.py b/scripts/checkrom.py index 98cdfa7f..a09203fe 100755 --- a/scripts

[SeaBIOS] Re: [PATCH 5/6] bios_version: Remove misinterpreted version string

2019-05-18 Thread Sam Eiderman
I wanted it to look more consistent with a dprintf just a few lines above: dprintf(1, "Intel IGD OpRegion enabled at 0x%08x, size %dKB, dev " "%02x:%02x.%x\n", (u32)addr, opregion->size >> 10, pci_bdf_to_bus(bdf), pci_bdf_to_dev(bdf), pci_bdf_to_fn(bdf)); What do you think? Sam

[SeaBIOS] Re: [PATCH 3/6] bios_date: Change BiosDate to SMBIOS bios date

2019-05-22 Thread Sam Eiderman
> On 20 May 2019, at 5:28, Kevin O'Connor wrote: > > On Fri, May 17, 2019 at 11:57:23PM +0300, Sam Eiderman wrote: >> From: Liran Alon >> >> Windows kernel extracts various BIOS information at boot-time. >> The method it uses to extract SystemBiosDate is ve

[SeaBIOS] Re: [PATCH 5/6] bios_version: Remove misinterpreted version string

2019-05-22 Thread Sam Eiderman
size %dKB, dev “ "%02x:%02x.%x\n", (u32)addr, opregion->size >> 10, pci_bdf_to_bus(bdf), pci_bdf_to_dev(bdf), pci_bdf_to_fn(bdf)); This solves the version problem Sam > On 20 May 2019, at 5:10, Kevin O'Connor wrote: > > On Sat, May 18, 2019 at 0

[SeaBIOS] Re: [PATCH 3/6] bios_date: Change BiosDate to SMBIOS bios date

2019-05-23 Thread Sam Eiderman
Hi, Many programs use SystemBiosDate registry key in order to verify the machine they are running on (mostly for activation/licensing purposes). This registry key is read only and is computed as explained before. When this date changes - this may break the behavior of the machine. This date

[SeaBIOS] Re: [PATCH 3/6] bios_date: Change BiosDate to SMBIOS bios date

2019-05-23 Thread Sam Eiderman
bios0.date is 01/01/2011, overriding the legacy smbios0.date will override win_bios_date too. I’m inclined to implement option C since it doesn’t break current functionality, what do you think? Sam > On 23 May 2019, at 19:29, Kevin O'Connor wrote: > > On Thu, May 23, 2019 at 06:58:5

[SeaBIOS] Re: [PATCH 3/6] bios_date: Change BiosDate to SMBIOS bios date

2019-05-23 Thread Sam Eiderman
> On 23 May 2019, at 18:54, Kevin O'Connor wrote: > > On Thu, May 23, 2019 at 04:11:21PM +0300, Sam Eiderman wrote: >> Many programs use SystemBiosDate registry key in order to verify the machine >> they are running on (mostly for activation/licensing purposes). >>

[SeaBIOS] Re: [PATCH 3/6] bios_date: Change BiosDate to SMBIOS bios date

2019-05-24 Thread Sam Eiderman
Kevin, Notice that your patch changes SystemBiosDate for legacy smbios users from 04/01/14 to 01/01/11 - I’m okay with this change. Also notice that the RELEASE_DATE_STR[] in smbios.c has to be volatile or else it is optimized, unlike BIOS_DATE[] which is used in a function call and is not

[SeaBIOS] [PATCH 3/6] bios_date: Change BiosDate to SMBIOS bios date

2019-05-17 Thread Sam Eiderman
she Signed-off-by: Sam Eiderman Signed-off-by: Liran Alon --- src/fw/biostables.c | 36 src/fw/smbios.c | 20 +++- src/util.h | 1 + 3 files changed, 56 insertions(+), 1 deletion(-) diff --git a/src/fw/biostables.c b/src

[SeaBIOS] [PATCH 4/6] bios_date: Add bios date checks in checkrom.py

2019-05-17 Thread Sam Eiderman
Rzeszutek Wilk Reviewed-by: Arbel Moshe Signed-off-by: Sam Eiderman Signed-off-by: Liran Alon --- scripts/checkrom.py | 19 +++ 1 file changed, 19 insertions(+) diff --git a/scripts/checkrom.py b/scripts/checkrom.py index aced5e2c..98cdfa7f 100755 --- a/scripts/checkrom.py

[SeaBIOS] [PATCH 5/6] bios_version: Remove misinterpreted version string

2019-05-17 Thread Sam Eiderman
00". For reference implementation of nt!CmpGetBiosVersion(), see ReactOS: https://doxygen.reactos.org/d5/dd2/i386_2cmhardwr_8c.html Reviewed-by: Konrad Rzeszutek Wilk Reviewed-by: Arbel Moshe Signed-off-by: Sam Eiderman Signed-off-by: Liran Alon --- src/fw/pciinit.c | 2 +- 1 file change

[SeaBIOS] [PATCH 6/6] bios_version: Add bios version checks in checkrom.py

2019-05-17 Thread Sam Eiderman
-by: Konrad Rzeszutek Wilk Reviewed-by: Arbel Moshe Signed-off-by: Sam Eiderman Signed-off-by: Liran Alon --- scripts/checkrom.py | 26 ++ 1 file changed, 26 insertions(+) diff --git a/scripts/checkrom.py b/scripts/checkrom.py index 98cdfa7f..a09203fe 100755 --- a/scripts

[SeaBIOS] [PATCH 1/6] bios_date: Make all dates in BIOS consistent

2019-05-17 Thread Sam Eiderman
and make sure all relevant places in code use it. Reviewed-by: Konrad Rzeszutek Wilk Reviewed-by: Arbel Moshe Signed-off-by: Sam Eiderman Signed-off-by: Liran Alon --- src/config.h| 11 +++ src/fw/biostables.c | 1 - src/fw/smbios.c | 3 +-- src/misc.c | 2 +- 4

[SeaBIOS] [PATCH 0/6] Fix reported version and date for Windows guests

2019-05-17 Thread Sam Eiderman
te bios_version: Remove misinterpreted version string Sam Eiderman (2): bios_date: Add bios date checks in checkrom.py bios_version: Add bios version checks in checkrom.py scripts/checkrom.py | 45 + src/config.h

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

2019-06-26 Thread Sam Eiderman
() and boot_lchs_find_scsi_device() call the same build_scsi_path() function, resulting in less code duplication. Sam > On 22 Jun 2019, at 20:33, Sam Eiderman wrote: > > > >> On 22 Jun 2019, at 18:27, Kevin O'Connor wrote: >> >> On Sat, Jun 22, 2019 at 11:51:

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

2019-06-26 Thread Sam Eiderman
Moshe Signed-off-by: Sam Eiderman --- hw/block/virtio-blk.c | 6 ++ hw/ide/qdev.c | 5 + hw/scsi/scsi-disk.c | 14 ++ 3 files changed, 25 insertions(+) diff --git a/hw/block/virtio-blk.c b/hw/block/virtio-blk.c index 06e57a4d39..787bbd768a 100644 --- a/hw/block

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

2019-06-26 Thread Sam Eiderman
I had to read the new fw_cfg layout on my own. Creating qcow2 disks with specific size and MBR layout is currently unused - we only use a default empty MBR. Reviewed-by: Karl Heubaum Reviewed-by: Arbel Moshe Signed-off-by: Sam Eiderman --- tests/Makefile.include | 2 +- tests/hd-geo-test.c

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

2019-06-26 Thread Sam Eiderman
xotic" disks. We serialize this information in a similar way to the "bootorder" interface. The new fw_cfg entry is "bios-geometry". Reviewed-by: Karl Heubaum Reviewed-by: Arbel Moshe Signed-off-by: Sam Eiderman --- bootdevice.c| 32 +

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

2019-06-26 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 a/hw

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

2019-06-26 Thread Sam Eiderman
e reason does not have qemu-img set v4: * Change fw_cfg interface from mixed textual/binary to textual only v5: * Fix line > 80 chars in tests/hd-geo-test.c Sam Eiderman (8): block: Refactor macros - fix tabbing block: Support providing LCHS from user bootdevice: Add interface to gather

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

2019-06-26 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 + include

  1   2   >