ppc-for-2.5 queue 20151130
The following changes since commit 714487515dbe0c65d5904251e796cd3a5b3579fb:
Merge remote-tracking branch 'remotes/jasowang/tags/net-pull-request' into staging (2015-11-27 10:44:42 +0000)
are available in the git repository at:
git://github.com/dgibson/qemu.git tags/ppc-for-2.5-20151130
for you to fetch changes up to 7624789234cd63b671bce1b49b93b0b1c00ea407:
target-ppc/fpu_helper: fix FPSCR_FX bit shift operation (2015-11-30 19:39:01 +1100)
----------------------------------------------------------------
ppc patch queue for qemu-2.5 20151130
target-ppc and related bugfix patches for qemu-2.5
I don't have the facilities to test the Macintosh and BookE related patches. I've sanity checked them (inspection + make check), but I'm otherwise relying on the submitters.
----------------------------------------------------------------
Hervé Poussineau (1):
mac_dbdma: always initialize channel field in DBDMA_channel
Madhavan Srinivasan (2):
target-ppc: Move the FPSCR bit update macros to cpu.h target-ppc/fpu_helper: fix FPSCR_FX bit shift operation
Peter Maydell (1):
hw/ppc/ppc405_boards: Fix infinite recursion by converting taihu_cpld from old_mmio
Thomas Huth (1):
hw/ppc/spapr: Remove duplicated "pseries" alias
hw/misc/macio/mac_dbdma.c | 2 +- hw/ppc/ppc405_boards.c | 52 ++++++++--------------------------------------- hw/ppc/spapr.c | 2 -- target-ppc/cpu.h | 21 +++++++++++++++++++ target-ppc/dfp_helper.c | 21 ------------------- target-ppc/fpu_helper.c | 22 ++++++++++---------- 6 files changed, 41 insertions(+), 79 deletions(-)
[Qemu-devel] [PULL 2/5] hw/ppc/spapr: Remove duplicated "pseries" alias
From: Thomas Huth <[email protected]>
The "pseries" alias is currently set twice, one time for the pseries-2.4 machine and one time for the "pseries-2.5" machine. To avoid confusion with the alias, let's remove the one from the older machine class. And while we're at it, also remove the "is_default = 0" there since the is_default variable should be set to zero by default already.
--- hw/ppc/spapr.c | 2 -- 1 file changed, 2 deletions(-)
hw/ppc/spapr.c +0 -2
@@ -2423,8 +2423,6 @@ static void spapr_machine_2_4_class_init(ObjectClass *oc, void *data)MachineClass *mc =MACHINE_CLASS (oc); mc->desc ="pSeries Logical Partition (PAPR compliant) v2.4" ; - mc->alias ="pseries" ; - mc->is_default =0 ; mc->compat_props = compat_props; }
Signature · 1 line
2.5.0
[Qemu-devel] [PULL 1/5] mac_dbdma: always initialize channel field in DBDMA_channel
In reply to David GibsonFrom: Hervé Poussineau <[email protected]>
dbdma_from_ch() uses channel field to return the right DBDMA object. Previous code was working if guest OS was only using registered DMA channels. However, it lead to QEMU crashes if guest OS was using unregistered DMA channels.
--- hw/misc/macio/mac_dbdma.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
hw/misc/macio/mac_dbdma.c +1 -1
@@ -557,7 +557,6 @@ void DBDMA_register_channel(void *dbdma, int nchan, qemu_irq irq,DBDMA_DPRINTF ("DBDMA_register_channel 0x%x\n" , nchan); ch->irq = irq; - ch->channel = nchan; ch->rw = rw; ch->flush = flush; ch->io.opaque = opaque;
@@ -753,6 +752,7 @@ void* DBDMA_init (MemoryRegion **dbdma_mem)for (i =0 ; i <DBDMA_CHANNELS ; i++) {DBDMA_io *io = &s->channels[i].io;qemu_iovec_init (&io->iov,1 ); + s->channels[i].channel = i; }memory_region_init_io (&s->mem,NULL , &dbdma_ops, s,"dbdma" ,0x1000 );
Signature · 1 line
2.5.0
[Qemu-devel] [PULL 3/5] hw/ppc/ppc405_boards: Fix infinite recursion by converting taihu_cpld from old_mmio
In reply to David GibsonFrom: Peter Maydell <[email protected]>
The taihu_cpld_writel() function had an obvious typo that meant that
if it was ever called it would go into an infinite recursion. Newer
versions of clang will detect and warn about this:
hw/ppc/ppc405_boards.c:481:1: warning: all paths through this function will call itself [-Winfinite-recursion]
Fix this by converting taihu_cpld from the legacy old_mmio accessors to new-style ones, with an impl {} declaration to cause the core memory code to do the splitting of 16 bit and 32 bit accesses into multiple 8-bit accesses.
--- hw/ppc/ppc405_boards.c | 52 ++++++++------------------------------------------ 1 file changed, 8 insertions(+), 44 deletions(-)
hw/ppc/ppc405_boards.c +8 -44
@@ -408,7 +408,7 @@ struct taihu_cpld_t {uint8_t reg1; }; -static uint32_t taihu_cpld_readb (void *opaque,hwaddr addr) +static uint64_t taihu_cpld_read (void *opaque,hwaddr addr,unsigned size) {taihu_cpld_t *cpld;uint32_t ret;
@@ -429,8 +429,8 @@ static uint32_t taihu_cpld_readb (void *opaque, hwaddr addr)return ret; } -static void taihu_cpld_writeb (void *opaque, -hwaddr addr,uint32_t value) +static void taihu_cpld_write (void *opaque,hwaddr addr, +uint64_t value,unsigned size) {taihu_cpld_t *cpld;
@@ -447,48 +447,12 @@ static void taihu_cpld_writeb (void *opaque, } } -static uint32_t taihu_cpld_readw (void *opaque,hwaddr addr) -{ -uint32_t ret; - - ret =taihu_cpld_readb (opaque, addr) <<8 ; - ret |=taihu_cpld_readb (opaque, addr +1 ); - -return ret; -} - -static void taihu_cpld_writew (void *opaque, -hwaddr addr,uint32_t value) -{ -taihu_cpld_writeb (opaque, addr, (value >>8 ) &0xFF ); -taihu_cpld_writeb (opaque, addr +1 , value &0xFF ); -} - -static uint32_t taihu_cpld_readl (void *opaque,hwaddr addr) -{ -uint32_t ret; - - ret =taihu_cpld_readb (opaque, addr) <<24 ; - ret |=taihu_cpld_readb (opaque, addr +1 ) <<16 ; - ret |=taihu_cpld_readb (opaque, addr +2 ) <<8 ; - ret |=taihu_cpld_readb (opaque, addr +3 ); - -return ret; -} - -static void taihu_cpld_writel (void *opaque, -hwaddr addr,uint32_t value) -{ -taihu_cpld_writel (opaque, addr, (value >>24 ) &0xFF ); -taihu_cpld_writel (opaque, addr +1 , (value >>16 ) &0xFF ); -taihu_cpld_writel (opaque, addr +2 , (value >>8 ) &0xFF ); -taihu_cpld_writeb (opaque, addr +3 , value &0xFF ); -} -static const MemoryRegionOps taihu_cpld_ops = { - .old_mmio = { - .read = { taihu_cpld_readb, taihu_cpld_readw, taihu_cpld_readl, }, - .write = { taihu_cpld_writeb, taihu_cpld_writew, taihu_cpld_writel, }, + .read = taihu_cpld_read, + .write = taihu_cpld_write, + .impl = { + .min_access_size =1 , + .max_access_size =1 , }, .endianness =DEVICE_NATIVE_ENDIAN , };
Signature · 1 line
2.5.0
[Qemu-devel] [PULL 4/5] target-ppc: Move the FPSCR bit update macros to cpu.h
In reply to David GibsonFrom: Madhavan Srinivasan <[email protected]>
Move the FPSCR bit update macros defined in dfp_helper to cpu.h. This way, fpu_helper functions can also use them
--- target-ppc/cpu.h | 21 +++++++++++++++++++++ target-ppc/dfp_helper.c | 21 --------------------- 2 files changed, 21 insertions(+), 21 deletions(-)
target-ppc/cpu.h +21 -0
@@ -684,6 +684,27 @@ enum {#define fpscr_eex (((env->fpscr) >> FPSCR_XX) & ((env->fpscr) >> FPSCR_XE) & \ 0x1F) +#define FP_FX (1ull << FPSCR_FX) +#define FP_FEX (1ull << FPSCR_FEX) +#define FP_OX (1ull << FPSCR_OX) +#define FP_OE (1ull << FPSCR_OE) +#define FP_UX (1ull << FPSCR_UX) +#define FP_UE (1ull << FPSCR_UE) +#define FP_XX (1ull << FPSCR_XX) +#define FP_XE (1ull << FPSCR_XE) +#define FP_ZX (1ull << FPSCR_ZX) +#define FP_ZE (1ull << FPSCR_ZE) +#define FP_VX (1ull << FPSCR_VX) +#define FP_VXSNAN (1ull << FPSCR_VXSNAN) +#define FP_VXISI (1ull << FPSCR_VXISI) +#define FP_VXIMZ (1ull << FPSCR_VXIMZ) +#define FP_VXZDZ (1ull << FPSCR_VXZDZ) +#define FP_VXIDI (1ull << FPSCR_VXIDI) +#define FP_VXVC (1ull << FPSCR_VXVC) +#define FP_VXCVI (1ull << FPSCR_VXCVI) +#define FP_VE (1ull << FPSCR_VE) +#define FP_FI (1ull << FPSCR_FI) +/*****************************************************************************/ /* Vector status and control register */ #define VSCR_NJ 16/* Vector non-java */
target-ppc/dfp_helper.c +0 -21
@@ -170,27 +170,6 @@ static void dfp_prepare_decimal128(struct PPC_DFP *dfp, uint64_t *a, } } -#define FP_FX (1ull << FPSCR_FX) -#define FP_FEX (1ull << FPSCR_FEX) -#define FP_OX (1ull << FPSCR_OX) -#define FP_OE (1ull << FPSCR_OE) -#define FP_UX (1ull << FPSCR_UX) -#define FP_UE (1ull << FPSCR_UE) -#define FP_XX (1ull << FPSCR_XX) -#define FP_XE (1ull << FPSCR_XE) -#define FP_ZX (1ull << FPSCR_ZX) -#define FP_ZE (1ull << FPSCR_ZE) -#define FP_VX (1ull << FPSCR_VX) -#define FP_VXSNAN (1ull << FPSCR_VXSNAN) -#define FP_VXISI (1ull << FPSCR_VXISI) -#define FP_VXIMZ (1ull << FPSCR_VXIMZ) -#define FP_VXZDZ (1ull << FPSCR_VXZDZ) -#define FP_VXIDI (1ull << FPSCR_VXIDI) -#define FP_VXVC (1ull << FPSCR_VXVC) -#define FP_VXCVI (1ull << FPSCR_VXCVI) -#define FP_VE (1ull << FPSCR_VE) -#define FP_FI (1ull << FPSCR_FI) -static void dfp_set_FPSCR_flag (struct PPC_DFP *dfp,uint64_t flag,uint64_t enabled) {
Signature · 1 line
2.5.0
[Qemu-devel] [PULL 5/5] target-ppc/fpu_helper: fix FPSCR_FX bit shift operation
In reply to David GibsonFrom: Madhavan Srinivasan <[email protected]>
Currently in TCG mode, updating floating exception summary bit (FPSCR_FX) in fpscr also updates the upper 32bits of fpscr with all 1s. Modify the bit shift operation statement to use 1ULL instead.
--- target-ppc/fpu_helper.c | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-)
target-ppc/fpu_helper.c +11 -11
@@ -194,7 +194,7 @@ static inline uint64_t fload_invalid_op_excp(CPUPPCState *env, int op,/* Update the floating-point invalid operation summary */ env->fpscr |=1 <<FPSCR_VX ;/* Update the floating-point exception summary */ - env->fpscr |=1 <<FPSCR_FX ; + env->fpscr |=FP_FX ;if (ve !=0 ) {/* Update the floating-point enabled exception summary */ env->fpscr |=1 <<FPSCR_FEX ;
@@ -211,7 +211,7 @@ static inline void float_zero_divide_excp(CPUPPCState *env) env->fpscr |=1 <<FPSCR_ZX ; env->fpscr &= ~((1 <<FPSCR_FR ) | (1 <<FPSCR_FI ));/* Update the floating-point exception summary */ - env->fpscr |=1 <<FPSCR_FX ; + env->fpscr |=FP_FX ;if (fpscr_ze !=0 ) {/* Update the floating-point enabled exception summary */ env->fpscr |=1 <<FPSCR_FEX ;
@@ -228,7 +228,7 @@ static inline void float_overflow_excp(CPUPPCState *env) env->fpscr |=1 <<FPSCR_OX ;/* Update the floating-point exception summary */ - env->fpscr |=1 <<FPSCR_FX ; + env->fpscr |=FP_FX ;if (fpscr_oe !=0 ) {/* XXX: should adjust the result */ /* Update the floating-point enabled exception summary */
@@ -248,7 +248,7 @@ static inline void float_underflow_excp(CPUPPCState *env) env->fpscr |=1 <<FPSCR_UX ;/* Update the floating-point exception summary */ - env->fpscr |=1 <<FPSCR_FX ; + env->fpscr |=FP_FX ;if (fpscr_ue !=0 ) {/* XXX: should adjust the result */ /* Update the floating-point enabled exception summary */
@@ -265,7 +265,7 @@ static inline void float_inexact_excp(CPUPPCState *env) env->fpscr |=1 <<FPSCR_XX ;/* Update the floating-point exception summary */ - env->fpscr |=1 <<FPSCR_FX ; + env->fpscr |=FP_FX ;if (fpscr_xe !=0 ) {/* Update the floating-point enabled exception summary */ env->fpscr |=1 <<FPSCR_FEX ;
@@ -330,31 +330,31 @@ void helper_fpscr_setbit(CPUPPCState *env, uint32_t bit)if (prev ==0 ) {switch (bit) {case FPSCR_VX : - env->fpscr |=1 <<FPSCR_FX ; + env->fpscr |=FP_FX ;if (fpscr_ve) { goto raise_ve; }break ;case FPSCR_OX : - env->fpscr |=1 <<FPSCR_FX ; + env->fpscr |=FP_FX ;if (fpscr_oe) { goto raise_oe; }break ;case FPSCR_UX : - env->fpscr |=1 <<FPSCR_FX ; + env->fpscr |=FP_FX ;if (fpscr_ue) { goto raise_ue; }break ;case FPSCR_ZX : - env->fpscr |=1 <<FPSCR_FX ; + env->fpscr |=FP_FX ;if (fpscr_ze) { goto raise_ze; }break ;case FPSCR_XX : - env->fpscr |=1 <<FPSCR_FX ; + env->fpscr |=FP_FX ;if (fpscr_xe) { goto raise_xe; }
@@ -369,7 +369,7 @@ void helper_fpscr_setbit(CPUPPCState *env, uint32_t bit)case FPSCR_VXSQRT :case FPSCR_VXCVI : env->fpscr |=1 <<FPSCR_VX ; - env->fpscr |=1 <<FPSCR_FX ; + env->fpscr |=FP_FX ;if (fpscr_ve !=0 ) { goto raise_ve; }
Signature · 1 line
2.5.0
Peter Maydell
AppliedQuoted 29 lines · David Gibson
The following changes since commit
714487515dbe0c65d5904251e796cd3a5b3579fb:Merge remote-tracking branch 'remotes/jasowang/tags/net-pull-request' into staging (2015-11-27 10:44:42 +0000)
are available in the git repository at:
git://github.com/dgibson/qemu.gittags/ppc-for-2.5-20151130for you to fetch changes up to
7624789234cd63b671bce1b49b93b0b1c00ea407:target-ppc/fpu_helper: fix
FPSCR_FXbit shift operation (2015-11-30 19:39:01 +1100)----------------------------------------------------------------
ppc patch queue for qemu-2.5 20151130target-ppc and related bugfix patches for qemu-2.5
I don't have the facilities to test the Macintosh and BookE related patches. I've sanity checked them (inspection + make check), but I'm otherwise relying on the submitters.
----------------------------------------------------------------
Hervé Poussineau (1):
mac_dbdma: always initialize channel field inDBDMA_channelMadhavan Srinivasan (2):
target-ppc: Move the FPSCR bit update macros tocpu.htarget-ppc/fpu_helper: fixFPSCR_FXbit shift operation
Quoted 5 lines
Peter Maydell (1):
hw/ppc/ppc405_boards: Fix infinite recursion by convertingtaihu_cpldfromold_mmioThomas Huth (1):
hw/ppc/spapr: Remove duplicated "pseries" alias
Applied, thanks.
-- PMM