qemu with hax to log dma reads & writes jcs.org/2018/11/12/vfio

acpi: cpuhp: introduce 'Command data 2' field

No functional change in practice, patch only aims to properly
document (in spec and code) intended usage of the reserved space.

The new field is to be used for 2 purposes:
- detection of modern CPU hotplug interface using
CPHP_GET_NEXT_CPU_WITH_EVENT_CMD command.
procedure will be described in follow up patch:
"acpi: cpuhp: spec: add typical usecases"
- for returning upper 32 bits of architecture specific CPU ID,
for new CPHP_GET_CPU_ID_CMD command added by follow up patch:
"acpi: cpuhp: add CPHP_GET_CPU_ID_CMD command"

Change is backward compatible with 4.2 and older machines, as field was
unconditionally reserved and always returned 0x0 if modern CPU hotplug
interface was enabled.

Signed-off-by: Igor Mammedov <imammedo@redhat.com>
Message-Id: <1575896942-331151-8-git-send-email-imammedo@redhat.com>
Reviewed-by: Michael S. Tsirkin <mst@redhat.com>
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
Reviewed-by: Laszlo Ersek <lersek@redhat.com>

authored by

Igor Mammedov and committed by
Michael S. Tsirkin
e6d0c3ce 5b8e5363

+16 -1
+4 -1
docs/specs/acpi_cpu_hotplug.txt
··· 44 44 45 45 read access: 46 46 offset: 47 - [0x0-0x3] reserved 47 + [0x0-0x3] Command data 2: (DWORD access) 48 + if value last stored in 'Command field': 49 + 0: reads as 0x0 50 + other values: reserved 48 51 [0x4] CPU device status fields: (1 byte access) 49 52 bits: 50 53 0: Device is enabled and may be used by guest
+11
hw/acpi/cpu.c
··· 12 12 #define ACPI_CPU_FLAGS_OFFSET_RW 4 13 13 #define ACPI_CPU_CMD_OFFSET_WR 5 14 14 #define ACPI_CPU_CMD_DATA_OFFSET_RW 8 15 + #define ACPI_CPU_CMD_DATA2_OFFSET_R 0 15 16 16 17 enum { 17 18 CPHP_GET_NEXT_CPU_WITH_EVENT_CMD = 0, ··· 78 79 break; 79 80 } 80 81 trace_cpuhp_acpi_read_cmd_data(cpu_st->selector, val); 82 + break; 83 + case ACPI_CPU_CMD_DATA2_OFFSET_R: 84 + switch (cpu_st->command) { 85 + case CPHP_GET_NEXT_CPU_WITH_EVENT_CMD: 86 + val = 0; 87 + break; 88 + default: 89 + break; 90 + } 91 + trace_cpuhp_acpi_read_cmd_data2(cpu_st->selector, val); 81 92 break; 82 93 default: 83 94 break;
+1
hw/acpi/trace-events
··· 23 23 cpuhp_acpi_write_idx(uint32_t idx) "set active cpu idx: 0x%"PRIx32 24 24 cpuhp_acpi_write_cmd(uint32_t idx, uint8_t cmd) "idx[0x%"PRIx32"] cmd: 0x%"PRIx8 25 25 cpuhp_acpi_read_cmd_data(uint32_t idx, uint32_t data) "idx[0x%"PRIx32"] data: 0x%"PRIx32 26 + cpuhp_acpi_read_cmd_data2(uint32_t idx, uint32_t data) "idx[0x%"PRIx32"] data: 0x%"PRIx32 26 27 cpuhp_acpi_cpu_has_events(uint32_t idx, bool ins, bool rm) "idx[0x%"PRIx32"] inserting: %d, removing: %d" 27 28 cpuhp_acpi_clear_inserting_evt(uint32_t idx) "idx[0x%"PRIx32"]" 28 29 cpuhp_acpi_clear_remove_evt(uint32_t idx) "idx[0x%"PRIx32"]"