Compare commits
20 Commits
v3.0.0-rc3
...
v3.0.0
Author | SHA1 | Date | |
---|---|---|---|
|
38441756b7 | ||
|
6ad9080538 | ||
|
93f874fe9d | ||
|
09b94ac0f2 | ||
|
09d98b6980 | ||
|
341823c172 | ||
|
326049cc8e | ||
|
7b69454a12 | ||
|
adc4fda6d5 | ||
|
78e9ddd75e | ||
|
1fb57da72a | ||
|
896b63dbff | ||
|
e3a4129abd | ||
|
1c707d6990 | ||
|
10efd7e108 | ||
|
16e2841d20 | ||
|
16b4226363 | ||
|
388a86df9c | ||
|
6484ab3dff | ||
|
1069a3c6e1 |
@@ -421,6 +421,11 @@ static void virtio_gpu_disable_scanout(VirtIOGPU *g, int scanout_id)
|
|||||||
scanout->height ?: 480,
|
scanout->height ?: 480,
|
||||||
"Guest disabled display.");
|
"Guest disabled display.");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (g->disable_scanout) {
|
||||||
|
g->disable_scanout(g, scanout_id);
|
||||||
|
}
|
||||||
|
|
||||||
dpy_gfx_replace_surface(scanout->con, ds);
|
dpy_gfx_replace_surface(scanout->con, ds);
|
||||||
scanout->resource_id = 0;
|
scanout->resource_id = 0;
|
||||||
scanout->ds = NULL;
|
scanout->ds = NULL;
|
||||||
|
@@ -75,6 +75,16 @@ static void virtio_vga_gl_block(void *opaque, bool block)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static void virtio_vga_disable_scanout(VirtIOGPU *g, int scanout_id)
|
||||||
|
{
|
||||||
|
VirtIOVGA *vvga = container_of(g, VirtIOVGA, vdev);
|
||||||
|
|
||||||
|
if (scanout_id == 0) {
|
||||||
|
/* reset surface if needed */
|
||||||
|
vvga->vga.graphic_mode = -1;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
static const GraphicHwOps virtio_vga_ops = {
|
static const GraphicHwOps virtio_vga_ops = {
|
||||||
.invalidate = virtio_vga_invalidate_display,
|
.invalidate = virtio_vga_invalidate_display,
|
||||||
.gfx_update = virtio_vga_update_display,
|
.gfx_update = virtio_vga_update_display,
|
||||||
@@ -156,6 +166,7 @@ static void virtio_vga_realize(VirtIOPCIProxy *vpci_dev, Error **errp)
|
|||||||
vvga->vga_mrs, true);
|
vvga->vga_mrs, true);
|
||||||
|
|
||||||
vga->con = g->scanout[0].con;
|
vga->con = g->scanout[0].con;
|
||||||
|
g->disable_scanout = virtio_vga_disable_scanout;
|
||||||
graphic_console_set_hwops(vga->con, &virtio_vga_ops, vvga);
|
graphic_console_set_hwops(vga->con, &virtio_vga_ops, vvga);
|
||||||
|
|
||||||
for (i = 0; i < g->conf.max_outputs; i++) {
|
for (i = 0; i < g->conf.max_outputs; i++) {
|
||||||
|
@@ -2269,7 +2269,16 @@ static void build_srat_hotpluggable_memory(GArray *table_data, uint64_t base,
|
|||||||
numamem = acpi_data_push(table_data, sizeof *numamem);
|
numamem = acpi_data_push(table_data, sizeof *numamem);
|
||||||
|
|
||||||
if (!info) {
|
if (!info) {
|
||||||
build_srat_memory(numamem, cur, end - cur, default_node,
|
/*
|
||||||
|
* Entry is required for Windows to enable memory hotplug in OS
|
||||||
|
* and for Linux to enable SWIOTLB when booted with less than
|
||||||
|
* 4G of RAM. Windows works better if the entry sets proximity
|
||||||
|
* to the highest NUMA node in the machine at the end of the
|
||||||
|
* reserved space.
|
||||||
|
* Memory devices may override proximity set by this entry,
|
||||||
|
* providing _PXM method if necessary.
|
||||||
|
*/
|
||||||
|
build_srat_memory(numamem, end - 1, 1, default_node,
|
||||||
MEM_AFFINITY_HOTPLUGGABLE | MEM_AFFINITY_ENABLED);
|
MEM_AFFINITY_HOTPLUGGABLE | MEM_AFFINITY_ENABLED);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
@@ -2392,24 +2401,19 @@ build_srat(GArray *table_data, BIOSLinker *linker, MachineState *machine)
|
|||||||
mem_len = next_base - pcms->below_4g_mem_size;
|
mem_len = next_base - pcms->below_4g_mem_size;
|
||||||
next_base = mem_base + mem_len;
|
next_base = mem_base + mem_len;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (mem_len > 0) {
|
||||||
numamem = acpi_data_push(table_data, sizeof *numamem);
|
numamem = acpi_data_push(table_data, sizeof *numamem);
|
||||||
build_srat_memory(numamem, mem_base, mem_len, i - 1,
|
build_srat_memory(numamem, mem_base, mem_len, i - 1,
|
||||||
MEM_AFFINITY_ENABLED);
|
MEM_AFFINITY_ENABLED);
|
||||||
}
|
}
|
||||||
|
}
|
||||||
slots = (table_data->len - numa_start) / sizeof *numamem;
|
slots = (table_data->len - numa_start) / sizeof *numamem;
|
||||||
for (; slots < pcms->numa_nodes + 2; slots++) {
|
for (; slots < pcms->numa_nodes + 2; slots++) {
|
||||||
numamem = acpi_data_push(table_data, sizeof *numamem);
|
numamem = acpi_data_push(table_data, sizeof *numamem);
|
||||||
build_srat_memory(numamem, 0, 0, 0, MEM_AFFINITY_NOFLAGS);
|
build_srat_memory(numamem, 0, 0, 0, MEM_AFFINITY_NOFLAGS);
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
|
||||||
* Entry is required for Windows to enable memory hotplug in OS
|
|
||||||
* and for Linux to enable SWIOTLB when booted with less than
|
|
||||||
* 4G of RAM. Windows works better if the entry sets proximity
|
|
||||||
* to the highest NUMA node in the machine.
|
|
||||||
* Memory devices may override proximity set by this entry,
|
|
||||||
* providing _PXM method if necessary.
|
|
||||||
*/
|
|
||||||
if (hotplugabble_address_space_size) {
|
if (hotplugabble_address_space_size) {
|
||||||
build_srat_hotpluggable_memory(table_data, machine->device_memory->base,
|
build_srat_hotpluggable_memory(table_data, machine->device_memory->base,
|
||||||
hotplugabble_address_space_size,
|
hotplugabble_address_space_size,
|
||||||
|
@@ -29,148 +29,11 @@
|
|||||||
#include "hw/arm/linux-boot-if.h"
|
#include "hw/arm/linux-boot-if.h"
|
||||||
#include "sysemu/kvm.h"
|
#include "sysemu/kvm.h"
|
||||||
|
|
||||||
static int gicv3_pre_save(void *opaque)
|
|
||||||
|
static void gicv3_gicd_no_migration_shift_bug_post_load(GICv3State *cs)
|
||||||
{
|
{
|
||||||
GICv3State *s = (GICv3State *)opaque;
|
|
||||||
ARMGICv3CommonClass *c = ARM_GICV3_COMMON_GET_CLASS(s);
|
|
||||||
|
|
||||||
if (c->pre_save) {
|
|
||||||
c->pre_save(s);
|
|
||||||
}
|
|
||||||
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
static int gicv3_post_load(void *opaque, int version_id)
|
|
||||||
{
|
|
||||||
GICv3State *s = (GICv3State *)opaque;
|
|
||||||
ARMGICv3CommonClass *c = ARM_GICV3_COMMON_GET_CLASS(s);
|
|
||||||
|
|
||||||
if (c->post_load) {
|
|
||||||
c->post_load(s);
|
|
||||||
}
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
static bool virt_state_needed(void *opaque)
|
|
||||||
{
|
|
||||||
GICv3CPUState *cs = opaque;
|
|
||||||
|
|
||||||
return cs->num_list_regs != 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
static const VMStateDescription vmstate_gicv3_cpu_virt = {
|
|
||||||
.name = "arm_gicv3_cpu/virt",
|
|
||||||
.version_id = 1,
|
|
||||||
.minimum_version_id = 1,
|
|
||||||
.needed = virt_state_needed,
|
|
||||||
.fields = (VMStateField[]) {
|
|
||||||
VMSTATE_UINT64_2DARRAY(ich_apr, GICv3CPUState, 3, 4),
|
|
||||||
VMSTATE_UINT64(ich_hcr_el2, GICv3CPUState),
|
|
||||||
VMSTATE_UINT64_ARRAY(ich_lr_el2, GICv3CPUState, GICV3_LR_MAX),
|
|
||||||
VMSTATE_UINT64(ich_vmcr_el2, GICv3CPUState),
|
|
||||||
VMSTATE_END_OF_LIST()
|
|
||||||
}
|
|
||||||
};
|
|
||||||
|
|
||||||
static int icc_sre_el1_reg_pre_load(void *opaque)
|
|
||||||
{
|
|
||||||
GICv3CPUState *cs = opaque;
|
|
||||||
|
|
||||||
/*
|
|
||||||
* If the sre_el1 subsection is not transferred this
|
|
||||||
* means SRE_EL1 is 0x7 (which might not be the same as
|
|
||||||
* our reset value).
|
|
||||||
*/
|
|
||||||
cs->icc_sre_el1 = 0x7;
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
static bool icc_sre_el1_reg_needed(void *opaque)
|
|
||||||
{
|
|
||||||
GICv3CPUState *cs = opaque;
|
|
||||||
|
|
||||||
return cs->icc_sre_el1 != 7;
|
|
||||||
}
|
|
||||||
|
|
||||||
const VMStateDescription vmstate_gicv3_cpu_sre_el1 = {
|
|
||||||
.name = "arm_gicv3_cpu/sre_el1",
|
|
||||||
.version_id = 1,
|
|
||||||
.minimum_version_id = 1,
|
|
||||||
.pre_load = icc_sre_el1_reg_pre_load,
|
|
||||||
.needed = icc_sre_el1_reg_needed,
|
|
||||||
.fields = (VMStateField[]) {
|
|
||||||
VMSTATE_UINT64(icc_sre_el1, GICv3CPUState),
|
|
||||||
VMSTATE_END_OF_LIST()
|
|
||||||
}
|
|
||||||
};
|
|
||||||
|
|
||||||
static const VMStateDescription vmstate_gicv3_cpu = {
|
|
||||||
.name = "arm_gicv3_cpu",
|
|
||||||
.version_id = 1,
|
|
||||||
.minimum_version_id = 1,
|
|
||||||
.fields = (VMStateField[]) {
|
|
||||||
VMSTATE_UINT32(level, GICv3CPUState),
|
|
||||||
VMSTATE_UINT32(gicr_ctlr, GICv3CPUState),
|
|
||||||
VMSTATE_UINT32_ARRAY(gicr_statusr, GICv3CPUState, 2),
|
|
||||||
VMSTATE_UINT32(gicr_waker, GICv3CPUState),
|
|
||||||
VMSTATE_UINT64(gicr_propbaser, GICv3CPUState),
|
|
||||||
VMSTATE_UINT64(gicr_pendbaser, GICv3CPUState),
|
|
||||||
VMSTATE_UINT32(gicr_igroupr0, GICv3CPUState),
|
|
||||||
VMSTATE_UINT32(gicr_ienabler0, GICv3CPUState),
|
|
||||||
VMSTATE_UINT32(gicr_ipendr0, GICv3CPUState),
|
|
||||||
VMSTATE_UINT32(gicr_iactiver0, GICv3CPUState),
|
|
||||||
VMSTATE_UINT32(edge_trigger, GICv3CPUState),
|
|
||||||
VMSTATE_UINT32(gicr_igrpmodr0, GICv3CPUState),
|
|
||||||
VMSTATE_UINT32(gicr_nsacr, GICv3CPUState),
|
|
||||||
VMSTATE_UINT8_ARRAY(gicr_ipriorityr, GICv3CPUState, GIC_INTERNAL),
|
|
||||||
VMSTATE_UINT64_ARRAY(icc_ctlr_el1, GICv3CPUState, 2),
|
|
||||||
VMSTATE_UINT64(icc_pmr_el1, GICv3CPUState),
|
|
||||||
VMSTATE_UINT64_ARRAY(icc_bpr, GICv3CPUState, 3),
|
|
||||||
VMSTATE_UINT64_2DARRAY(icc_apr, GICv3CPUState, 3, 4),
|
|
||||||
VMSTATE_UINT64_ARRAY(icc_igrpen, GICv3CPUState, 3),
|
|
||||||
VMSTATE_UINT64(icc_ctlr_el3, GICv3CPUState),
|
|
||||||
VMSTATE_END_OF_LIST()
|
|
||||||
},
|
|
||||||
.subsections = (const VMStateDescription * []) {
|
|
||||||
&vmstate_gicv3_cpu_virt,
|
|
||||||
NULL
|
|
||||||
},
|
|
||||||
.subsections = (const VMStateDescription * []) {
|
|
||||||
&vmstate_gicv3_cpu_sre_el1,
|
|
||||||
NULL
|
|
||||||
}
|
|
||||||
};
|
|
||||||
|
|
||||||
static int gicv3_gicd_no_migration_shift_bug_pre_load(void *opaque)
|
|
||||||
{
|
|
||||||
GICv3State *cs = opaque;
|
|
||||||
|
|
||||||
/*
|
|
||||||
* The gicd_no_migration_shift_bug flag is used for migration compatibility
|
|
||||||
* for old version QEMU which may have the GICD bmp shift bug under KVM mode.
|
|
||||||
* Strictly, what we want to know is whether the migration source is using
|
|
||||||
* KVM. Since we don't have any way to determine that, we look at whether the
|
|
||||||
* destination is using KVM; this is close enough because for the older QEMU
|
|
||||||
* versions with this bug KVM -> TCG migration didn't work anyway. If the
|
|
||||||
* source is a newer QEMU without this bug it will transmit the migration
|
|
||||||
* subsection which sets the flag to true; otherwise it will remain set to
|
|
||||||
* the value we select here.
|
|
||||||
*/
|
|
||||||
if (kvm_enabled()) {
|
|
||||||
cs->gicd_no_migration_shift_bug = false;
|
|
||||||
}
|
|
||||||
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
static int gicv3_gicd_no_migration_shift_bug_post_load(void *opaque,
|
|
||||||
int version_id)
|
|
||||||
{
|
|
||||||
GICv3State *cs = opaque;
|
|
||||||
|
|
||||||
if (cs->gicd_no_migration_shift_bug) {
|
if (cs->gicd_no_migration_shift_bug) {
|
||||||
return 0;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Older versions of QEMU had a bug in the handling of state save/restore
|
/* Older versions of QEMU had a bug in the handling of state save/restore
|
||||||
@@ -199,16 +62,152 @@ static int gicv3_gicd_no_migration_shift_bug_post_load(void *opaque,
|
|||||||
* for next migration to work from this new version QEMU.
|
* for next migration to work from this new version QEMU.
|
||||||
*/
|
*/
|
||||||
cs->gicd_no_migration_shift_bug = true;
|
cs->gicd_no_migration_shift_bug = true;
|
||||||
|
}
|
||||||
|
|
||||||
|
static int gicv3_pre_save(void *opaque)
|
||||||
|
{
|
||||||
|
GICv3State *s = (GICv3State *)opaque;
|
||||||
|
ARMGICv3CommonClass *c = ARM_GICV3_COMMON_GET_CLASS(s);
|
||||||
|
|
||||||
|
if (c->pre_save) {
|
||||||
|
c->pre_save(s);
|
||||||
|
}
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static int gicv3_post_load(void *opaque, int version_id)
|
||||||
|
{
|
||||||
|
GICv3State *s = (GICv3State *)opaque;
|
||||||
|
ARMGICv3CommonClass *c = ARM_GICV3_COMMON_GET_CLASS(s);
|
||||||
|
|
||||||
|
gicv3_gicd_no_migration_shift_bug_post_load(s);
|
||||||
|
|
||||||
|
if (c->post_load) {
|
||||||
|
c->post_load(s);
|
||||||
|
}
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
static bool virt_state_needed(void *opaque)
|
||||||
|
{
|
||||||
|
GICv3CPUState *cs = opaque;
|
||||||
|
|
||||||
|
return cs->num_list_regs != 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
static const VMStateDescription vmstate_gicv3_cpu_virt = {
|
||||||
|
.name = "arm_gicv3_cpu/virt",
|
||||||
|
.version_id = 1,
|
||||||
|
.minimum_version_id = 1,
|
||||||
|
.needed = virt_state_needed,
|
||||||
|
.fields = (VMStateField[]) {
|
||||||
|
VMSTATE_UINT64_2DARRAY(ich_apr, GICv3CPUState, 3, 4),
|
||||||
|
VMSTATE_UINT64(ich_hcr_el2, GICv3CPUState),
|
||||||
|
VMSTATE_UINT64_ARRAY(ich_lr_el2, GICv3CPUState, GICV3_LR_MAX),
|
||||||
|
VMSTATE_UINT64(ich_vmcr_el2, GICv3CPUState),
|
||||||
|
VMSTATE_END_OF_LIST()
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
static int vmstate_gicv3_cpu_pre_load(void *opaque)
|
||||||
|
{
|
||||||
|
GICv3CPUState *cs = opaque;
|
||||||
|
|
||||||
|
/*
|
||||||
|
* If the sre_el1 subsection is not transferred this
|
||||||
|
* means SRE_EL1 is 0x7 (which might not be the same as
|
||||||
|
* our reset value).
|
||||||
|
*/
|
||||||
|
cs->icc_sre_el1 = 0x7;
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
static bool icc_sre_el1_reg_needed(void *opaque)
|
||||||
|
{
|
||||||
|
GICv3CPUState *cs = opaque;
|
||||||
|
|
||||||
|
return cs->icc_sre_el1 != 7;
|
||||||
|
}
|
||||||
|
|
||||||
|
const VMStateDescription vmstate_gicv3_cpu_sre_el1 = {
|
||||||
|
.name = "arm_gicv3_cpu/sre_el1",
|
||||||
|
.version_id = 1,
|
||||||
|
.minimum_version_id = 1,
|
||||||
|
.needed = icc_sre_el1_reg_needed,
|
||||||
|
.fields = (VMStateField[]) {
|
||||||
|
VMSTATE_UINT64(icc_sre_el1, GICv3CPUState),
|
||||||
|
VMSTATE_END_OF_LIST()
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
static const VMStateDescription vmstate_gicv3_cpu = {
|
||||||
|
.name = "arm_gicv3_cpu",
|
||||||
|
.version_id = 1,
|
||||||
|
.minimum_version_id = 1,
|
||||||
|
.pre_load = vmstate_gicv3_cpu_pre_load,
|
||||||
|
.fields = (VMStateField[]) {
|
||||||
|
VMSTATE_UINT32(level, GICv3CPUState),
|
||||||
|
VMSTATE_UINT32(gicr_ctlr, GICv3CPUState),
|
||||||
|
VMSTATE_UINT32_ARRAY(gicr_statusr, GICv3CPUState, 2),
|
||||||
|
VMSTATE_UINT32(gicr_waker, GICv3CPUState),
|
||||||
|
VMSTATE_UINT64(gicr_propbaser, GICv3CPUState),
|
||||||
|
VMSTATE_UINT64(gicr_pendbaser, GICv3CPUState),
|
||||||
|
VMSTATE_UINT32(gicr_igroupr0, GICv3CPUState),
|
||||||
|
VMSTATE_UINT32(gicr_ienabler0, GICv3CPUState),
|
||||||
|
VMSTATE_UINT32(gicr_ipendr0, GICv3CPUState),
|
||||||
|
VMSTATE_UINT32(gicr_iactiver0, GICv3CPUState),
|
||||||
|
VMSTATE_UINT32(edge_trigger, GICv3CPUState),
|
||||||
|
VMSTATE_UINT32(gicr_igrpmodr0, GICv3CPUState),
|
||||||
|
VMSTATE_UINT32(gicr_nsacr, GICv3CPUState),
|
||||||
|
VMSTATE_UINT8_ARRAY(gicr_ipriorityr, GICv3CPUState, GIC_INTERNAL),
|
||||||
|
VMSTATE_UINT64_ARRAY(icc_ctlr_el1, GICv3CPUState, 2),
|
||||||
|
VMSTATE_UINT64(icc_pmr_el1, GICv3CPUState),
|
||||||
|
VMSTATE_UINT64_ARRAY(icc_bpr, GICv3CPUState, 3),
|
||||||
|
VMSTATE_UINT64_2DARRAY(icc_apr, GICv3CPUState, 3, 4),
|
||||||
|
VMSTATE_UINT64_ARRAY(icc_igrpen, GICv3CPUState, 3),
|
||||||
|
VMSTATE_UINT64(icc_ctlr_el3, GICv3CPUState),
|
||||||
|
VMSTATE_END_OF_LIST()
|
||||||
|
},
|
||||||
|
.subsections = (const VMStateDescription * []) {
|
||||||
|
&vmstate_gicv3_cpu_virt,
|
||||||
|
&vmstate_gicv3_cpu_sre_el1,
|
||||||
|
NULL
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
static int gicv3_pre_load(void *opaque)
|
||||||
|
{
|
||||||
|
GICv3State *cs = opaque;
|
||||||
|
|
||||||
|
/*
|
||||||
|
* The gicd_no_migration_shift_bug flag is used for migration compatibility
|
||||||
|
* for old version QEMU which may have the GICD bmp shift bug under KVM mode.
|
||||||
|
* Strictly, what we want to know is whether the migration source is using
|
||||||
|
* KVM. Since we don't have any way to determine that, we look at whether the
|
||||||
|
* destination is using KVM; this is close enough because for the older QEMU
|
||||||
|
* versions with this bug KVM -> TCG migration didn't work anyway. If the
|
||||||
|
* source is a newer QEMU without this bug it will transmit the migration
|
||||||
|
* subsection which sets the flag to true; otherwise it will remain set to
|
||||||
|
* the value we select here.
|
||||||
|
*/
|
||||||
|
if (kvm_enabled()) {
|
||||||
|
cs->gicd_no_migration_shift_bug = false;
|
||||||
|
}
|
||||||
|
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
static bool needed_always(void *opaque)
|
||||||
|
{
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
const VMStateDescription vmstate_gicv3_gicd_no_migration_shift_bug = {
|
const VMStateDescription vmstate_gicv3_gicd_no_migration_shift_bug = {
|
||||||
.name = "arm_gicv3/gicd_no_migration_shift_bug",
|
.name = "arm_gicv3/gicd_no_migration_shift_bug",
|
||||||
.version_id = 1,
|
.version_id = 1,
|
||||||
.minimum_version_id = 1,
|
.minimum_version_id = 1,
|
||||||
.pre_load = gicv3_gicd_no_migration_shift_bug_pre_load,
|
.needed = needed_always,
|
||||||
.post_load = gicv3_gicd_no_migration_shift_bug_post_load,
|
|
||||||
.fields = (VMStateField[]) {
|
.fields = (VMStateField[]) {
|
||||||
VMSTATE_BOOL(gicd_no_migration_shift_bug, GICv3State),
|
VMSTATE_BOOL(gicd_no_migration_shift_bug, GICv3State),
|
||||||
VMSTATE_END_OF_LIST()
|
VMSTATE_END_OF_LIST()
|
||||||
@@ -219,6 +218,7 @@ static const VMStateDescription vmstate_gicv3 = {
|
|||||||
.name = "arm_gicv3",
|
.name = "arm_gicv3",
|
||||||
.version_id = 1,
|
.version_id = 1,
|
||||||
.minimum_version_id = 1,
|
.minimum_version_id = 1,
|
||||||
|
.pre_load = gicv3_pre_load,
|
||||||
.pre_save = gicv3_pre_save,
|
.pre_save = gicv3_pre_save,
|
||||||
.post_load = gicv3_post_load,
|
.post_load = gicv3_post_load,
|
||||||
.priority = MIG_PRI_GICV3,
|
.priority = MIG_PRI_GICV3,
|
||||||
|
@@ -554,9 +554,8 @@ static void cuda_init(Object *obj)
|
|||||||
CUDAState *s = CUDA(obj);
|
CUDAState *s = CUDA(obj);
|
||||||
SysBusDevice *sbd = SYS_BUS_DEVICE(obj);
|
SysBusDevice *sbd = SYS_BUS_DEVICE(obj);
|
||||||
|
|
||||||
object_initialize(&s->mos6522_cuda, sizeof(s->mos6522_cuda),
|
sysbus_init_child_obj(obj, "mos6522-cuda", &s->mos6522_cuda,
|
||||||
TYPE_MOS6522_CUDA);
|
sizeof(s->mos6522_cuda), TYPE_MOS6522_CUDA);
|
||||||
qdev_set_parent_bus(DEVICE(&s->mos6522_cuda), sysbus_get_default());
|
|
||||||
|
|
||||||
memory_region_init_io(&s->mem, obj, &mos6522_cuda_ops, s, "cuda", 0x2000);
|
memory_region_init_io(&s->mem, obj, &mos6522_cuda_ops, s, "cuda", 0x2000);
|
||||||
sysbus_init_mmio(sbd, &s->mem);
|
sysbus_init_mmio(sbd, &s->mem);
|
||||||
|
@@ -209,14 +209,11 @@ static void macio_oldworld_realize(PCIDevice *d, Error **errp)
|
|||||||
static void macio_init_ide(MacIOState *s, MACIOIDEState *ide, size_t ide_size,
|
static void macio_init_ide(MacIOState *s, MACIOIDEState *ide, size_t ide_size,
|
||||||
int index)
|
int index)
|
||||||
{
|
{
|
||||||
gchar *name;
|
gchar *name = g_strdup_printf("ide[%i]", index);
|
||||||
|
|
||||||
object_initialize(ide, ide_size, TYPE_MACIO_IDE);
|
sysbus_init_child_obj(OBJECT(s), name, ide, ide_size, TYPE_MACIO_IDE);
|
||||||
qdev_set_parent_bus(DEVICE(ide), sysbus_get_default());
|
|
||||||
memory_region_add_subregion(&s->bar, 0x1f000 + ((index + 1) * 0x1000),
|
memory_region_add_subregion(&s->bar, 0x1f000 + ((index + 1) * 0x1000),
|
||||||
&ide->mem);
|
&ide->mem);
|
||||||
name = g_strdup_printf("ide[%i]", index);
|
|
||||||
object_property_add_child(OBJECT(s), name, OBJECT(ide), NULL);
|
|
||||||
g_free(name);
|
g_free(name);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -232,9 +229,7 @@ static void macio_oldworld_init(Object *obj)
|
|||||||
qdev_prop_allow_set_link_before_realize,
|
qdev_prop_allow_set_link_before_realize,
|
||||||
0, NULL);
|
0, NULL);
|
||||||
|
|
||||||
object_initialize(&s->cuda, sizeof(s->cuda), TYPE_CUDA);
|
sysbus_init_child_obj(obj, "cuda", &s->cuda, sizeof(s->cuda), TYPE_CUDA);
|
||||||
qdev_set_parent_bus(DEVICE(&s->cuda), sysbus_get_default());
|
|
||||||
object_property_add_child(obj, "cuda", OBJECT(&s->cuda), NULL);
|
|
||||||
|
|
||||||
object_initialize(&os->nvram, sizeof(os->nvram), TYPE_MACIO_NVRAM);
|
object_initialize(&os->nvram, sizeof(os->nvram), TYPE_MACIO_NVRAM);
|
||||||
dev = DEVICE(&os->nvram);
|
dev = DEVICE(&os->nvram);
|
||||||
@@ -390,8 +385,8 @@ static void macio_newworld_init(Object *obj)
|
|||||||
qdev_prop_allow_set_link_before_realize,
|
qdev_prop_allow_set_link_before_realize,
|
||||||
0, NULL);
|
0, NULL);
|
||||||
|
|
||||||
object_initialize(&ns->gpio, sizeof(ns->gpio), TYPE_MACIO_GPIO);
|
sysbus_init_child_obj(obj, "gpio", &ns->gpio, sizeof(ns->gpio),
|
||||||
qdev_set_parent_bus(DEVICE(&ns->gpio), sysbus_get_default());
|
TYPE_MACIO_GPIO);
|
||||||
|
|
||||||
for (i = 0; i < 2; i++) {
|
for (i = 0; i < 2; i++) {
|
||||||
macio_init_ide(s, &ns->ide[i], sizeof(ns->ide[i]), i);
|
macio_init_ide(s, &ns->ide[i], sizeof(ns->ide[i]), i);
|
||||||
@@ -404,13 +399,10 @@ static void macio_instance_init(Object *obj)
|
|||||||
|
|
||||||
memory_region_init(&s->bar, obj, "macio", 0x80000);
|
memory_region_init(&s->bar, obj, "macio", 0x80000);
|
||||||
|
|
||||||
object_initialize(&s->dbdma, sizeof(s->dbdma), TYPE_MAC_DBDMA);
|
sysbus_init_child_obj(obj, "dbdma", &s->dbdma, sizeof(s->dbdma),
|
||||||
qdev_set_parent_bus(DEVICE(&s->dbdma), sysbus_get_default());
|
TYPE_MAC_DBDMA);
|
||||||
object_property_add_child(obj, "dbdma", OBJECT(&s->dbdma), NULL);
|
|
||||||
|
|
||||||
object_initialize(&s->escc, sizeof(s->escc), TYPE_ESCC);
|
sysbus_init_child_obj(obj, "escc", &s->escc, sizeof(s->escc), TYPE_ESCC);
|
||||||
qdev_set_parent_bus(DEVICE(&s->escc), sysbus_get_default());
|
|
||||||
object_property_add_child(obj, "escc", OBJECT(&s->escc), NULL);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
static const VMStateDescription vmstate_macio_oldworld = {
|
static const VMStateDescription vmstate_macio_oldworld = {
|
||||||
|
@@ -770,9 +770,8 @@ static void pmu_init(Object *obj)
|
|||||||
qdev_prop_allow_set_link_before_realize,
|
qdev_prop_allow_set_link_before_realize,
|
||||||
0, NULL);
|
0, NULL);
|
||||||
|
|
||||||
object_initialize(&s->mos6522_pmu, sizeof(s->mos6522_pmu),
|
sysbus_init_child_obj(obj, "mos6522-pmu", &s->mos6522_pmu,
|
||||||
TYPE_MOS6522_PMU);
|
sizeof(s->mos6522_pmu), TYPE_MOS6522_PMU);
|
||||||
qdev_set_parent_bus(DEVICE(&s->mos6522_pmu), sysbus_get_default());
|
|
||||||
|
|
||||||
memory_region_init_io(&s->mem, obj, &mos6522_pmu_ops, s, "via-pmu",
|
memory_region_init_io(&s->mem, obj, &mos6522_pmu_ops, s, "via-pmu",
|
||||||
0x2000);
|
0x2000);
|
||||||
|
@@ -57,7 +57,7 @@ typedef struct PPC440PCIXState {
|
|||||||
struct PLBOutMap pom[PPC440_PCIX_NR_POMS];
|
struct PLBOutMap pom[PPC440_PCIX_NR_POMS];
|
||||||
struct PLBInMap pim[PPC440_PCIX_NR_PIMS];
|
struct PLBInMap pim[PPC440_PCIX_NR_PIMS];
|
||||||
uint32_t sts;
|
uint32_t sts;
|
||||||
qemu_irq irq[PCI_NUM_PINS];
|
qemu_irq irq;
|
||||||
AddressSpace bm_as;
|
AddressSpace bm_as;
|
||||||
MemoryRegion bm;
|
MemoryRegion bm;
|
||||||
|
|
||||||
@@ -418,21 +418,20 @@ static void ppc440_pcix_reset(DeviceState *dev)
|
|||||||
* This may need further refactoring for other boards. */
|
* This may need further refactoring for other boards. */
|
||||||
static int ppc440_pcix_map_irq(PCIDevice *pci_dev, int irq_num)
|
static int ppc440_pcix_map_irq(PCIDevice *pci_dev, int irq_num)
|
||||||
{
|
{
|
||||||
int slot = pci_dev->devfn >> 3;
|
trace_ppc440_pcix_map_irq(pci_dev->devfn, irq_num, 0);
|
||||||
trace_ppc440_pcix_map_irq(pci_dev->devfn, irq_num, slot);
|
return 0;
|
||||||
return slot - 1;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
static void ppc440_pcix_set_irq(void *opaque, int irq_num, int level)
|
static void ppc440_pcix_set_irq(void *opaque, int irq_num, int level)
|
||||||
{
|
{
|
||||||
qemu_irq *pci_irqs = opaque;
|
qemu_irq *pci_irq = opaque;
|
||||||
|
|
||||||
trace_ppc440_pcix_set_irq(irq_num);
|
trace_ppc440_pcix_set_irq(irq_num);
|
||||||
if (irq_num < 0) {
|
if (irq_num < 0) {
|
||||||
error_report("%s: PCI irq %d", __func__, irq_num);
|
error_report("%s: PCI irq %d", __func__, irq_num);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
qemu_set_irq(pci_irqs[irq_num], level);
|
qemu_set_irq(*pci_irq, level);
|
||||||
}
|
}
|
||||||
|
|
||||||
static AddressSpace *ppc440_pcix_set_iommu(PCIBus *b, void *opaque, int devfn)
|
static AddressSpace *ppc440_pcix_set_iommu(PCIBus *b, void *opaque, int devfn)
|
||||||
@@ -471,19 +470,15 @@ static int ppc440_pcix_initfn(SysBusDevice *dev)
|
|||||||
{
|
{
|
||||||
PPC440PCIXState *s;
|
PPC440PCIXState *s;
|
||||||
PCIHostState *h;
|
PCIHostState *h;
|
||||||
int i;
|
|
||||||
|
|
||||||
h = PCI_HOST_BRIDGE(dev);
|
h = PCI_HOST_BRIDGE(dev);
|
||||||
s = PPC440_PCIX_HOST_BRIDGE(dev);
|
s = PPC440_PCIX_HOST_BRIDGE(dev);
|
||||||
|
|
||||||
for (i = 0; i < ARRAY_SIZE(s->irq); i++) {
|
sysbus_init_irq(dev, &s->irq);
|
||||||
sysbus_init_irq(dev, &s->irq[i]);
|
|
||||||
}
|
|
||||||
|
|
||||||
memory_region_init(&s->busmem, OBJECT(dev), "pci bus memory", UINT64_MAX);
|
memory_region_init(&s->busmem, OBJECT(dev), "pci bus memory", UINT64_MAX);
|
||||||
h->bus = pci_register_root_bus(DEVICE(dev), NULL, ppc440_pcix_set_irq,
|
h->bus = pci_register_root_bus(DEVICE(dev), NULL, ppc440_pcix_set_irq,
|
||||||
ppc440_pcix_map_irq, s->irq, &s->busmem,
|
ppc440_pcix_map_irq, &s->irq, &s->busmem,
|
||||||
get_system_io(), PCI_DEVFN(0, 0), 4, TYPE_PCI_BUS);
|
get_system_io(), PCI_DEVFN(0, 0), 1, TYPE_PCI_BUS);
|
||||||
|
|
||||||
s->dev = pci_create_simple(h->bus, PCI_DEVFN(0, 0), "ppc4xx-host-bridge");
|
s->dev = pci_create_simple(h->bus, PCI_DEVFN(0, 0), "ppc4xx-host-bridge");
|
||||||
|
|
||||||
|
@@ -515,10 +515,8 @@ static void sam460ex_init(MachineState *machine)
|
|||||||
|
|
||||||
/* PCI bus */
|
/* PCI bus */
|
||||||
ppc460ex_pcie_init(env);
|
ppc460ex_pcie_init(env);
|
||||||
/* FIXME: is this correct? */
|
/* All PCI irqs are connected to the same UIC pin (cf. UBoot source) */
|
||||||
dev = sysbus_create_varargs("ppc440-pcix-host", 0xc0ec00000,
|
dev = sysbus_create_simple("ppc440-pcix-host", 0xc0ec00000, uic[1][0]);
|
||||||
uic[1][0], uic[1][20], uic[1][21], uic[1][22],
|
|
||||||
NULL);
|
|
||||||
pci_bus = (PCIBus *)qdev_get_child_bus(dev, "pci.0");
|
pci_bus = (PCIBus *)qdev_get_child_bus(dev, "pci.0");
|
||||||
if (!pci_bus) {
|
if (!pci_bus) {
|
||||||
error_report("couldn't create PCI controller!");
|
error_report("couldn't create PCI controller!");
|
||||||
|
@@ -663,12 +663,14 @@ static void vhost_iommu_region_add(MemoryListener *listener,
|
|||||||
struct vhost_iommu *iommu;
|
struct vhost_iommu *iommu;
|
||||||
Int128 end;
|
Int128 end;
|
||||||
int iommu_idx;
|
int iommu_idx;
|
||||||
IOMMUMemoryRegion *iommu_mr = IOMMU_MEMORY_REGION(section->mr);
|
IOMMUMemoryRegion *iommu_mr;
|
||||||
|
|
||||||
if (!memory_region_is_iommu(section->mr)) {
|
if (!memory_region_is_iommu(section->mr)) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
iommu_mr = IOMMU_MEMORY_REGION(section->mr);
|
||||||
|
|
||||||
iommu = g_malloc0(sizeof(*iommu));
|
iommu = g_malloc0(sizeof(*iommu));
|
||||||
end = int128_add(int128_make64(section->offset_within_region),
|
end = int128_add(int128_make64(section->offset_within_region),
|
||||||
section->size);
|
section->size);
|
||||||
|
@@ -125,6 +125,7 @@ typedef struct VirtIOGPU {
|
|||||||
uint32_t bytes_3d;
|
uint32_t bytes_3d;
|
||||||
} stats;
|
} stats;
|
||||||
|
|
||||||
|
void (*disable_scanout)(struct VirtIOGPU *g, int scanout_id);
|
||||||
Error *migration_blocker;
|
Error *migration_blocker;
|
||||||
} VirtIOGPU;
|
} VirtIOGPU;
|
||||||
|
|
||||||
|
@@ -154,7 +154,7 @@ m_inc(struct mbuf *m, int size)
|
|||||||
int datasize;
|
int datasize;
|
||||||
|
|
||||||
/* some compilers throw up on gotos. This one we can fake. */
|
/* some compilers throw up on gotos. This one we can fake. */
|
||||||
if (m->m_size > size) {
|
if (M_ROOM(m) > size) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -184,6 +184,7 @@ static const VMStateDescription vmstate_m_faultmask_primask = {
|
|||||||
.name = "cpu/m/faultmask-primask",
|
.name = "cpu/m/faultmask-primask",
|
||||||
.version_id = 1,
|
.version_id = 1,
|
||||||
.minimum_version_id = 1,
|
.minimum_version_id = 1,
|
||||||
|
.needed = m_needed,
|
||||||
.fields = (VMStateField[]) {
|
.fields = (VMStateField[]) {
|
||||||
VMSTATE_UINT32(env.v7m.faultmask[M_REG_NS], ARMCPU),
|
VMSTATE_UINT32(env.v7m.faultmask[M_REG_NS], ARMCPU),
|
||||||
VMSTATE_UINT32(env.v7m.primask[M_REG_NS], ARMCPU),
|
VMSTATE_UINT32(env.v7m.primask[M_REG_NS], ARMCPU),
|
||||||
@@ -230,6 +231,7 @@ static const VMStateDescription vmstate_m_scr = {
|
|||||||
.name = "cpu/m/scr",
|
.name = "cpu/m/scr",
|
||||||
.version_id = 1,
|
.version_id = 1,
|
||||||
.minimum_version_id = 1,
|
.minimum_version_id = 1,
|
||||||
|
.needed = m_needed,
|
||||||
.fields = (VMStateField[]) {
|
.fields = (VMStateField[]) {
|
||||||
VMSTATE_UINT32(env.v7m.scr[M_REG_NS], ARMCPU),
|
VMSTATE_UINT32(env.v7m.scr[M_REG_NS], ARMCPU),
|
||||||
VMSTATE_END_OF_LIST()
|
VMSTATE_END_OF_LIST()
|
||||||
@@ -240,6 +242,7 @@ static const VMStateDescription vmstate_m_other_sp = {
|
|||||||
.name = "cpu/m/other-sp",
|
.name = "cpu/m/other-sp",
|
||||||
.version_id = 1,
|
.version_id = 1,
|
||||||
.minimum_version_id = 1,
|
.minimum_version_id = 1,
|
||||||
|
.needed = m_needed,
|
||||||
.fields = (VMStateField[]) {
|
.fields = (VMStateField[]) {
|
||||||
VMSTATE_UINT32(env.v7m.other_sp, ARMCPU),
|
VMSTATE_UINT32(env.v7m.other_sp, ARMCPU),
|
||||||
VMSTATE_END_OF_LIST()
|
VMSTATE_END_OF_LIST()
|
||||||
|
@@ -149,7 +149,7 @@ static void xtensa_cpu_initfn(Object *obj)
|
|||||||
#ifndef CONFIG_USER_ONLY
|
#ifndef CONFIG_USER_ONLY
|
||||||
env->address_space_er = g_malloc(sizeof(*env->address_space_er));
|
env->address_space_er = g_malloc(sizeof(*env->address_space_er));
|
||||||
env->system_er = g_malloc(sizeof(*env->system_er));
|
env->system_er = g_malloc(sizeof(*env->system_er));
|
||||||
memory_region_init_io(env->system_er, NULL, NULL, env, "er",
|
memory_region_init_io(env->system_er, obj, NULL, env, "er",
|
||||||
UINT64_C(0x100000000));
|
UINT64_C(0x100000000));
|
||||||
address_space_init(env->address_space_er, env->system_er, "ER");
|
address_space_init(env->address_space_er, env->system_er, "ER");
|
||||||
#endif
|
#endif
|
||||||
|
@@ -1094,9 +1094,9 @@ void tcg_optimize(TCGContext *s)
|
|||||||
tmp = arg_info(op->args[1])->val;
|
tmp = arg_info(op->args[1])->val;
|
||||||
tmp = dup_const(TCGOP_VECE(op), tmp);
|
tmp = dup_const(TCGOP_VECE(op), tmp);
|
||||||
tcg_opt_gen_movi(s, op, op->args[0], tmp);
|
tcg_opt_gen_movi(s, op, op->args[0], tmp);
|
||||||
continue;
|
|
||||||
}
|
|
||||||
break;
|
break;
|
||||||
|
}
|
||||||
|
goto do_default;
|
||||||
|
|
||||||
CASE_OP_32_64(not):
|
CASE_OP_32_64(not):
|
||||||
CASE_OP_32_64(neg):
|
CASE_OP_32_64(neg):
|
||||||
|
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Reference in New Issue
Block a user