ACPI spec 5.0 allows the use of PCI vendor IDs. Since we have one for virtio, it seems neater to use that rather than LNRO. For the device ID, use 103F which is a legacy ID that isn't used in virtio PCI spec - seems to make sense since virtio-mmio is a legacy device but we don't know the correct device type. Guests should probably match everything in the range 1000-103F (just like legacy pci drivers do) which will allow us to pass in the actual ID in the future if we want to. Signed-off-by: Michael S. Tsirkin <mst at redhat.com> --- hw/arm/virt-acpi-build.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/hw/arm/virt-acpi-build.c b/hw/arm/virt-acpi-build.c index f365140..dea61ba 100644 --- a/hw/arm/virt-acpi-build.c +++ b/hw/arm/virt-acpi-build.c @@ -145,7 +145,7 @@ static void acpi_dsdt_add_virtio(Aml *scope, for (i = 0; i < num; i++) { Aml *dev = aml_device("VR%02u", i); - aml_append(dev, aml_name_decl("_HID", aml_string("LNRO0005"))); + aml_append(dev, aml_name_decl("_HID", aml_string("1AF4103F"))); aml_append(dev, aml_name_decl("_UID", aml_int(i))); Aml *crs = aml_resource_template(); -- MST
Shannon Zhao
2015-Jul-30 01:23 UTC
[Qemu-devel] [PATCH v2] arm: change vendor ID for virtio-mmio
On 2015/7/30 3:16, Michael S. Tsirkin wrote:> ACPI spec 5.0 allows the use of PCI vendor IDs. >But virtio-mmio is not a PCI device, it's a platform device. Why do we drop the previous way using "QEMUXXXX"? Something I missed?> Since we have one for virtio, it seems neater to use that > rather than LNRO. For the device ID, use 103F which is a legacy ID that > isn't used in virtio PCI spec - seems to make sense since virtio-mmio is > a legacy device but we don't know the correct device type. > > Guests should probably match everything in the range 1000-103F > (just like legacy pci drivers do) which will allow us to pass in the > actual ID in the future if we want to. > > Signed-off-by: Michael S. Tsirkin <mst at redhat.com> > --- > hw/arm/virt-acpi-build.c | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > diff --git a/hw/arm/virt-acpi-build.c b/hw/arm/virt-acpi-build.c > index f365140..dea61ba 100644 > --- a/hw/arm/virt-acpi-build.c > +++ b/hw/arm/virt-acpi-build.c > @@ -145,7 +145,7 @@ static void acpi_dsdt_add_virtio(Aml *scope, > > for (i = 0; i < num; i++) { > Aml *dev = aml_device("VR%02u", i); > - aml_append(dev, aml_name_decl("_HID", aml_string("LNRO0005"))); > + aml_append(dev, aml_name_decl("_HID", aml_string("1AF4103F"))); > aml_append(dev, aml_name_decl("_UID", aml_int(i))); > > Aml *crs = aml_resource_template(); >-- Shannon
Michael S. Tsirkin
2015-Jul-30 08:04 UTC
[Qemu-devel] [PATCH v2] arm: change vendor ID for virtio-mmio
On Thu, Jul 30, 2015 at 09:23:20AM +0800, Shannon Zhao wrote:> > > On 2015/7/30 3:16, Michael S. Tsirkin wrote: > > ACPI spec 5.0 allows the use of PCI vendor IDs. > > > But virtio-mmio is not a PCI device, it's a platform device.Yes. ACPI spec 5.0 says: A valid PNP ID must be of the form "AAA####" where A is an uppercase letter and # is a hex digit. A valid ACPI ID must be of the form "NNNN####" where N is an uppercase letter or a digit ('0'-'9') and # is a hex digit. This specification reserves the string "ACPI" for use only with devices defined herein. It further reserves all strings representing 4 HEX digits for exclusive use with PCI-assigned Vendor IDs. The second paragraph means if PCI SIG assigned you an ID, you can use that without need to register it with ASWG.> Why do we drop the previous way using "QEMUXXXX"? Something I missed?So that guests that bind to this interface will work fine with non QEMU implementations of virtio-mmio. It's just playing nice with others. We could have done something similar to pvpanic as well, except we didn't and guests using the QEMU prefix have been released, so we have to keep using that.> > Since we have one for virtio, it seems neater to use that > > rather than LNRO. For the device ID, use 103F which is a legacy ID that > > isn't used in virtio PCI spec - seems to make sense since virtio-mmio is > > a legacy device but we don't know the correct device type. > > > > Guests should probably match everything in the range 1000-103F > > (just like legacy pci drivers do) which will allow us to pass in the > > actual ID in the future if we want to. > > > > Signed-off-by: Michael S. Tsirkin <mst at redhat.com> > > --- > > hw/arm/virt-acpi-build.c | 2 +- > > 1 file changed, 1 insertion(+), 1 deletion(-) > > > > diff --git a/hw/arm/virt-acpi-build.c b/hw/arm/virt-acpi-build.c > > index f365140..dea61ba 100644 > > --- a/hw/arm/virt-acpi-build.c > > +++ b/hw/arm/virt-acpi-build.c > > @@ -145,7 +145,7 @@ static void acpi_dsdt_add_virtio(Aml *scope, > > > > for (i = 0; i < num; i++) { > > Aml *dev = aml_device("VR%02u", i); > > - aml_append(dev, aml_name_decl("_HID", aml_string("LNRO0005"))); > > + aml_append(dev, aml_name_decl("_HID", aml_string("1AF4103F"))); > > aml_append(dev, aml_name_decl("_UID", aml_int(i))); > > > > Aml *crs = aml_resource_template(); > > > > -- > Shannon
On 29 July 2015 at 20:16, Michael S. Tsirkin <mst at redhat.com> wrote:> ACPI spec 5.0 allows the use of PCI vendor IDs. > > Since we have one for virtio, it seems neater to use that > rather than LNRO. For the device ID, use 103F which is a legacy ID that > isn't used in virtio PCI spec - seems to make sense since virtio-mmio is > a legacy device but we don't know the correct device type. > > Guests should probably match everything in the range 1000-103F > (just like legacy pci drivers do) which will allow us to pass in the > actual ID in the future if we want to. > > Signed-off-by: Michael S. Tsirkin <mst at redhat.com> > --- > hw/arm/virt-acpi-build.c | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > diff --git a/hw/arm/virt-acpi-build.c b/hw/arm/virt-acpi-build.c > index f365140..dea61ba 100644 > --- a/hw/arm/virt-acpi-build.c > +++ b/hw/arm/virt-acpi-build.c > @@ -145,7 +145,7 @@ static void acpi_dsdt_add_virtio(Aml *scope, > > for (i = 0; i < num; i++) { > Aml *dev = aml_device("VR%02u", i); > - aml_append(dev, aml_name_decl("_HID", aml_string("LNRO0005"))); > + aml_append(dev, aml_name_decl("_HID", aml_string("1AF4103F"))); > aml_append(dev, aml_name_decl("_UID", aml_int(i)));So, I've just checked, and I believe that the kernel that RedHat are shipping in their RHEL7 dev preview for AArch64 (and probably thus also the Fedora/Centos one) includes a patch which adds ACPI support to the virtio-mmio driver using the LNRO0005 ID string. This to me suggests that we should just stick with that ID, rather than changing to QEMUxxxx, the hex one based on the PCI vendor ID, or anything else. We're obviously under no obligation to make life easy for people who ship kernels full of patches that haven't gone upstream yet, but in this case there doesn't seem to me to be any benefit to QEMU from picking an ID string that would break compatibility... [The kernel I checked was the one in https://git.centos.org/sources/kernel-aarch64/c7-aarch64/c589ab77889df6d93dbe817c373080631ab3275b which despite the filename is actually an 80MB .tar.xz archive, as pointed to by https://git.centos.org/blob/rpms!kernel-aarch64/910dbce5f13419d68002f58e67ee6e762a93a425/.kernel-aarch64.metadata ] thanks -- PMM
Andrew Jones
2015-Aug-03 12:09 UTC
[Qemu-devel] [PATCH v2] arm: change vendor ID for virtio-mmio
On Fri, Jul 31, 2015 at 01:37:44PM +0100, Peter Maydell wrote:> On 29 July 2015 at 20:16, Michael S. Tsirkin <mst at redhat.com> wrote: > > ACPI spec 5.0 allows the use of PCI vendor IDs. > > > > Since we have one for virtio, it seems neater to use that > > rather than LNRO. For the device ID, use 103F which is a legacy ID that > > isn't used in virtio PCI spec - seems to make sense since virtio-mmio is > > a legacy device but we don't know the correct device type. > > > > Guests should probably match everything in the range 1000-103F > > (just like legacy pci drivers do) which will allow us to pass in the > > actual ID in the future if we want to. > > > > Signed-off-by: Michael S. Tsirkin <mst at redhat.com> > > --- > > hw/arm/virt-acpi-build.c | 2 +- > > 1 file changed, 1 insertion(+), 1 deletion(-) > > > > diff --git a/hw/arm/virt-acpi-build.c b/hw/arm/virt-acpi-build.c > > index f365140..dea61ba 100644 > > --- a/hw/arm/virt-acpi-build.c > > +++ b/hw/arm/virt-acpi-build.c > > @@ -145,7 +145,7 @@ static void acpi_dsdt_add_virtio(Aml *scope, > > > > for (i = 0; i < num; i++) { > > Aml *dev = aml_device("VR%02u", i); > > - aml_append(dev, aml_name_decl("_HID", aml_string("LNRO0005"))); > > + aml_append(dev, aml_name_decl("_HID", aml_string("1AF4103F"))); > > aml_append(dev, aml_name_decl("_UID", aml_int(i))); > > So, I've just checked, and I believe that the kernel that RedHat > are shipping in their RHEL7 dev preview for AArch64 (and probably > thus also the Fedora/Centos one) includes a patch which adds > ACPI support to the virtio-mmio driver using the LNRO0005 ID string.Yes, we have https://lkml.org/lkml/2015/7/28/216 in the RHELSA kernel. Although, while that kernel is floating around already, it hasn't really been released, particularly not for virt use cases. So we could change it (although that change needs to be soon).> > This to me suggests that we should just stick with that ID, > rather than changing to QEMUxxxx, the hex one based on the PCI > vendor ID, or anything else. > > We're obviously under no obligation to make life easy for people > who ship kernels full of patches that haven't gone upstream yet, > but in this case there doesn't seem to me to be any benefit to > QEMU from picking an ID string that would break compatibility...I'll remain abstained on this debate, but if the consensus is to change it, then let me know, and I'll handle the changes on the RHELSA side. Thanks, drew> > [The kernel I checked was the one in > https://git.centos.org/sources/kernel-aarch64/c7-aarch64/c589ab77889df6d93dbe817c373080631ab3275b > which despite the filename is actually an 80MB .tar.xz archive, > as pointed to by > https://git.centos.org/blob/rpms!kernel-aarch64/910dbce5f13419d68002f58e67ee6e762a93a425/.kernel-aarch64.metadata > ] > > thanks > -- PMM >
Reasonably Related Threads
- [PATCH v2] arm: change vendor ID for virtio-mmio
- [Qemu-devel] [PATCH v2] arm: change vendor ID for virtio-mmio
- [Qemu-devel] [PATCH v2] arm: change vendor ID for virtio-mmio
- [Qemu-devel] [PATCH v2] arm: change vendor ID for virtio-mmio
- [PATCH] virtio_mmio: add ACPI probing