qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
* [Qemu-devel] [PATCH 0/3] add pc-1.3, fix xhci comat, ivshmem 64bit option
@ 2012-09-13  9:07 Gerd Hoffmann
  2012-09-13  9:08 ` [Qemu-devel] [PATCH 1/3] add pc-1.3 machine type Gerd Hoffmann
                   ` (4 more replies)
  0 siblings, 5 replies; 6+ messages in thread
From: Gerd Hoffmann @ 2012-09-13  9:07 UTC (permalink / raw)
  To: qemu-devel; +Cc: Gerd Hoffmann

  Hi,

Small series with tree patches, the first one adds a new machine type
for the upcoming 1.3 release so we can add compat properties as needed,
the other two patches actually add compat properties.  The xhci one is
a pure compat fix which turns off msi+msix on old machine types.  The
other is the 64bit ivshmem patch which has been posted multiple times
and still didn't make it into master yet.  It adds a compat property
too to turn off 64bit on old machine types.

cheers,
  Gerd

The following changes since commit e0a1e32dbc41e6b2aabb436a9417dfd32177a3dc:

  Merge branch 'usb.64' of git://git.kraxel.org/qemu (2012-09-11 18:06:56 +0200)

are available in the git repository at:

  git://git.kraxel.org/qemu misc.1

Gerd Hoffmann (3):
      add pc-1.3 machine type
      compat: turn off msi/msix on xhci for old machine types
      ivshmem: add 64bit option

 hw/ivshmem.c |   13 ++++++++++---
 hw/pc_piix.c |   32 ++++++++++++++++++++++++++++++--
 2 files changed, 40 insertions(+), 5 deletions(-)

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

* [Qemu-devel] [PATCH 1/3] add pc-1.3 machine type
  2012-09-13  9:07 [Qemu-devel] [PATCH 0/3] add pc-1.3, fix xhci comat, ivshmem 64bit option Gerd Hoffmann
@ 2012-09-13  9:08 ` Gerd Hoffmann
  2012-09-13  9:08 ` [Qemu-devel] [PATCH 2/3] compat: turn off msi/msix on xhci for old machine types Gerd Hoffmann
                   ` (3 subsequent siblings)
  4 siblings, 0 replies; 6+ messages in thread
From: Gerd Hoffmann @ 2012-09-13  9:08 UTC (permalink / raw)
  To: qemu-devel; +Cc: Gerd Hoffmann

Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
---
 hw/pc_piix.c |   12 ++++++++++--
 1 files changed, 10 insertions(+), 2 deletions(-)

diff --git a/hw/pc_piix.c b/hw/pc_piix.c
index 88ff041..5a0796b 100644
--- a/hw/pc_piix.c
+++ b/hw/pc_piix.c
@@ -349,8 +349,8 @@ static void pc_xen_hvm_init(ram_addr_t ram_size,
 }
 #endif
 
-static QEMUMachine pc_machine_v1_2 = {
-    .name = "pc-1.2",
+static QEMUMachine pc_machine_v1_3 = {
+    .name = "pc-1.3",
     .alias = "pc",
     .desc = "Standard PC",
     .init = pc_init_pci,
@@ -358,6 +358,13 @@ static QEMUMachine pc_machine_v1_2 = {
     .is_default = 1,
 };
 
+static QEMUMachine pc_machine_v1_2 = {
+    .name = "pc-1.2",
+    .desc = "Standard PC",
+    .init = pc_init_pci,
+    .max_cpus = 255,
+};
+
 #define PC_COMPAT_1_1 \
         {\
             .driver   = "virtio-scsi-pci",\
@@ -655,6 +662,7 @@ static QEMUMachine xenfv_machine = {
 
 static void pc_machine_init(void)
 {
+    qemu_register_machine(&pc_machine_v1_3);
     qemu_register_machine(&pc_machine_v1_2);
     qemu_register_machine(&pc_machine_v1_1);
     qemu_register_machine(&pc_machine_v1_0);
-- 
1.7.1

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

* [Qemu-devel] [PATCH 2/3] compat: turn off msi/msix on xhci for old machine types
  2012-09-13  9:07 [Qemu-devel] [PATCH 0/3] add pc-1.3, fix xhci comat, ivshmem 64bit option Gerd Hoffmann
  2012-09-13  9:08 ` [Qemu-devel] [PATCH 1/3] add pc-1.3 machine type Gerd Hoffmann
@ 2012-09-13  9:08 ` Gerd Hoffmann
  2012-09-13  9:08 ` [Qemu-devel] [PATCH 3/3] ivshmem: add 64bit option Gerd Hoffmann
                   ` (2 subsequent siblings)
  4 siblings, 0 replies; 6+ messages in thread
From: Gerd Hoffmann @ 2012-09-13  9:08 UTC (permalink / raw)
  To: qemu-devel; +Cc: Gerd Hoffmann

Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
---
 hw/pc_piix.c |   16 ++++++++++++++++
 1 files changed, 16 insertions(+), 0 deletions(-)

diff --git a/hw/pc_piix.c b/hw/pc_piix.c
index 5a0796b..afd8361 100644
--- a/hw/pc_piix.c
+++ b/hw/pc_piix.c
@@ -358,14 +358,30 @@ static QEMUMachine pc_machine_v1_3 = {
     .is_default = 1,
 };
 
+#define PC_COMPAT_1_2 \
+        {\
+            .driver   = "nec-usb-xhci",\
+            .property = "msi",\
+            .value    = "off",\
+        },{\
+            .driver   = "nec-usb-xhci",\
+            .property = "msix",\
+            .value    = "off",\
+        }
+
 static QEMUMachine pc_machine_v1_2 = {
     .name = "pc-1.2",
     .desc = "Standard PC",
     .init = pc_init_pci,
     .max_cpus = 255,
+    .compat_props = (GlobalProperty[]) {
+        PC_COMPAT_1_2,
+        { /* end of list */ }
+    },
 };
 
 #define PC_COMPAT_1_1 \
+        PC_COMPAT_1_2,\
         {\
             .driver   = "virtio-scsi-pci",\
             .property = "hotplug",\
-- 
1.7.1

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

* [Qemu-devel] [PATCH 3/3] ivshmem: add 64bit option
  2012-09-13  9:07 [Qemu-devel] [PATCH 0/3] add pc-1.3, fix xhci comat, ivshmem 64bit option Gerd Hoffmann
  2012-09-13  9:08 ` [Qemu-devel] [PATCH 1/3] add pc-1.3 machine type Gerd Hoffmann
  2012-09-13  9:08 ` [Qemu-devel] [PATCH 2/3] compat: turn off msi/msix on xhci for old machine types Gerd Hoffmann
@ 2012-09-13  9:08 ` Gerd Hoffmann
  2012-09-24  8:10 ` [Qemu-devel] [PATCH 0/3] add pc-1.3, fix xhci comat, ivshmem " Gerd Hoffmann
  2012-09-26 12:38 ` Anthony Liguori
  4 siblings, 0 replies; 6+ messages in thread
From: Gerd Hoffmann @ 2012-09-13  9:08 UTC (permalink / raw)
  To: qemu-devel; +Cc: Gerd Hoffmann

This patch adds a "use64" property which will make the ivshmem driver
register a 64bit memory bar when set, so you have something to play with
when testing 64bit pci bits.  It also allows to have quite big shared
memory regions, like this:

[root@fedora ~]# lspci -vs1:1
01:01.0 RAM memory: Red Hat, Inc Device 1110
        Subsystem: Red Hat, Inc Device 1100
        Physical Slot: 1-1
        Flags: fast devsel
        Memory at fd400000 (32-bit, non-prefetchable) [disabled] [size=256]
        Memory at 8040000000 (64-bit, prefetchable) [size=1G]

[ v5: rebase, update compat property for post-1.2 merge ]
[ v4: rebase & adapt to latest master again ]
[ v3: rebase & adapt to latest master ]
[ v2: default to on as suggested by avi,
      turn off for pc-$old using compat property ]

Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
Tested-by: Cam Macdonell <cam@cs.ualberta.ca>
---
 hw/ivshmem.c |   13 ++++++++++---
 hw/pc_piix.c |    4 ++++
 2 files changed, 14 insertions(+), 3 deletions(-)

diff --git a/hw/ivshmem.c b/hw/ivshmem.c
index 62fe53a..59f1aa4 100644
--- a/hw/ivshmem.c
+++ b/hw/ivshmem.c
@@ -71,6 +71,8 @@ typedef struct IVShmemState {
     MemoryRegion bar;
     MemoryRegion ivshmem;
     uint64_t ivshmem_size; /* size of shared memory region */
+    uint32_t ivshmem_attr;
+    uint32_t ivshmem_64bit;
     int shm_fd; /* shared memory file descriptor */
 
     Peer *peers;
@@ -339,7 +341,7 @@ static void create_shared_memory_BAR(IVShmemState *s, int fd) {
     memory_region_add_subregion(&s->bar, 0, &s->ivshmem);
 
     /* region for shared memory */
-    pci_register_bar(&s->dev, 2, PCI_BASE_ADDRESS_SPACE_MEMORY, &s->bar);
+    pci_register_bar(&s->dev, 2, s->ivshmem_attr, &s->bar);
 }
 
 static void ivshmem_add_eventfd(IVShmemState *s, int posn, int i)
@@ -690,6 +692,11 @@ static int pci_ivshmem_init(PCIDevice *dev)
                      &s->ivshmem_mmio);
 
     memory_region_init(&s->bar, "ivshmem-bar2-container", s->ivshmem_size);
+    s->ivshmem_attr = PCI_BASE_ADDRESS_SPACE_MEMORY |
+        PCI_BASE_ADDRESS_MEM_PREFETCH;
+    if (s->ivshmem_64bit) {
+        s->ivshmem_attr |= PCI_BASE_ADDRESS_MEM_TYPE_64;
+    }
 
     if ((s->server_chr != NULL) &&
                         (strncmp(s->server_chr->filename, "unix:", 5) == 0)) {
@@ -715,8 +722,7 @@ static int pci_ivshmem_init(PCIDevice *dev)
         /* allocate/initialize space for interrupt handling */
         s->peers = g_malloc0(s->nb_peers * sizeof(Peer));
 
-        pci_register_bar(&s->dev, 2,
-                         PCI_BASE_ADDRESS_SPACE_MEMORY, &s->bar);
+        pci_register_bar(&s->dev, 2, s->ivshmem_attr, &s->bar);
 
         s->eventfd_chr = g_malloc0(s->vectors * sizeof(CharDriverState *));
 
@@ -786,6 +792,7 @@ static Property ivshmem_properties[] = {
     DEFINE_PROP_BIT("msi", IVShmemState, features, IVSHMEM_MSI, true),
     DEFINE_PROP_STRING("shm", IVShmemState, shmobj),
     DEFINE_PROP_STRING("role", IVShmemState, role),
+    DEFINE_PROP_UINT32("use64", IVShmemState, ivshmem_64bit, 1),
     DEFINE_PROP_END_OF_LIST(),
 };
 
diff --git a/hw/pc_piix.c b/hw/pc_piix.c
index afd8361..fd5898f 100644
--- a/hw/pc_piix.c
+++ b/hw/pc_piix.c
@@ -367,6 +367,10 @@ static QEMUMachine pc_machine_v1_3 = {
             .driver   = "nec-usb-xhci",\
             .property = "msix",\
             .value    = "off",\
+        },{\
+            .driver   = "ivshmem",\
+            .property = "use64",\
+            .value    = "0",\
         }
 
 static QEMUMachine pc_machine_v1_2 = {
-- 
1.7.1

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

* Re: [Qemu-devel] [PATCH 0/3] add pc-1.3, fix xhci comat, ivshmem 64bit option
  2012-09-13  9:07 [Qemu-devel] [PATCH 0/3] add pc-1.3, fix xhci comat, ivshmem 64bit option Gerd Hoffmann
                   ` (2 preceding siblings ...)
  2012-09-13  9:08 ` [Qemu-devel] [PATCH 3/3] ivshmem: add 64bit option Gerd Hoffmann
@ 2012-09-24  8:10 ` Gerd Hoffmann
  2012-09-26 12:38 ` Anthony Liguori
  4 siblings, 0 replies; 6+ messages in thread
From: Gerd Hoffmann @ 2012-09-24  8:10 UTC (permalink / raw)
  To: Gerd Hoffmann; +Cc: qemu-devel

On 09/13/12 11:07, Gerd Hoffmann wrote:
> Small series with tree patches, the first one adds a new machine type
> for the upcoming 1.3 release so we can add compat properties as needed,
> the other two patches actually add compat properties.  The xhci one is
> a pure compat fix which turns off msi+msix on old machine types.  The
> other is the 64bit ivshmem patch which has been posted multiple times
> and still didn't make it into master yet.  It adds a compat property
> too to turn off 64bit on old machine types.

Ping?

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

* Re: [Qemu-devel] [PATCH 0/3] add pc-1.3, fix xhci comat, ivshmem 64bit option
  2012-09-13  9:07 [Qemu-devel] [PATCH 0/3] add pc-1.3, fix xhci comat, ivshmem 64bit option Gerd Hoffmann
                   ` (3 preceding siblings ...)
  2012-09-24  8:10 ` [Qemu-devel] [PATCH 0/3] add pc-1.3, fix xhci comat, ivshmem " Gerd Hoffmann
@ 2012-09-26 12:38 ` Anthony Liguori
  4 siblings, 0 replies; 6+ messages in thread
From: Anthony Liguori @ 2012-09-26 12:38 UTC (permalink / raw)
  To: Gerd Hoffmann, qemu-devel

Gerd Hoffmann <kraxel@redhat.com> writes:

>   Hi,
>
> Small series with tree patches, the first one adds a new machine type
> for the upcoming 1.3 release so we can add compat properties as needed,
> the other two patches actually add compat properties.  The xhci one is
> a pure compat fix which turns off msi+msix on old machine types.  The
> other is the 64bit ivshmem patch which has been posted multiple times
> and still didn't make it into master yet.  It adds a compat property
> too to turn off 64bit on old machine types.
>
> cheers,
>   Gerd
>
> The following changes since commit e0a1e32dbc41e6b2aabb436a9417dfd32177a3dc:
>
>   Merge branch 'usb.64' of git://git.kraxel.org/qemu (2012-09-11 18:06:56 +0200)
>
> are available in the git repository at:
>
>   git://git.kraxel.org/qemu misc.1
>

Applied. Thanks.

Regards,

Anthony Liguori

> Gerd Hoffmann (3):
>       add pc-1.3 machine type
>       compat: turn off msi/msix on xhci for old machine types
>       ivshmem: add 64bit option
>
>  hw/ivshmem.c |   13 ++++++++++---
>  hw/pc_piix.c |   32 ++++++++++++++++++++++++++++++--
>  2 files changed, 40 insertions(+), 5 deletions(-)

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

end of thread, other threads:[~2012-09-26 12:38 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-09-13  9:07 [Qemu-devel] [PATCH 0/3] add pc-1.3, fix xhci comat, ivshmem 64bit option Gerd Hoffmann
2012-09-13  9:08 ` [Qemu-devel] [PATCH 1/3] add pc-1.3 machine type Gerd Hoffmann
2012-09-13  9:08 ` [Qemu-devel] [PATCH 2/3] compat: turn off msi/msix on xhci for old machine types Gerd Hoffmann
2012-09-13  9:08 ` [Qemu-devel] [PATCH 3/3] ivshmem: add 64bit option Gerd Hoffmann
2012-09-24  8:10 ` [Qemu-devel] [PATCH 0/3] add pc-1.3, fix xhci comat, ivshmem " Gerd Hoffmann
2012-09-26 12:38 ` Anthony Liguori

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