qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
* [Qemu-devel] [PULL build-fix 0/6] SCSI patches for 2013-09-20
@ 2013-09-20 15:08 Paolo Bonzini
  2013-09-20 15:08 ` [Qemu-devel] [PULL 1/6] lsi: use constant name instead of its value Paolo Bonzini
                   ` (5 more replies)
  0 siblings, 6 replies; 7+ messages in thread
From: Paolo Bonzini @ 2013-09-20 15:08 UTC (permalink / raw)
  To: qemu-devel

Anthony,

The following changes since commit f4ff3b7ba1bcb77d5b5cdbd6e695df793761170b:

  spapr-vscsi: Report error on unsupported MAD requests (2013-09-12 13:15:54 +0200)

are available in the git repository at:

  git://github.com/bonzini/qemu.git scsi-next

for you to fetch changes up to f35c934a5add17eb549e3f7f4b8286605eb21e99:

  block/iscsi: Drop iscsi_co_get_block_status for older versions of libiscsi (2013-09-18 01:28:50 +0200)

This includes Stefan's patch to fix compilation with older versions of libiscsi.

----------------------------------------------------------------
Hervé Poussineau (5):
      lsi: use constant name instead of its value
      lsi: check ssid versus sdid only if ssid is valid
      lsi: ignore write accesses to CTEST0 registers
      lsi: remove todo
      lsi: add 53C810 variant

Stefan Weil (1):
      block/iscsi: Drop iscsi_co_get_block_status for older versions of libiscsi

 block/iscsi.c            |  6 ++++++
 hw/scsi/lsi53c895a.c     | 32 +++++++++++++++++++++++++++-----
 include/hw/pci/pci_ids.h |  1 +
 3 files changed, 34 insertions(+), 5 deletions(-)
-- 
1.8.3.1

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

* [Qemu-devel] [PULL 1/6] lsi: use constant name instead of its value
  2013-09-20 15:08 [Qemu-devel] [PULL build-fix 0/6] SCSI patches for 2013-09-20 Paolo Bonzini
@ 2013-09-20 15:08 ` Paolo Bonzini
  2013-09-20 15:08 ` [Qemu-devel] [PULL 2/6] lsi: check ssid versus sdid only if ssid is valid Paolo Bonzini
                   ` (4 subsequent siblings)
  5 siblings, 0 replies; 7+ messages in thread
From: Paolo Bonzini @ 2013-09-20 15:08 UTC (permalink / raw)
  To: qemu-devel; +Cc: Hervé Poussineau

From: Hervé Poussineau <hpoussin@reactos.org>

Signed-off-by: Hervé Poussineau <hpoussin@reactos.org>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
---
 hw/scsi/lsi53c895a.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/hw/scsi/lsi53c895a.c b/hw/scsi/lsi53c895a.c
index 5affc82..4cc0c6a 100644
--- a/hw/scsi/lsi53c895a.c
+++ b/hw/scsi/lsi53c895a.c
@@ -1515,7 +1515,7 @@ static uint8_t lsi_reg_readb(LSIState *s, int offset)
            used for diagnostics, so should be ok.  */
         return 0;
     case 0xc: /* DSTAT */
-        tmp = s->dstat | 0x80;
+        tmp = s->dstat | LSI_DSTAT_DFE;
         if ((s->istat0 & LSI_ISTAT0_INTF) == 0)
             s->dstat = 0;
         lsi_update_irq(s);
@@ -2106,7 +2106,7 @@ static int lsi_scsi_init(PCIDevice *dev)
                           "lsi-io", 256);
 
     pci_register_bar(dev, 0, PCI_BASE_ADDRESS_SPACE_IO, &s->io_io);
-    pci_register_bar(dev, 1, 0, &s->mmio_io);
+    pci_register_bar(dev, 1, PCI_BASE_ADDRESS_SPACE_MEMORY, &s->mmio_io);
     pci_register_bar(dev, 2, PCI_BASE_ADDRESS_SPACE_MEMORY, &s->ram_io);
     QTAILQ_INIT(&s->queue);
 
-- 
1.8.3.1

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

* [Qemu-devel] [PULL 2/6] lsi: check ssid versus sdid only if ssid is valid
  2013-09-20 15:08 [Qemu-devel] [PULL build-fix 0/6] SCSI patches for 2013-09-20 Paolo Bonzini
  2013-09-20 15:08 ` [Qemu-devel] [PULL 1/6] lsi: use constant name instead of its value Paolo Bonzini
@ 2013-09-20 15:08 ` Paolo Bonzini
  2013-09-20 15:08 ` [Qemu-devel] [PULL 3/6] lsi: ignore write accesses to CTEST0 registers Paolo Bonzini
                   ` (3 subsequent siblings)
  5 siblings, 0 replies; 7+ messages in thread
From: Paolo Bonzini @ 2013-09-20 15:08 UTC (permalink / raw)
  To: qemu-devel; +Cc: Hervé Poussineau

From: Hervé Poussineau <hpoussin@reactos.org>

This prevents some (invalid) error messages on console.

Signed-off-by: Hervé Poussineau <hpoussin@reactos.org>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
---
 hw/scsi/lsi53c895a.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/hw/scsi/lsi53c895a.c b/hw/scsi/lsi53c895a.c
index 4cc0c6a..4314efe 100644
--- a/hw/scsi/lsi53c895a.c
+++ b/hw/scsi/lsi53c895a.c
@@ -1699,8 +1699,9 @@ static void lsi_reg_writeb(LSIState *s, int offset, uint8_t val)
         s->sxfer = val;
         break;
     case 0x06: /* SDID */
-        if ((val & 0xf) != (s->ssid & 0xf))
+        if ((s->ssid & 0x80) && (val & 0xf) != (s->ssid & 0xf)) {
             BADF("Destination ID does not match SSID\n");
+        }
         s->sdid = val & 0xf;
         break;
     case 0x07: /* GPREG0 */
-- 
1.8.3.1

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

* [Qemu-devel] [PULL 3/6] lsi: ignore write accesses to CTEST0 registers
  2013-09-20 15:08 [Qemu-devel] [PULL build-fix 0/6] SCSI patches for 2013-09-20 Paolo Bonzini
  2013-09-20 15:08 ` [Qemu-devel] [PULL 1/6] lsi: use constant name instead of its value Paolo Bonzini
  2013-09-20 15:08 ` [Qemu-devel] [PULL 2/6] lsi: check ssid versus sdid only if ssid is valid Paolo Bonzini
@ 2013-09-20 15:08 ` Paolo Bonzini
  2013-09-20 15:08 ` [Qemu-devel] [PULL 4/6] lsi: remove todo Paolo Bonzini
                   ` (2 subsequent siblings)
  5 siblings, 0 replies; 7+ messages in thread
From: Paolo Bonzini @ 2013-09-20 15:08 UTC (permalink / raw)
  To: qemu-devel; +Cc: Hervé Poussineau

From: Hervé Poussineau <hpoussin@reactos.org>

53C895A datasheet says that this register is read/write, and that the value
returned on read access is dependant of DMA FIFO state. However, nothing is
said for written value.

53C810A datasheet gives more insight about this register:
"This was a general purpose read/write register in previous SYM53C8XX
family chips. Although it is still a read/write register, Symbios reserves
the right to use these bits for future 53C8XX family enhancements."

This prevents going to the default case, which prints an error message.

Signed-off-by: Hervé Poussineau <hpoussin@reactos.org>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
---
 hw/scsi/lsi53c895a.c | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/hw/scsi/lsi53c895a.c b/hw/scsi/lsi53c895a.c
index 4314efe..89d934b 100644
--- a/hw/scsi/lsi53c895a.c
+++ b/hw/scsi/lsi53c895a.c
@@ -1743,6 +1743,9 @@ static void lsi_reg_writeb(LSIState *s, int offset, uint8_t val)
     case 0x17: /* MBOX1 */
         s->mbox1 = val;
         break;
+    case 0x18: /* CTEST0 */
+        /* nothing to do */
+        break;
     case 0x1a: /* CTEST2 */
 	s->ctest2 = val & LSI_CTEST2_PCICIE;
 	break;
-- 
1.8.3.1

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

* [Qemu-devel] [PULL 4/6] lsi: remove todo
  2013-09-20 15:08 [Qemu-devel] [PULL build-fix 0/6] SCSI patches for 2013-09-20 Paolo Bonzini
                   ` (2 preceding siblings ...)
  2013-09-20 15:08 ` [Qemu-devel] [PULL 3/6] lsi: ignore write accesses to CTEST0 registers Paolo Bonzini
@ 2013-09-20 15:08 ` Paolo Bonzini
  2013-09-20 15:08 ` [Qemu-devel] [PULL 5/6] lsi: add 53C810 variant Paolo Bonzini
  2013-09-20 15:08 ` [Qemu-devel] [PULL 6/6] block/iscsi: Drop iscsi_co_get_block_status for older versions of libiscsi Paolo Bonzini
  5 siblings, 0 replies; 7+ messages in thread
From: Paolo Bonzini @ 2013-09-20 15:08 UTC (permalink / raw)
  To: qemu-devel; +Cc: Hervé Poussineau

From: Hervé Poussineau <hpoussin@reactos.org>

LSI emulation has been tested with Linux on PPC platform.

Signed-off-by: Hervé Poussineau <hpoussin@reactos.org>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
---
 hw/scsi/lsi53c895a.c | 3 ---
 1 file changed, 3 deletions(-)

diff --git a/hw/scsi/lsi53c895a.c b/hw/scsi/lsi53c895a.c
index 89d934b..87c8888 100644
--- a/hw/scsi/lsi53c895a.c
+++ b/hw/scsi/lsi53c895a.c
@@ -7,9 +7,6 @@
  * This code is licensed under the LGPL.
  */
 
-/* ??? Need to check if the {read,write}[wl] routines work properly on
-   big-endian targets.  */
-
 #include <assert.h>
 
 #include "hw/hw.h"
-- 
1.8.3.1

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

* [Qemu-devel] [PULL 5/6] lsi: add 53C810 variant
  2013-09-20 15:08 [Qemu-devel] [PULL build-fix 0/6] SCSI patches for 2013-09-20 Paolo Bonzini
                   ` (3 preceding siblings ...)
  2013-09-20 15:08 ` [Qemu-devel] [PULL 4/6] lsi: remove todo Paolo Bonzini
@ 2013-09-20 15:08 ` Paolo Bonzini
  2013-09-20 15:08 ` [Qemu-devel] [PULL 6/6] block/iscsi: Drop iscsi_co_get_block_status for older versions of libiscsi Paolo Bonzini
  5 siblings, 0 replies; 7+ messages in thread
From: Paolo Bonzini @ 2013-09-20 15:08 UTC (permalink / raw)
  To: qemu-devel; +Cc: Hervé Poussineau

From: Hervé Poussineau <hpoussin@reactos.org>

Currently, treat it exactly as a 53C895A.
53C895A is a 53C810 with more capabilities, so this should work.

However, this lets us test different code paths on Linux, which
don't use lastest features if it detect a 810, or on some OSes
which only support 810 and not 895A (like very old Windows NT
versions).

Signed-off-by: Hervé Poussineau <hpoussin@reactos.org>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
---
 hw/scsi/lsi53c895a.c     | 21 +++++++++++++++++++++
 include/hw/pci/pci_ids.h |  1 +
 2 files changed, 22 insertions(+)

diff --git a/hw/scsi/lsi53c895a.c b/hw/scsi/lsi53c895a.c
index 87c8888..36e5f50 100644
--- a/hw/scsi/lsi53c895a.c
+++ b/hw/scsi/lsi53c895a.c
@@ -7,6 +7,12 @@
  * This code is licensed under the LGPL.
  */
 
+/* Note:
+ * LSI53C810 emulation is incorrect, in the sense that it supports
+ * features added in later evolutions. This should not be a problem,
+ * as well-behaved operating systems will not try to use them.
+ */
+
 #include <assert.h>
 
 #include "hw/hw.h"
@@ -275,6 +281,7 @@ typedef struct {
     uint32_t script_ram[2048];
 } LSIState;
 
+#define TYPE_LSI53C810  "lsi53c810"
 #define TYPE_LSI53C895A "lsi53c895a"
 
 #define LSI53C895A(obj) \
@@ -2145,9 +2152,23 @@ static const TypeInfo lsi_info = {
     .class_init    = lsi_class_init,
 };
 
+static void lsi53c810_class_init(ObjectClass *klass, void *data)
+{
+    PCIDeviceClass *k = PCI_DEVICE_CLASS(klass);
+
+    k->device_id = PCI_DEVICE_ID_LSI_53C810;
+}
+
+static TypeInfo lsi53c810_info = {
+    .name          = TYPE_LSI53C810,
+    .parent        = TYPE_LSI53C895A,
+    .class_init    = lsi53c810_class_init,
+};
+
 static void lsi53c895a_register_types(void)
 {
     type_register_static(&lsi_info);
+    type_register_static(&lsi53c810_info);
 }
 
 type_init(lsi53c895a_register_types)
diff --git a/include/hw/pci/pci_ids.h b/include/hw/pci/pci_ids.h
index 3ddaf6a..4c0002b 100644
--- a/include/hw/pci/pci_ids.h
+++ b/include/hw/pci/pci_ids.h
@@ -53,6 +53,7 @@
 /* Vendors and devices.  Sort key: vendor first, device next. */
 
 #define PCI_VENDOR_ID_LSI_LOGIC          0x1000
+#define PCI_DEVICE_ID_LSI_53C810         0x0001
 #define PCI_DEVICE_ID_LSI_53C895A        0x0012
 #define PCI_DEVICE_ID_LSI_SAS1078        0x0060
 
-- 
1.8.3.1

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

* [Qemu-devel] [PULL 6/6] block/iscsi: Drop iscsi_co_get_block_status for older versions of libiscsi
  2013-09-20 15:08 [Qemu-devel] [PULL build-fix 0/6] SCSI patches for 2013-09-20 Paolo Bonzini
                   ` (4 preceding siblings ...)
  2013-09-20 15:08 ` [Qemu-devel] [PULL 5/6] lsi: add 53C810 variant Paolo Bonzini
@ 2013-09-20 15:08 ` Paolo Bonzini
  5 siblings, 0 replies; 7+ messages in thread
From: Paolo Bonzini @ 2013-09-20 15:08 UTC (permalink / raw)
  To: qemu-devel; +Cc: Stefan Weil

From: Stefan Weil <sw@weilnetz.de>

Debian wheezy includes libiscsi-dev 1.4.0 which does not provide
SCSI_PROVISIONING_TYPE_DEALLOCATED. Drop iscsi_co_get_block_status
in this case to allow compilation without errors.

Signed-off-by: Stefan Weil <sw@weilnetz.de>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
---
 block/iscsi.c | 6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/block/iscsi.c b/block/iscsi.c
index 68f99d3..6222ea9 100644
--- a/block/iscsi.c
+++ b/block/iscsi.c
@@ -811,6 +811,8 @@ iscsi_getlength(BlockDriverState *bs)
     return len;
 }
 
+#if defined(SCSI_PROVISIONING_TYPE_DEALLOCATED)
+
 static int64_t coroutine_fn iscsi_co_get_block_status(BlockDriverState *bs,
                                                   int64_t sector_num,
                                                   int nb_sectors, int *pnum)
@@ -901,6 +903,8 @@ out:
     return ret;
 }
 
+#endif /* SCSI_PROVISIONING_TYPE_DEALLOCATED */
+
 static int
 coroutine_fn iscsi_co_discard(BlockDriverState *bs, int64_t sector_num,
                                    int nb_sectors)
@@ -1522,7 +1526,9 @@ static BlockDriver bdrv_iscsi = {
     .bdrv_getlength  = iscsi_getlength,
     .bdrv_truncate   = iscsi_truncate,
 
+#if defined(SCSI_PROVISIONING_TYPE_DEALLOCATED)
     .bdrv_co_get_block_status = iscsi_co_get_block_status,
+#endif
     .bdrv_co_discard      = iscsi_co_discard,
 
     .bdrv_aio_readv  = iscsi_aio_readv,
-- 
1.8.3.1

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

end of thread, other threads:[~2013-09-20 15:09 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-09-20 15:08 [Qemu-devel] [PULL build-fix 0/6] SCSI patches for 2013-09-20 Paolo Bonzini
2013-09-20 15:08 ` [Qemu-devel] [PULL 1/6] lsi: use constant name instead of its value Paolo Bonzini
2013-09-20 15:08 ` [Qemu-devel] [PULL 2/6] lsi: check ssid versus sdid only if ssid is valid Paolo Bonzini
2013-09-20 15:08 ` [Qemu-devel] [PULL 3/6] lsi: ignore write accesses to CTEST0 registers Paolo Bonzini
2013-09-20 15:08 ` [Qemu-devel] [PULL 4/6] lsi: remove todo Paolo Bonzini
2013-09-20 15:08 ` [Qemu-devel] [PULL 5/6] lsi: add 53C810 variant Paolo Bonzini
2013-09-20 15:08 ` [Qemu-devel] [PULL 6/6] block/iscsi: Drop iscsi_co_get_block_status for older versions of libiscsi Paolo Bonzini

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).