Skip to content

Commit 0e3327b

Browse files
committed
Merge tag 'for_upstream' of https://git.kernel.org/pub/scm/virt/kvm/mst/qemu into staging
virtio,pc,pci: features, fixes, cleanups The big thing here are: stage-1 translation in vtd internal migration in vhost-user ghes driver preparation for error injection new resource uuid feature in virtio gpu new vmclock device And as usual, fixes and cleanups. Signed-off-by: Michael S. Tsirkin <mst@redhat.com> # -----BEGIN PGP SIGNATURE----- # # iQFDBAABCAAtFiEEXQn9CHHI+FuUyooNKB8NuNKNVGkFAmeIOiIPHG1zdEByZWRo # YXQuY29tAAoJECgfDbjSjVRpORgIAL0clwZxQL7PIPJ91FwXc1bo6Do/HYquAzvH # eA+ryCG5S5ewh/e2R8SdIUG7nYesEMWJGVL1gb3BFu7wgGh1aLaaTxQ1LIo5HpRF # P0Ak3QO7TKIsSEcZIz9h3eMEpg6X9d8i2h7llp7H3qqXBbduO+cGfeNH/fZD5IEl # 7DFvXuJUgUtZb38I+qtcO+9EQFKGHjgdQAN5P/I4vawWJdxN9sBfT4YVEgpVhiq/ # ALxdSeaEiXA4EXexdHVZhXiQzEBsCQ78RZIIDiRE8I34cVY7rolTodKRfr4bip3P # 6Llu11yvzNi1gppOzkny3QFsRza3hV0RisWYjAMTwLhNCdi/mHQ= # =GjDq # -----END PGP SIGNATURE----- # gpg: Signature made Wed 15 Jan 2025 17:43:46 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: (49 commits) hw/acpi: Add vmclock device virtio-net: vhost-user: Implement internal migration vhost: Add stubs for the migration state transfer interface hw/cxl: Fix msix_notify: Assertion `vector < dev->msix_entries_nr` tests: acpi: update expected blobs pci: acpi: Windows 'PCI Label Id' bug workaround tests: acpi: whitelist expected blobs docs: acpi_hest_ghes: fix documentation for CPER size acpi/ghes: Change ghes fill logic to work with only one source acpi/ghes: move offset calculus to a separate function acpi/ghes: better name the offset of the hardware error firmware acpi/ghes: rename etc/hardware_error file macros acpi/ghes: don't crash QEMU if ghes GED is not found acpi/ghes: better name GHES memory error function acpi/ghes: make the GHES record generation more generic acpi/ghes: don't check if physical_address is not zero acpi/ghes: Change the type for source_id acpi/ghes: Remove a duplicated out of bounds check acpi/ghes: Fix acpi_ghes_record_errors() argument acpi/ghes: better handle source_id and notification ... Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
2 parents 7433709 + 3634039 commit 0e3327b

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

74 files changed

+1536
-326
lines changed

MAINTAINERS

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3711,6 +3711,7 @@ F: hw/i386/intel_iommu.c
37113711
F: hw/i386/intel_iommu_internal.h
37123712
F: include/hw/i386/intel_iommu.h
37133713
F: tests/functional/test_intel_iommu.py
3714+
F: tests/qtest/intel-iommu-test.c
37143715

37153716
AMD-Vi Emulation
37163717
S: Orphan

docs/specs/acpi_hest_ghes.rst

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -67,8 +67,10 @@ Design Details
6767
(3) The address registers table contains N Error Block Address entries
6868
and N Read Ack Register entries. The size for each entry is 8-byte.
6969
The Error Status Data Block table contains N Error Status Data Block
70-
entries. The size for each entry is 4096(0x1000) bytes. The total size
71-
for the "etc/hardware_errors" fw_cfg blob is (N * 8 * 2 + N * 4096) bytes.
70+
entries. The size for each entry is defined at the source code as
71+
ACPI_GHES_MAX_RAW_DATA_LENGTH (currently 1024 bytes). The total size
72+
for the "etc/hardware_errors" fw_cfg blob is
73+
(N * 8 * 2 + N * ACPI_GHES_MAX_RAW_DATA_LENGTH) bytes.
7274
N is the number of the kinds of hardware error sources.
7375

7476
(4) QEMU generates the ACPI linker/loader script for the firmware. The

hw/acpi/Kconfig

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -60,6 +60,11 @@ config ACPI_VMGENID
6060
default y
6161
depends on PC
6262

63+
config ACPI_VMCLOCK
64+
bool
65+
default y
66+
depends on PC
67+
6368
config ACPI_VIOT
6469
bool
6570
depends on ACPI

hw/acpi/cpu.c

Lines changed: 34 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -327,6 +327,7 @@ const VMStateDescription vmstate_cpu_hotplug = {
327327
#define CPU_EJECT_METHOD "CEJ0"
328328
#define CPU_OST_METHOD "COST"
329329
#define CPU_ADDED_LIST "CNEW"
330+
#define CPU_EJ_LIST "CEJL"
330331

331332
#define CPU_ENABLED "CPEN"
332333
#define CPU_SELECTOR "CSEL"
@@ -488,7 +489,6 @@ void build_cpus_aml(Aml *table, MachineState *machine, CPUHotplugFeatures opts,
488489
method = aml_method(CPU_SCAN_METHOD, 0, AML_SERIALIZED);
489490
{
490491
const uint8_t max_cpus_per_pass = 255;
491-
Aml *else_ctx;
492492
Aml *while_ctx, *while_ctx2;
493493
Aml *has_event = aml_local(0);
494494
Aml *dev_chk = aml_int(1);
@@ -499,6 +499,8 @@ void build_cpus_aml(Aml *table, MachineState *machine, CPUHotplugFeatures opts,
499499
Aml *uid = aml_local(3);
500500
Aml *has_job = aml_local(4);
501501
Aml *new_cpus = aml_name(CPU_ADDED_LIST);
502+
Aml *ej_cpus = aml_name(CPU_EJ_LIST);
503+
Aml *num_ej_cpus = aml_local(5);
502504

503505
aml_append(method, aml_acquire(ctrl_lock, 0xFFFF));
504506

@@ -513,6 +515,8 @@ void build_cpus_aml(Aml *table, MachineState *machine, CPUHotplugFeatures opts,
513515
*/
514516
aml_append(method, aml_name_decl(CPU_ADDED_LIST,
515517
aml_package(max_cpus_per_pass)));
518+
aml_append(method, aml_name_decl(CPU_EJ_LIST,
519+
aml_package(max_cpus_per_pass)));
516520

517521
aml_append(method, aml_store(zero, uid));
518522
aml_append(method, aml_store(one, has_job));
@@ -527,6 +531,7 @@ void build_cpus_aml(Aml *table, MachineState *machine, CPUHotplugFeatures opts,
527531

528532
aml_append(while_ctx2, aml_store(one, has_event));
529533
aml_append(while_ctx2, aml_store(zero, num_added_cpus));
534+
aml_append(while_ctx2, aml_store(zero, num_ej_cpus));
530535

531536
/*
532537
* Scan CPUs, till there are CPUs with events or
@@ -559,8 +564,10 @@ void build_cpus_aml(Aml *table, MachineState *machine, CPUHotplugFeatures opts,
559564
* if CPU_ADDED_LIST is full, exit inner loop and process
560565
* collected CPUs
561566
*/
562-
ifctx = aml_if(
563-
aml_equal(num_added_cpus, aml_int(max_cpus_per_pass)));
567+
ifctx = aml_if(aml_lor(
568+
aml_equal(num_added_cpus, aml_int(max_cpus_per_pass)),
569+
aml_equal(num_ej_cpus, aml_int(max_cpus_per_pass))
570+
));
564571
{
565572
aml_append(ifctx, aml_store(one, has_job));
566573
aml_append(ifctx, aml_break());
@@ -577,16 +584,16 @@ void build_cpus_aml(Aml *table, MachineState *machine, CPUHotplugFeatures opts,
577584
aml_append(ifctx, aml_store(one, has_event));
578585
}
579586
aml_append(while_ctx, ifctx);
580-
else_ctx = aml_else();
587+
581588
ifctx = aml_if(aml_equal(rm_evt, one));
582589
{
583-
aml_append(ifctx,
584-
aml_call2(CPU_NOTIFY_METHOD, uid, eject_req));
585-
aml_append(ifctx, aml_store(one, rm_evt));
590+
/* cache to be removed CPUs to Notify later */
591+
aml_append(ifctx, aml_store(uid,
592+
aml_index(ej_cpus, num_ej_cpus)));
593+
aml_append(ifctx, aml_increment(num_ej_cpus));
586594
aml_append(ifctx, aml_store(one, has_event));
587595
}
588-
aml_append(else_ctx, ifctx);
589-
aml_append(while_ctx, else_ctx);
596+
aml_append(while_ctx, ifctx);
590597
aml_append(while_ctx, aml_increment(uid));
591598
}
592599
aml_append(while_ctx2, while_ctx);
@@ -620,6 +627,24 @@ void build_cpus_aml(Aml *table, MachineState *machine, CPUHotplugFeatures opts,
620627
aml_append(while_ctx, aml_increment(cpu_idx));
621628
}
622629
aml_append(while_ctx2, while_ctx);
630+
631+
/*
632+
* Notify OSPM about to be removed CPUs and clear remove flag
633+
*/
634+
aml_append(while_ctx2, aml_store(zero, cpu_idx));
635+
while_ctx = aml_while(aml_lless(cpu_idx, num_ej_cpus));
636+
{
637+
aml_append(while_ctx,
638+
aml_store(aml_derefof(aml_index(ej_cpus, cpu_idx)),
639+
uid));
640+
aml_append(while_ctx,
641+
aml_call2(CPU_NOTIFY_METHOD, uid, eject_req));
642+
aml_append(while_ctx, aml_store(uid, cpu_selector));
643+
aml_append(while_ctx, aml_store(one, rm_evt));
644+
aml_append(while_ctx, aml_increment(cpu_idx));
645+
}
646+
aml_append(while_ctx2, while_ctx);
647+
623648
/*
624649
* If another batch is needed, then it will resume scanning
625650
* exactly at -- and not after -- the last CPU that's currently

hw/acpi/generic_event_device.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -363,15 +363,15 @@ static const VMStateDescription vmstate_ghes = {
363363
.version_id = 1,
364364
.minimum_version_id = 1,
365365
.fields = (const VMStateField[]) {
366-
VMSTATE_UINT64(ghes_addr_le, AcpiGhesState),
366+
VMSTATE_UINT64(hw_error_le, AcpiGhesState),
367367
VMSTATE_END_OF_LIST()
368368
},
369369
};
370370

371371
static bool ghes_needed(void *opaque)
372372
{
373373
AcpiGedState *s = opaque;
374-
return s->ghes_state.ghes_addr_le;
374+
return s->ghes_state.hw_error_le;
375375
}
376376

377377
static const VMStateDescription vmstate_ghes_state = {

hw/acpi/ghes-stub.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
#include "qemu/osdep.h"
1212
#include "hw/acpi/ghes.h"
1313

14-
int acpi_ghes_record_errors(uint8_t source_id, uint64_t physical_address)
14+
int acpi_ghes_memory_errors(uint16_t source_id, uint64_t physical_address)
1515
{
1616
return -1;
1717
}

0 commit comments

Comments
 (0)