All of lore.kernel.org
 help / color / mirror / Atom feed
From: Sam Eiderman <shmuel.eiderman@oracle.com>
To: Gerd Hoffmann <kraxel@redhat.com>
Cc: kwolf@redhat.com, qemu-block@nongnu.org, arbel.moshe@oracle.com,
	seabios@seabios.org, QEMU <qemu-devel@nongnu.org>,
	mreitz@redhat.com, kevin@koconnor.net, liran.alon@oracle.com,
	karl.heubaum@oracle.com
Subject: Re: [Qemu-devel] [QEMU] [PATCH v2 0/8] Add Qemu to SeaBIOS LCHS interface
Date: Wed, 12 Jun 2019 16:30:03 +0300	[thread overview]
Message-ID: <A3F8BD49-3C35-4A07-8DE2-85F7CC293DC9@oracle.com> (raw)
In-Reply-To: <20190612130650.xftda65kgnsefyvs@sirius.home.kraxel.org>



> On 12 Jun 2019, at 16:06, Gerd Hoffmann <kraxel@redhat.com> 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
>> 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 56 SPT (sectors per track).
>> No matter what QEMU will guess - SeaBIOS, for large enough disks - will
>> use LBA translation, which will report 63 SPT instead.
> 
> --verbose please.
> 
> As far I know seabios switches to LBA mode when the disk is simply too
> big for LCHS addressing.  So I fail to see which problem is solved by
> this.  If your guest needs LCHS, why do you assign a disk which can't
> be fully accessed using LCHS addressing?

The scenario is as follows:

A user has a disk with 56 spts.
This disk has been already created under a bios that reported 56 spts.
When migrating this disk to QEMU/SeaBIOS, SeaBIOS will report 63 spts
(under LBA translation) - this will break the boot for this guest.

> 
>> In addition we can not enforce SeaBIOS to rely on phyiscal geometries at
>> all. A virtio-blk-pci virtual disk with 255 phyiscal heads can not
>> report 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.
> 
> Well, not really.  Moving disks from one controller to another when the
> OS depends on LHCS addressing never is a good idea.  That already caused
> problems in the 90-ies, when moving scsi disks from one scsi host
> adapter to another type, *way* before virtualization became a thing.

I agree, but this is easily solvable in virtualized environments where the
hypervisor can guess the correct LCHS values by inspecting the MBR,
or letting the user set these values manually.

> 
> BTW:  One possible way to figure which LCHS layout a disk uses is to
> check the MBR partition table.  With that we (a) don't need a new
> interface between qemu and seabios and (b) it is not needed to manually
> specify the geometry.

In my opinion SeaBIOS is not the correct place for this change since
“enhancing” the detection of LCHS values in SeaBIOS may cause it to
suddenly report different values for already existing guests which rely on
LCHS - thus, breaking compatibility.
Much like smbios, acpi and mptables - I believe that the correct place to
use MBR guessing is QEMU (which already has one, with some issues)
and pass the guess using fw_cfg - this will allow using the compat system
in qemu itself.

Sam

> 
> cheers,
>  Gerd
> 



  reply	other threads:[~2019-06-12 13:34 UTC|newest]

Thread overview: 28+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-06-12 11:59 [Qemu-devel] [QEMU] [PATCH v2 0/8] Add Qemu to SeaBIOS LCHS interface Sam Eiderman
2019-06-12 11:59 ` [Qemu-devel] [QEMU] [PATCH v2 1/8] block: Refactor macros - fix tabbing Sam Eiderman
2019-06-12 11:59 ` [Qemu-devel] [QEMU] [PATCH v2 2/8] block: Support providing LCHS from user Sam Eiderman
2019-06-12 11:59 ` [Qemu-devel] [QEMU] [PATCH v2 3/8] bootdevice: Add interface to gather LCHS Sam Eiderman
2019-06-12 11:59 ` [Qemu-devel] [QEMU] [PATCH v2 4/8] scsi: Propagate unrealize() callback to scsi-hd Sam Eiderman
2019-06-12 11:59 ` [Qemu-devel] [QEMU] [PATCH v2 5/8] bootdevice: Gather LCHS from all relevant devices Sam Eiderman
2019-06-12 11:59 ` [Qemu-devel] [QEMU] [PATCH v2 6/8] bootdevice: Refactor get_boot_devices_list Sam Eiderman
2019-06-12 11:59 ` [Qemu-devel] [QEMU] [PATCH v2 7/8] bootdevice: FW_CFG interface for LCHS values Sam Eiderman
2019-06-17  7:20   ` Gerd Hoffmann
2019-06-17  7:36     ` Sam Eiderman
2019-06-17  8:38       ` Gerd Hoffmann
2019-06-17 10:08         ` Sam Eiderman
2019-06-17 14:48       ` Kevin O'Connor
2019-06-17 15:13         ` Sam Eiderman
2019-06-12 11:59 ` [Qemu-devel] [QEMU] [PATCH v2 8/8] hd-geo-test: Add tests for lchs override Sam Eiderman
2019-06-12 12:33 ` [Qemu-devel] [SeaBIOS] [QEMU] [PATCH v2 0/8] Add Qemu to SeaBIOS LCHS interface no-reply
2019-06-12 13:06 ` [Qemu-devel] " Gerd Hoffmann
2019-06-12 13:30   ` Sam Eiderman [this message]
2019-06-12 19:18     ` Gerd Hoffmann
2019-06-13  7:41       ` Sam Eiderman
2019-06-13  7:44         ` Sam Eiderman
2019-06-13  9:38         ` Gerd Hoffmann
2019-06-13 11:45           ` Sam Eiderman
2019-06-14  4:43             ` Gerd Hoffmann
2019-06-14  9:37               ` Sam Eiderman
2019-06-17  6:50                 ` Gerd Hoffmann
2019-06-17  7:59                   ` Sam Eiderman
2019-06-12 13:51 ` [Qemu-devel] [SeaBIOS] " no-reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=A3F8BD49-3C35-4A07-8DE2-85F7CC293DC9@oracle.com \
    --to=shmuel.eiderman@oracle.com \
    --cc=arbel.moshe@oracle.com \
    --cc=karl.heubaum@oracle.com \
    --cc=kevin@koconnor.net \
    --cc=kraxel@redhat.com \
    --cc=kwolf@redhat.com \
    --cc=liran.alon@oracle.com \
    --cc=mreitz@redhat.com \
    --cc=qemu-block@nongnu.org \
    --cc=qemu-devel@nongnu.org \
    --cc=seabios@seabios.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.