public inbox for qemu-devel@nongnu.org
 help / color / mirror / Atom feed
From: Pedro Falcato <pfalcato@suse.de>
To: "Daniel P. Berrangé" <berrange@redhat.com>
Cc: John Snow <jsnow@redhat.com>,
	qemu-block@nongnu.org,  qemu-devel@nongnu.org,
	qemu-stable@nongnu.org, Niklas Cassel <cassel@kernel.org>
Subject: Re: [PATCH] ide: Set IDENTIFY word 93 to 0 on SATA drives
Date: Wed, 18 Mar 2026 17:24:58 +0000	[thread overview]
Message-ID: <fifhay3zi37f3gyngcgwhtlbhninwljokrqulwzeyxru6tizfn@eyl2uzcqqc3g> (raw)
In-Reply-To: <abrZsaFWDwnbWbKL@redhat.com>

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/20260303183337.1013474-1-pfalcato@suse.de/
> > > Cc: qemu-stable@nongnu.org
> > > Suggsted-by: Niklas Cassel <cassel@kernel.org>
> > > Signed-off-by: Pedro Falcato <pfalcato@suse.de>
> > > ---
> > > 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?
 
> > IMHO Linux should just assume any actively maintained distro that
> > cares about this problem will fix their QEMU releases and not try
> > to add a version specific workaround.

The compromise we reached in Linux was to apply this quirk workaround
*only* for 2.5+ versioned firmware revision. Many stable distributions
out there (e.g debian, enterprise) would not see this QEMU fix for years.
Particularly if it is not QEMU stable material.

> 
> 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.

> 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?

I am OK with this idea, especially since the quirk patch is already
propagating through Linux upstream stable branches. So it should be ok to just
apply this permanent fix for the latest QEMU release.

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.

-- 
Pedro


  reply	other threads:[~2026-03-18 17:25 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-03-18 16:29 [PATCH] ide: Set IDENTIFY word 93 to 0 on SATA drives Pedro Falcato
2026-03-18 16:54 ` Daniel P. Berrangé
2026-03-18 16:58   ` Daniel P. Berrangé
2026-03-18 17:24     ` Pedro Falcato [this message]
2026-03-19 16:05       ` Daniel P. Berrangé
2026-03-18 20:13 ` BALATON Zoltan
2026-03-24 17:01   ` Paolo Bonzini

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=fifhay3zi37f3gyngcgwhtlbhninwljokrqulwzeyxru6tizfn@eyl2uzcqqc3g \
    --to=pfalcato@suse.de \
    --cc=berrange@redhat.com \
    --cc=cassel@kernel.org \
    --cc=jsnow@redhat.com \
    --cc=qemu-block@nongnu.org \
    --cc=qemu-devel@nongnu.org \
    --cc=qemu-stable@nongnu.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox