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

hw/i386: Introduce apicid functions inside X86MachineState

Introduce model specific apicid functions inside X86MachineState.
These functions will be loaded from X86CPUDefinition.

Signed-off-by: Babu Moger <babu.moger@amd.com>
Reviewed-by: Igor Mammedov <imammedo@redhat.com>
Acked-by: Michael S. Tsirkin <mst@redhat.com>
Message-Id: <158396722838.58170.5675998866484476427.stgit@naples-babu.amd.com>
Signed-off-by: Eduardo Habkost <ehabkost@redhat.com>

authored by

Babu Moger and committed by
Eduardo Habkost
6121c7fb dd08ef03

+14
+5
hw/i386/x86.c
··· 937 937 x86ms->acpi = ON_OFF_AUTO_AUTO; 938 938 x86ms->max_ram_below_4g = 0; /* use default */ 939 939 x86ms->smp_dies = 1; 940 + 941 + x86ms->apicid_from_cpu_idx = x86_apicid_from_cpu_idx; 942 + x86ms->topo_ids_from_apicid = x86_topo_ids_from_apicid; 943 + x86ms->apicid_from_topo_ids = x86_apicid_from_topo_ids; 944 + x86ms->apicid_pkg_offset = apicid_pkg_offset; 940 945 } 941 946 942 947 static void x86_machine_class_init(ObjectClass *oc, void *data)
+9
include/hw/i386/x86.h
··· 66 66 OnOffAuto smm; 67 67 OnOffAuto acpi; 68 68 69 + /* Apic id specific handlers */ 70 + uint32_t (*apicid_from_cpu_idx)(X86CPUTopoInfo *topo_info, 71 + unsigned cpu_index); 72 + void (*topo_ids_from_apicid)(apic_id_t apicid, X86CPUTopoInfo *topo_info, 73 + X86CPUTopoIDs *topo_ids); 74 + apic_id_t (*apicid_from_topo_ids)(X86CPUTopoInfo *topo_info, 75 + const X86CPUTopoIDs *topo_ids); 76 + uint32_t (*apicid_pkg_offset)(X86CPUTopoInfo *topo_info); 77 + 69 78 /* 70 79 * Address space used by IOAPIC device. All IOAPIC interrupts 71 80 * will be translated to MSI messages in the address space.