[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[RFC v2 14/14] virt/acpi: add SDEI table if SDEI is enabled
From: |
Heyi Guo |
Subject: |
[RFC v2 14/14] virt/acpi: add SDEI table if SDEI is enabled |
Date: |
Tue, 5 Nov 2019 17:10:56 +0800 |
Add SDEI table if SDEI is enabled, so that guest OS can get aware and
utilize the interfaces.
Signed-off-by: Heyi Guo <address@hidden>
Cc: Peter Maydell <address@hidden>
Cc: Dave Martin <address@hidden>
Cc: Marc Zyngier <address@hidden>
Cc: Mark Rutland <address@hidden>
Cc: James Morse <address@hidden>
Cc: Shannon Zhao <address@hidden>
Cc: "Michael S. Tsirkin" <address@hidden>
Cc: Igor Mammedov <address@hidden>
---
Notes:
v2:
- Drop SDEI table definition and add comments
hw/arm/virt-acpi-build.c | 26 ++++++++++++++++++++++++++
1 file changed, 26 insertions(+)
diff --git a/hw/arm/virt-acpi-build.c b/hw/arm/virt-acpi-build.c
index 4cd50175e0..73d3f8cd15 100644
--- a/hw/arm/virt-acpi-build.c
+++ b/hw/arm/virt-acpi-build.c
@@ -32,6 +32,7 @@
#include "trace.h"
#include "hw/core/cpu.h"
#include "target/arm/cpu.h"
+#include "target/arm/sdei.h"
#include "hw/acpi/acpi-defs.h"
#include "hw/acpi/acpi.h"
#include "hw/nvram/fw_cfg.h"
@@ -475,6 +476,26 @@ build_iort(GArray *table_data, BIOSLinker *linker,
VirtMachineState *vms)
"IORT", table_data->len - iort_start, 0, NULL, NULL);
}
+/*
+ * ACPI spec 6.2 Software Delegated Exception Interface (SDEI).
+ * (Revision 1.0)
+ * "SDEI" was reserved in ACPI 6.2. See "Links to ACPI-Related Documents"
+ * (http://uefi.org/acpi) under the heading "Software
+ * Delegated Exceptions Interface." The definition is under
+ * "10 Appendix C: ACPI table definitions for SDEI" in the linked document.
+ *
+ * This is a dummy table to expose platform SDEI capbility to OS.
+ */
+static void
+build_sdei(GArray *table_data, BIOSLinker *linker, VirtMachineState *vms)
+{
+ int sdei_start = table_data->len;
+
+ (void)acpi_data_push(table_data, sizeof(AcpiTableHeader));
+ build_header(linker, table_data, (void *)(table_data->data + sdei_start),
+ "SDEI", table_data->len - sdei_start, 1, NULL, NULL);
+}
+
static void
build_spcr(GArray *table_data, BIOSLinker *linker, VirtMachineState *vms)
{
@@ -825,6 +846,11 @@ void virt_acpi_build(VirtMachineState *vms,
AcpiBuildTables *tables)
acpi_add_table(table_offsets, tables_blob);
build_spcr(tables_blob, tables->linker, vms);
+ if (sdei_enabled) {
+ acpi_add_table(table_offsets, tables_blob);
+ build_sdei(tables_blob, tables->linker, vms);
+ }
+
if (ms->numa_state->num_nodes > 0) {
acpi_add_table(table_offsets, tables_blob);
build_srat(tables_blob, tables->linker, vms);
--
2.19.1
- Re: [RFC v2 02/14] standard-headers: import arm_sdei.h, (continued)
- [RFC v2 09/14] arm/sdei: override qemu_irq handler when binding interrupt, Heyi Guo, 2019/11/05
- [RFC v2 11/14] linux-headers/kvm.h: add capability to forward hypercall, Heyi Guo, 2019/11/05
- Re: [RFC v2 11/14] linux-headers/kvm.h: add capability to forward hypercall, Cornelia Huck, 2019/11/06
- Re: [RFC v2 11/14] linux-headers/kvm.h: add capability to forward hypercall, Guoheyi, 2019/11/06
- Re: [RFC v2 11/14] linux-headers/kvm.h: add capability to forward hypercall, Michael S. Tsirkin, 2019/11/07
- Re: [RFC v2 11/14] linux-headers/kvm.h: add capability to forward hypercall, Guoheyi, 2019/11/07
- Re: [RFC v2 11/14] linux-headers/kvm.h: add capability to forward hypercall, Cornelia Huck, 2019/11/07
- Re: [RFC v2 11/14] linux-headers/kvm.h: add capability to forward hypercall, Guoheyi, 2019/11/07
[RFC v2 14/14] virt/acpi: add SDEI table if SDEI is enabled,
Heyi Guo <=
[RFC v2 13/14] arm/kvm: handle guest exit of hypercall, Heyi Guo, 2019/11/05
[RFC v2 03/14] arm/sdei: add virtual device framework, Heyi Guo, 2019/11/05
[RFC v2 12/14] arm/sdei: add stub to fix build failure when SDEI is not enabled, Heyi Guo, 2019/11/05
[RFC v2 05/14] arm/sdei: add support to handle SDEI requests from guest, Heyi Guo, 2019/11/05
Re: [RFC v2 00/14] Add SDEI support for arm64, Guoheyi, 2019/11/05
Re: [RFC v2 00/14] Add SDEI support for arm64, no-reply, 2019/11/05
Re: [RFC v2 00/14] Add SDEI support for arm64, no-reply, 2019/11/05
Re: [RFC v2 00/14] Add SDEI support for arm64, Guoheyi, 2019/11/18