* [Qemu-devel] [PATCH 1/5] docs: move pci-ids.txt to docs/specs/
2012-11-19 10:21 [Qemu-devel] [PATCH 0/5] Improve consistency of pci-ids.txt, use symbolic constants for QEMU devices Paolo Bonzini
@ 2012-11-19 10:21 ` Paolo Bonzini
2012-11-19 10:21 ` [Qemu-devel] [PATCH 2/5] reorganize pci-ids.txt Paolo Bonzini
` (5 subsequent siblings)
6 siblings, 0 replies; 16+ messages in thread
From: Paolo Bonzini @ 2012-11-19 10:21 UTC (permalink / raw)
To: qemu-devel; +Cc: kraxel, mst
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
---
pci-ids.txt => docs/specs/pci-ids.txt | 0
1 file modificato, 0 inserzioni(+), 0 rimozioni(-)
rename pci-ids.txt => docs/specs/pci-ids.txt (100%)
diff --git a/pci-ids.txt b/docs/specs/pci-ids.txt
similarity index 100%
rename from pci-ids.txt
rename to docs/specs/pci-ids.txt
--
1.7.12.1
^ permalink raw reply [flat|nested] 16+ messages in thread
* [Qemu-devel] [PATCH 2/5] reorganize pci-ids.txt
2012-11-19 10:21 [Qemu-devel] [PATCH 0/5] Improve consistency of pci-ids.txt, use symbolic constants for QEMU devices Paolo Bonzini
2012-11-19 10:21 ` [Qemu-devel] [PATCH 1/5] docs: move pci-ids.txt to docs/specs/ Paolo Bonzini
@ 2012-11-19 10:21 ` Paolo Bonzini
2012-11-19 10:21 ` [Qemu-devel] [PATCH 3/5] virtio-9p: use symbolic constant, add to pci-ids.txt Paolo Bonzini
` (4 subsequent siblings)
6 siblings, 0 replies; 16+ messages in thread
From: Paolo Bonzini @ 2012-11-19 10:21 UTC (permalink / raw)
To: qemu-devel; +Cc: kraxel, mst
Some devices were missing, and we're using two PCI vendor ids.
This patch only adds devices that are already documented in hw/pci.h.
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
---
docs/specs/pci-ids.txt | 26 +++++++++++++-------------
1 file modificato, 13 inserzioni(+), 13 rimozioni(-)
diff --git a/docs/specs/pci-ids.txt b/docs/specs/pci-ids.txt
index 73125a8..445b293 100644
--- a/docs/specs/pci-ids.txt
+++ b/docs/specs/pci-ids.txt
@@ -3,29 +3,30 @@ PCI IDs for qemu
================
Red Hat, Inc. donates a part of its device ID range to qemu, to be used for
-virtual devices. The vendor ID is 1af4 (formerly Qumranet ID).
+virtual devices. The vendor IDs are 1af4 (formerly Qumranet ID) and 1b36.
-The 1000 -> 10ff device ID range is used for VirtIO devices.
+Contact Gerd Hoffmann <kraxel@redhat.com> to get a device ID assigned
+for your devices.
-The 1100 device ID is used as PCI Subsystem ID for existing hardware
-devices emulated by qemu.
+1af4 vendor ID
+--------------
-All other device IDs are reserved.
-
-
-VirtIO Device IDs
------------------
+The 1000 -> 10ff device ID range is used as follows for virtio-pci devices.
+Note that this allocation separate from the virtio device IDs, which are
+maintained as part of the virtio specification.
1af4:1000 network device
1af4:1001 block device
1af4:1002 balloon device
1af4:1003 console device
-
-1af4:1004 Reserved.
- to Contact Gerd Hoffmann <kraxel@redhat.com> to get a
-1af4:10ef device ID assigned for your new virtio device.
+1af4:1004 SCSI host bus adapter device
+1af4:1005 entropy generator device
1af4:10f0 Available for experimental usage without registration. Must get
to official ID when the code leaves the test lab (i.e. when seeking
1af4:10ff upstream merge or shipping a distro/product) to avoid conflicts.
+1af4:1100 Used as PCI Subsystem ID for existing hardware devices emulated
+ by qemu.
+
+All other device IDs are reserved.
--
1.7.12.1
^ permalink raw reply related [flat|nested] 16+ messages in thread
* [Qemu-devel] [PATCH 3/5] virtio-9p: use symbolic constant, add to pci-ids.txt
2012-11-19 10:21 [Qemu-devel] [PATCH 0/5] Improve consistency of pci-ids.txt, use symbolic constants for QEMU devices Paolo Bonzini
2012-11-19 10:21 ` [Qemu-devel] [PATCH 1/5] docs: move pci-ids.txt to docs/specs/ Paolo Bonzini
2012-11-19 10:21 ` [Qemu-devel] [PATCH 2/5] reorganize pci-ids.txt Paolo Bonzini
@ 2012-11-19 10:21 ` Paolo Bonzini
2012-11-19 10:21 ` [Qemu-devel] [PATCH 4/5] ivshmem: use symbolic constant for PCI ID, " Paolo Bonzini
` (3 subsequent siblings)
6 siblings, 0 replies; 16+ messages in thread
From: Paolo Bonzini @ 2012-11-19 10:21 UTC (permalink / raw)
To: qemu-devel; +Cc: kraxel, mst
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
---
docs/specs/pci-ids.txt | 1 +
hw/9pfs/virtio-9p-device.c | 2 +-
hw/pci.h | 1 +
3 file modificati, 3 inserzioni(+). 1 rimozione(-)
diff --git a/docs/specs/pci-ids.txt b/docs/specs/pci-ids.txt
index 445b293..28dcf90 100644
--- a/docs/specs/pci-ids.txt
+++ b/docs/specs/pci-ids.txt
@@ -20,6 +20,7 @@ maintained as part of the virtio specification.
1af4:1003 console device
1af4:1004 SCSI host bus adapter device
1af4:1005 entropy generator device
+1af4:1009 9p filesystem device
1af4:10f0 Available for experimental usage without registration. Must get
to official ID when the code leaves the test lab (i.e. when seeking
diff --git a/hw/9pfs/virtio-9p-device.c b/hw/9pfs/virtio-9p-device.c
index b8220ab..e338c46 100644
--- a/hw/9pfs/virtio-9p-device.c
+++ b/hw/9pfs/virtio-9p-device.c
@@ -170,7 +170,7 @@ static void virtio_9p_class_init(ObjectClass *klass, void *data)
k->init = virtio_9p_init_pci;
k->vendor_id = PCI_VENDOR_ID_REDHAT_QUMRANET;
- k->device_id = 0x1009;
+ k->device_id = PCI_DEVICE_ID_VIRTIO_9P;
k->revision = VIRTIO_PCI_ABI_VERSION;
k->class_id = 0x2;
dc->props = virtio_9p_properties;
diff --git a/hw/pci.h b/hw/pci.h
index 4da0c2a..0719521 100644
--- a/hw/pci.h
+++ b/hw/pci.h
@@ -77,6 +77,7 @@
#define PCI_DEVICE_ID_VIRTIO_CONSOLE 0x1003
#define PCI_DEVICE_ID_VIRTIO_SCSI 0x1004
#define PCI_DEVICE_ID_VIRTIO_RNG 0x1005
+#define PCI_DEVICE_ID_VIRTIO_9P 0x1009
#define FMT_PCIBUS PRIx64
--
1.7.12.1
^ permalink raw reply related [flat|nested] 16+ messages in thread
* [Qemu-devel] [PATCH 4/5] ivshmem: use symbolic constant for PCI ID, add to pci-ids.txt
2012-11-19 10:21 [Qemu-devel] [PATCH 0/5] Improve consistency of pci-ids.txt, use symbolic constants for QEMU devices Paolo Bonzini
` (2 preceding siblings ...)
2012-11-19 10:21 ` [Qemu-devel] [PATCH 3/5] virtio-9p: use symbolic constant, add to pci-ids.txt Paolo Bonzini
@ 2012-11-19 10:21 ` Paolo Bonzini
2012-12-12 14:22 ` Michael S. Tsirkin
2012-11-19 10:21 ` [Qemu-devel] [PATCH 5/5] pci: use constants for devices under the 1B36 device ID, document them Paolo Bonzini
` (2 subsequent siblings)
6 siblings, 1 reply; 16+ messages in thread
From: Paolo Bonzini @ 2012-11-19 10:21 UTC (permalink / raw)
To: qemu-devel; +Cc: kraxel, mst
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
---
docs/specs/pci-ids.txt | 2 ++
hw/ivshmem.c | 2 +-
hw/pci.h | 1 +
3 file modificati, 4 inserzioni(+). 1 rimozione(-)
diff --git a/docs/specs/pci-ids.txt b/docs/specs/pci-ids.txt
index 28dcf90..6b5cf42 100644
--- a/docs/specs/pci-ids.txt
+++ b/docs/specs/pci-ids.txt
@@ -29,4 +29,6 @@ maintained as part of the virtio specification.
1af4:1100 Used as PCI Subsystem ID for existing hardware devices emulated
by qemu.
+1af4:1110 ivshmem device (shared memory, docs/specs/ivshmem_device_spec.txt)
+
All other device IDs are reserved.
diff --git a/hw/ivshmem.c b/hw/ivshmem.c
index f6dbb21..8adeb2c 100644
--- a/hw/ivshmem.c
+++ b/hw/ivshmem.c
@@ -800,7 +800,7 @@ static void ivshmem_class_init(ObjectClass *klass, void *data)
k->init = pci_ivshmem_init;
k->exit = pci_ivshmem_uninit;
k->vendor_id = PCI_VENDOR_ID_REDHAT_QUMRANET;
- k->device_id = 0x1110;
+ k->device_id = PCI_DEVICE_ID_QUMRANET_IVSHMEM;
k->class_id = PCI_CLASS_MEMORY_RAM;
dc->reset = ivshmem_reset;
dc->props = ivshmem_properties;
diff --git a/hw/pci.h b/hw/pci.h
index 0719521..3704d5f 100644
--- a/hw/pci.h
+++ b/hw/pci.h
@@ -78,6 +78,7 @@
#define PCI_DEVICE_ID_VIRTIO_SCSI 0x1004
#define PCI_DEVICE_ID_VIRTIO_RNG 0x1005
#define PCI_DEVICE_ID_VIRTIO_9P 0x1009
+#define PCI_DEVICE_ID_QUMRANET_IVSHMEM 0x1110
#define FMT_PCIBUS PRIx64
--
1.7.12.1
^ permalink raw reply related [flat|nested] 16+ messages in thread
* Re: [Qemu-devel] [PATCH 4/5] ivshmem: use symbolic constant for PCI ID, add to pci-ids.txt
2012-11-19 10:21 ` [Qemu-devel] [PATCH 4/5] ivshmem: use symbolic constant for PCI ID, " Paolo Bonzini
@ 2012-12-12 14:22 ` Michael S. Tsirkin
2012-12-12 14:29 ` Paolo Bonzini
0 siblings, 1 reply; 16+ messages in thread
From: Michael S. Tsirkin @ 2012-12-12 14:22 UTC (permalink / raw)
To: Paolo Bonzini; +Cc: qemu-devel, kraxel
On Mon, Nov 19, 2012 at 11:21:33AM +0100, Paolo Bonzini wrote:
> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
> ---
> docs/specs/pci-ids.txt | 2 ++
> hw/ivshmem.c | 2 +-
> hw/pci.h | 1 +
> 3 file modificati, 4 inserzioni(+). 1 rimozione(-)
>
> diff --git a/docs/specs/pci-ids.txt b/docs/specs/pci-ids.txt
> index 28dcf90..6b5cf42 100644
> --- a/docs/specs/pci-ids.txt
> +++ b/docs/specs/pci-ids.txt
> @@ -29,4 +29,6 @@ maintained as part of the virtio specification.
> 1af4:1100 Used as PCI Subsystem ID for existing hardware devices emulated
> by qemu.
>
> +1af4:1110 ivshmem device (shared memory, docs/specs/ivshmem_device_spec.txt)
> +
> All other device IDs are reserved.
> diff --git a/hw/ivshmem.c b/hw/ivshmem.c
> index f6dbb21..8adeb2c 100644
> --- a/hw/ivshmem.c
> +++ b/hw/ivshmem.c
> @@ -800,7 +800,7 @@ static void ivshmem_class_init(ObjectClass *klass, void *data)
> k->init = pci_ivshmem_init;
> k->exit = pci_ivshmem_uninit;
> k->vendor_id = PCI_VENDOR_ID_REDHAT_QUMRANET;
> - k->device_id = 0x1110;
> + k->device_id = PCI_DEVICE_ID_QUMRANET_IVSHMEM;
> k->class_id = PCI_CLASS_MEMORY_RAM;
> dc->reset = ivshmem_reset;
> dc->props = ivshmem_properties;
> diff --git a/hw/pci.h b/hw/pci.h
> index 0719521..3704d5f 100644
> --- a/hw/pci.h
> +++ b/hw/pci.h
> @@ -78,6 +78,7 @@
> #define PCI_DEVICE_ID_VIRTIO_SCSI 0x1004
> #define PCI_DEVICE_ID_VIRTIO_RNG 0x1005
> #define PCI_DEVICE_ID_VIRTIO_9P 0x1009
> +#define PCI_DEVICE_ID_QUMRANET_IVSHMEM 0x1110
>
> #define FMT_PCIBUS PRIx64
Why _QUMRANET I wonder?
> --
> 1.7.12.1
>
^ permalink raw reply [flat|nested] 16+ messages in thread
* Re: [Qemu-devel] [PATCH 4/5] ivshmem: use symbolic constant for PCI ID, add to pci-ids.txt
2012-12-12 14:22 ` Michael S. Tsirkin
@ 2012-12-12 14:29 ` Paolo Bonzini
2012-12-12 14:48 ` Michael S. Tsirkin
0 siblings, 1 reply; 16+ messages in thread
From: Paolo Bonzini @ 2012-12-12 14:29 UTC (permalink / raw)
To: Michael S. Tsirkin; +Cc: qemu-devel, kraxel
Il 12/12/2012 15:22, Michael S. Tsirkin ha scritto:
>> > @@ -29,4 +29,6 @@ maintained as part of the virtio specification.
>> > 1af4:1100 Used as PCI Subsystem ID for existing hardware devices emulated
>> > by qemu.
>> >
>> > +1af4:1110 ivshmem device (shared memory, docs/specs/ivshmem_device_spec.txt)
>> > +
>> > All other device IDs are reserved.
>> > diff --git a/hw/ivshmem.c b/hw/ivshmem.c
>> > index f6dbb21..8adeb2c 100644
>> > --- a/hw/ivshmem.c
>> > +++ b/hw/ivshmem.c
>> > @@ -800,7 +800,7 @@ static void ivshmem_class_init(ObjectClass *klass, void *data)
>> > k->init = pci_ivshmem_init;
>> > k->exit = pci_ivshmem_uninit;
>> > k->vendor_id = PCI_VENDOR_ID_REDHAT_QUMRANET;
>> > - k->device_id = 0x1110;
>> > + k->device_id = PCI_DEVICE_ID_QUMRANET_IVSHMEM;
>> > k->class_id = PCI_CLASS_MEMORY_RAM;
>> > dc->reset = ivshmem_reset;
>> > dc->props = ivshmem_properties;
>> > diff --git a/hw/pci.h b/hw/pci.h
>> > index 0719521..3704d5f 100644
>> > --- a/hw/pci.h
>> > +++ b/hw/pci.h
>> > @@ -78,6 +78,7 @@
>> > #define PCI_DEVICE_ID_VIRTIO_SCSI 0x1004
>> > #define PCI_DEVICE_ID_VIRTIO_RNG 0x1005
>> > #define PCI_DEVICE_ID_VIRTIO_9P 0x1009
>> > +#define PCI_DEVICE_ID_QUMRANET_IVSHMEM 0x1110
>> >
>> > #define FMT_PCIBUS PRIx64
> Why _QUMRANET I wonder?
>
Because it's under 0x1af4 (PCI_VENDOR_ID_REDHAT_QUMRANET), not 0x1b36
(PCI_VENDOR_ID_REDHAT).
Paolo
^ permalink raw reply [flat|nested] 16+ messages in thread
* Re: [Qemu-devel] [PATCH 4/5] ivshmem: use symbolic constant for PCI ID, add to pci-ids.txt
2012-12-12 14:29 ` Paolo Bonzini
@ 2012-12-12 14:48 ` Michael S. Tsirkin
2012-12-12 14:51 ` Paolo Bonzini
0 siblings, 1 reply; 16+ messages in thread
From: Michael S. Tsirkin @ 2012-12-12 14:48 UTC (permalink / raw)
To: Paolo Bonzini; +Cc: qemu-devel, kraxel
On Wed, Dec 12, 2012 at 03:29:31PM +0100, Paolo Bonzini wrote:
> Il 12/12/2012 15:22, Michael S. Tsirkin ha scritto:
> >> > @@ -29,4 +29,6 @@ maintained as part of the virtio specification.
> >> > 1af4:1100 Used as PCI Subsystem ID for existing hardware devices emulated
> >> > by qemu.
> >> >
> >> > +1af4:1110 ivshmem device (shared memory, docs/specs/ivshmem_device_spec.txt)
> >> > +
> >> > All other device IDs are reserved.
> >> > diff --git a/hw/ivshmem.c b/hw/ivshmem.c
> >> > index f6dbb21..8adeb2c 100644
> >> > --- a/hw/ivshmem.c
> >> > +++ b/hw/ivshmem.c
> >> > @@ -800,7 +800,7 @@ static void ivshmem_class_init(ObjectClass *klass, void *data)
> >> > k->init = pci_ivshmem_init;
> >> > k->exit = pci_ivshmem_uninit;
> >> > k->vendor_id = PCI_VENDOR_ID_REDHAT_QUMRANET;
> >> > - k->device_id = 0x1110;
> >> > + k->device_id = PCI_DEVICE_ID_QUMRANET_IVSHMEM;
> >> > k->class_id = PCI_CLASS_MEMORY_RAM;
> >> > dc->reset = ivshmem_reset;
> >> > dc->props = ivshmem_properties;
> >> > diff --git a/hw/pci.h b/hw/pci.h
> >> > index 0719521..3704d5f 100644
> >> > --- a/hw/pci.h
> >> > +++ b/hw/pci.h
> >> > @@ -78,6 +78,7 @@
> >> > #define PCI_DEVICE_ID_VIRTIO_SCSI 0x1004
> >> > #define PCI_DEVICE_ID_VIRTIO_RNG 0x1005
> >> > #define PCI_DEVICE_ID_VIRTIO_9P 0x1009
> >> > +#define PCI_DEVICE_ID_QUMRANET_IVSHMEM 0x1110
> >> >
> >> > #define FMT_PCIBUS PRIx64
> > Why _QUMRANET I wonder?
> >
>
> Because it's under 0x1af4 (PCI_VENDOR_ID_REDHAT_QUMRANET), not 0x1b36
> (PCI_VENDOR_ID_REDHAT).
>
> Paolo
Yes but so are all virtio devices are they not?
^ permalink raw reply [flat|nested] 16+ messages in thread
* Re: [Qemu-devel] [PATCH 4/5] ivshmem: use symbolic constant for PCI ID, add to pci-ids.txt
2012-12-12 14:48 ` Michael S. Tsirkin
@ 2012-12-12 14:51 ` Paolo Bonzini
2012-12-12 15:21 ` Michael S. Tsirkin
0 siblings, 1 reply; 16+ messages in thread
From: Paolo Bonzini @ 2012-12-12 14:51 UTC (permalink / raw)
To: Michael S. Tsirkin; +Cc: qemu-devel, kraxel
Il 12/12/2012 15:48, Michael S. Tsirkin ha scritto:
>>>>> > >> > diff --git a/hw/pci.h b/hw/pci.h
>>>>> > >> > index 0719521..3704d5f 100644
>>>>> > >> > --- a/hw/pci.h
>>>>> > >> > +++ b/hw/pci.h
>>>>> > >> > @@ -78,6 +78,7 @@
>>>>> > >> > #define PCI_DEVICE_ID_VIRTIO_SCSI 0x1004
>>>>> > >> > #define PCI_DEVICE_ID_VIRTIO_RNG 0x1005
>>>>> > >> > #define PCI_DEVICE_ID_VIRTIO_9P 0x1009
>>>>> > >> > +#define PCI_DEVICE_ID_QUMRANET_IVSHMEM 0x1110
>>>>> > >> >
>>>>> > >> > #define FMT_PCIBUS PRIx64
>>> > > Why _QUMRANET I wonder?
>>> > >
>> >
>> > Because it's under 0x1af4 (PCI_VENDOR_ID_REDHAT_QUMRANET), not 0x1b36
>> > (PCI_VENDOR_ID_REDHAT).
>
> Yes but so are all virtio devices are they not?
All device IDs start with PCI_DEVICE_ID_<vendor>. virtio devices are
the exception for some historical reason I don't know.
PCI_DEVICE_ID_VIRTIO_IVSHMEM is wrong, and PCI_DEVICE_ID_IVSHMEM is
unspecific. PCI_DEVICE_ID_QEMU_IVSHMEM is wrong because the QEMU vendor
id is 0x1234.
So either it stays Qumranet, or the 0x1234 vendor id is renamed to
PCI_VENDOR_ID_BOCHS and 0x1af4 becomes PCI_VENDOR_ID_REDHAT_QEMU.
Either is fine for me, but I wanted to minimize the churn.
Paolo
^ permalink raw reply [flat|nested] 16+ messages in thread
* Re: [Qemu-devel] [PATCH 4/5] ivshmem: use symbolic constant for PCI ID, add to pci-ids.txt
2012-12-12 14:51 ` Paolo Bonzini
@ 2012-12-12 15:21 ` Michael S. Tsirkin
2012-12-12 15:24 ` Paolo Bonzini
0 siblings, 1 reply; 16+ messages in thread
From: Michael S. Tsirkin @ 2012-12-12 15:21 UTC (permalink / raw)
To: Paolo Bonzini; +Cc: qemu-devel, kraxel
On Wed, Dec 12, 2012 at 03:51:16PM +0100, Paolo Bonzini wrote:
> Il 12/12/2012 15:48, Michael S. Tsirkin ha scritto:
> >>>>> > >> > diff --git a/hw/pci.h b/hw/pci.h
> >>>>> > >> > index 0719521..3704d5f 100644
> >>>>> > >> > --- a/hw/pci.h
> >>>>> > >> > +++ b/hw/pci.h
> >>>>> > >> > @@ -78,6 +78,7 @@
> >>>>> > >> > #define PCI_DEVICE_ID_VIRTIO_SCSI 0x1004
> >>>>> > >> > #define PCI_DEVICE_ID_VIRTIO_RNG 0x1005
> >>>>> > >> > #define PCI_DEVICE_ID_VIRTIO_9P 0x1009
> >>>>> > >> > +#define PCI_DEVICE_ID_QUMRANET_IVSHMEM 0x1110
> >>>>> > >> >
> >>>>> > >> > #define FMT_PCIBUS PRIx64
> >>> > > Why _QUMRANET I wonder?
> >>> > >
> >> >
> >> > Because it's under 0x1af4 (PCI_VENDOR_ID_REDHAT_QUMRANET), not 0x1b36
> >> > (PCI_VENDOR_ID_REDHAT).
> >
> > Yes but so are all virtio devices are they not?
>
> All device IDs start with PCI_DEVICE_ID_<vendor>. virtio devices are
> the exception for some historical reason I don't know.
> PCI_DEVICE_ID_VIRTIO_IVSHMEM is wrong, and PCI_DEVICE_ID_IVSHMEM is
> unspecific. PCI_DEVICE_ID_QEMU_IVSHMEM is wrong because the QEMU vendor
> id is 0x1234.
>
> So either it stays Qumranet, or the 0x1234 vendor id is renamed to
> PCI_VENDOR_ID_BOCHS and 0x1af4 becomes PCI_VENDOR_ID_REDHAT_QEMU.
> Either is fine for me, but I wanted to minimize the churn.
>
> Paolo
Thinking about it some more, I'd rather move this stuff
out of pci.h
For virtio, there's actually linux/virtio_ids.h
which defines VIRTIO_ID_NET etc. We should add that,
and have virtio just use it.
Doesn't ivshmem have a linux driver?
When it lands upstream we'll be able to add it to pci_ids.h
meanwhile keeping a number in device .c seems fine as well.
I will do the virtio change I think - meanwhile
could you limit this patch to just the .txt change please?
--
MST
^ permalink raw reply [flat|nested] 16+ messages in thread
* Re: [Qemu-devel] [PATCH 4/5] ivshmem: use symbolic constant for PCI ID, add to pci-ids.txt
2012-12-12 15:21 ` Michael S. Tsirkin
@ 2012-12-12 15:24 ` Paolo Bonzini
2012-12-12 15:35 ` Michael S. Tsirkin
0 siblings, 1 reply; 16+ messages in thread
From: Paolo Bonzini @ 2012-12-12 15:24 UTC (permalink / raw)
To: Michael S. Tsirkin; +Cc: qemu-devel, kraxel
Il 12/12/2012 16:21, Michael S. Tsirkin ha scritto:
> Thinking about it some more, I'd rather move this stuff
> out of pci.h
>
> For virtio, there's actually linux/virtio_ids.h
> which defines VIRTIO_ID_NET etc. We should add that,
> and have virtio just use it.
>
> Doesn't ivshmem have a linux driver?
No, you use it with mmap of sysfs files. The doorbell feature requires uio.
> When it lands upstream we'll be able to add it to pci_ids.h
> meanwhile keeping a number in device .c seems fine as well.
I think the point was to avoid conflicts, but as long as docs/specs/ is
kept in sync that's fine.
> I will do the virtio change I think - meanwhile
> could you limit this patch to just the .txt change please?
Ok, will resend.
Paolo
^ permalink raw reply [flat|nested] 16+ messages in thread
* Re: [Qemu-devel] [PATCH 4/5] ivshmem: use symbolic constant for PCI ID, add to pci-ids.txt
2012-12-12 15:24 ` Paolo Bonzini
@ 2012-12-12 15:35 ` Michael S. Tsirkin
0 siblings, 0 replies; 16+ messages in thread
From: Michael S. Tsirkin @ 2012-12-12 15:35 UTC (permalink / raw)
To: Paolo Bonzini; +Cc: qemu-devel, kraxel
On Wed, Dec 12, 2012 at 04:24:26PM +0100, Paolo Bonzini wrote:
> Il 12/12/2012 16:21, Michael S. Tsirkin ha scritto:
> > Thinking about it some more, I'd rather move this stuff
> > out of pci.h
> >
> > For virtio, there's actually linux/virtio_ids.h
> > which defines VIRTIO_ID_NET etc. We should add that,
> > and have virtio just use it.
> >
> > Doesn't ivshmem have a linux driver?
>
> No, you use it with mmap of sysfs files. The doorbell feature requires uio.
>
> > When it lands upstream we'll be able to add it to pci_ids.h
> > meanwhile keeping a number in device .c seems fine as well.
>
> I think the point was to avoid conflicts, but as long as docs/specs/ is
> kept in sync that's fine.
Right. We are not the final authority on device/vendor IDs anyway -
I am more worried about using the correct IDs for emulated devices.
> > I will do the virtio change I think - meanwhile
> > could you limit this patch to just the .txt change please?
>
> Ok, will resend.
>
> Paolo
^ permalink raw reply [flat|nested] 16+ messages in thread
* [Qemu-devel] [PATCH 5/5] pci: use constants for devices under the 1B36 device ID, document them
2012-11-19 10:21 [Qemu-devel] [PATCH 0/5] Improve consistency of pci-ids.txt, use symbolic constants for QEMU devices Paolo Bonzini
` (3 preceding siblings ...)
2012-11-19 10:21 ` [Qemu-devel] [PATCH 4/5] ivshmem: use symbolic constant for PCI ID, " Paolo Bonzini
@ 2012-11-19 10:21 ` Paolo Bonzini
2012-11-19 10:45 ` [Qemu-devel] [PATCH 0/5] Improve consistency of pci-ids.txt, use symbolic constants for QEMU devices Gerd Hoffmann
2012-12-12 13:54 ` Paolo Bonzini
6 siblings, 0 replies; 16+ messages in thread
From: Paolo Bonzini @ 2012-11-19 10:21 UTC (permalink / raw)
To: qemu-devel; +Cc: kraxel, mst
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
---
docs/specs/pci-ids.txt | 15 +++++++++++++++
hw/pci.h | 7 +++++++
hw/pci_bridge_dev.c | 8 ++------
hw/serial-pci.c | 12 ++++++------
4 file modificati, 30 inserzioni(+), 12 rimozioni(-)
diff --git a/docs/specs/pci-ids.txt b/docs/specs/pci-ids.txt
index 6b5cf42..2f4a557 100644
--- a/docs/specs/pci-ids.txt
+++ b/docs/specs/pci-ids.txt
@@ -32,3 +32,18 @@ maintained as part of the virtio specification.
1af4:1110 ivshmem device (shared memory, docs/specs/ivshmem_device_spec.txt)
All other device IDs are reserved.
+
+1b36 vendor ID
+--------------
+
+The 0000 -> 00ff device ID range is used as follows for QEMU-specific
+PCI devices (other than virtio):
+
+1b36:0001 PCI-PCI bridge
+1b36:0002 PCI serial port (16550A) adapter (docs/specs/pci-serial.txt)
+1b36:0003 PCI Dual-port 16550A adapter (docs/specs/pci-serial.txt)
+1b36:0004 PCI Quad-port 16550A adapter (docs/specs/pci-serial.txt)
+
+All these devices are documented in docs/specs.
+
+The 0100 device ID is used for the QXL video card device.
+
+All other device IDs are reserved.
diff --git a/hw/pci.h b/hw/pci.h
index 3704d5f..9344842 100644
--- a/hw/pci.h
+++ b/hw/pci.h
@@ -80,6 +80,13 @@
#define PCI_DEVICE_ID_VIRTIO_9P 0x1009
#define PCI_DEVICE_ID_QUMRANET_IVSHMEM 0x1110
+#define PCI_VENDOR_ID_REDHAT 0x1b36
+#define PCI_DEVICE_ID_REDHAT_BRIDGE 0x0001
+#define PCI_DEVICE_ID_REDHAT_SERIAL 0x0002
+#define PCI_DEVICE_ID_REDHAT_SERIAL2 0x0003
+#define PCI_DEVICE_ID_REDHAT_SERIAL4 0x0004
+#define PCI_DEVICE_ID_REDHAT_QXL 0x0100
+
#define FMT_PCIBUS PRIx64
typedef void PCIConfigWriteFunc(PCIDevice *pci_dev,
diff --git a/hw/pci_bridge_dev.c b/hw/pci_bridge_dev.c
index f706396..d72bd3d 100644
--- a/hw/pci_bridge_dev.c
+++ b/hw/pci_bridge_dev.c
@@ -27,10 +27,6 @@
#include "memory.h"
#include "pci_internals.h"
-#define REDHAT_PCI_VENDOR_ID 0x1b36
-#define PCI_BRIDGE_DEV_VENDOR_ID REDHAT_PCI_VENDOR_ID
-#define PCI_BRIDGE_DEV_DEVICE_ID 0x1
-
struct PCIBridgeDev {
PCIBridge bridge;
MemoryRegion bar;
@@ -146,8 +142,8 @@ static void pci_bridge_dev_class_init(ObjectClass *klass, void *data)
k->init = pci_bridge_dev_initfn;
k->exit = pci_bridge_dev_exitfn;
k->config_write = pci_bridge_dev_write_config;
- k->vendor_id = PCI_BRIDGE_DEV_VENDOR_ID;
- k->device_id = PCI_BRIDGE_DEV_DEVICE_ID;
+ k->vendor_id = PCI_VENDOR_ID_REDHAT;
+ k->device_id = PCI_DEVICE_ID_REDHAT_BRIDGE;
k->class_id = PCI_CLASS_BRIDGE_PCI;
k->is_bridge = 1,
dc->desc = "Standard PCI Bridge";
diff --git a/hw/serial-pci.c b/hw/serial-pci.c
index 95dc5c8..f7be5fd 100644
--- a/hw/serial-pci.c
+++ b/hw/serial-pci.c
@@ -185,8 +185,8 @@ static void serial_pci_class_initfn(ObjectClass *klass, void *data)
PCIDeviceClass *pc = PCI_DEVICE_CLASS(klass);
pc->init = serial_pci_init;
pc->exit = serial_pci_exit;
- pc->vendor_id = 0x1b36; /* Red Hat */
- pc->device_id = 0x0002;
+ pc->vendor_id = PCI_VENDOR_ID_REDHAT;
+ pc->device_id = PCI_DEVICE_ID_REDHAT_SERIAL;
pc->revision = 1;
pc->class_id = PCI_CLASS_COMMUNICATION_SERIAL;
dc->vmsd = &vmstate_pci_serial;
@@ -199,8 +199,8 @@ static void multi_2x_serial_pci_class_initfn(ObjectClass *klass, void *data)
PCIDeviceClass *pc = PCI_DEVICE_CLASS(klass);
pc->init = multi_serial_pci_init;
pc->exit = multi_serial_pci_exit;
- pc->vendor_id = 0x1b36; /* Red Hat */
- pc->device_id = 0x0003;
+ pc->vendor_id = PCI_VENDOR_ID_REDHAT;
+ pc->device_id = PCI_DEVICE_ID_REDHAT_SERIAL2;
pc->revision = 1;
pc->class_id = PCI_CLASS_COMMUNICATION_SERIAL;
dc->vmsd = &vmstate_pci_multi_serial;
@@ -213,8 +213,8 @@ static void multi_4x_serial_pci_class_initfn(ObjectClass *klass, void *data)
PCIDeviceClass *pc = PCI_DEVICE_CLASS(klass);
pc->init = multi_serial_pci_init;
pc->exit = multi_serial_pci_exit;
- pc->vendor_id = 0x1b36; /* Red Hat */
- pc->device_id = 0x0004;
+ pc->vendor_id = PCI_VENDOR_ID_REDHAT;
+ pc->device_id = PCI_DEVICE_ID_REDHAT_SERIAL4;
pc->revision = 1;
pc->class_id = PCI_CLASS_COMMUNICATION_SERIAL;
dc->vmsd = &vmstate_pci_multi_serial;
--
1.7.12.1
^ permalink raw reply related [flat|nested] 16+ messages in thread
* Re: [Qemu-devel] [PATCH 0/5] Improve consistency of pci-ids.txt, use symbolic constants for QEMU devices
2012-11-19 10:21 [Qemu-devel] [PATCH 0/5] Improve consistency of pci-ids.txt, use symbolic constants for QEMU devices Paolo Bonzini
` (4 preceding siblings ...)
2012-11-19 10:21 ` [Qemu-devel] [PATCH 5/5] pci: use constants for devices under the 1B36 device ID, document them Paolo Bonzini
@ 2012-11-19 10:45 ` Gerd Hoffmann
2012-12-12 13:54 ` Paolo Bonzini
6 siblings, 0 replies; 16+ messages in thread
From: Gerd Hoffmann @ 2012-11-19 10:45 UTC (permalink / raw)
To: Paolo Bonzini; +Cc: qemu-devel, mst
On 11/19/12 11:21, Paolo Bonzini wrote:
> Five small, boring patches. Inspired by Gerd's patch at
> http://lists.gnu.org/archive/html/qemu-devel/2012-10/msg05229.html which
> unfortunately is already out of date.
Thanks for picking this up, series looks good.
cheers,
Gerd
^ permalink raw reply [flat|nested] 16+ messages in thread
* Re: [Qemu-devel] [PATCH 0/5] Improve consistency of pci-ids.txt, use symbolic constants for QEMU devices
2012-11-19 10:21 [Qemu-devel] [PATCH 0/5] Improve consistency of pci-ids.txt, use symbolic constants for QEMU devices Paolo Bonzini
` (5 preceding siblings ...)
2012-11-19 10:45 ` [Qemu-devel] [PATCH 0/5] Improve consistency of pci-ids.txt, use symbolic constants for QEMU devices Gerd Hoffmann
@ 2012-12-12 13:54 ` Paolo Bonzini
2012-12-12 14:22 ` Michael S. Tsirkin
6 siblings, 1 reply; 16+ messages in thread
From: Paolo Bonzini @ 2012-12-12 13:54 UTC (permalink / raw)
Cc: mst, qemu-devel, kraxel
Il 19/11/2012 11:21, Paolo Bonzini ha scritto:
> Five small, boring patches. Inspired by Gerd's patch at
> http://lists.gnu.org/archive/html/qemu-devel/2012-10/msg05229.html which
> unfortunately is already out of date.
>
> Paolo Bonzini (5):
> docs: move pci-ids.txt to docs/specs/
> reorganize pci-ids.txt
> virtio-9p: use symbolic constant, add to pci-ids.txt
> ivshmem: use symbolic constant for PCI ID, add to pci-ids.txt
> pci: use constants for devices under the 1B36 device ID, document them
>
> docs/specs/pci-ids.txt | 49 ++++++++++++++++++++++++++++++++++++++++++++++
> hw/9pfs/virtio-9p-device.c | 2 +-
> hw/ivshmem.c | 2 +-
> hw/pci.h | 9 +++++++++
> hw/pci_bridge_dev.c | 8 ++------
> hw/serial-pci.c | 12 ++++++------
> pci-ids.txt | 31 -----------------------------
> 7 file modificati, 68 inserzioni(+), 45 rimozioni(-)
> create mode 100644 docs/specs/pci-ids.txt
> delete mode 100644 pci-ids.txt
>
Ping?
Paolo
^ permalink raw reply [flat|nested] 16+ messages in thread
* Re: [Qemu-devel] [PATCH 0/5] Improve consistency of pci-ids.txt, use symbolic constants for QEMU devices
2012-12-12 13:54 ` Paolo Bonzini
@ 2012-12-12 14:22 ` Michael S. Tsirkin
0 siblings, 0 replies; 16+ messages in thread
From: Michael S. Tsirkin @ 2012-12-12 14:22 UTC (permalink / raw)
To: Paolo Bonzini; +Cc: qemu-devel, kraxel
On Wed, Dec 12, 2012 at 02:54:31PM +0100, Paolo Bonzini wrote:
> Il 19/11/2012 11:21, Paolo Bonzini ha scritto:
> > Five small, boring patches. Inspired by Gerd's patch at
> > http://lists.gnu.org/archive/html/qemu-devel/2012-10/msg05229.html which
> > unfortunately is already out of date.
> >
> > Paolo Bonzini (5):
> > docs: move pci-ids.txt to docs/specs/
> > reorganize pci-ids.txt
> > virtio-9p: use symbolic constant, add to pci-ids.txt
> > ivshmem: use symbolic constant for PCI ID, add to pci-ids.txt
> > pci: use constants for devices under the 1B36 device ID, document them
> >
> > docs/specs/pci-ids.txt | 49 ++++++++++++++++++++++++++++++++++++++++++++++
> > hw/9pfs/virtio-9p-device.c | 2 +-
> > hw/ivshmem.c | 2 +-
> > hw/pci.h | 9 +++++++++
> > hw/pci_bridge_dev.c | 8 ++------
> > hw/serial-pci.c | 12 ++++++------
> > pci-ids.txt | 31 -----------------------------
> > 7 file modificati, 68 inserzioni(+), 45 rimozioni(-)
> > create mode 100644 docs/specs/pci-ids.txt
> > delete mode 100644 pci-ids.txt
> >
>
> Ping?
>
> Paolo
Sent one question otherwise looks fine to me.
^ permalink raw reply [flat|nested] 16+ messages in thread