All of lore.kernel.org
 help / color / mirror / Atom feed
* [Bug 1896342] [NEW] IDE ATA IDENTIFY WORD 106
@ 2020-09-19 19:01 Benjamin David Lunt
  2020-09-19 19:38 ` [Bug 1896342] " Benjamin David Lunt
                   ` (3 more replies)
  0 siblings, 4 replies; 5+ messages in thread
From: Benjamin David Lunt @ 2020-09-19 19:01 UTC (permalink / raw)
  To: qemu-devel

Public bug reported:

The code at line 202 in hw/ide/core.c
 (https://git.qemu.org/?p=qemu.git;a=blob;f=hw/ide/core.c;#l201)
hard codes bit 13 set.  However, get_physical_block_exp() can and may return 0, which is a valid response. If get_physical_block_exp() does return zero, bit 13 should not be set.

ATAPI8 states (Section 7.17.7.73):
 "Bit 13 of word 106 shall be set to one to indicate that the device has more than one logical sector per physical sector"

and gives the examples:
  Bits (3:0): 0 = 2^0 = 1 logical sector per physical sector
  Bits (3:0): 1 = 2^1 = 2 logical sector per physical sector
  Bits (3:0): 2 = 2^2 = 4 logical sector per physical sector
  Bits (3:0): 3 = 2^3 = 8 logical sector per physical sector

Therefore, if bit 13 is set, bits 3:0 must be greater than zero.

If get_physical_block_exp() returns zero then there is a 1:1 ratio and
bit 13 must be 0.

Just my opinion.

Thanks,
Ben

** Affects: qemu
     Importance: Undecided
         Status: New

-- 
You received this bug notification because you are a member of qemu-
devel-ml, which is subscribed to QEMU.
https://bugs.launchpad.net/bugs/1896342

Title:
  IDE ATA IDENTIFY WORD 106

Status in QEMU:
  New

Bug description:
  The code at line 202 in hw/ide/core.c
   (https://git.qemu.org/?p=qemu.git;a=blob;f=hw/ide/core.c;#l201)
  hard codes bit 13 set.  However, get_physical_block_exp() can and may return 0, which is a valid response. If get_physical_block_exp() does return zero, bit 13 should not be set.

  ATAPI8 states (Section 7.17.7.73):
   "Bit 13 of word 106 shall be set to one to indicate that the device has more than one logical sector per physical sector"

  and gives the examples:
    Bits (3:0): 0 = 2^0 = 1 logical sector per physical sector
    Bits (3:0): 1 = 2^1 = 2 logical sector per physical sector
    Bits (3:0): 2 = 2^2 = 4 logical sector per physical sector
    Bits (3:0): 3 = 2^3 = 8 logical sector per physical sector

  Therefore, if bit 13 is set, bits 3:0 must be greater than zero.

  If get_physical_block_exp() returns zero then there is a 1:1 ratio and
  bit 13 must be 0.

  Just my opinion.

  Thanks,
  Ben

To manage notifications about this bug go to:
https://bugs.launchpad.net/qemu/+bug/1896342/+subscriptions


^ permalink raw reply	[flat|nested] 5+ messages in thread

* [Bug 1896342] Re: IDE ATA IDENTIFY WORD 106
  2020-09-19 19:01 [Bug 1896342] [NEW] IDE ATA IDENTIFY WORD 106 Benjamin David Lunt
@ 2020-09-19 19:38 ` Benjamin David Lunt
  2020-10-02 19:54 ` John Snow
                   ` (2 subsequent siblings)
  3 siblings, 0 replies; 5+ messages in thread
From: Benjamin David Lunt @ 2020-09-19 19:38 UTC (permalink / raw)
  To: qemu-devel

For more information, Annex-E of the ACS-2 explains this as well.

http://www.t13.org/Documents/UploadedDocuments/docs2009/d2015r2
-ATAATAPI_Command_set_-_2_ACS-2.pdf

See the statement on the top of page 165 as well.  "If bit 13 is set,
then bits 3:0 are valid".

Page 119 of that same document states:
  "13  1 = Device has multiple logical sectors per physical sector."

In my opinion, if bit 13 is set and bits 3:0 are valid, then bits 3:0
should be non-zero.

Therefore, I gather that in QEMU (assuming that get_physical_block_exp()
returns the same value shown in the example listing above):

1) if get_physical_block_exp() return a non-zero value, bit 13 must be set and bits 3:0 will be non-zero.
2) if get_physical_block_exp() return a zero value, bit 13 must be clear and bits 3:0 must be ignored.

Please correct me if I am wrong in these assumptions.

Thanks,
Ben

-- 
You received this bug notification because you are a member of qemu-
devel-ml, which is subscribed to QEMU.
https://bugs.launchpad.net/bugs/1896342

Title:
  IDE ATA IDENTIFY WORD 106

Status in QEMU:
  New

Bug description:
  The code at line 202 in hw/ide/core.c
   (https://git.qemu.org/?p=qemu.git;a=blob;f=hw/ide/core.c;#l201)
  hard codes bit 13 set.  However, get_physical_block_exp() can and may return 0, which is a valid response. If get_physical_block_exp() does return zero, bit 13 should not be set.

  ATAPI8 states (Section 7.17.7.73):
   "Bit 13 of word 106 shall be set to one to indicate that the device has more than one logical sector per physical sector"

  and gives the examples:
    Bits (3:0): 0 = 2^0 = 1 logical sector per physical sector
    Bits (3:0): 1 = 2^1 = 2 logical sector per physical sector
    Bits (3:0): 2 = 2^2 = 4 logical sector per physical sector
    Bits (3:0): 3 = 2^3 = 8 logical sector per physical sector

  Therefore, if bit 13 is set, bits 3:0 must be greater than zero.

  If get_physical_block_exp() returns zero then there is a 1:1 ratio and
  bit 13 must be 0.

  Just my opinion.

  Thanks,
  Ben

To manage notifications about this bug go to:
https://bugs.launchpad.net/qemu/+bug/1896342/+subscriptions


^ permalink raw reply	[flat|nested] 5+ messages in thread

* [Bug 1896342] Re: IDE ATA IDENTIFY WORD 106
  2020-09-19 19:01 [Bug 1896342] [NEW] IDE ATA IDENTIFY WORD 106 Benjamin David Lunt
  2020-09-19 19:38 ` [Bug 1896342] " Benjamin David Lunt
@ 2020-10-02 19:54 ` John Snow
  2021-05-09 13:59 ` Thomas Huth
  2021-07-09  4:17 ` Launchpad Bug Tracker
  3 siblings, 0 replies; 5+ messages in thread
From: John Snow @ 2020-10-02 19:54 UTC (permalink / raw)
  To: qemu-devel

You might be right, though at present it seems like it doesn't hurt
anything that I am aware of to claim that our mapping is 1:1 in such
cases.

Patches welcome; especially if there is any proof that this has caused
any problems anywhere.

--js

-- 
You received this bug notification because you are a member of qemu-
devel-ml, which is subscribed to QEMU.
https://bugs.launchpad.net/bugs/1896342

Title:
  IDE ATA IDENTIFY WORD 106

Status in QEMU:
  New

Bug description:
  The code at line 202 in hw/ide/core.c
   (https://git.qemu.org/?p=qemu.git;a=blob;f=hw/ide/core.c;#l201)
  hard codes bit 13 set.  However, get_physical_block_exp() can and may return 0, which is a valid response. If get_physical_block_exp() does return zero, bit 13 should not be set.

  ATAPI8 states (Section 7.17.7.73):
   "Bit 13 of word 106 shall be set to one to indicate that the device has more than one logical sector per physical sector"

  and gives the examples:
    Bits (3:0): 0 = 2^0 = 1 logical sector per physical sector
    Bits (3:0): 1 = 2^1 = 2 logical sector per physical sector
    Bits (3:0): 2 = 2^2 = 4 logical sector per physical sector
    Bits (3:0): 3 = 2^3 = 8 logical sector per physical sector

  Therefore, if bit 13 is set, bits 3:0 must be greater than zero.

  If get_physical_block_exp() returns zero then there is a 1:1 ratio and
  bit 13 must be 0.

  Just my opinion.

  Thanks,
  Ben

To manage notifications about this bug go to:
https://bugs.launchpad.net/qemu/+bug/1896342/+subscriptions


^ permalink raw reply	[flat|nested] 5+ messages in thread

* [Bug 1896342] Re: IDE ATA IDENTIFY WORD 106
  2020-09-19 19:01 [Bug 1896342] [NEW] IDE ATA IDENTIFY WORD 106 Benjamin David Lunt
  2020-09-19 19:38 ` [Bug 1896342] " Benjamin David Lunt
  2020-10-02 19:54 ` John Snow
@ 2021-05-09 13:59 ` Thomas Huth
  2021-07-09  4:17 ` Launchpad Bug Tracker
  3 siblings, 0 replies; 5+ messages in thread
From: Thomas Huth @ 2021-05-09 13:59 UTC (permalink / raw)
  To: qemu-devel

The QEMU project is currently moving its bug tracking to another system.
For this we need to know which bugs are still valid and which could be
closed already. Thus we are setting the bug state to "Incomplete" now.

If the bug has already been fixed in the latest upstream version of QEMU,
then please close this ticket as "Fix released".

If it is not fixed yet and you think that this bug report here is still
valid, then you have two options:

1) If you already have an account on gitlab.com, please open a new ticket
for this problem in our new tracker here:

    https://gitlab.com/qemu-project/qemu/-/issues

and then close this ticket here on Launchpad (or let it expire auto-
matically after 60 days). Please mention the URL of this bug ticket on
Launchpad in the new ticket on GitLab.

2) If you don't have an account on gitlab.com and don't intend to get
one, but still would like to keep this ticket opened, then please switch
the state back to "New" or "Confirmed" within the next 60 days (other-
wise it will get closed as "Expired"). We will then eventually migrate
the ticket automatically to the new system (but you won't be the reporter
of the bug in the new system and thus you won't get notified on changes
anymore).

Thank you and sorry for the inconvenience.


** Changed in: qemu
       Status: New => Incomplete

-- 
You received this bug notification because you are a member of qemu-
devel-ml, which is subscribed to QEMU.
https://bugs.launchpad.net/bugs/1896342

Title:
  IDE ATA IDENTIFY WORD 106

Status in QEMU:
  Incomplete

Bug description:
  The code at line 202 in hw/ide/core.c
   (https://git.qemu.org/?p=qemu.git;a=blob;f=hw/ide/core.c;#l201)
  hard codes bit 13 set.  However, get_physical_block_exp() can and may return 0, which is a valid response. If get_physical_block_exp() does return zero, bit 13 should not be set.

  ATAPI8 states (Section 7.17.7.73):
   "Bit 13 of word 106 shall be set to one to indicate that the device has more than one logical sector per physical sector"

  and gives the examples:
    Bits (3:0): 0 = 2^0 = 1 logical sector per physical sector
    Bits (3:0): 1 = 2^1 = 2 logical sector per physical sector
    Bits (3:0): 2 = 2^2 = 4 logical sector per physical sector
    Bits (3:0): 3 = 2^3 = 8 logical sector per physical sector

  Therefore, if bit 13 is set, bits 3:0 must be greater than zero.

  If get_physical_block_exp() returns zero then there is a 1:1 ratio and
  bit 13 must be 0.

  Just my opinion.

  Thanks,
  Ben

To manage notifications about this bug go to:
https://bugs.launchpad.net/qemu/+bug/1896342/+subscriptions


^ permalink raw reply	[flat|nested] 5+ messages in thread

* [Bug 1896342] Re: IDE ATA IDENTIFY WORD 106
  2020-09-19 19:01 [Bug 1896342] [NEW] IDE ATA IDENTIFY WORD 106 Benjamin David Lunt
                   ` (2 preceding siblings ...)
  2021-05-09 13:59 ` Thomas Huth
@ 2021-07-09  4:17 ` Launchpad Bug Tracker
  3 siblings, 0 replies; 5+ messages in thread
From: Launchpad Bug Tracker @ 2021-07-09  4:17 UTC (permalink / raw)
  To: qemu-devel

[Expired for QEMU because there has been no activity for 60 days.]

** Changed in: qemu
       Status: Incomplete => Expired

-- 
You received this bug notification because you are a member of qemu-
devel-ml, which is subscribed to QEMU.
https://bugs.launchpad.net/bugs/1896342

Title:
  IDE ATA IDENTIFY WORD 106

Status in QEMU:
  Expired

Bug description:
  The code at line 202 in hw/ide/core.c
   (https://git.qemu.org/?p=qemu.git;a=blob;f=hw/ide/core.c;#l201)
  hard codes bit 13 set.  However, get_physical_block_exp() can and may return 0, which is a valid response. If get_physical_block_exp() does return zero, bit 13 should not be set.

  ATAPI8 states (Section 7.17.7.73):
   "Bit 13 of word 106 shall be set to one to indicate that the device has more than one logical sector per physical sector"

  and gives the examples:
    Bits (3:0): 0 = 2^0 = 1 logical sector per physical sector
    Bits (3:0): 1 = 2^1 = 2 logical sector per physical sector
    Bits (3:0): 2 = 2^2 = 4 logical sector per physical sector
    Bits (3:0): 3 = 2^3 = 8 logical sector per physical sector

  Therefore, if bit 13 is set, bits 3:0 must be greater than zero.

  If get_physical_block_exp() returns zero then there is a 1:1 ratio and
  bit 13 must be 0.

  Just my opinion.

  Thanks,
  Ben

To manage notifications about this bug go to:
https://bugs.launchpad.net/qemu/+bug/1896342/+subscriptions


^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2021-07-09  4:36 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-09-19 19:01 [Bug 1896342] [NEW] IDE ATA IDENTIFY WORD 106 Benjamin David Lunt
2020-09-19 19:38 ` [Bug 1896342] " Benjamin David Lunt
2020-10-02 19:54 ` John Snow
2021-05-09 13:59 ` Thomas Huth
2021-07-09  4:17 ` Launchpad Bug Tracker

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.