ppc patch queue 2015-03-25 for 2.3
Hi Peter,
This is my current patch queue for ppc against 2.3. Please pull.
Alex
The following changes since commit 054903a832b865eb5432d79b5c9d1e1ff31b58d7:
Update version for v2.3.0-rc1 release (2015-03-24 16:34:16 +0000)
are available in the git repository at:
git://github.com/agraf/qemu.git tags/signed-ppc-for-upstream
for you to fetch changes up to c6e765035bc5e0d73231c2c0fbd54620201d6655:
powerpc: fix -machine usb=no for newworld and pseries machines (2015-03-25 22:49:47 +0100)
----------------------------------------------------------------
Patch queue for 2.3 ppc - 2015-03-25
Just a few bug fixes before 2.3 gets released:
- pseries: Firmware update, bugfixes
- remove POWER5+ v0.0 that we incorrectly introduced in 2.3
- Fix -machine usb=no
- Fix -boot once=foo in pseries
- Add NULL pointer check in pseries machine init
----------------------------------------------------------------
Alexander Graf (1):
PPC: pseries: Implement boot once=foo
Alexey Kardashevskiy (2):
pseries: Update SLOF firmware image to qemu-slof-20150313
target-ppc: Remove POWER5+ v0.0 that never existed
Paolo Bonzini (1):
powerpc: fix -machine usb=no for newworld and pseries machines
Stefan Weil (1):
spapr: Add missing checks for NULL pointers and report failures
hw/core/machine.c | 1 + hw/ppc/mac_newworld.c | 2 +- hw/ppc/spapr.c | 40 +++++++++++++++++++++++++++++++--------- include/hw/boards.h | 1 + pc-bios/README | 2 +- pc-bios/slof.bin | Bin 911704 -> 912192 bytes roms/SLOF | 2 +- target-ppc/cpu-models.c | 6 ++---- target-ppc/cpu-models.h | 1 - 9 files changed, 38 insertions(+), 17 deletions(-)
[Qemu-devel] [PULL 2.3 2/5] spapr: Add missing checks for NULL pointers and report failures
From: Stefan Weil <[email protected]>
This fixes potential runtime crashes and two warnings from Coverity.
The new error message does not add a prefix "qemu:" because that is already done in function hw_error. It also starts with an uppercase letter because that seems to be the mostly used form.
--- hw/ppc/spapr.c | 8 ++++++++ 1 file changed, 8 insertions(+)
hw/ppc/spapr.c +8 -0
@@ -1506,6 +1506,10 @@ static void ppc_spapr_init(MachineState *machine) } filename =qemu_find_file (QEMU_FILE_TYPE_BIOS ,"spapr-rtas.bin" ); +if (!filename) { +hw_error ("Could not find LPAR rtas '%s'\n" ,"spapr-rtas.bin" ); +exit (1 ); + } spapr->rtas_size =get_image_size (filename); spapr->rtas_blob =g_malloc (spapr->rtas_size);if (load_image_size (filename, spapr->rtas_blob, spapr->rtas_size) <0 ) {
@@ -1623,6 +1627,10 @@ static void ppc_spapr_init(MachineState *machine) bios_name =FW_FILE_NAME ; } filename =qemu_find_file (QEMU_FILE_TYPE_BIOS , bios_name); +if (!filename) { +hw_error ("Could not find LPAR rtas '%s'\n" , bios_name); +exit (1 ); + } fw_size =load_image_targphys (filename,0 ,FW_MAX_SIZE );if (fw_size <0 ) {hw_error ("qemu: could not load LPAR rtas '%s'\n" , filename);
Signature · 1 line
1.8.1.4
[Qemu-devel] [PULL 2.3 3/5] target-ppc: Remove POWER5+ v0.0 that never existed
In reply to Alexander GrafFrom: Alexey Kardashevskiy <[email protected]>
IBM uses low 16bits to specify the chip version of a POWER CPU. So there has never been an actual silicon with PVR = 0x003B0000. The first silicon would have PVR 0x003B0100 but it is very unlikely to find it in any machine shipped to any customer as it was too raw.
This removes CPU_POWERPC_POWER5P_v00 definition and changes POWER5+ and POWERgs aliases (which are synonyms) to point to POWER5+_v2.1 which can still be found in real machines.
--- target-ppc/cpu-models.c | 6 ++---- target-ppc/cpu-models.h | 1 - 2 files changed, 2 insertions(+), 5 deletions(-)
target-ppc/cpu-models.c +2 -4
@@ -1124,8 +1124,6 @@POWERPC_DEF ("POWER5" ,CPU_POWERPC_POWER5 ,POWER5 , "POWER5")#endif -POWERPC_DEF ("POWER5+_v0.0" , CPU_POWERPC_POWER5P_v00,POWER5P , - "POWER5+ v0.0")POWERPC_DEF ("POWER5+_v2.1" , CPU_POWERPC_POWER5P_v21,POWER5P , "POWER5+ v2.1")#if defined(TODO )
@@ -1387,8 +1385,8 @@ PowerPCCPUAlias ppc_cpu_aliases[] = { { "Dino", "POWER3" }, { "POWER3+", "631" }, { "POWER5gr", "POWER5" }, - { "POWER5+", "POWER5+_v0.0" }, - { "POWER5gs", "POWER5+_v0.0" }, + { "POWER5+", "POWER5+_v2.1" }, + { "POWER5gs", "POWER5+_v2.1" }, { "POWER7", "POWER7_v2.3" }, { "POWER7+", "POWER7+_v2.1" }, { "POWER8E", "POWER8E_v1.0" },
target-ppc/cpu-models.h +0 -1
@@ -547,7 +547,6 @@ enum {CPU_POWERPC_POWER4P =0x00380000 ,/* XXX: missing 0x003A0201 */ CPU_POWERPC_POWER5 =0x003A0203 , - CPU_POWERPC_POWER5P_v00 =0x003B0000 , CPU_POWERPC_POWER5P_v21 =0x003B0201 ,CPU_POWERPC_POWER6 =0x003E0000 , CPU_POWERPC_POWER6_5 = 0x0F000001, /* POWER6 in POWER5 mode */
Signature · 1 line
1.8.1.4
[Qemu-devel] [PULL 2.3 1/5] pseries: Update SLOF firmware image to qemu-slof-20150313
In reply to Alexander GrafFrom: Alexey Kardashevskiy <[email protected]>
The changelog is:
Quoted 11 lines
virtio: Fix vring allocation
helpers: FixSLOF_alloc_mem_alignedto meet callers expectation Set default palette according to "16-color Text Extension" document Fix rectangle drawing functions to work also with higher bit depths Fix the x86emu patch file
Silence compiler warning when building the biosemu
Use device-type Forth word to set up the corresponding property Improve /openprom node
pci-properties: Remove redundant call to device-type
cas: reconfigure memory nodes
pci: use 64bit bar ranges
--- pc-bios/README | 2 +- pc-bios/slof.bin | Bin 911704 -> 912192 bytes roms/SLOF | 2 +- 3 files changed, 2 insertions(+), 2 deletions(-)
pc-bios/README +1 -1
@@ -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-20141202. + built from git tag qemu-slof-20150313. - 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
roms/SLOF +1 -1
@@ -1 +1 @@ -Subproject commit a70dbda2e21f6e438b3617c44ff180c3418dc30f +Subproject commit c89b0df661c0a6bfa9ff0ed4a371f631f5ee38b0
Signature · 1 line
1.8.1.4
[Qemu-devel] [PULL 2.3 4/5] PPC: pseries: Implement boot once=foo
In reply to Alexander GrafOn sPAPR we haven't supported boot once ever since it emerged, but recently grew need for it. This patch implements boot once logic to it.
While at it, we also move to the new bootdevice handling that got introduced to the tree recently.
--- hw/ppc/spapr.c | 30 ++++++++++++++++++++++-------- 1 file changed, 22 insertions(+), 8 deletions(-)
hw/ppc/spapr.c +22 -8
@@ -314,7 +314,6 @@ static void *spapr_create_fdt_skel(hwaddr initrd_base,hwaddr initrd_size, hwaddr kernel_size, bool little_endian, - const char *boot_device, const char *kernel_cmdline, uint32_t epow_irq) {
@@ -407,9 +406,6 @@ static void *spapr_create_fdt_skel(hwaddr initrd_base,_FDT ((fdt_property (fdt,"qemu,boot-kernel-le" ,NULL ,0 ))); } } -if (boot_device) { -_FDT ((fdt_property_string (fdt,"qemu,boot-device" , boot_device))); - }if (boot_menu) {_FDT ((fdt_property_cell (fdt,"qemu,boot-menu" , boot_menu))); }
@@ -721,6 +717,8 @@ static void spapr_finalize_fdt(sPAPREnvironment *spapr, hwaddr rtas_addr, hwaddr rtas_size) { +MachineState *machine =MACHINE (qdev_get_machine ()); +const char *boot_device = machine->boot_order;int ret, i;size_t cb =0 ;char *bootlist;
@@ -780,6 +778,15 @@ static void spapr_finalize_fdt(sPAPREnvironment *spapr, ret =fdt_setprop_string (fdt, offset,"qemu,boot-list" , bootlist); } +if (boot_device &&strlen (boot_device)) { +int offset =fdt_path_offset (fdt,"/chosen" ); + +if (offset <0 ) { +exit (1 ); + } +fdt_setprop_string (fdt, offset,"qemu,boot-device" , boot_device); + } +if (!spapr->has_graphics) {spapr_populate_chosen_stdout (fdt, spapr->vio_bus); }
@@ -1370,6 +1377,13 @@ static SaveVMHandlers savevm_htab_handlers = { .load_state = htab_load, }; +static void spapr_boot_set (void *opaque,const char *boot_device, +Error **errp) +{ +MachineState *machine =MACHINE (qdev_get_machine ()); + machine->boot_order =g_strdup (boot_device); +} +/* pSeries LPAR / sPAPR hardware init */ static void ppc_spapr_init (MachineState *machine) {
@@ -1378,7 +1392,6 @@ static void ppc_spapr_init(MachineState *machine)const char *kernel_filename = machine->kernel_filename;const char *kernel_cmdline = machine->kernel_cmdline;const char *initrd_filename = machine->initrd_filename; -const char *boot_device = machine->boot_order;PowerPCCPU *cpu;CPUPPCState *env;PCIHostState *phb;
@@ -1647,9 +1660,10 @@ static void ppc_spapr_init(MachineState *machine)/* Prepare the device tree */ spapr->fdt_skel =spapr_create_fdt_skel (initrd_base, initrd_size, kernel_size, kernel_le, - boot_device, kernel_cmdline, - spapr->epow_irq); + kernel_cmdline, spapr->epow_irq);assert (spapr->fdt_skel !=NULL ); + +qemu_register_boot_set (spapr_boot_set, spapr); }static int spapr_kvm_type (const char *vm_type)
@@ -1779,7 +1793,7 @@ static void spapr_machine_class_init(ObjectClass *oc, void *data) mc->block_default_type =IF_SCSI ; mc->max_cpus =MAX_CPUS ; mc->no_parallel =1 ; - mc->default_boot_order =NULL ; + mc->default_boot_order ="" ; mc->kvm_type = spapr_kvm_type; mc->has_dynamic_sysbus = true;
Signature · 1 line
1.8.1.4
[Qemu-devel] [PULL 2.3 5/5] powerpc: fix -machine usb=no for newworld and pseries machines
In reply to Alexander GrafFrom: Paolo Bonzini <[email protected]>
Capture the explicit setting of "usb=no" into a separate bool, and use it to skip the update of machine->usb in the board init function.
--- hw/core/machine.c | 1 + hw/ppc/mac_newworld.c | 2 +- hw/ppc/spapr.c | 2 +- include/hw/boards.h | 1 + 4 files changed, 4 insertions(+), 2 deletions(-)
hw/core/machine.c +1 -0
@@ -223,6 +223,7 @@ static void machine_set_usb(Object *obj, bool value, Error **errp)MachineState *ms =MACHINE (obj); ms->usb = value; + ms->usb_disabled = !value; }static char *machine_get_firmware (Object *obj,Error **errp)
hw/ppc/mac_newworld.c +1 -1
@@ -371,7 +371,7 @@ static void ppc_core99_init(MachineState *machine)/* 970 gets a U3 bus */ pci_bus =pci_pmac_u3_init (pic,get_system_memory (),get_system_io ()); machine_arch =ARCH_MAC99_U3 ; - machine->usb |=defaults_enabled (); + machine->usb |=defaults_enabled () && !machine->usb_disabled; }else { pci_bus =pci_pmac_init (pic,get_system_memory (),get_system_io ()); machine_arch =ARCH_MAC99 ;
hw/ppc/spapr.c +1 -1
@@ -1580,7 +1580,7 @@ static void ppc_spapr_init(MachineState *machine)/* Graphics */ if (spapr_vga_init (phb->bus)) { spapr->has_graphics = true; - machine->usb |=defaults_enabled (); + machine->usb |=defaults_enabled () && !machine->usb_disabled; }if (machine->usb) {
include/hw/boards.h +1 -0
@@ -146,6 +146,7 @@ struct MachineState {bool dump_guest_core;bool mem_merge;bool usb; +bool usb_disabled;char *firmware;bool iommu;bool suppress_vmdesc;
Signature · 1 line
1.8.1.4
Peter Maydell
AppliedQuoted 22 lines · Alexander Graf
Hi Peter,
This is my current patch queue for ppc against 2.3. Please pull.
Alex
The following changes since commit
054903a832b865eb5432d79b5c9d1e1ff31b58d7:Update version for v2.3.0-rc1 release (2015-03-24 16:34:16 +0000)
are available in the git repository at:
git://github.com/agraf/qemu.gittags/signed-ppc-for-upstreamfor you to fetch changes up to
c6e765035bc5e0d73231c2c0fbd54620201d6655:powerpc: fix -machine usb=no for newworld and pseries machines (2015-03-25 22:49:47 +0100)
----------------------------------------------------------------
Patch queue for 2.3 ppc - 2015-03-25
Quoted 7 lines
Just a few bug fixes before 2.3 gets released:
- pseries: Firmware update, bugfixes
- remove POWER5+ v0.0 that we incorrectly introduced in 2.3
- Fix -machine usb=no
- Fix -boot once=foo in pseries
- Add NULL pointer check in pseries machine init
Applied, thanks.
-- PMM