From 5ec7d09818881b87052c41259e5cb781683977d2 Mon Sep 17 00:00:00 2001 From: Gerd Hoffmann Date: Fri, 24 Jun 2016 13:35:17 +0200 Subject: xen: fix ram init regression Commit "8156d48 pc: allow raising low memory via max-ram-below-4g option" causes a regression on xen, because it uses a different memory split. This patch initializes max-ram-below-4g to zero and leaves the initialization to the memory initialization functions. That way they can pick different default values (max-ram-below-4g is zero still) or use the user supplied value (max-ram-below-4g is non-zero). Also skip the whole ram split calculation on Xen. xen_ram_init() does its own split calculation anyway so it is superfluous, also this way xen_ram_init can actually see whenever max-ram-below-4g is zero or not. Reported-by: Anthony PERARD Tested-by: Anthony PERARD Signed-off-by: Gerd Hoffmann Reviewed-by: Michael S. Tsirkin Signed-off-by: Michael S. Tsirkin --- hw/i386/pc_q35.c | 3 +++ 1 file changed, 3 insertions(+) (limited to 'hw/i386/pc_q35.c') diff --git a/hw/i386/pc_q35.c b/hw/i386/pc_q35.c index 04b2684d37..cd57bced1a 100644 --- a/hw/i386/pc_q35.c +++ b/hw/i386/pc_q35.c @@ -94,6 +94,9 @@ static void pc_q35_init(MachineState *machine) /* Handle the machine opt max-ram-below-4g. It is basically doing * min(qemu limit, user limit). */ + if (!pcms->max_ram_below_4g) { + pcms->max_ram_below_4g = 1ULL << 32; /* default: 4G */; + } if (lowmem > pcms->max_ram_below_4g) { lowmem = pcms->max_ram_below_4g; if (machine->ram_size - lowmem > lowmem && -- cgit v1.2.3 From bf8d492405feaee2c1685b3b9d5e03228ed3e47f Mon Sep 17 00:00:00 2001 From: Marcel Apfelbaum Date: Mon, 27 Jun 2016 18:38:33 +0300 Subject: q35: allow dynamic sysbus Allow adding sysbus devices with -device on Q35. At first Q35 will support only intel-iommu to be added this way, however the command line will support all sysbus devices. Mark with 'cannot_instantiate_with_device_add_yet' the ones causing immediate problems (e.g. crashes). Signed-off-by: Marcel Apfelbaum Reviewed-by: Michael S. Tsirkin Signed-off-by: Michael S. Tsirkin --- hw/i386/pc_q35.c | 1 + 1 file changed, 1 insertion(+) (limited to 'hw/i386/pc_q35.c') diff --git a/hw/i386/pc_q35.c b/hw/i386/pc_q35.c index cd57bced1a..fbaf2e6ca2 100644 --- a/hw/i386/pc_q35.c +++ b/hw/i386/pc_q35.c @@ -290,6 +290,7 @@ static void pc_q35_machine_options(MachineClass *m) m->default_machine_opts = "firmware=bios-256k.bin"; m->default_display = "std"; m->no_floppy = 1; + m->has_dynamic_sysbus = true; } static void pc_q35_2_7_machine_options(MachineClass *m) -- cgit v1.2.3 From 621d983a1f9051f4cfc3f402569b46b77d8449fc Mon Sep 17 00:00:00 2001 From: Marcel Apfelbaum Date: Mon, 27 Jun 2016 18:38:34 +0300 Subject: hw/iommu: enable iommu with -device Use the standard '-device intel-iommu' to create the IOMMU device. The legacy '-machine,iommu=on' can still be used. Signed-off-by: Marcel Apfelbaum Reviewed-by: Michael S. Tsirkin Signed-off-by: Michael S. Tsirkin --- hw/i386/pc_q35.c | 1 - 1 file changed, 1 deletion(-) (limited to 'hw/i386/pc_q35.c') diff --git a/hw/i386/pc_q35.c b/hw/i386/pc_q35.c index fbaf2e6ca2..c0b9961928 100644 --- a/hw/i386/pc_q35.c +++ b/hw/i386/pc_q35.c @@ -179,7 +179,6 @@ static void pc_q35_init(MachineState *machine) qdev_init_nofail(DEVICE(q35_host)); phb = PCI_HOST_BRIDGE(q35_host); host_bus = phb->bus; - pcms->bus = phb->bus; /* create ISA bus */ lpc = pci_create_simple_multifunction(host_bus, PCI_DEVFN(ICH9_LPC_DEV, ICH9_LPC_FUNC), true, -- cgit v1.2.3