All of lore.kernel.org
 help / color / mirror / Atom feed
From: BALATON Zoltan <balaton@eik.bme.hu>
To: Mark Cave-Ayland <mark.cave-ayland@ilande.co.uk>
Cc: jsnow@redhat.com, qemu-devel@nongnu.org, jasper.lowell@bt.com
Subject: Re: [PATCH] hw/ide: Remove status register read side effect
Date: Sat, 22 Feb 2020 20:45:09 +0100 (CET)	[thread overview]
Message-ID: <alpine.LMD.2.03.2002222042370.1577@eik.bme.hu> (raw)
In-Reply-To: <f432a118-f6be-d6ff-fe37-35b6244f3b97@ilande.co.uk>

On Sat, 22 Feb 2020, Mark Cave-Ayland wrote:
> On 21/02/2020 06:50, jasper.lowell@bt.com wrote:
>> The Linux libATA API documentation mentions that on some hardware,
>> reading the status register has the side effect of clearing the
>> interrupt condition. When emulating the generic Sun4u machine running
>> Solaris 10, the Solaris 10 CMD646 driver exits fatally because of this
>> emulated side effect. This side effect is likely to not exist on real
>> CMD646 hardware.
>>
>> Signed-off-by: Jasper Lowell <jasper.lowell@bt.com>
>> ---
>>  hw/ide/core.c | 1 -
>>  1 file changed, 1 deletion(-)
>>
>> diff --git a/hw/ide/core.c b/hw/ide/core.c
>> index 80000eb766..82fd0632ac 100644
>> --- a/hw/ide/core.c
>> +++ b/hw/ide/core.c
>> @@ -2210,7 +2210,6 @@ uint32_t ide_ioport_read(void *opaque, uint32_t addr)
>>          } else {
>>              ret = s->status;
>>          }
>> -        qemu_irq_lower(bus->irq);
>>          break;
>>      }
>
> I don't think that this is correct: from memory when I last looked at this, there
> were 2 IDE status registers: the one from the original specification which clears the
> IRQ upon read, and another one in subsequent revisions which allows you to read the
> value without clearing any pending IRQ. My guess would be that changing this would
> not only cause QEMU to deviate from the specification, but causes problems in other OSs.

You're right, legacy ide has two status registers as described here:

ftp://ftp.seagate.com/pub/acrobat/reference/111-1c.pdf

Now question is which of these the above is emulating? Looks like CMD646 
should not clear interrupt when reading status reg so maybe instead of 
removing this from here another change is needed to CMD646 specific read 
func to read alternate status instead of status reg?

Regards,
BALATON Zoltan


  reply	other threads:[~2020-02-22 19:55 UTC|newest]

Thread overview: 27+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-02-21  6:50 [PATCH] hw/ide: Remove status register read side effect jasper.lowell
2020-02-21  8:08 ` no-reply
2020-02-21 15:43 ` BALATON Zoltan
2020-02-22  2:07   ` jasper.lowell
2020-02-22 11:47     ` BALATON Zoltan
2020-02-22 17:50     ` BALATON Zoltan
2020-02-22 19:26     ` BALATON Zoltan
2020-02-22 19:32 ` Mark Cave-Ayland
2020-02-22 19:45   ` BALATON Zoltan [this message]
2020-02-22 20:05     ` BALATON Zoltan
2020-02-23  7:23       ` jasper.lowell
2020-02-23 15:16         ` BALATON Zoltan
2020-02-25  3:55           ` jasper.lowell
2020-02-25 15:08             ` BALATON Zoltan
2020-02-26  5:22               ` jasper.lowell
2020-02-26 11:07                 ` BALATON Zoltan
2020-02-27  5:10                   ` jasper.lowell
2020-02-27  5:56                     ` jasper.lowell
2020-02-27 11:35                       ` BALATON Zoltan
2020-03-04  0:55                         ` jasper.lowell
2020-02-27 11:38                     ` BALATON Zoltan
2020-03-04  0:58                       ` jasper.lowell
2020-03-01 18:02                 ` BALATON Zoltan
2020-03-04  3:11                   ` jasper.lowell
2020-03-04  8:48                     ` BALATON Zoltan
2020-03-04 21:07                     ` Mark Cave-Ayland
2020-03-05  0:47                       ` jasper.lowell

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=alpine.LMD.2.03.2002222042370.1577@eik.bme.hu \
    --to=balaton@eik.bme.hu \
    --cc=jasper.lowell@bt.com \
    --cc=jsnow@redhat.com \
    --cc=mark.cave-ayland@ilande.co.uk \
    --cc=qemu-devel@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 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.