On Wed, Mar 18, 2026 at 05:24:58PM +0000, Pedro Falcato wrote:
> On Wed, Mar 18, 2026 at 04:58:25PM +0000, Daniel P. Berrangé wrote:
> > On Wed, Mar 18, 2026 at 04:54:45PM +0000, Daniel P. Berrangé wrote:
> > > On Wed, Mar 18, 2026 at 04:29:51PM +0000, Pedro Falcato wrote:
> > > > According to the ATA Command Set specification (and the SATA 
> > > > specification
> > > > too), SATA drives are supposed to set word 93 (which for PATA holds 
> > > > hardware
> > > > reset results) to 0. As such, clear it when ncq_queues > 0 (which is 
> > > > only true
> > > > for SATA drives).
> > > > 
> > > > Doing so fixes a quirk in Linux where it thinks the AHCI QEMU drive is 
> > > > PATA
> > > > over a SATA bridge, and thus limits maximum transfer sizes for 
> > > > individual IOs
> > > > with a:
> > > > [    1.632121] ata1.00: applying bridge limits
> > > > 
> > > > While at it, bump the device's firmware revision for IDENTIFY. This 
> > > > makes it
> > > > so Linux can avoid enabling a quirk for fixed QEMU releases.
> > > > 
> > > > Link: 
> > > > https://lore.kernel.org/linux-ide/[email protected]/
> > > > Cc: [email protected]
> > > > Suggsted-by: Niklas Cassel <[email protected]>
> > > > Signed-off-by: Pedro Falcato <[email protected]>
> > > > ---
> > > > Note: I understand the version bump is vaguely controversial 
> > > > (particularly
> > > >  exposing the QEMU version in the string) but I don't have a much better
> > > >  idea. Logically, bumping it to 11.0 for stable releases doesn't make 
> > > > much
> > > >  sense.
> > > 
> > > Bumping the version string changes guest ABI, so such a change should
> > > normally be tied to a new machine type version, not unconditionally
> > > changed.  That would also in turn make it unsuitable for QEMU stable
> > > release branches which don't take changes which affect machine type
> > > ABI.
> > >
> 
> I don't understand (I don't usually hack on QEMU). What do you mean with
> guest ABI and machine type ABI?

QEMU  can save/restore the state of a running VM to disk, or through
Live migration between hosts, transfer state across two QEMU's. If
those two processes are running different QEMU releases, we need to
ensure the guest visible virtual hardware doesn't change its behaviour.
Guest OS are liable to misbehave if hardware changes behaviour while the
OS is running.

In QEMU we have machine types "pc" ( "i440fx") and "q35" which encode
which have versions associated with them. These are intended to encode
settings which ensure QEMU exposes consistent guest hardware features.

IOW, the machine 'pc-i440fx-10.0.0'  should operate the same regardless
of whether it is run from QEMU 10.0.0, or a later  QEMU 10.1.0.

Behaviour changes would only be introduced ina  newer 'pc-i440fx-10.1.0'

We generally refer to this overall situation as "fixed guest ABI" or
"fixed machine type ABI".

> > Having said that, possibly the functional fix itself might need to
> > be tied to the machine type too, given that it is triggering a
> > behavioural change in the emulation and guest driver ? If that's
> 
> There is no behavioural change on QEMU's side. QEMU has always been
> able to perform IO up to the controller interface's limit. Yes, it does
> change Linux's behavior.

Yes, I meant, we would be changing what features QEMU exposes to the
guest, and that changes the guest behaviour

> > the case, then the version could be changed at the same time.
> 
> I was skimming through 
> https://www.qemu.org/docs/master/devel/migration/compatibility.html.
> So tying this to the machine type would mean (if I am not mistaken, but do
> correct me if I'm wrong) setting the device version (or an equivalent device
> property) in hw_compat_10_2 (in our case, since it's the last QEMU release).
> Is this correct?

Yes, something along those lines. We're about to make the QEMU 11.0.0
release, in a feew weeks and are in freeze now. We can take bug fix
patches in freeze, so 11.0 is still a possibility.

We might want a specific bool property 'x-sata-identify-fix'  to control
enablement of the fix that is added to hw_compat, parallel to the
version change.

> My only other concern would be how to expose firmware versions in a proper 
> way.
> From my reading, it is clear that QEMU does not want to expose versions to
> guests. Perhaps some versioning scheme like "2.6.<revision>" or maybe even
> "2.5+<revision>" could be maximally backwards compatible whilst not exposing
> too much to the guest.

IIUC, we didn't want the version in the hardware to unconditionally
change every time the QEMU version changed. So back in the 2.5 release
we fixed the version at 2.5, such that future changes would need an
explicit decision. I think it is likely Ok to change the version
number to 11


With regards,
Daniel
-- 
|: https://berrange.com       ~~        https://hachyderm.io/@berrange :|
|: https://libvirt.org          ~~          https://entangle-photo.org :|
|: https://pixelfed.art/berrange   ~~    https://fstop138.berrange.com :|


Reply via email to