mirror of
https://github.com/Motorhead1991/qemu.git
synced 2025-08-04 16:23:55 -06:00
acpi, vhost, misc: fixes, features
vDPA support, fix to vhost blk RO bit handling, some include path cleanups, NFIT ACPI table. Signed-off-by: Michael S. Tsirkin <mst@redhat.com> -----BEGIN PGP SIGNATURE----- iQEcBAABAgAGBQJbEXNvAAoJECgfDbjSjVRpc8gH/R8xrcFrV+k9wwbgYcOcGb6Y LWjseE31pqJcxRV80vLOdzYEuLStZQKQQY7xBDMlA5vdyvZxIA6FLO2IsiJSbFAk EK8pclwhpwQAahr8BfzenabohBv2UO7zu5+dqSvuJCiMWF3jGtPAIMxInfjXaOZY odc1zY2D2EgsC7wZZ1hfraRbISBOiRaez9BoGDKPOyBY9G1ASEgxJgleFgoBLfsK a1XU+fDM6hAVdxftfkTm0nibyf7PWPDyzqghLqjR9WXLvZP3Cqud4p8N29mY51pR KSTjA4FYk6Z9EVMltyBHfdJs6RQzglKjxcNGdlrvacDfyFi79fGdiosVllrjfJM= =3+V0 -----END PGP SIGNATURE----- Merge remote-tracking branch 'remotes/mst/tags/for_upstream' into staging acpi, vhost, misc: fixes, features vDPA support, fix to vhost blk RO bit handling, some include path cleanups, NFIT ACPI table. Signed-off-by: Michael S. Tsirkin <mst@redhat.com> # gpg: Signature made Fri 01 Jun 2018 17:25:19 BST # gpg: using RSA key 281F0DB8D28D5469 # gpg: Good signature from "Michael S. Tsirkin <mst@kernel.org>" # gpg: aka "Michael S. Tsirkin <mst@redhat.com>" # 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 * remotes/mst/tags/for_upstream: (31 commits) vhost-blk: turn on pre-defined RO feature bit ACPI testing: test NFIT platform capabilities nvdimm, acpi: support NFIT platform capabilities tests/.gitignore: add entry for generated file arch_init: sort architectures ui: use local path for local headers qga: use local path for local headers colo: use local path for local headers migration: use local path for local headers usb: use local path for local headers sd: fix up include vhost-scsi: drop an unused include ppc: use local path for local headers rocker: drop an unused include e1000e: use local path for local headers ioapic: fix up includes ide: use local path for local headers display: use local path for local headers trace: use local path for local headers migration: drop an unused include ... Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
This commit is contained in:
commit
f67c9b693a
104 changed files with 807 additions and 166 deletions
|
@ -169,6 +169,21 @@ struct NvdimmNfitControlRegion {
|
|||
} QEMU_PACKED;
|
||||
typedef struct NvdimmNfitControlRegion NvdimmNfitControlRegion;
|
||||
|
||||
/*
|
||||
* NVDIMM Platform Capabilities Structure
|
||||
*
|
||||
* Defined in section 5.2.25.9 of ACPI 6.2 Errata A, September 2017
|
||||
*/
|
||||
struct NvdimmNfitPlatformCaps {
|
||||
uint16_t type;
|
||||
uint16_t length;
|
||||
uint8_t highest_cap;
|
||||
uint8_t reserved[3];
|
||||
uint32_t capabilities;
|
||||
uint8_t reserved2[4];
|
||||
} QEMU_PACKED;
|
||||
typedef struct NvdimmNfitPlatformCaps NvdimmNfitPlatformCaps;
|
||||
|
||||
/*
|
||||
* Module serial number is a unique number for each device. We use the
|
||||
* slot id of NVDIMM device to generate this number so that each device
|
||||
|
@ -351,7 +366,23 @@ static void nvdimm_build_structure_dcr(GArray *structures, DeviceState *dev)
|
|||
JEDEC Annex L Release 3. */);
|
||||
}
|
||||
|
||||
static GArray *nvdimm_build_device_structure(void)
|
||||
/*
|
||||
* ACPI 6.2 Errata A: 5.2.25.9 NVDIMM Platform Capabilities Structure
|
||||
*/
|
||||
static void
|
||||
nvdimm_build_structure_caps(GArray *structures, uint32_t capabilities)
|
||||
{
|
||||
NvdimmNfitPlatformCaps *nfit_caps;
|
||||
|
||||
nfit_caps = acpi_data_push(structures, sizeof(*nfit_caps));
|
||||
|
||||
nfit_caps->type = cpu_to_le16(7 /* NVDIMM Platform Capabilities */);
|
||||
nfit_caps->length = cpu_to_le16(sizeof(*nfit_caps));
|
||||
nfit_caps->highest_cap = 31 - clz32(capabilities);
|
||||
nfit_caps->capabilities = cpu_to_le32(capabilities);
|
||||
}
|
||||
|
||||
static GArray *nvdimm_build_device_structure(AcpiNVDIMMState *state)
|
||||
{
|
||||
GSList *device_list = nvdimm_get_device_list();
|
||||
GArray *structures = g_array_new(false, true /* clear */, 1);
|
||||
|
@ -373,6 +404,10 @@ static GArray *nvdimm_build_device_structure(void)
|
|||
}
|
||||
g_slist_free(device_list);
|
||||
|
||||
if (state->capabilities) {
|
||||
nvdimm_build_structure_caps(structures, state->capabilities);
|
||||
}
|
||||
|
||||
return structures;
|
||||
}
|
||||
|
||||
|
@ -381,16 +416,18 @@ static void nvdimm_init_fit_buffer(NvdimmFitBuffer *fit_buf)
|
|||
fit_buf->fit = g_array_new(false, true /* clear */, 1);
|
||||
}
|
||||
|
||||
static void nvdimm_build_fit_buffer(NvdimmFitBuffer *fit_buf)
|
||||
static void nvdimm_build_fit_buffer(AcpiNVDIMMState *state)
|
||||
{
|
||||
NvdimmFitBuffer *fit_buf = &state->fit_buf;
|
||||
|
||||
g_array_free(fit_buf->fit, true);
|
||||
fit_buf->fit = nvdimm_build_device_structure();
|
||||
fit_buf->fit = nvdimm_build_device_structure(state);
|
||||
fit_buf->dirty = true;
|
||||
}
|
||||
|
||||
void nvdimm_plug(AcpiNVDIMMState *state)
|
||||
{
|
||||
nvdimm_build_fit_buffer(&state->fit_buf);
|
||||
nvdimm_build_fit_buffer(state);
|
||||
}
|
||||
|
||||
static void nvdimm_build_nfit(AcpiNVDIMMState *state, GArray *table_offsets,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue