Skip to content

Commit

Permalink
Merge tag 'for_upstream' of https://git.kernel.org/pub/scm/virt/kvm/m…
Browse files Browse the repository at this point in the history
…st/qemu into staging

pc,virtio: regression, test fixes

fixes regressions:
    virtio error message triggered by seabios
    failure in vhost due to VIRTIO_F_RING_RESET
    broken keyboard under seabios

some biosbits test fixes

there's still a known regression with migration and vsock,
not fixed yet.

Signed-off-by: Michael S. Tsirkin <mst@redhat.com>

# -----BEGIN PGP SIGNATURE-----
#
# iQFDBAABCAAtFiEEXQn9CHHI+FuUyooNKB8NuNKNVGkFAmN8os4PHG1zdEByZWRo
# YXQuY29tAAoJECgfDbjSjVRpw+UH/2JOoxqzkkq4QyV5PzmjsiyyMbrBqFSOTro2
# 98k9MwxNWHIk6fi3FVIz+LX1EdwDbMl44IHQ88xo7k39V7ThvVvLfjaQySSeoCfE
# 04++AvkOQ/O8W7sob17r2iPWIHKPIndq8uB652T89o1I/nhmFMsUkdRWmVQ3XsDk
# DnPZxjBQnKY0oSvBd7SmSI3C+eA4lF1tht50ZxmOshLx4OSjK/maFVpIyLsUGTMn
# 6OMxKffDjfvw5z94+pGN1RQm9xu7OwtFZyUnH16xoQUmWSXjzcYXUZ3buTY+eAyJ
# I5j9ox27Cqn1wGcypUiTCKLIExEMBfvNY4ovyRa1xvW+MXluVyE=
# =bF2U
# -----END PGP SIGNATURE-----
# gpg: Signature made Tue 22 Nov 2022 05:22:06 EST
# gpg:                using RSA key 5D09FD0871C8F85B94CA8A0D281F0DB8D28D5469
# gpg:                issuer "mst@redhat.com"
# gpg: Good signature from "Michael S. Tsirkin <mst@kernel.org>" [full]
# gpg:                 aka "Michael S. Tsirkin <mst@redhat.com>" [full]
# Primary key fingerprint: 0270 606B 6F3C DF3D 0B17  0970 C350 3912 AFBE 8E67
#      Subkey fingerprint: 5D09 FD08 71C8 F85B 94CA  8A0D 281F 0DB8 D28D 5469

* tag 'for_upstream' of https://git.kernel.org/pub/scm/virt/kvm/mst/qemu:
  virtio: disable error for out of spec queue-enable
  acpi/tests/avocado/bits: keep the work directory when BITS_DEBUG is set in env
  tests/avocado: configure acpi-bits to use avocado timeout
  MAINTAINERS: add mst to list of biosbits maintainers
  tests: acpi: x86: update expected DSDT after moving PRQx fields in _SB scope
  acpi: x86: move RPQx field back to _SB scope
  tests: acpi: whitelist DSDT before moving PRQx to _SB scope
  vhost: mask VIRTIO_F_RING_RESET for vhost and vhost-user devices

Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
  • Loading branch information
stefanhaRH committed Nov 22, 2022
2 parents d3e9c79 + b7c6178 commit ccb8d59
Show file tree
Hide file tree
Showing 51 changed files with 45 additions and 34 deletions.
1 change: 1 addition & 0 deletions MAINTAINERS
Expand Up @@ -1865,6 +1865,7 @@ F: hw/acpi/viot.h

ACPI/AVOCADO/BIOSBITS
M: Ani Sinha <ani@anisinha.ca>
M: Michael S. Tsirkin <mst@redhat.com>
S: Supported
F: tests/avocado/acpi-bits/*
F: tests/avocado/acpi-bits.py
Expand Down
1 change: 1 addition & 0 deletions hw/block/vhost-user-blk.c
Expand Up @@ -52,6 +52,7 @@ static const int user_feature_bits[] = {
VIRTIO_F_NOTIFY_ON_EMPTY,
VIRTIO_F_RING_PACKED,
VIRTIO_F_IOMMU_PLATFORM,
VIRTIO_F_RING_RESET,
VHOST_INVALID_FEATURE_BIT
};

Expand Down
16 changes: 4 additions & 12 deletions hw/isa/lpc_ich9.c
Expand Up @@ -813,12 +813,13 @@ static void build_ich9_isa_aml(AcpiDevAmlIf *adev, Aml *scope)
BusChild *kid;
ICH9LPCState *s = ICH9_LPC_DEVICE(adev);
BusState *bus = BUS(s->isa_bus);
Aml *sb_scope = aml_scope("\\_SB");

/* ICH9 PCI to ISA irq remapping */
aml_append(scope, aml_operation_region("PIRQ", AML_PCI_CONFIG,
aml_int(0x60), 0x0C));
/* Fields declarion has to happen *after* operation region */
field = aml_field("PIRQ", AML_BYTE_ACC, AML_NOLOCK, AML_PRESERVE);
field = aml_field("PCI0.SF8.PIRQ", AML_BYTE_ACC, AML_NOLOCK, AML_PRESERVE);
aml_append(field, aml_named_field("PRQA", 8));
aml_append(field, aml_named_field("PRQB", 8));
aml_append(field, aml_named_field("PRQC", 8));
Expand All @@ -828,17 +829,8 @@ static void build_ich9_isa_aml(AcpiDevAmlIf *adev, Aml *scope)
aml_append(field, aml_named_field("PRQF", 8));
aml_append(field, aml_named_field("PRQG", 8));
aml_append(field, aml_named_field("PRQH", 8));
aml_append(scope, field);

/* hack: put fields into _SB scope for LNKx to find them */
aml_append(scope, aml_alias("PRQA", "\\_SB.PRQA"));
aml_append(scope, aml_alias("PRQB", "\\_SB.PRQB"));
aml_append(scope, aml_alias("PRQC", "\\_SB.PRQC"));
aml_append(scope, aml_alias("PRQD", "\\_SB.PRQD"));
aml_append(scope, aml_alias("PRQE", "\\_SB.PRQE"));
aml_append(scope, aml_alias("PRQF", "\\_SB.PRQF"));
aml_append(scope, aml_alias("PRQG", "\\_SB.PRQG"));
aml_append(scope, aml_alias("PRQH", "\\_SB.PRQH"));
aml_append(sb_scope, field);
aml_append(scope, sb_scope);

QTAILQ_FOREACH(kid, &bus->children, sibling) {
call_dev_aml_func(DEVICE(kid->child), scope);
Expand Down
12 changes: 4 additions & 8 deletions hw/isa/piix3.c
Expand Up @@ -318,24 +318,20 @@ static void build_pci_isa_aml(AcpiDevAmlIf *adev, Aml *scope)
{
Aml *field;
BusChild *kid;
Aml *sb_scope = aml_scope("\\_SB");
BusState *bus = qdev_get_child_bus(DEVICE(adev), "isa.0");

/* PIIX PCI to ISA irq remapping */
aml_append(scope, aml_operation_region("P40C", AML_PCI_CONFIG,
aml_int(0x60), 0x04));
/* Fields declarion has to happen *after* operation region */
field = aml_field("P40C", AML_BYTE_ACC, AML_NOLOCK, AML_PRESERVE);
field = aml_field("PCI0.S08.P40C", AML_BYTE_ACC, AML_NOLOCK, AML_PRESERVE);
aml_append(field, aml_named_field("PRQ0", 8));
aml_append(field, aml_named_field("PRQ1", 8));
aml_append(field, aml_named_field("PRQ2", 8));
aml_append(field, aml_named_field("PRQ3", 8));
aml_append(scope, field);

/* hack: put fields into _SB scope for LNKx to find them */
aml_append(scope, aml_alias("PRQ0", "\\_SB.PRQ0"));
aml_append(scope, aml_alias("PRQ1", "\\_SB.PRQ1"));
aml_append(scope, aml_alias("PRQ2", "\\_SB.PRQ2"));
aml_append(scope, aml_alias("PRQ3", "\\_SB.PRQ3"));
aml_append(sb_scope, field);
aml_append(scope, sb_scope);

QTAILQ_FOREACH(kid, &bus->children, sibling) {
call_dev_aml_func(DEVICE(kid->child), scope);
Expand Down
1 change: 1 addition & 0 deletions hw/net/vhost_net.c
Expand Up @@ -75,6 +75,7 @@ static const int user_feature_bits[] = {
VIRTIO_NET_F_MTU,
VIRTIO_F_IOMMU_PLATFORM,
VIRTIO_F_RING_PACKED,
VIRTIO_F_RING_RESET,
VIRTIO_NET_F_RSS,
VIRTIO_NET_F_HASH_REPORT,

Expand Down
1 change: 1 addition & 0 deletions hw/scsi/vhost-scsi.c
Expand Up @@ -38,6 +38,7 @@ static const int kernel_feature_bits[] = {
VIRTIO_RING_F_INDIRECT_DESC,
VIRTIO_RING_F_EVENT_IDX,
VIRTIO_SCSI_F_HOTPLUG,
VIRTIO_F_RING_RESET,
VHOST_INVALID_FEATURE_BIT
};

Expand Down
1 change: 1 addition & 0 deletions hw/scsi/vhost-user-scsi.c
Expand Up @@ -36,6 +36,7 @@ static const int user_feature_bits[] = {
VIRTIO_RING_F_INDIRECT_DESC,
VIRTIO_RING_F_EVENT_IDX,
VIRTIO_SCSI_F_HOTPLUG,
VIRTIO_F_RING_RESET,
VHOST_INVALID_FEATURE_BIT
};

Expand Down
1 change: 1 addition & 0 deletions hw/virtio/vhost-user-fs.c
Expand Up @@ -32,6 +32,7 @@ static const int user_feature_bits[] = {
VIRTIO_F_NOTIFY_ON_EMPTY,
VIRTIO_F_RING_PACKED,
VIRTIO_F_IOMMU_PLATFORM,
VIRTIO_F_RING_RESET,

VHOST_INVALID_FEATURE_BIT
};
Expand Down
1 change: 1 addition & 0 deletions hw/virtio/vhost-user-gpio.c
Expand Up @@ -24,6 +24,7 @@ static const int feature_bits[] = {
VIRTIO_RING_F_INDIRECT_DESC,
VIRTIO_RING_F_EVENT_IDX,
VIRTIO_GPIO_F_IRQ,
VIRTIO_F_RING_RESET,
VHOST_INVALID_FEATURE_BIT
};

Expand Down
1 change: 1 addition & 0 deletions hw/virtio/vhost-user-i2c.c
Expand Up @@ -16,6 +16,7 @@

static const int feature_bits[] = {
VIRTIO_I2C_F_ZERO_LENGTH_REQUEST,
VIRTIO_F_RING_RESET,
VHOST_INVALID_FEATURE_BIT
};

Expand Down
11 changes: 9 additions & 2 deletions hw/virtio/vhost-user-rng.c
Expand Up @@ -16,6 +16,11 @@
#include "qemu/error-report.h"
#include "standard-headers/linux/virtio_ids.h"

static const int feature_bits[] = {
VIRTIO_F_RING_RESET,
VHOST_INVALID_FEATURE_BIT
};

static void vu_rng_start(VirtIODevice *vdev)
{
VHostUserRNG *rng = VHOST_USER_RNG(vdev);
Expand Down Expand Up @@ -106,8 +111,10 @@ static void vu_rng_set_status(VirtIODevice *vdev, uint8_t status)
static uint64_t vu_rng_get_features(VirtIODevice *vdev,
uint64_t requested_features, Error **errp)
{
/* No feature bits used yet */
return requested_features;
VHostUserRNG *rng = VHOST_USER_RNG(vdev);

return vhost_get_features(&rng->vhost_dev, feature_bits,
requested_features);
}

static void vu_rng_handle_output(VirtIODevice *vdev, VirtQueue *vq)
Expand Down
1 change: 1 addition & 0 deletions hw/virtio/vhost-vsock-common.c
Expand Up @@ -21,6 +21,7 @@

const int feature_bits[] = {
VIRTIO_VSOCK_F_SEQPACKET,
VIRTIO_F_RING_RESET,
VHOST_INVALID_FEATURE_BIT
};

Expand Down
7 changes: 7 additions & 0 deletions hw/virtio/virtio.c
Expand Up @@ -2499,10 +2499,17 @@ void virtio_queue_enable(VirtIODevice *vdev, uint32_t queue_index)
{
VirtioDeviceClass *k = VIRTIO_DEVICE_GET_CLASS(vdev);

/*
* TODO: Seabios is currently out of spec and triggering this error.
* So this needs to be fixed in Seabios, then this can
* be re-enabled for new machine types only, and also after
* being converted to LOG_GUEST_ERROR.
*
if (!virtio_vdev_has_feature(vdev, VIRTIO_F_VERSION_1)) {
error_report("queue_enable is only suppported in devices of virtio "
"1.0 or later.");
}
*/

if (k->queue_enable) {
k->queue_enable(vdev, queue_index);
Expand Down
1 change: 1 addition & 0 deletions net/vhost-vdpa.c
Expand Up @@ -69,6 +69,7 @@ const int vdpa_feature_bits[] = {
VIRTIO_NET_F_CTRL_VQ,
VIRTIO_F_IOMMU_PLATFORM,
VIRTIO_F_RING_PACKED,
VIRTIO_F_RING_RESET,
VIRTIO_NET_F_RSS,
VIRTIO_NET_F_HASH_REPORT,
VIRTIO_NET_F_GUEST_ANNOUNCE,
Expand Down
23 changes: 11 additions & 12 deletions tests/avocado/acpi-bits.py
Expand Up @@ -263,7 +263,7 @@ def generate_bits_iso(self):
self.logger.info('using grub-mkrescue for generating biosbits iso ...')

try:
if os.getenv('V'):
if os.getenv('V') or os.getenv('BITS_DEBUG'):
subprocess.check_call([mkrescue_script, '-o', iso_file,
bits_dir], stderr=subprocess.STDOUT)
else:
Expand Down Expand Up @@ -347,7 +347,7 @@ def parse_log(self):
self._print_log(log)
raise e
else:
if os.getenv('V'):
if os.getenv('V') or os.getenv('BITS_DEBUG'):
self._print_log(log)

def tearDown(self):
Expand All @@ -356,8 +356,13 @@ def tearDown(self):
"""
if self._vm:
self.assertFalse(not self._vm.is_running)
self.logger.info('removing the work directory %s', self._workDir)
shutil.rmtree(self._workDir)
if not os.getenv('BITS_DEBUG'):
self.logger.info('removing the work directory %s', self._workDir)
shutil.rmtree(self._workDir)
else:
self.logger.info('not removing the work directory %s ' \
'as BITS_DEBUG is ' \
'passed in the environment', self._workDir)
super().tearDown()

def test_acpi_smbios_bits(self):
Expand Down Expand Up @@ -388,12 +393,6 @@ def test_acpi_smbios_bits(self):
self._vm.launch()
# biosbits has been configured to run all the specified test suites
# in batch mode and then automatically initiate a vm shutdown.
# sleep for maximum of one minute
max_sleep_time = time.monotonic() + 60
while self._vm.is_running() and time.monotonic() < max_sleep_time:
time.sleep(1)

self.assertFalse(time.monotonic() > max_sleep_time,
'The VM seems to have failed to shutdown in time')

# Rely on avocado's unit test timeout.
self._vm.wait(timeout=None)
self.parse_log()
Binary file modified tests/data/acpi/pc/DSDT
Binary file not shown.
Binary file modified tests/data/acpi/pc/DSDT.acpierst
Binary file not shown.
Binary file modified tests/data/acpi/pc/DSDT.acpihmat
Binary file not shown.
Binary file modified tests/data/acpi/pc/DSDT.bridge
Binary file not shown.
Binary file modified tests/data/acpi/pc/DSDT.cphp
Binary file not shown.
Binary file modified tests/data/acpi/pc/DSDT.dimmpxm
Binary file not shown.
Binary file modified tests/data/acpi/pc/DSDT.hpbridge
Binary file not shown.
Binary file modified tests/data/acpi/pc/DSDT.hpbrroot
Binary file not shown.
Binary file modified tests/data/acpi/pc/DSDT.ipmikcs
Binary file not shown.
Binary file modified tests/data/acpi/pc/DSDT.memhp
Binary file not shown.
Binary file modified tests/data/acpi/pc/DSDT.nohpet
Binary file not shown.
Binary file modified tests/data/acpi/pc/DSDT.numamem
Binary file not shown.
Binary file modified tests/data/acpi/pc/DSDT.roothp
Binary file not shown.
Binary file modified tests/data/acpi/q35/DSDT
Binary file not shown.
Binary file modified tests/data/acpi/q35/DSDT.acpierst
Binary file not shown.
Binary file modified tests/data/acpi/q35/DSDT.acpihmat
Binary file not shown.
Binary file modified tests/data/acpi/q35/DSDT.acpihmat-noinitiator
Binary file not shown.
Binary file modified tests/data/acpi/q35/DSDT.applesmc
Binary file not shown.
Binary file modified tests/data/acpi/q35/DSDT.bridge
Binary file not shown.
Binary file modified tests/data/acpi/q35/DSDT.core-count2
Binary file not shown.
Binary file modified tests/data/acpi/q35/DSDT.cphp
Binary file not shown.
Binary file modified tests/data/acpi/q35/DSDT.cxl
Binary file not shown.
Binary file modified tests/data/acpi/q35/DSDT.dimmpxm
Binary file not shown.
Binary file modified tests/data/acpi/q35/DSDT.ipmibt
Binary file not shown.
Binary file modified tests/data/acpi/q35/DSDT.ipmismbus
Binary file not shown.
Binary file modified tests/data/acpi/q35/DSDT.ivrs
Binary file not shown.
Binary file modified tests/data/acpi/q35/DSDT.memhp
Binary file not shown.
Binary file modified tests/data/acpi/q35/DSDT.mmio64
Binary file not shown.
Binary file modified tests/data/acpi/q35/DSDT.multi-bridge
Binary file not shown.
Binary file modified tests/data/acpi/q35/DSDT.nohpet
Binary file not shown.
Binary file modified tests/data/acpi/q35/DSDT.numamem
Binary file not shown.
Binary file modified tests/data/acpi/q35/DSDT.pvpanic-isa
Binary file not shown.
Binary file modified tests/data/acpi/q35/DSDT.tis.tpm12
Binary file not shown.
Binary file modified tests/data/acpi/q35/DSDT.tis.tpm2
Binary file not shown.
Binary file modified tests/data/acpi/q35/DSDT.viot
Binary file not shown.
Binary file modified tests/data/acpi/q35/DSDT.xapic
Binary file not shown.

0 comments on commit ccb8d59

Please sign in to comment.