Skip to contentSkip to conversation

ppc-next queue 20151111

GIT PULL Applied David Gibson 2 participants 6 messages Nov 11, 2015

lore
Share & tools
lore
#0 lore raw

The following changes since commit a77067f6ac9b17beefea506ce5f514072fe3fcf4:

Merge remote-tracking branch 'remotes/juanquintela/tags/migration/20151110' into staging (2015-11-10 17:49:39 +0000)

are available in the git repository at:

git://github.com/dgibson/qemu.git tags/ppc-next-20151111

for you to fetch changes up to b41d320fef705289d2b73f4949731eb2e189161d:

spapr: Handle failure of KVM_PPC_ALLOCATE_HTAB ioctl (2015-11-11 13:29:04 +1100)

A handful of ppc updates I think are reasonable to squeeze in before the hard freeze. There's one or two more patches I might send, depending on feedback, but if they miss the cut-off well, too bad.

----------------------------------------------------------------
ppc patch queue - 2015-11-11

Highlights:
- Updated SLOF version for "pseries machine
- Bugfix / cleanup for KVM hash page table allocation

----------------------------------------------------------------
Alexey Kardashevskiy (1):
pseries: Update SLOF firmware image to qemu-slof-20151103

Bharata B Rao (3):
ppc: Add/Re-introduce MMU model definitions needed by PR KVM
ppc: Let kvmppc_reset_htab() return 0 for !CONFIG_KVM
spapr: Handle failure of KVM_PPC_ALLOCATE_HTAB ioctl

 hw/ppc/spapr.c          |  20 ++++++++++++++++----
 pc-bios/README          |   2 +-
 pc-bios/slof.bin        | Bin 915584 -> 914712 bytes
 roms/SLOF               |   2 +-
 target-ppc/cpu.h        |   6 ++++++
 target-ppc/kvm_ppc.h    |   2 +-
 target-ppc/mmu_helper.c |   8 ++++++++
 7 files changed, 33 insertions(+), 7 deletions(-)
#1 lore raw

[Qemu-devel] [PULL 1/4] ppc: Add/Re-introduce MMU model definitions needed by PR KVM

From: Bharata B Rao <[email protected]>

Commit aa4bb5875231 (ppc: Add mmu_model defines for arch 2.03 and 2.07) removed the mmu_model definition POWERPC_MMU_2_06a which is needed by PR KVM. Reintroduce it and also add POWERPC_MMU_2_07a.

This fixes QEMU crash (qemu: fatal: Unknown MMU model) during booting of PR KVM guest.

---
 target-ppc/cpu.h        | 6 ++++++
 target-ppc/mmu_helper.c | 8 ++++++++
 2 files changed, 14 insertions(+)
target-ppc/cpu.h +6 -0
index b34aed6..31c6fee 100644
@@ -122,9 +122,15 @@ enum powerpc_mmu_t {
     /* Architecture 2.06 variant                               */
     POWERPC_MMU_2_06       = POWERPC_MMU_64 | POWERPC_MMU_1TSEG
                              | POWERPC_MMU_AMR | 0x00000003,
+    /* Architecture 2.06 "degraded" (no 1T segments)           */
+    POWERPC_MMU_2_06a      = POWERPC_MMU_64 | POWERPC_MMU_AMR
+                             | 0x00000003,
     /* Architecture 2.07 variant                               */
     POWERPC_MMU_2_07       = POWERPC_MMU_64 | POWERPC_MMU_1TSEG
                              | POWERPC_MMU_AMR | 0x00000004,
+    /* Architecture 2.07 "degraded" (no 1T segments)           */
+    POWERPC_MMU_2_07a      = POWERPC_MMU_64 | POWERPC_MMU_AMR
+                             | 0x00000004,
 #endif /* defined(TARGET_PPC64) */
 };
 
target-ppc/mmu_helper.c +8 -0
index e52d0e5..30298d8 100644
@@ -1295,7 +1295,9 @@ void dump_mmu(FILE *f, fprintf_function cpu_fprintf, CPUPPCState *env)
     case POWERPC_MMU_64B:
     case POWERPC_MMU_2_03:
     case POWERPC_MMU_2_06:
+    case POWERPC_MMU_2_06a:
     case POWERPC_MMU_2_07:
+    case POWERPC_MMU_2_07a:
         dump_slb(f, cpu_fprintf, env);
         break;
 #endif
@@ -1435,7 +1437,9 @@ hwaddr ppc_cpu_get_phys_page_debug(CPUState *cs, vaddr addr)
     case POWERPC_MMU_64B:
     case POWERPC_MMU_2_03:
     case POWERPC_MMU_2_06:
+    case POWERPC_MMU_2_06a:
     case POWERPC_MMU_2_07:
+    case POWERPC_MMU_2_07a:
         return ppc_hash64_get_phys_page_debug(env, addr);
 #endif
 
@@ -1939,7 +1943,9 @@ void ppc_tlb_invalidate_all(CPUPPCState *env)
     case POWERPC_MMU_64B:
     case POWERPC_MMU_2_03:
     case POWERPC_MMU_2_06:
+    case POWERPC_MMU_2_06a:
     case POWERPC_MMU_2_07:
+    case POWERPC_MMU_2_07a:
 #endif /* defined(TARGET_PPC64) */
         tlb_flush(CPU(cpu), 1);
         break;
@@ -2013,7 +2019,9 @@ void ppc_tlb_invalidate_one(CPUPPCState *env, target_ulong addr)
     case POWERPC_MMU_64B:
     case POWERPC_MMU_2_03:
     case POWERPC_MMU_2_06:
+    case POWERPC_MMU_2_06a:
     case POWERPC_MMU_2_07:
+    case POWERPC_MMU_2_07a:
         /* tlbie invalidate TLBs for all segments */
         /* XXX: given the fact that there are too many segments to invalidate,
          *      and we still don't have a tlb_flush_mask(env, n, mask) in QEMU,
Signature · 1 line
2.5.0
#2 lore raw

[Qemu-devel] [PULL 3/4] ppc: Let kvmppc_reset_htab() return 0 for !CONFIG_KVM

In reply to David Gibson

From: Bharata B Rao <[email protected]>

The !CONFIG_KVM implementation of kvmppc_reset_htab() returns -1 by default. Change this to return 0 so that we fall back to user space HTAB allocation for emulated guests.

This fixes the make check failures for ppc64 emulated target.

---
 target-ppc/kvm_ppc.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
target-ppc/kvm_ppc.h +1 -1
index 309cbe0..5e1333d 100644
@@ -180,7 +180,7 @@ static inline int kvmppc_remove_spapr_tce(void *table, int pfd,
 
 static inline int kvmppc_reset_htab(int shift_hint)
 {
-    return -1;
+    return 0;
 }
 
 static inline uint64_t kvmppc_rma_size(uint64_t current_size,
Signature · 1 line
2.5.0
#3 lore raw

[Qemu-devel] [PULL 4/4] spapr: Handle failure of KVM_PPC_ALLOCATE_HTAB ioctl

In reply to David Gibson

From: Bharata B Rao <[email protected]>

KVM_PPC_ALLOCATE_HTAB ioctl can return -ENOMEM for KVM guests and QEMU never handled this correctly. But this didn't cause any problems till now as KVM_PPC_ALLOCATE_HTAB ioctl returned with smaller than requested HTAB when enough contiguous memory wasn't available in the host. After the proposed kernel change: https://patchwork.ozlabs.org/patch/530501/,
KVM_PPC_ALLOCATE_HTAB ioctl will not fallback to lower sized HTAB allocation and will fail if requested HTAB size can't be met.

Check for such failures in QEMU and abort appropriately. This will prevent guest kernel from hanging/freezing during early boot by doing graceful exit when host is unable to allocate requested HTAB.

---
 hw/ppc/spapr.c | 20 ++++++++++++++++----
 1 file changed, 16 insertions(+), 4 deletions(-)
hw/ppc/spapr.c +16 -4
index 37d071e..030ee35 100644
@@ -1021,9 +1021,19 @@ static void spapr_alloc_htab(sPAPRMachineState *spapr)
      * RAM */
 
     shift = kvmppc_reset_htab(spapr->htab_shift);
-
-    if (shift > 0) {
-        /* Kernel handles htab, we don't need to allocate one */
+    if (shift < 0) {
+        /*
+         * For HV KVM, host kernel will return -ENOMEM when requested
+         * HTAB size can't be allocated.
+         */
+        error_setg(&error_abort, "Failed to allocate HTAB of requested size, try with smaller maxmem");
+    } else if (shift > 0) {
+        /*
+         * Kernel handles htab, we don't need to allocate one
+         *
+         * Older kernels can fall back to lower HTAB shift values,
+         * but we don't allow booting of such guests.
+         */
         if (shift != spapr->htab_shift) {
             error_setg(&error_abort, "Failed to allocate HTAB of requested size, try with smaller maxmem");
         }
@@ -1055,7 +1065,9 @@ static void spapr_reset_htab(sPAPRMachineState *spapr)
     int index;
 
     shift = kvmppc_reset_htab(spapr->htab_shift);
-    if (shift > 0) {
+    if (shift < 0) {
+        error_setg(&error_abort, "Failed to reset HTAB");
+    } else if (shift > 0) {
         if (shift != spapr->htab_shift) {
             error_setg(&error_abort, "Requested HTAB allocation failed during reset");
         }
Signature · 1 line
2.5.0
#4 lore raw

[Qemu-devel] [PULL 2/4] pseries: Update SLOF firmware image to qemu-slof-20151103

In reply to David Gibson

From: Alexey Kardashevskiy <[email protected]>

The changes are:
1. supports recent binutils;
2. 64bit BARs behind PCI bridges supported;
3. Many fixes for USB keyboard support - keys, XHCI;
4. virtio-vga support.

This image was built with:
gcc version 4.8.3 20140911 (Red Hat 4.8.3-7) (GCC) GNU ld version 2.23.2

The full changelog is:

Quoted 12 lines

version: update to 20151103
documentation: Add a clause about signing off qemu/js2x/client: Support binutils >= 2.25.1 Fix special keys on USB
Fix function keys on USB
pci-scan: program 64-bit mem bar range in pci-bridge bar Allow to build SLOF on Little Endian host
usb-xhci: add keyboard support
usb-xhci: ready the link trb early
usb-xhci: scan usb high speed ports
usb-xhci: bulk improve event handling loop
usb-xhci: return on allocation failure

Quoted 8 lines

usb-xhci: add delay in shutdown path
usb-xhci: event trbs does not need link trb
usb-hid: refactor usb key reading
takeover: Fix header includes
board-js2x: Add missing file dma-function.fs
vga: Add support for virtio-vga
qemu-vga: Use MMIO BAR instead of legacy IO ports
slof: Change call_c() function to a proper assembler function

---
 pc-bios/README   |   2 +-
 pc-bios/slof.bin | Bin 915584 -> 914712 bytes
 roms/SLOF        |   2 +-
 3 files changed, 2 insertions(+), 2 deletions(-)
pc-bios/README +1 -1
index e4154ab..d260c1b 100644
@@ -17,7 +17,7 @@
 - SLOF (Slimline Open Firmware) is a free IEEE 1275 Open Firmware
   implementation for certain IBM POWER hardware.  The sources are at
   https://github.com/aik/SLOF, and the image currently in qemu is
-  built from git tag qemu-slof-20150813.
+  built from git tag qemu-slof-20151103.
 
 - sgabios (the Serial Graphics Adapter option ROM) provides a means for
   legacy x86 software to communicate with an attached serial console as
pc-bios/slof.bin binary +0 -0
index 701933f7dc7b20f6cfcbb538a95142d0a598ada8..90f30996f96a77918dd57aa6131323f97630fe6c 100644
GIT binary patch
roms/SLOF +1 -1
index 811277a..b4c9380 160000
@@ -1 +1 @@
-Subproject commit 811277ac91f674a9273e2b529791e9b75350f3e8
+Subproject commit b4c93802a5b2c72f096649c497ec9ff5708e4456
Signature · 1 line
2.5.0
#5 lore raw
In reply to David Gibson
Quoted 16 lines · David Gibson

The following changes since commit a77067f6ac9b17beefea506ce5f514072fe3fcf4:

Merge remote-tracking branch 'remotes/juanquintela/tags/migration/20151110' into staging (2015-11-10 17:49:39 +0000)

are available in the git repository at:

git://github.com/dgibson/qemu.git tags/ppc-next-20151111

for you to fetch changes up to b41d320fef705289d2b73f4949731eb2e189161d:

spapr: Handle failure of KVM_PPC_ALLOCATE_HTAB ioctl (2015-11-11 13:29:04 +1100)

A handful of ppc updates I think are reasonable to squeeze in before the hard freeze. There's one or two more patches I might send, depending on feedback, but if they miss the cut-off well, too bad.

Quoted 7 lines

----------------------------------------------------------------
ppc patch queue - 2015-11-11

Highlights:
- Updated SLOF version for "pseries machine
- Bugfix / cleanup for KVM hash page table allocation

Applied, thanks.

-- PMM