aboutsummaryrefslogtreecommitdiff
path: root/hw/ppc/spapr.c
diff options
context:
space:
mode:
authorPeter Maydell <peter.maydell@linaro.org>2016-06-07 12:54:25 +0100
committerPeter Maydell <peter.maydell@linaro.org>2016-06-07 12:54:25 +0100
commit0601d6a4112a5b0333d2348aa2c3465cc0075ec6 (patch)
tree5ffd5808261948ec27f3160aece62acc7c20ddcb /hw/ppc/spapr.c
parent76462405809d29bab65a3699686998ba124ab942 (diff)
parent4d6a0680fa425230748a2d91d81be9afe050eeb3 (diff)
downloadqemu-0601d6a4112a5b0333d2348aa2c3465cc0075ec6.zip
qemu-0601d6a4112a5b0333d2348aa2c3465cc0075ec6.tar.gz
qemu-0601d6a4112a5b0333d2348aa2c3465cc0075ec6.tar.bz2
Merge remote-tracking branch 'remotes/dgibson/tags/ppc-for-2.7-20160607' into staging
ppc patch queue for 2016-05-31 Latest patch queue for ppc. Several significant things in here: * A bunch of patches from BenH fixing things in TCG - This should fix several regressions introduced by recent patches for better HV mode support - It also fixes some other bugs discovered along the way * Some fixes and cleanups for Mac machine types from Marc Cave-Ayland * Preliminary patches towards dynamic DMA window support from Alexey Kardashevskiy - This includes a patch to migration code code * Increase number of hotpluggable memory slots - Includes a change to KVM generic code, ACKed by Paolo * Another TCG fix for an SPE instruction # gpg: Signature made Tue 07 Jun 2016 11:46:57 BST # gpg: using RSA key 0x6C38CACA20D9B392 # gpg: Good signature from "David Gibson <david@gibson.dropbear.id.au>" # gpg: aka "David Gibson (Red Hat) <dgibson@redhat.com>" # gpg: aka "David Gibson (ozlabs.org) <dgibson@ozlabs.org>" # gpg: WARNING: This key is not certified with sufficiently trusted signatures! # gpg: It is not certain that the signature belongs to the owner. # Primary key fingerprint: 75F4 6586 AE61 A66C C44E 87DC 6C38 CACA 20D9 B392 * remotes/dgibson/tags/ppc-for-2.7-20160607: (26 commits) ppc: Do not take exceptions on unknown SPRs in privileged mode ppc: Add missing slbfee. instruction on ppc64 BookS processors ppc: Fix slbia decode ppc: Fix mtmsr decoding ppc: POWER7 has lq/stq instructions and stq need to check ISA ppc: POWER7 had ACOP and PID registers ppc: Batch TLB flushes on 32-bit 6xx/7xx/7xxx in hash mode ppc: Fix tlb invalidations on 6xx/7xx/7xxx 32-bit processors ppc: Properly tag the translation cache based on MMU mode dbdma: use DMA memory interface for memory accesses macio: use DMA memory interface for non-block ATAPI transfers target-ppc: fixup bitrot in mmu_helper.c debug statements spapr_pci: Drop cannot_instantiate_with_device_add_yet=false ppc: fix hrfid, tlbia and slbia privilege ppc: Fix hreg_store_msr() so that non-HV mode cannot alter MSR:HV ppc: Better figure out if processor has HV mode spapr: Introduce pseries-2.7 machine type spapr: Increase hotpluggable memory slots to 256 spapr_pci: Add and export DMA resetting helper spapr_pci: Reset DMA config on PHB reset ... Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
Diffstat (limited to 'hw/ppc/spapr.c')
-rw-r--r--hw/ppc/spapr.c36
1 files changed, 32 insertions, 4 deletions
diff --git a/hw/ppc/spapr.c b/hw/ppc/spapr.c
index 44e401a..0636642 100644
--- a/hw/ppc/spapr.c
+++ b/hw/ppc/spapr.c
@@ -1816,11 +1816,21 @@ static void ppc_spapr_init(MachineState *machine)
/* initialize hotplug memory address space */
if (machine->ram_size < machine->maxram_size) {
ram_addr_t hotplug_mem_size = machine->maxram_size - machine->ram_size;
+ /*
+ * Limit the number of hotpluggable memory slots to half the number
+ * slots that KVM supports, leaving the other half for PCI and other
+ * devices. However ensure that number of slots doesn't drop below 32.
+ */
+ int max_memslots = kvm_enabled() ? kvm_get_max_memslots() / 2 :
+ SPAPR_MAX_RAM_SLOTS;
- if (machine->ram_slots > SPAPR_MAX_RAM_SLOTS) {
+ if (max_memslots < SPAPR_MAX_RAM_SLOTS) {
+ max_memslots = SPAPR_MAX_RAM_SLOTS;
+ }
+ if (machine->ram_slots > max_memslots) {
error_report("Specified number of memory slots %"
PRIu64" exceeds max supported %d",
- machine->ram_slots, SPAPR_MAX_RAM_SLOTS);
+ machine->ram_slots, max_memslots);
exit(1);
}
@@ -2344,18 +2354,36 @@ static const TypeInfo spapr_machine_info = {
type_init(spapr_machine_register_##suffix)
/*
+ * pseries-2.7
+ */
+static void spapr_machine_2_7_instance_options(MachineState *machine)
+{
+}
+
+static void spapr_machine_2_7_class_options(MachineClass *mc)
+{
+ /* Defaults for the latest behaviour inherited from the base class */
+}
+
+DEFINE_SPAPR_MACHINE(2_7, "2.7", true);
+
+/*
* pseries-2.6
*/
+#define SPAPR_COMPAT_2_6 \
+ HW_COMPAT_2_6
+
static void spapr_machine_2_6_instance_options(MachineState *machine)
{
}
static void spapr_machine_2_6_class_options(MachineClass *mc)
{
- /* Defaults for the latest behaviour inherited from the base class */
+ spapr_machine_2_7_class_options(mc);
+ SET_MACHINE_COMPAT(mc, SPAPR_COMPAT_2_6);
}
-DEFINE_SPAPR_MACHINE(2_6, "2.6", true);
+DEFINE_SPAPR_MACHINE(2_6, "2.6", false);
/*
* pseries-2.5