Re: [Qemu-devel] [PATCH v3 2/2] semihosting: add --semihosting-config arg sub-argument

2015-05-20 Thread Leon Alrae
On 20/05/2015 09:30, Liviu Ionescu wrote: > >> On 20 May 2015, at 11:11, Leon Alrae wrote: >> >> like "If both are specified, -kernel/-append are ignored (-kernel is >> used to load an image, but the path won't be passed to semihosting)" > ... &g

Re: [Qemu-devel] [PATCH v3 2/2] semihosting: add --semihosting-config arg sub-argument

2015-05-20 Thread Leon Alrae
On 20/05/2015 09:54, Peter Maydell wrote: > Well, with these patches alone we end up with a documented but broken > option. For reasons of consistency (again) I don't want the new > option in the tree without it being supported by ARM, even if the > MIPS code that uses it goes in. Fair enough. I’l

Re: [Qemu-devel] [PATCH v3 2/2] semihosting: add --semihosting-config arg sub-argument

2015-05-20 Thread Leon Alrae
On 20/05/2015 12:12, Liviu Ionescu wrote: > yes, that's correct, my comment was related to the above quotes from your > message, in the first part you mention "the path won't be passed to > semihosting", which is not consistent with the actual behaviour, since the > entire kernel path is passed

Re: [Qemu-devel] [PATCH v3 2/2] semihosting: add --semihosting-config arg sub-argument

2015-05-21 Thread Leon Alrae
On 20/05/2015 09:54, Peter Maydell wrote: > On 20 May 2015 at 09:11, Leon Alrae wrote: >> Agreed. We could initialize semihosting.argv[0] with -kernel and argv[1] >> with -append string if in semihosting mode and no semihosting args have >> been specified. I'll update

Re: [Qemu-devel] [PATCH v3 2/2] semihosting: add --semihosting-config arg sub-argument

2015-05-21 Thread Leon Alrae
On 21/05/2015 15:01, Peter Maydell wrote: > Well, it will presumably mean that on a MIPS semihosting case > if the user tries -append "some command line" it won't do what > they expect... Yes, but I think the user should use semihosting-config arg, which is more natural in semihosting context, rat

Re: [Qemu-devel] [PATCH] mips_malta: provide ememsize env variable to kernels

2015-05-26 Thread Leon Alrae
kernels may use all > available memory without the user having to manually specifying its size > & location. > > Signed-off-by: Paul Burton > Cc: Aurelien Jarno > Cc: Leon Alrae > --- Reviewed-by: Leon Alrae

[Qemu-devel] [PATCH v4 2/2] semihosting: add --semihosting-config arg sub-argument

2015-05-26 Thread Leon Alrae
do (i.e. argv[1] contains the whole -append), but is more intuitive from UHI user's point of view and Linux kernel just does not care as it concatenates argv[1..n] into single cmdline string anyway. Signed-off-by: Leon Alrae --- include/exec/semihost.h | 18 ++ qemu-opt

[Qemu-devel] [PATCH v4 0/2] semihosting: clean up and add --semihosting-config arg

2015-05-26 Thread Leon Alrae
renaming is not required (these modifications are relatively simple anyway). Leon Alrae (2): semihosting: create SemihostingConfig structure and semihost.h semihosting: add --semihosting-config arg sub-argument gdbstub.c | 8 ++-- include/exec/gdbstub.h| 6 --- include/

[Qemu-devel] [PATCH v4 1/2] semihosting: create SemihostingConfig structure and semihost.h

2015-05-26 Thread Leon Alrae
stuff from target specific semihosting code. Signed-off-by: Leon Alrae Reviewed-by: Peter Maydell --- gdbstub.c | 8 include/exec/gdbstub.h| 6 -- include/exec/semihost.h | 44 include/sysemu/sysemu.h | 1

Re: [Qemu-devel] [PATCH v6 1/3] target-mips: Misaligned memory accesses for R6

2015-05-29 Thread Leon Alrae
which probably is fine. However, IIUC these two instructions LWPC and LDPC are from mips16 ASE, so probably you want to skip them as well? (note that for R6 we’ve got R6_OPC_LWPC and R6_OPC_LDPC and they are naturally aligned). Apart from that, Reviewed-by: Leon Alrae BTW these OPC_LWPC a

Re: [Qemu-devel] [PATCH v6 3/3] target-mips: Misaligned memory accesses for MSA

2015-05-29 Thread Leon Alrae
On 27/05/2015 14:29, Yongbok Kim wrote: > MIPS SIMD Architecture vector loads and stores require misalignment support. > MSA Memory access should work as an atomic operation. Therefore, it has to > check validity of all addresses for a vector store access if it is spanning > into two pages. > > Se

Re: [Qemu-devel] [PATCH v6 3/3] target-mips: Misaligned memory accesses for MSA

2015-05-29 Thread Leon Alrae
On 27/05/2015 14:29, Yongbok Kim wrote: > MIPS SIMD Architecture vector loads and stores require misalignment support. > MSA Memory access should work as an atomic operation. Therefore, it has to > check validity of all addresses for a vector store access if it is spanning > into two pages. > > Se

Re: [Qemu-devel] [PATCH 0/2] cpus: fix deadlock and segfault

2015-03-02 Thread Leon Alrae
On 27/02/2015 19:05, Paolo Bonzini wrote: > Reported by Leon Alrae on the mailing list, and by > Andreas Gustafsson as Launchpad bug 1426472. > > Paolo Bonzini (2): > cpus: fix deadlock and segfault in qemu_mutex_lock_iothread > cpus: be more paranoid in avoiding deadlocks

Re: [Qemu-devel] [PATCH 2/4] target-mips: add Unified Hosting Interface (UHI) support

2015-03-02 Thread Leon Alrae
Hi Matthew, On 01/03/2015 22:17, Matthew Fortune wrote: > Hi Leon, > > Many thanks for implementing this interface in QEMU. I haven't reviewed > in great detail as I am not familiar enough with QEMU internals to do > so. Overall it seems to match the UHI spec. The one potential issue is > transla

[Qemu-devel] [PULL 2/2] target-mips: add missing MSACSR and restore fp_status and hflags

2015-03-11 Thread Leon Alrae
they are cleared. Therefore there is no need for saving them in vmstate. Signed-off-by: Leon Alrae Reviewed-by: Richard Henderson --- target-mips/cpu.h| 17 + target-mips/machine.c| 34 ++ target-mips/msa_helper.c | 12

[Qemu-devel] [PULL 0/2] target-mips queue

2015-03-11 Thread Leon Alrae
lags (2015-03-11 14:13:57 +) MIPS patches 2015-03-11 Changes: * use VMStateDescription for MIPS CPU ---- Leon Alrae (2): target-mips: replace cpu_save/cpu

[Qemu-devel] [PULL 1/2] target-mips: replace cpu_save/cpu_load with VMStateDescription

2015-03-11 Thread Leon Alrae
Create VMStateDescription for MIPS CPU. The new structure contains exactly the same fields as before, therefore leaving existing version_id. Signed-off-by: Leon Alrae --- target-mips/cpu-qom.h | 4 + target-mips/cpu.c | 1 + target-mips/cpu.h | 2 - target-mips/machine.c | 567

Re: [Qemu-devel] [PATCH 1/9] mips/kvm: Drop KVM_REG_MIPS_COUNT_* definitions

2015-03-12 Thread Leon Alrae
m.c can now be dropped. > > Signed-off-by: James Hogan > Cc: Paolo Bonzini > Cc: Leon Alrae > Cc: Aurelien Jarno > --- > target-mips/kvm.c | 11 --- > 1 file changed, 11 deletions(-) Reviewed-by: Leon Alrae

Re: [Qemu-devel] [PATCH 2/9] mips/kvm: Remove a couple of noisy DPRINTFs

2015-03-12 Thread Leon Alrae
> Signed-off-by: James Hogan > Cc: Paolo Bonzini > Cc: Leon Alrae > Cc: Aurelien Jarno > --- > target-mips/kvm.c | 2 -- > 1 file changed, 2 deletions(-) Reviewed-by: Leon Alrae

Re: [Qemu-devel] [PATCH 3/9] mips/kvm: Implement PRid CP0 register

2015-03-12 Thread Leon Alrae
onzini > Cc: Leon Alrae > Cc: Aurelien Jarno > --- > target-mips/kvm.c | 11 +++ > 1 file changed, 11 insertions(+) Reviewed-by: Leon Alrae

Re: [Qemu-devel] [PATCH 4/9] mips/kvm: Implement Config CP0 registers

2015-03-12 Thread Leon Alrae
y a guest so QEMU needs to know about them so as not > to clobber them on migration/savevm. > > Signed-off-by: James Hogan > Cc: Paolo Bonzini > Cc: Leon Alrae > Cc: Aurelien Jarno > --- > target-mips/kvm.c | 108 > +

[Qemu-devel] [PATCH] target-mips: save cpu state before calling MSA load and store helpers

2015-03-16 Thread Leon Alrae
PC needs to be saved if an exception can be generated by an helper. This fixes a problem related to resuming the execution at unexpected address after an exception (caused by MSA load/store instruction) has been serviced. Signed-off-by: Leon Alrae --- target-mips/translate.c | 2 ++ 1 file

[Qemu-devel] [PATCH v2] target-mips: fix CP0.BadVAddr by stopping translation on Address Error

2015-03-16 Thread Leon Alrae
CP0.BadVAddr is supposed to capture the most recent virtual address that caused the exception. Currently this does not work correctly for unaligned instruction fetch as translation is not stopped and CP0.BadVAddr is updated with subsequent addresses. Signed-off-by: Leon Alrae --- v2

[Qemu-devel] [2.4 PATCH] target-mips: add Config5.FRE support allowing Status.FR=0 emulation

2015-03-17 Thread Leon Alrae
exception. Config5.UFE: Allows user to write/read Config5.FRE using CTC1/CFC1 instructions. Enable the feature in MIPS64R6-generic CPU. Signed-off-by: Leon Alrae --- target-mips/cpu.h| 13 +- target-mips/op_helper.c | 34 + target-mips/translate.c | 307

Re: [Qemu-devel] [2.4 PATCH] target-mips: add Config5.FRE support allowing Status.FR=0 emulation

2015-03-17 Thread Leon Alrae
Hi James, On 17/03/2015 10:55, James Hogan wrote: > Hi Leon, > > On 17/03/15 09:56, Leon Alrae wrote: >> This relatively small architectural feature adds the following: >> >> FIR.FREP: Read-only. If FREP=1, then Config5.FRE and Config5.UFE are >> available. &g

[Qemu-devel] [PATCH 00/21] target-mips: add MIPS64R6 Instruction Set support

2014-05-30 Thread Leon Alrae
patchset does not include MIPS64 Privileged Resource Architecture modifications. All those changes will follow the current patchset soon. Leon Alrae (17): target-mips: introduce MIPS64R6 ISA and a new generic CPU target-mips: signal RI Exception on instructions removed in R6 target-mips: add

[Qemu-devel] [PATCH 01/21] target-mips: introduce MIPS64R6 ISA and a new generic CPU

2014-05-30 Thread Leon Alrae
Define ISA_MIPS64R6 and add MIPS64R6-generic core supporting new ISA. Additionally define ISA_MIPS64R3 and ISA_MIPS64R5 to fill the gap. Signed-off-by: Leon Alrae --- target-mips/mips-defs.h | 28 +++- target-mips/translate_init.c | 29

[Qemu-devel] [PATCH 03/21] target-mips: add SELEQZ and SELNEZ instructions

2014-05-30 Thread Leon Alrae
Signed-off-by: Leon Alrae --- disas/mips.c|8 target-mips/translate.c | 16 2 files changed, 24 insertions(+), 0 deletions(-) diff --git a/disas/mips.c b/disas/mips.c index 2106b57..b950e53 100644 --- a/disas/mips.c +++ b/disas/mips.c @@ -521,6 +521,8

[Qemu-devel] [PATCH 17/21] target-mips: add new Floating Point Comparison instructions

2014-05-30 Thread Leon Alrae
From: Yongbok Kim Signed-off-by: Yongbok Kim Signed-off-by: Leon Alrae --- disas/mips.c| 44 ++ target-mips/helper.h| 27 ++ target-mips/op_helper.c | 113 ++ target-mips/translate.c | 206

[Qemu-devel] [PATCH 04/21] target-mips: move LL and SC instructions

2014-05-30 Thread Leon Alrae
The encoding of LL and SC instruction has changed in MIPS32 Release 6. Signed-off-by: Leon Alrae --- disas/mips.c|9 - target-mips/translate.c | 29 +++-- 2 files changed, 35 insertions(+), 3 deletions(-) diff --git a/disas/mips.c b/disas

[Qemu-devel] [PATCH 21/21] target-mips: use pointers referring to appropriate decoding function

2014-05-30 Thread Leon Alrae
After selecting CPU in QEMU the base ISA will not change. Therefore introducing *_arch function pointers that are set in cpu_state_reset to point at the appropriate SPECIAL and SPECIAL3 decoding functions, and avoid unnecessary 'if' statements. Signed-off-by: Leon Alrae --- t

[Qemu-devel] [PATCH 06/21] target-mips: split decode_opc_special* into *_r6 and *_legacy

2014-05-30 Thread Leon Alrae
functions will contain instructions which were removed in R6. Signed-off-by: Leon Alrae --- target-mips/translate.c | 227 +-- 1 files changed, 159 insertions(+), 68 deletions(-) diff --git a/target-mips/translate.c b/target-mips/translate.c ind

[Qemu-devel] [PATCH 07/21] target-mips: signal RI Exception on DSP and Loongson instructions

2014-05-30 Thread Leon Alrae
Move DSP and Loongson instruction to *_legacy functions as they have been removed in R6. Signed-off-by: Leon Alrae --- target-mips/translate.c | 195 --- 1 files changed, 98 insertions(+), 97 deletions(-) diff --git a/target-mips/translate.c b

[Qemu-devel] [PATCH 11/21] target-mips: Status.UX/SX/KX enable 32-bit address wrapping

2014-05-30 Thread Leon Alrae
In R6 the special behaviour for data references is also specified for Kernel and Supervisor mode. Therefore MIPS_HFLAG_UX is replaced by generic MIPS_HFLAG_X indicating whether 64-bit mode is enabled in current operating mode. Signed-off-by: Leon Alrae --- target-mips/cpu.h | 14

[Qemu-devel] [PATCH 14/21] target-mips: add Addressing and PC-relative instructions

2014-05-30 Thread Leon Alrae
Signed-off-by: Leon Alrae --- disas/mips.c| 41 +- target-mips/translate.c | 194 --- 2 files changed, 222 insertions(+), 13 deletions(-) diff --git a/disas/mips.c b/disas/mips.c index bee39d8..6def662 100644 --- a/disas/mips.c

[Qemu-devel] [PATCH 12/21] target-mips: add ALIGN, DALIGN, BITSWAP and DBITSWAP instructions

2014-05-30 Thread Leon Alrae
From: Yongbok Kim Signed-off-by: Yongbok Kim Signed-off-by: Leon Alrae --- disas/mips.c|4 ++ target-mips/helper.h|2 + target-mips/op_helper.c | 16 +++ target-mips/translate.c | 103 +- 4 files changed, 113

[Qemu-devel] [PATCH 02/21] target-mips: signal RI Exception on instructions removed in R6

2014-05-30 Thread Leon Alrae
loads / stores - traps - legacy accumulator instructions - COP1X - MIPS-3D Signed-off-by: Leon Alrae --- target-mips/translate.c | 64 +-- 1 files changed, 56 insertions(+), 8 deletions(-) diff --git a/target-mips/translate.c b/target-mips/translate.c

[Qemu-devel] [PATCH 10/21] target-mips: move CLO, DCLO, CLZ, DCLZ, SDBBP and free special2 in R6

2014-05-30 Thread Leon Alrae
Also consider OPC_SPIM instruction as deleted in R6 because it is overlaping with MIPS32R6 SDBBP. Signed-off-by: Leon Alrae --- disas/mips.c|5 ++ target-mips/translate.c | 120 --- 2 files changed, 66 insertions(+), 59 deletions

[Qemu-devel] [PATCH 20/21] mips_malta: update malta's pseudo-bootloader - replace JR with JALR

2014-05-30 Thread Leon Alrae
JR has been removed in R6 and now this instruction will cause Reserved Instruction Exception. Therefore use JALR with rd=0 which is equivalent to JR. Signed-off-by: Leon Alrae --- hw/mips/mips_malta.c | 10 +- 1 files changed, 5 insertions(+), 5 deletions(-) diff --git a/hw/mips

[Qemu-devel] [PATCH 16/21] target-mips: add new Floating Point instructions

2014-05-30 Thread Leon Alrae
. Signed-off-by: Leon Alrae --- disas/mips.c| 22 +++ target-mips/helper.h| 21 +++ target-mips/op_helper.c | 108 +++ target-mips/translate.c | 449 ++- 4 files changed, 552 insertions(+), 48 deletions(-) diff --git a/disas

[Qemu-devel] [PATCH 18/21] target-mips: do not allow Status.FR=0 mode in 64-bit FPU

2014-05-30 Thread Leon Alrae
Status.FR bit must be ignored on write and read as 1 when an implementation of Release 6 of the Architecture in which a 64-bit floating point unit is implemented. Signed-off-by: Leon Alrae --- target-mips/translate.c |7 +++ 1 files changed, 7 insertions(+), 0 deletions(-) diff --git a

[Qemu-devel] [PATCH 15/21] softfloat: add functions corresponding to IEEE-2008 min/maxNumMag

2014-05-30 Thread Leon Alrae
returns y if |y| > |x|, otherwise maxnum(x,y) Signed-off-by: Leon Alrae --- fpu/softfloat.c | 37 ++--- include/fpu/softfloat.h |4 2 files changed, 34 insertions(+), 7 deletions(-) diff --git a/fpu/softfloat.c b/fpu/softf

[Qemu-devel] [PATCH 13/21] target-mips: add Compact Branches

2014-05-30 Thread Leon Alrae
From: Yongbok Kim Introduce MIPS32R6 Compact Branch instructions which do not have delay slot - they have forbidden slot instead. However, current implementation does not support forbidden slot yet. Signed-off-by: Yongbok Kim Signed-off-by: Leon Alrae --- disas/mips.c| 67

[Qemu-devel] [PATCH 19/21] target-mips: remove JR, BLTZAL, BGEZAL and add NAL, BAL instructions

2014-05-30 Thread Leon Alrae
From: Yongbok Kim Signed-off-by: Yongbok Kim Signed-off-by: Leon Alrae --- disas/mips.c|2 ++ target-mips/translate.c | 18 -- 2 files changed, 18 insertions(+), 2 deletions(-) diff --git a/disas/mips.c b/disas/mips.c index 5eac8cc..3852ec4 100644 --- a

[Qemu-devel] [PATCH 08/21] target-mips: move PREF, CACHE, LLD and SCD instructions

2014-05-30 Thread Leon Alrae
The encoding of PREF, CACHE, LLD and SCD instruction changed in MIPS32R6. Additionally, the hint codes in PREF instruction greater than or equal to 24 generate Reserved Instruction Exception. Signed-off-by: Leon Alrae --- disas/mips.c|4 target-mips/translate.c | 29

[Qemu-devel] [PATCH 09/21] target-mips: redefine Integer Multiply and Divide instructions

2014-05-30 Thread Leon Alrae
Use "R6_" prefix in front of all new Multiply / Divide instructions for easier differentiation between R6 and preR6. Signed-off-by: Leon Alrae --- disas/mips.c| 16 ++ target-mips/translate.c | 351 --- 2 files changed, 346

Re: [Qemu-devel] [PATCH 11/21] target-mips: Status.UX/SX/KX enable 32-bit address wrapping

2014-06-02 Thread Leon Alrae
On 30/05/14 23:41, Aurelien Jarno wrote: >> In R6 the special behaviour for data references is also specified for Kernel >> and Supervisor mode. Therefore MIPS_HFLAG_UX is replaced by generic >> MIPS_HFLAG_X >> indicating whether 64-bit mode is enabled in current operating mode. > > I haven't fou

Re: [Qemu-devel] [PATCH 01/21] target-mips: introduce MIPS64R6 ISA and a new generic CPU

2014-06-02 Thread Leon Alrae
On 30/05/14 17:43, Aurelien Jarno wrote: >> +/* A generic CPU providing MIPS64 Release 6 features. >> + FIXME: Eventually this should be replaced by a real CPU model. */ >> +.name = "MIPS64R6-generic", >> +.CP0_PRid = 0x0001, >> +.CP0_Config0 = MIPS_CO

Re: [Qemu-devel] [PATCH 13/21] target-mips: add Compact Branches

2014-06-03 Thread Leon Alrae
On 02/06/14 20:16, Aurelien Jarno wrote: >> -case OPC_DADDI: >> +case OPC_DADDI: /* OPC_BNVC, OPC_BNEZALC, OPC_BNEC */ >> +if (ctx->insn_flags & ISA_MIPS32R6) { >> +/* OPC_BNVC, OPC_BNEZALC, OPC_BNEC */ >> +gen_compute_compact_branch(ctx, op, rs, rt, imm << 2

Re: [Qemu-devel] [PATCH v2 2/6] disas/mips: Add R6 jr/jr.hb to disassembler

2015-10-02 Thread Leon Alrae
}, > +{"jr.hb", "s", 0x0408, 0xfc1f, UBD|RD_s, 0, > I32R6 }, /* jalr.hb */ jr.hb match should be 0x0409, otherwise: Reviewed-by: Leon Alrae

Re: [Qemu-devel] [PATCH pic32 v3 04/16] pic32: add two MIPS processor variants: M4K and microAptivUP

2015-10-02 Thread Leon Alrae
Hi Serge, On 06/07/15 07:14, Serge Vakulenko wrote: > Needed for pic32mx (M4K) and pic32mz (microAptivUP) simulation. > > Signed-off-by: Serge Vakulenko > --- > target-mips/translate_init.c | 46 > > 1 file changed, 46 insertions(+) This patch look

Re: [Qemu-devel] [PATCH] target-mips: fix updating XContext on mmu exception

2015-10-06 Thread Leon Alrae
On 02/10/15 16:34, Yongbok Kim wrote: > Correct updating XContext.Region field on mmu exceptions. > If Config3.CTXTC = 0 then the R filed of XContext has to be updated s/filed/field > with the value of bits 63..62 of the virtual address upon a TLB > exception. > > Signed-off-by: Yongbok Kim > -

Re: [Qemu-devel] [PATCH] target-mips: Add enum for BREAK32

2015-10-06 Thread Leon Alrae
On 02/10/15 17:50, Yongbok Kim wrote: > Add enum for BREAK32 > > Signed-off-by: Yongbok Kim > --- > target-mips/translate.c |3 ++- > 1 files changed, 2 insertions(+), 1 deletions(-) Reviewed-by: Leon Alrae

Re: [Qemu-devel] [PATCH] target-mips: Add SIGRIE instruction

2015-10-06 Thread Leon Alrae
On 05/10/15 10:33, Yongbok Kim wrote: > @@ -18958,6 +18964,10 @@ static void decode_opc(CPUMIPSState *env, > DisasContext *ctx) > check_insn_opc_removed(ctx, ISA_MIPS32R6); > gen_trap(ctx, op1, rs, -1, imm); > break; > +case OPC_SIGRIE: > +

Re: [Qemu-devel] [PATCH v3 6/6] tcg/mips: Support r6 SEL{NE, EQ}Z instead of MOVN/MOVZ

2015-10-07 Thread Leon Alrae
On 07/10/15 10:46, Richard Henderson wrote: > Leon, do you want to take this as a mips maintainer, or shall I as tcg > maintainer? I thought this would go via Aurelien's mips tcg-backend queue. But if Aurelien is busy, could you take them? (at the moment I don't have anything handy to test the mip

Re: [Qemu-devel] [PATCH for-2.5 v2 3/4] mips: add Global Interrupt Controller

2015-10-29 Thread Leon Alrae
On 27/10/15 17:12, Yongbok Kim wrote: > +static uint64_t gic_read(void *opaque, hwaddr addr, unsigned size) > +{ > +MIPSGICState *gic = (MIPSGICState *) opaque; > +uint32_t vp_index = gic_get_current_vp(gic); > +uint64_t ret = 0; > +int i, base, irq_src; > +uint32_t other_index;

Re: [Qemu-devel] [PATCH v4] target-mips: fix updating XContext on mmu exception

2015-10-30 Thread Leon Alrae
On 29/10/15 17:17, Yongbok Kim wrote: > Correct updating XContext.Region field on mmu exceptions. > If Config3.CTXTC = 0 then the R field of XContext has to be updated > with the value of bits 63..62 of the virtual address upon a TLB > exception. > Also fixed the below line which overs 80 character

[Qemu-devel] [PULL 0/9] target-mips queue

2015-10-30 Thread Leon Alrae
n (1): hw/mips_malta: Fix KVM PC initialisation Leon Alrae (3): target-mips: move the test for enabled interrupts to a separate function target-mips: implement the CPU wake-up on non-enabled interrupts in R6 target-mips: update writing to CP0.Status.KX/SX/UX in MIPS Release R6

[Qemu-devel] [PULL 1/9] target-mips: move the test for enabled interrupts to a separate function

2015-10-30 Thread Leon Alrae
Signed-off-by: Leon Alrae --- target-mips/cpu.c| 4 +++- target-mips/cpu.h| 29 +++-- target-mips/helper.c | 3 ++- 3 files changed, 20 insertions(+), 16 deletions(-) diff --git a/target-mips/cpu.c b/target-mips/cpu.c index 37880d2..bbfee45 100644 --- a/target

[Qemu-devel] [PULL 9/9] target-mips: fix updating XContext on mmu exception

2015-10-30 Thread Leon Alrae
Kim Reviewed-by: James Hogan Reviewed-by: Leon Alrae Signed-off-by: Leon Alrae --- target-mips/helper.c | 7 --- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/target-mips/helper.c b/target-mips/helper.c index 2d86323..b3fe816 100644 --- a/target-mips/helper.c +++ b/target

[Qemu-devel] [PULL 2/9] target-mips: implement the CPU wake-up on non-enabled interrupts in R6

2015-10-30 Thread Leon Alrae
In Release 6, the behaviour of WAIT has been modified to make it a requirement that a processor that has disabled operation as a result of executing a WAIT will resume operation on arrival of an interrupt even if interrupts are not enabled. Signed-off-by: Leon Alrae --- target-mips/cpu.c | 7

[Qemu-devel] [PULL 6/9] target-mips: add PC, XNP reg numbers to RDHWR

2015-10-30 Thread Leon Alrae
From: Yongbok Kim Add Performance Counter (4) and XNP (5) register numbers to RDHWR. Add check_hwrena() to simplify access control checkings. Add RDHWR support to microMIPS R6. Signed-off-by: Yongbok Kim Reviewed-by: Leon Alrae Signed-off-by: Leon Alrae --- target-mips/cpu.h | 1

[Qemu-devel] [PULL 5/9] hw/mips_malta: Fix KVM PC initialisation

2015-10-30 Thread Leon Alrae
for KVM to use ram_low_size. Fix that now. Fixes: 71c199c81d29 ("mips_malta: provide ememsize env variable to kernels") Signed-off-by: James Hogan Cc: Paul Burton Cc: Leon Alrae Cc: Aurelien Jarno Reviewed-by: Aurelien Jarno Reviewed-by: Leon Alrae Signed-off-by: Leon Alrae ---

[Qemu-devel] [PULL 7/9] target-mips: Set Config5.XNP for R6 cores

2015-10-30 Thread Leon Alrae
From: Yongbok Kim Set Config5.XNP for R6 cores to indicate the extended LL/SC family of instructions NOT present. Signed-off-by: Yongbok Kim Reviewed-by: Leon Alrae Signed-off-by: Leon Alrae --- target-mips/translate_init.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff

[Qemu-devel] [PULL 3/9] target-mips: update writing to CP0.Status.KX/SX/UX in MIPS Release R6

2015-10-30 Thread Leon Alrae
Implement the relationship between CP0.Status.KX, SX and UX. It should not be possible to set UX bit if SX is 0, the same applies for setting SX if KX is 0. Signed-off-by: Leon Alrae --- target-mips/cpu.h | 7 ++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/target-mips

[Qemu-devel] [PULL 8/9] target-mips: add SIGRIE instruction

2015-10-30 Thread Leon Alrae
From: Yongbok Kim Add SIGRIE (Signal Reserved Instruction Exception) for both MIPS and microMIPS. The instruction allows to use the 16-bit code field for software use. This instruction is introduced by and required as of Release 6. Signed-off-by: Yongbok Kim Reviewed-by: Leon Alrae Signed-off

[Qemu-devel] [PULL 4/9] target-mips: Add enum for BREAK32

2015-10-30 Thread Leon Alrae
From: Yongbok Kim Add enum for BREAK32 Signed-off-by: Yongbok Kim Reviewed-by: Leon Alrae Reviewed-by: Aurelien Jarno Signed-off-by: Leon Alrae --- target-mips/translate.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/target-mips/translate.c b/target-mips

Re: [Qemu-devel] [PATCH] mips: Clean up includes

2016-01-22 Thread Leon Alrae
On 18/01/16 17:35, Peter Maydell wrote: > Clean up includes so that osdep.h is included first and headers > which it implies are not included manually. > > This commit was created with scripts/clean-includes. > > Signed-off-by: Peter Maydell > --- > disas/mips.c | 1 + > hw/mips/add

[Qemu-devel] [PULL 0/4] target-mips queue

2016-01-25 Thread Leon Alrae
Hi, Here's my target-mips queue, few fixes and includes clean-up. Thanks, Leon Cc: Peter Maydell Cc: Aurelien Jarno The following changes since commit 047e363b05679724d6b784c6ec6310697fe48ba0: Merge remote-tracking branch 'remotes/pmaydell/tags/pull-softfloat-20160122' into staging (2016-

[Qemu-devel] [PULL 1/4] target-mips/cpu.h: Fix spell error

2016-01-25 Thread Leon Alrae
From: Dongxue Zhang CP0IntCtl_IPPC1, the last letter should be 'i', not 'one'. Signed-off-by: Dongxue Zhang Reviewed-by: Leon Alrae Signed-off-by: Leon Alrae --- target-mips/cpu.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/target-mips/cpu.h b/tar

[Qemu-devel] [PULL 2/4] target-mips: silence NaNs for cvt.s.d and cvt.d.s

2016-01-25 Thread Leon Alrae
From: Aurelien Jarno cvt.s.d and cvt.d.s are FP operations and thus need to convert input sNaN into corresponding qNaN. Explicitely use the floatXX_maybe_silence_nan functions for that as the floatXX_to_floatXX functions do not do that. Cc: Leon Alrae Signed-off-by: Aurelien Jarno Reviewed-by

[Qemu-devel] [PULL 3/4] target-mips: Fix ALIGN instruction when bp=0

2016-01-25 Thread Leon Alrae
GPR[rs]) >> (8*(4-bp)) tmp = tmp_rt_hi || tmp_rt_lo GPR[rd] = sign_extend.32(tmp) Signed-off-by: Miodrag Dinic Reviewed-by: Aurelien Jarno Reviewed-by: Leon Alrae Signed-off-by: Leon Alrae --- target-mips/translate.c | 11 ++- 1 file changed, 10 insertions(+)

[Qemu-devel] [PULL 4/4] mips: Clean up includes

2016-01-25 Thread Leon Alrae
From: Peter Maydell Clean up includes so that osdep.h is included first and headers which it implies are not included manually. This commit was created with scripts/clean-includes. Signed-off-by: Peter Maydell Reviewed-by: Leon Alrae Signed-off-by: Leon Alrae --- disas/mips.c

Re: [Qemu-devel] [PATCH v4 7/7] mips/kvm: Support MSA in MIPS KVM guests

2016-02-02 Thread Leon Alrae
Hi James, On 18/12/15 10:46, James Hogan wrote: > @@ -611,17 +664,51 @@ static int kvm_mips_get_fpu_registers(CPUState *cs) > restore_flush_mode(env); > } > > -/* Floating point registers */ > -for (i = 0; i < 32; ++i) { > -if (env->CP0_Status &

Re: [Qemu-devel] [PATCH] target-mips: Stop using uint_fast*_t types in r4k_tlb_t struct

2016-02-02 Thread Leon Alrae
On 25/01/16 17:40, Peter Maydell wrote: > The r4k_tlb_t structure uses the uint_fast*_t types. Most of these > uses are in bitfields and are thus pointless, because the bitfield > itself specifies the width of the type; just use 'unsigned int' > instead. (On glibc uint_fast16_t is defined as either

Re: [Qemu-devel] [PATCH v4 7/7] mips/kvm: Support MSA in MIPS KVM guests

2016-02-02 Thread Leon Alrae
On 02/02/16 12:39, James Hogan wrote: > I can use restore_msa_fp_status(env); here, and actually the FP one > above (in previous patch) can change to restore_fp_status(env); too, > since it does the same thing. This sounds good. > I've rebased and resolved the uint64 thing too, would you like a r

[Qemu-devel] [PATCH v2] target-mips: implement R6 multi-threading

2016-02-03 Thread Leon Alrae
/EVP instructions. Signed-off-by: Yongbok Kim Signed-off-by: Leon Alrae --- This is an updated version of the patch originally sent by Yongbok some time ago. v2: * rebased * fix typo: GlobalNumer -> GlobalNumber * fix minor style issues * update the patch description --- disas/mip

[Qemu-devel] [PATCH 7/9] hw/mips_malta: make ITU available to multi-threading processors

2016-02-03 Thread Leon Alrae
Add ITU block to Malta board and make it available to multithreading processors. Signed-off-by: Leon Alrae --- hw/mips/mips_malta.c | 53 1 file changed, 53 insertions(+) diff --git a/hw/mips/mips_malta.c b/hw/mips/mips_malta.c index c5da83f

[Qemu-devel] [PATCH 6/9] hw/mips: implement ITC Storage - Bypass View

2016-02-03 Thread Leon Alrae
Bypass View does not cause issuing thread to block and does not affect any of the cells state bit. Read from a FIFO cell returns the value of the oldest entry. Store to a FIFO cell changes the value of the newest entry. Signed-off-by: Leon Alrae --- hw/misc/mips_itu.c | 27

[Qemu-devel] [PATCH 8/9] target-mips: check CP0 enabled for CACHE instruction also in R6

2016-02-03 Thread Leon Alrae
Signed-off-by: Leon Alrae --- target-mips/translate.c | 1 + 1 file changed, 1 insertion(+) diff --git a/target-mips/translate.c b/target-mips/translate.c index c6e2951..3fb3744 100644 --- a/target-mips/translate.c +++ b/target-mips/translate.c @@ -17179,6 +17179,7 @@ static void

[Qemu-devel] [PATCH 4/9] hw/mips: implement ITC Storage - Empty/Full Sync and Try Views

2016-02-03 Thread Leon Alrae
tions) not implemented. Store Conditional support for E/F Try View (i.e. indicate failure if FIFO is full) not implemented. Signed-off-by: Leon Alrae --- hw/misc/mips_itu.c | 113 + 1 file changed, 113 insertions(+) diff --git a/hw/misc/mips_itu.c

[Qemu-devel] [PATCH 1/9] hw/mips: implement ITC Configuration Tags

2016-02-03 Thread Leon Alrae
/writes directly. * storage_io: memory-mapped ITC Storage whose address space is configurable (i.e. enabled/remapped/resized) by writing to ITCAddressMap{0,1} registers. Signed-off-by: Leon Alrae --- default-configs/mips-softmmu.mak | 1 + default-configs/mips64-softmmu.mak | 1

[Qemu-devel] [PATCH 0/9] mips: implement Inter-Thread Communication Unit

2016-02-03 Thread Leon Alrae
atch 9: make changes in the CPU to access ITC Tags Feedback is welcome! Thanks, Leon Leon Alrae (9): hw/mips: implement ITC Configuration Tags hw/mips: add ITC Storage Cells hw/mips: implement ITC Storage - Control View hw/mips: implement ITC Storage - Empty/Full Sync and Try Views hw

[Qemu-devel] [PATCH 9/9] target-mips: make ITC Configuration Tags accessible to the CPU

2016-02-03 Thread Leon Alrae
the CACHE instruction as NOP. But since CACHE can operate on ITC Tags new MIPS_HFLAG_ITC_CACHE hflag is introduced to generate the helper only when CACHE is in the ITC Access mode. Signed-off-by: Leon Alrae --- target-mips/cpu.h | 7 +- target-mips/helper.h| 3 +++ target-mips

[Qemu-devel] [PATCH 2/9] hw/mips: add ITC Storage Cells

2016-02-03 Thread Leon Alrae
and P/V Synchronized Views) each cell contains a bitmap to track which threads are currently blocked. Signed-off-by: Leon Alrae --- hw/misc/mips_itu.c | 17 + include/hw/misc/mips_itu.h | 25 + 2 files changed, 42 insertions(+) diff --git a/hw/misc

[Qemu-devel] [PATCH 5/9] hw/mips: implement ITC Storage - P/V Sync and Try Views

2016-02-03 Thread Leon Alrae
is 0. P/V Try View does not block the thread, it returns 0 in this case. Cell's Empty and Full bits are not modified. Trap bit (i.e. Gating Storage exceptions) not implemented. Signed-off-by: Leon Alrae --- hw/misc/mips_itu.c | 68 ++ 1

[Qemu-devel] [PATCH 3/9] hw/mips: implement ITC Storage - Control View

2016-02-03 Thread Leon Alrae
Control view is used to access the ITC Storage Cell Tags. It never causes the issuing thread to block. Guest can empty the FIFO cell by setting Empty bit to 1. Signed-off-by: Leon Alrae --- hw/misc/mips_itu.c | 104 + 1 file changed, 104

Re: [Qemu-devel] [PATCH v5 0/7] mips/kvm: Support FPU & SIMD (MSA) in MIPS KVM guests

2016-02-04 Thread Leon Alrae
On 03/02/16 17:16, James Hogan wrote: > Here's a v5 refresh of my FPU/MSA patchset for v2.6. Thanks to all who > have taken the time to review it so far. > > This patchset primarily adds support for FPU and MIPS SIMD Architecture > (MSA) in MIPS KVM guests to QEMU. It depends on Linux v4.1, specif

Re: [Qemu-devel] [PATCH] target-mips: Fix exceptions while UX=0

2015-11-17 Thread Leon Alrae
interrupt() to clear the MIPS_HFLAG_WRAP > flag when necessary, according to compute_hflags(). > > Fixes: 01f728857941 ("target-mips: Status.UX/SX/KX enable 32-bit...") > Signed-off-by: James Hogan > Cc: Leon Alrae > Cc: Aurelien Jarno > --- > Note, compute_hflag

Re: [Qemu-devel] [PATCH v2] target-mips: Fix exceptions while UX=0

2015-11-18 Thread Leon Alrae
d exception loop. The same applies to errors and debug > exceptions. > > Fix by updating mips_cpu_do_interrupt() to clear the MIPS_HFLAG_WRAP > flag when necessary, according to compute_hflags(). > > Fixes: 01f728857941 ("target-mips: Status.UX/SX/KX enable 32-bit...") >

[Qemu-devel] [PATCH] target-mips: flush QEMU TLB when disabling 64-bit addressing

2015-11-20 Thread Leon Alrae
because we forget to flush QEMU TLB. This patch fixes it. Signed-off-by: Leon Alrae --- target-mips/cpu.h | 18 +- target-mips/op_helper.c | 13 - 2 files changed, 17 insertions(+), 14 deletions(-) diff --git a/target-mips/cpu.h b/target-mips/cpu.h index

[Qemu-devel] [PULL 1/2] target-mips: Fix exceptions while UX=0

2015-11-24 Thread Leon Alrae
_do_interrupt() to clear the MIPS_HFLAG_WRAP flag when necessary, according to compute_hflags(). Fixes: 01f728857941 ("target-mips: Status.UX/SX/KX enable 32-bit...") Signed-off-by: James Hogan Cc: Leon Alrae Cc: Aurelien Jarno Reviewed-by: Leon Alrae Signed-off-by: Leon

[Qemu-devel] [PULL 0/2] target-mips queue

2015-11-24 Thread Leon Alrae
1:03 +) MIPS patches 2015-11-24 Changes: * bugfixes for accessing 64-bit addresses James Hogan (1): target-mips: Fix exceptions while UX=0 Leon Alrae (1): target-mips:

[Qemu-devel] [PULL 2/2] target-mips: flush QEMU TLB when disabling 64-bit addressing

2015-11-24 Thread Leon Alrae
because we forget to flush QEMU TLB. This patch fixes it. Signed-off-by: Leon Alrae --- target-mips/cpu.h | 18 +- target-mips/op_helper.c | 13 - 2 files changed, 17 insertions(+), 14 deletions(-) diff --git a/target-mips/cpu.h b/target-mips/cpu.h index

Re: [Qemu-devel] [PATCH] target-mips/cpu.h: Fix spell error

2015-11-25 Thread Leon Alrae
On 25/11/15 12:57, Dongxue Zhang wrote: > CP0IntCtl_IPPC1, the last letter should be 'i', not 'one'. > > Signed-off-by: Dongxue Zhang > --- > target-mips/cpu.h | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > diff --git a/target-mips/cpu.h b/target-mips/cpu.h > index 89c01f7..17817c3

Re: [Qemu-devel] [PULL 02/32] memory: RCU ram_list.dirty_memory[] for safe RAM hotplug

2016-02-10 Thread Leon Alrae
Hi, I just noticed significant performance hit with this change. Booting small system (I tried on system mips only) was usually taking around 20 seconds, now reaches 3 minutes with this change. Leon On 09/02/16 12:13, Paolo Bonzini wrote: > From: Stefan Hajnoczi > > Although accesses to ram_li

Re: [Qemu-devel] [PATCH] memory: fix usage of find_next_bit and find_next_zero_bit

2016-02-10 Thread Leon Alrae
- > 1 file changed, 36 insertions(+), 19 deletions(-) It fixes the performance problem I was seeing: Tested-by: Leon Alrae Thanks, Leon

Re: [Qemu-devel] [PATCH v2] target-mips: Fix ALIGN instruction when bp=0

2016-01-08 Thread Leon Alrae
Hi Miodrag, Thanks for the fix; I've applied it to the target-mips queue (in future please send patches inline). Thanks, Leon On 04/01/16 15:52, Miodrag Dinic wrote: > Hello Aurelien, > > thanks for your comments and review. > Version 2 of the patch is in the attachment. > > Diff between versi

Re: [Qemu-devel] [PATCH 0/6] Get rid of confusing softfloat-specific integer types

2016-01-12 Thread Leon Alrae
clude/hw/i386/pc.h | 2 +- > migration/ram.c| 2 +- > target-alpha/fpu_helper.c | 2 +- > target-mips/kvm.c | 4 +- > target-mips/msa_helper.c | 36 > target-s390x/kvm.c | 2 +- > tests/vhost-user-test.c| 2 +- > 20 files changed, 187 insertions(+), 197 deletions(-) > Looks good to me; for MIPS part in patch 1 and 3: Acked-by: Leon Alrae Thanks, Leon

Re: [Qemu-devel] [PATCH 2/6] fpu: Replace uint64 typedef with uint64_t

2016-01-12 Thread Leon Alrae
On 12/01/16 14:31, James Hogan wrote: > Paolo/Leon: This also affects kvm_mips_get_one_ureg64() in patch 5 of my > MIPS KVM FPU patchset (mips/kvm: Support signed 64-bit KVM registers). > Are you okay to fix up the conflict when you apply? I'll fix it while applying to my queue. Regards, Leon

<    1   2   3   4   5   6   7   8   9   10   >