Skip to contentSkip to conversation

ppc-for-2.11 queue 20171204

GIT PULL Applied David Gibson 2 participants 7 messages Dec 4, 2017 – Dec 5, 2017

lore
Share & tools
lore
#0 lore raw

The following changes since commit c11d61271b9e6e7a1f0479ef1ca8fb55fa457a62:

Update version for v2.11.0-rc3 release (2017-11-29 17:59:34 +0000)

are available in the Git repository at:

git://github.com/dgibson/qemu.git tags/ppc-for-2.11-20171204

for you to fetch changes up to 768a20f3a491ed4afce73ebb65347d55251c0ebd:

spapr: Include "pre-plugged" DIMMS in ram size calculation at reset (2017-12-04 11:31:22 +1100)

----------------------------------------------------------------
ppc patch queue 2017-12-04

We are, alas, not yet to the bottom of ppc bugs. This pull request fixes several more. I believe they're important enough to include in 2.11. despite the late date.

----------------------------------------------------------------
David Gibson (1):
spapr: Include "pre-plugged" DIMMS in ram size calculation at reset

Kurban Mallachiev (1):
target-ppc: Don't invalidate non-supported msr bits

Laurent Vivier (1):
pseries: fix TCG migration

 hw/ppc/spapr.c       | 7 +++++--
 target/ppc/machine.c | 4 ++--
 2 files changed, 7 insertions(+), 4 deletions(-)
#1 lore raw

[Qemu-devel] [PULL 1/3] pseries: fix TCG migration

From: Laurent Vivier <[email protected]>

Migration of pseries is broken with TCG because QEMU tries to restore KVM MMU state unconditionally.

The result is a SIGSEGV in kvm_vm_ioctl():

#0 kvm_vm_ioctl (s=0x0, type=-2146390353)

      at qemu/accel/kvm/kvm-all.c:2032
  #1  0x00000001003e3e2c in kvmppc_configure_v3_mmu (cpu=<optimized out>,
      radix=<optimized out>, gtse=<optimized out>, proc_tbl=<optimized out>)
      at qemu/target/ppc/kvm.c:396
  #2  0x00000001002f8b88 in spapr_post_load (opaque=0x1019103c0,
      version_id=<optimized out>) at qemu/hw/ppc/spapr.c:1578
  #3  0x000000010059e4cc in vmstate_load_state (f=0x106230000,
      vmsd=0x1009479e0 <vmstate_spapr>, opaque=0x1019103c0,
      version_id=<optimized out>) at qemu/migration/vmstate.c:165
  #4  0x00000001005987e0 in vmstate_load (f=<optimized out>, se=<optimized out>)
      at qemu/migration/savevm.c:748

This patch fixes the problem by not calling the KVM function with the TCG mode.

Fixes d39c90f5f3 ("spapr: Fix migration of Radix guests")
---
 hw/ppc/spapr.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
hw/ppc/spapr.c +1 -1
index 9efddeaee5..a471de6cab 100644
@@ -1570,7 +1570,7 @@ static int spapr_post_load(void *opaque, int version_id)
         err = spapr_rtc_import_offset(&spapr->rtc, spapr->rtc_offset);
     }
 
-    if (spapr->patb_entry) {
+    if (kvm_enabled() && spapr->patb_entry) {
         PowerPCCPU *cpu = POWERPC_CPU(first_cpu);
         bool radix = !!(spapr->patb_entry & PATBE1_GR);
         bool gtse = !!(cpu->env.spr[SPR_LPCR] & LPCR_GTSE);
Signature · 1 line
2.14.3
#2 lore raw

[Qemu-devel] [PULL 2/3] target-ppc: Don't invalidate non-supported msr bits

In reply to David Gibson

From: Kurban Mallachiev <[email protected]>

The msr invalidation code (commits 993eb and 2360b) inverts all bits except MSR_TGPR and MSR_HVB. On non PowerPC 601 processors this leads to incorrect change of excp_prefix in hreg_store_msr() function. The problem is that new msr value get multiplied by msr_mask and inverted msr does not, thus values of MSR_EP bit in new msr value and inverted msr are distinct, so that excp_prefix changes but should not.

---
 target/ppc/machine.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
target/ppc/machine.c +2 -2
index 24117e8f31..e475206c6a 100644
@@ -300,9 +300,9 @@ static int cpu_post_load(void *opaque, int version_id)
         ppc_store_sdr1(env, env->spr[SPR_SDR1]);
     }
 
-    /* Invalidate all msr bits except MSR_TGPR/MSR_HVB before restoring */
+    /* Invalidate all supported msr bits except MSR_TGPR/MSR_HVB before restoring */
     msr = env->msr;
-    env->msr ^= ~((1ULL << MSR_TGPR) | MSR_HVB);
+    env->msr ^= env->msr_mask & ~((1ULL << MSR_TGPR) | MSR_HVB);
     ppc_store_msr(env, msr);
 
     hreg_compute_mem_idx(env);
Signature · 1 line
2.14.3
#3 lore raw

[Qemu-devel] [PULL 3/3] spapr: Include "pre-plugged" DIMMS in ram size calculation at reset

In reply to David Gibson

At guest reset time, we allocate a hash page table (HPT) for the guest based on the guest's RAM size. If dynamic HPT resizing is not available we use the maximum RAM size, if it is we use the current RAM size.

But the "current RAM size" calculation is incorrect - we just use the "base" ram_size from the machine structure. This doesn't include any pluggable DIMMs that are already plugged at reset time.

This means that if you try to start a 'pseries' machine with a DIMM specified on the command line that's much larger than the "base" RAM size, then the guest will get a woefully inadequate HPT. This can lead to a guest freeze during boot as it runs out of HPT space during initial MMU setup.

---
 hw/ppc/spapr.c | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)
hw/ppc/spapr.c +4 -1
index a471de6cab..1ac7eb0f8c 100644
@@ -1386,7 +1386,10 @@ void spapr_setup_hpt_and_vrma(sPAPRMachineState *spapr)
             && !spapr_ovec_test(spapr->ov5_cas, OV5_HPT_RESIZE))) {
         hpt_shift = spapr_hpt_shift_for_ramsize(MACHINE(spapr)->maxram_size);
     } else {
-        hpt_shift = spapr_hpt_shift_for_ramsize(MACHINE(spapr)->ram_size);
+        uint64_t current_ram_size;
+
+        current_ram_size = MACHINE(spapr)->ram_size + get_plugged_memory_size();
+        hpt_shift = spapr_hpt_shift_for_ramsize(current_ram_size);
     }
     spapr_reallocate_hpt(spapr, hpt_shift, &error_fatal);
 
Signature · 1 line
2.14.3
#4 lore raw
In reply to David Gibson
Quoted 23 lines · David Gibson

The following changes since commit c11d61271b9e6e7a1f0479ef1ca8fb55fa457a62:

Update version for v2.11.0-rc3 release (2017-11-29 17:59:34 +0000)

are available in the Git repository at:

git://github.com/dgibson/qemu.git tags/ppc-for-2.11-20171204

for you to fetch changes up to 768a20f3a491ed4afce73ebb65347d55251c0ebd:

spapr: Include "pre-plugged" DIMMS in ram size calculation at reset (2017-12-04 11:31:22 +1100)

----------------------------------------------------------------
ppc patch queue 2017-12-04

We are, alas, not yet to the bottom of ppc bugs. This pull request fixes several more. I believe they're important enough to include in 2.11. despite the late date.

----------------------------------------------------------------
David Gibson (1):
spapr: Include "pre-plugged" DIMMS in ram size calculation at reset

Quoted 5 lines

Kurban Mallachiev (1):
target-ppc: Don't invalidate non-supported msr bits

Laurent Vivier (1):
pseries: fix TCG migration

So my question here is about the same as to mst: are these fixes all really vital? Were any of the bugs they fix present in 2.10 ?

(A +7-4 diffstat is not too difficult to justify though.)

thanks
-- PMM

#5 lore raw
Quoted 27 lines · Peter Maydell
Quoted 26 lines · David Gibson

The following changes since commit c11d61271b9e6e7a1f0479ef1ca8fb55fa457a62:

Update version for v2.11.0-rc3 release (2017-11-29 17:59:34 +0000)

are available in the Git repository at:

git://github.com/dgibson/qemu.git tags/ppc-for-2.11-20171204

for you to fetch changes up to 768a20f3a491ed4afce73ebb65347d55251c0ebd:

spapr: Include "pre-plugged" DIMMS in ram size calculation at reset (2017-12-04 11:31:22 +1100)

----------------------------------------------------------------
ppc patch queue 2017-12-04

We are, alas, not yet to the bottom of ppc bugs. This pull request fixes several more. I believe they're important enough to include in 2.11. despite the late date.

----------------------------------------------------------------
David Gibson (1):
spapr: Include "pre-plugged" DIMMS in ram size calculation at reset

Kurban Mallachiev (1):
target-ppc: Don't invalidate non-supported msr bits

Quoted 7 lines
Quoted 2 lines

Laurent Vivier (1):
pseries: fix TCG migration

So my question here is about the same as to mst: are these fixes all really vital? Were any of the bugs they fix present in 2.10 ?

(A +7-4 diffstat is not too difficult to justify though.)

...so I looked at the patches and agreed they made sense for rc4.

Applied, thanks.
-- PMM

#6 lore raw
Quoted 31 lines · Peter Maydell
Quoted 30 lines · Peter Maydell
Quoted 28 lines · David Gibson

The following changes since commit c11d61271b9e6e7a1f0479ef1ca8fb55fa457a62:

Update version for v2.11.0-rc3 release (2017-11-29 17:59:34 +0000)

are available in the Git repository at:

git://github.com/dgibson/qemu.git tags/ppc-for-2.11-20171204

for you to fetch changes up to 768a20f3a491ed4afce73ebb65347d55251c0ebd:

spapr: Include "pre-plugged" DIMMS in ram size calculation at reset (2017-12-04 11:31:22 +1100)

----------------------------------------------------------------
ppc patch queue 2017-12-04

We are, alas, not yet to the bottom of ppc bugs. This pull request fixes several more. I believe they're important enough to include in 2.11. despite the late date.

----------------------------------------------------------------
David Gibson (1):
spapr: Include "pre-plugged" DIMMS in ram size calculation at reset

Kurban Mallachiev (1):
target-ppc: Don't invalidate non-supported msr bits

Laurent Vivier (1):
pseries: fix TCG migration

Quoted 6 lines
Quoted 4 lines

So my question here is about the same as to mst: are these fixes all really vital? Were any of the bugs they fix present in 2.10 ?

(A +7-4 diffstat is not too difficult to justify though.)

...so I looked at the patches and agreed they made sense for rc4.

Thanks!

Signature · 4 lines
David Gibson			| I'll have my music baroque, and my code
david AT gibson.dropbear.id.au	| minimalist, thank you.  NOT _the_ _other_
				| _way_ _around_!
http://www.ozlabs.org/~dgibson