[PATCH] target/riscv/pmp: fix non-translated page size address checks w/ MPU

2022-09-09 Thread leon
From: Leon Schuermann This commit fixes PMP address access checks with non page-aligned PMP regions on harts with MPU enabled. Without this change, the presence of an MPU in the virtual CPU model would influence the PMP address check behavior when an access size was unknown (`size == 0

[PATCH] target/riscv/pmp.c: respect mseccfg.RLB for pmpaddrX changes

2023-08-29 Thread leon
From: Leon Schuermann When the rule-lock bypass (RLB) bit is set in the mseccfg CSR, the PMP configuration lock bits must not apply. While this behavior is implemented for the pmpcfgX CSRs, this bit is not respected for changes to the pmpaddrX CSRs. This patch ensures that pmpaddrX CSR writes

[Qemu-devel] [Bug 1686390] [NEW] vnc server closed socket after arrow "down" keyevent

2017-04-26 Thread leon
Public bug reported: This is a rewrite for https://bugs.launchpad.net/qemu/+bug/1670377 QEMU 2.6 or later tigervncviwer 1.6 Once get into grub boot interface(choose boot os, or recovery mode), keep pressing arrow down button for couple times, qemu will close the connection, vnc used zrle mode.

[Qemu-devel] [Bug 1686390] Re: vnc server closed socket after arrow "down" keyevent

2017-04-26 Thread leon
** Description changed: This is a rewrite for https://bugs.launchpad.net/qemu/+bug/1670377 QEMU 2.6 or later - tigervncviwer 1.6 + tigervncviwer 1.6 Once get into grub boot interface(choose boot os, or recovery mode), - keep pressing arrow down button for couple times, qemu will clos

[Qemu-devel] [Bug 1686390] Re: vnc server closed socket after arrow "down" keyevent

2017-04-27 Thread leon
/0x5579e7b6d730: shared -> disconnected ** Changed in: qemu Assignee: (unassigned) => leon (liayan) -- You received this bug notification because you are a member of qemu- devel-ml, which is subscribed to QEMU. https://bugs.launchpad.net/bugs/1686390 Title: vnc server closed socke

[Qemu-devel] [PATCH] target-mips: fix mips16 MULT/DIV (broken by ASE_DSP)

2013-02-19 Thread Leon Yu
using bit[11-12] of opcode as acc is not correct for ASE_MIPS16 instructions. doing so generates RI/DSPDIS exception when decoding MIPS16 MULT/DIV. Signed-off-by: Leon Yu --- target-mips/translate.c | 14 +++--- 1 files changed, 7 insertions(+), 7 deletions(-) diff --git a/target

[Qemu-devel] [PATCH] mips/malta: prevent writes to reset flash mapping faulting

2013-08-23 Thread Leon Alrae
to a bios device with a nop write callback. Signed-off-by: James Hogan Cc: Paul Burton Cc: Leon Alrae Cc: Aurelien Jarno Signed-off-by: Leon Alrae --- hw/mips/mips_malta.c | 14 -- 1 files changed, 12 insertions(+), 2 deletions(-) diff --git a/hw/mips/mips_malta.c b/hw/mips/mi

[Qemu-devel] [PATCH v2] mips/malta: allow volatile writes to reset flash

2013-08-28 Thread Leon Alrae
s fixed by making the bios copy ram writeable, but loaded via rom_add_blob_fixed() so that it it restored on reset. That's not as volatile as real hardware but should be good enough. Signed-off-by: James Hogan Cc: Paul Burton Cc: Leon Alrae Cc: Aurelien Jarno Cc: Andreas Färber Signed-off

Re: [Qemu-devel] [PATCH v2] target-mips: fix broken MIPS16 and microMIPS

2014-09-22 Thread Leon Alrae
& MIPS_HFLAG_BDS16) && > + !(ctx.hflags & MIPS_HFLAG_BDS32)) { IMHO it would look nicer if you made this condition shorter by ORing BDS hflags. Feel free to add: Reviewed-by: Leon Alrae Regards, Leon

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

2014-09-24 Thread Leon Alrae
ping - would anyone help me and review the remaining patches in this series? On 22/08/2014 12:26, Leon Alrae wrote: > ping > > Anybody? There hasn't been any feedback on this patchset for almost 2 > months now... > > On 12/08/2014 12:36, Leon Alrae wrote: >> ping &g

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

2014-09-26 Thread Leon Alrae
Hi James, On 26/09/2014 13:03, James Hogan wrote: > Hi Leon, > > On 27/06/14 16:21, Leon Alrae wrote: >> /* MIPS64 MIPS-3D ASE support. */ >> #define I16 INSN_MIPS16 >> @@ -1209,6 +1215,8 @@ const struct mips_opcode mips_builtin_opcodes[] = >> them f

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

2014-09-26 Thread Leon Alrae
Hi James, On 26/09/2014 13:44, James Hogan wrote: > Hi Leon, > > On 27/06/14 16:21, Leon Alrae wrote: >> @@ -1215,6 +1217,8 @@ const struct mips_opcode mips_builtin_opcodes[] = >> them first. The assemblers uses a hash table based on the >> instruction n

[Qemu-devel] pending target-mips patches

2014-10-01 Thread Leon Alrae
maintainer assisting Aurelien? Leon

Re: [Qemu-devel] pending target-mips patches

2014-10-02 Thread Leon Alrae
Hi Peter, On 01/10/2014 17:32, Peter Maydell wrote: > On 1 October 2014 16:35, Leon Alrae wrote: >> I noticed that it's quite difficult to get target-mips changes >> reviewed/accepted. There is already a queue of relatively big features >> and bug fixes which are stu

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

2014-10-03 Thread Leon Alrae
Hi Yongbok, On 02/10/2014 17:10, Yongbok Kim wrote: > Hi, > > Overall looking good but has issues with not freeing tcg_temps and some > style problem which > failed with the checkpatch.pl script. I remember that checkpatch.pl just hung on this patch, probably due to macros. Regards, Leon

[Qemu-devel] [PATCH v4 01/21] target-mips: define ISA_MIPS64R6

2014-10-08 Thread Leon Alrae
Signed-off-by: Leon Alrae Reviewed-by: Aurelien Jarno --- v2: * move new CPU definition to a separate patch --- target-mips/mips-defs.h | 28 +++- 1 file changed, 19 insertions(+), 9 deletions(-) diff --git a/target-mips/mips-defs.h b/target-mips/mips-defs.h index

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

2014-10-08 Thread Leon Alrae
elien. More detailed changelog included in the separate patches. * added missing zero register case for LSA, ALIGN and BITSWAP instructions Leon Alrae (17): target-mips: define ISA_MIPS64R6 target-mips: signal RI Exception on instructions removed in R6 target-mips: add SELEQZ and SELNEZ instructions

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

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

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

2014-10-08 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 Reviewed-by: Aurelien Jarno --- disas/mips.c| 4 target

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

2014-10-08 Thread Leon Alrae
The encoding of LL and SC instruction has changed in MIPS32 Release 6. Signed-off-by: Leon Alrae Reviewed-by: Aurelien Jarno Reviewed-by: James Hogan --- v4: * fix disas mask for ll and sc * remove unnecessary check_insn_opc_removed line --- disas/mips.c| 9 - target-mips

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

2014-10-08 Thread Leon Alrae
Signed-off-by: Leon Alrae Reviewed-by: Aurelien Jarno Reviewed-by: James Hogan --- v4: * remove OPC_SPECIAL35_RESERVED and OPC_SPECIAL37_RESERVED v2: * correct conditions to match instruction name --- disas/mips.c| 8 target-mips/translate.c | 18 -- 2

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

2014-10-08 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 Reviewed-by: Aurelien Jarno --- v2: * use tcg_gen_mul_* for cases where the high part is discarded --- disas/mips.c| 16 +++ t

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

2014-06-11 Thread Leon Alrae
, ALIGN and BITSWAP instructions Leon Alrae (18): target-mips: define ISA_MIPS64R6 target-mips: signal RI Exception on instructions removed in R6 target-mips: add SELEQZ and SELNEZ instructions target-mips: move LL and SC instructions target-mips: extract decode_opc_special* from

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

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

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

2014-06-11 Thread Leon Alrae
functions will contain instructions which were removed in R6. Signed-off-by: Leon Alrae --- v2: * imm contains shifted value --- target-mips/translate.c | 227 +-- 1 files changed, 159 insertions(+), 68 deletions(-) diff --git a/target-mips/translate.

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

2014-06-11 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_AWRAP indicating enabled 32-bit address wrapping. Signed-off-by: Leon Alrae --- v2: * set hflag indicating 32-bit wrapping in compute_hflags

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

2014-06-11 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 Reviewed-by: Aurelien Jarno --- disas/mips.c|4 target

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

2014-06-11 Thread Leon Alrae
Also consider OPC_SPIM instruction as deleted in R6 because it is overlaping with MIPS32R6 SDBBP. Signed-off-by: Leon Alrae Reviewed-by: Aurelien Jarno --- v2: * check_insn_opc_removed() moved to decode_opc_special2_legacy() --- disas/mips.c|5 ++ target-mips/translate.c | 121

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

2014-06-11 Thread Leon Alrae
Signed-off-by: Leon Alrae Reviewed-by: Aurelien Jarno --- v2: * correct conditions to match instruction name --- 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

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

2014-06-11 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 --- v2: * use tcg_gen_mul_* for cases where the high part is discarded --- disas/mips.c| 16 +++ target-mips/translat

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

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

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

2014-06-11 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 v2 13/22] target-mips: add Compact Branches

2014-06-11 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 --- v2: * rename "handle_delay_slo

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

2014-06-11 Thread Leon Alrae
From: Yongbok Kim Signed-off-by: Yongbok Kim Signed-off-by: Leon Alrae --- v2: * have separate bitswap and dbitswap helpers and use common function * use TCG_CALL_NO_RWG_SE flag for bitswap and dbitswap helpers * remove useless shift in ALIGN and DALIGN * improve ALIGN implementation by

[Qemu-devel] [PATCH v2 22/22] target-mips: define a new generic CPU supporting MIPS64R6

2014-06-11 Thread Leon Alrae
Signed-off-by: Leon Alrae --- target-mips/translate_init.c | 29 + 1 files changed, 29 insertions(+), 0 deletions(-) diff --git a/target-mips/translate_init.c b/target-mips/translate_init.c index 29dc2ef..0adbb19 100644 --- a/target-mips/translate_init.c +++ b

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

2014-06-11 Thread Leon Alrae
Signed-off-by: Leon Alrae --- disas/mips.c| 42 +- target-mips/translate.c | 198 --- 2 files changed, 227 insertions(+), 13 deletions(-) diff --git a/disas/mips.c b/disas/mips.c index bee39d8..e041858 100644 --- a/disas/mips.c

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

2014-06-11 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 v2 01/22] target-mips: define ISA_MIPS64R6

2014-06-11 Thread Leon Alrae
Signed-off-by: Leon Alrae --- v2: * move new CPU definition to a separate patch --- target-mips/mips-defs.h | 28 +++- 1 files changed, 19 insertions(+), 9 deletions(-) diff --git a/target-mips/mips-defs.h b/target-mips/mips-defs.h index 9dfa516..6cb62b2 100644 --- a

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

2014-06-11 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 dd2473e..e3e253f 100644 --- a

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

2014-06-11 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 | 111 + target-mips/translate.c | 206

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

2014-06-11 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, 35 insertions(+), 6 deletions(-) diff --git a/fpu/softfloat.c b/fpu/softf

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

2014-06-11 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 v2 20/22] mips_malta: update malta's pseudo-bootloader - replace JR with JALR

2014-06-11 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 v2 02/22] target-mips: signal RI Exception on instructions removed in R6

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

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

2014-06-12 Thread Leon Alrae
On 11/06/2014 17:39, Richard Henderson wrote: > On 06/11/2014 08:19 AM, Leon Alrae wrote: >> * add missing zero register case > > What missing zero register case? > >> +if (rd == 0) { >> +/* Treat as NOP. */ >> +break; >>

Re: [Qemu-devel] [v4 PATCH] target-mips: implement UserLocal Register

2014-06-18 Thread Leon Alrae
tive_tc.CP0_UserLocal)); >> +rn = "UserLocal"; >> +} else { >> +tcg_gen_movi_tl(arg, 0); >> +} >> default: >> goto die; >> } You forgot to put "break" at the end of the case - this leads to Reserved Instruction exception when trying to read the register. Regards, Leon

[Qemu-devel] [PATCH 00/12] implement features required in MIPS64 Release 6

2014-06-19 Thread Leon Alrae
comments / suggestions are more than welcome! Thanks, Leon Leon Alrae (12): target-mips: add KScratch registers target-mips: update cpu_save/cpu_load to support KScratch registers target-mips: distinguish between data load and instruction fetch target-mips: add RI and XI fields to TLB

[Qemu-devel] [PATCH 01/12] target-mips: add KScratch registers

2014-06-19 Thread Leon Alrae
CP0_KScratch1-6 registers. For Release 6, all KScratch registers are required. Signed-off-by: Leon Alrae --- target-mips/cpu.h |3 +++ target-mips/translate.c | 27 +++ 2 files changed, 30 insertions(+), 0 deletions(-) diff --git a/target-mips/cpu.h b/target

[Qemu-devel] [PATCH 04/12] target-mips: add RI and XI fields to TLB entry

2014-06-19 Thread Leon Alrae
In Revision 3 of the architecture, the RI and XI bits were added to the TLB to enable more secure access of memory pages. These bits (along with the Dirty bit) allow the implementation of read-only, write-only, no-execute access policies for mapped pages. Signed-off-by: Leon Alrae --- target

[Qemu-devel] [PATCH 08/12] target-mips: add BadInstr and BadInstrP support

2014-06-19 Thread Leon Alrae
is in a branch delay slot. The BadInstr and BadInstrP registers are provided to allow acceleration of instruction emulation. Signed-off-by: Leon Alrae --- target-mips/cpu.h |6 +++ target-mips/helper.c| 23 +++ target-mips/translate.c | 102

[Qemu-devel] [PATCH 06/12] target-mips: add new Read-Inhibit and Execute-Inhibit exceptions

2014-06-19 Thread Leon Alrae
when the virtual address of a memory load reference matches a TLB entry whose RI bit is set. This exception type can only occur if the RI bit is implemented within the TLB and is enabled, this is denoted by the PageGrain RIE bit. Signed-off-by: Leon Alrae --- target-mips/cpu.h|5

[Qemu-devel] [PATCH 03/12] target-mips: distinguish between data load and instruction fetch

2014-06-19 Thread Leon Alrae
Signed-off-by: Leon Alrae --- target-mips/helper.c | 27 --- 1 files changed, 16 insertions(+), 11 deletions(-) diff --git a/target-mips/helper.c b/target-mips/helper.c index 064622c..b59ac13 100644 --- a/target-mips/helper.c +++ b/target-mips/helper.c @@ -26,6 +26,12

[Qemu-devel] [PATCH 07/12] target-mips: add TLBINV support

2014-06-19 Thread Leon Alrae
support for Config4.IE == 3 only (i.e. TLBINV* instructions operate on entire MMU). Single TLB entry can be marked as invalid on TLB entry write by having EntryHi.EHINV set to 1. Signed-off-by: Leon Alrae --- disas/mips.c |2 + target-mips/cpu.h|7 target

[Qemu-devel] [PATCH 05/12] target-mips: update PageGrain and m{t, f}c0 EntryLo{0, 1}

2014-06-19 Thread Leon Alrae
PageGrain needs rw bitmask which differs between MIPS architectures. In pre-R6 if RIXI is supported, PageGrain.XIE and PageGrain.RIE are writeable, whereas in R6 they are read-only 1. Signed-off-by: Leon Alrae --- target-mips/cpu.h|4 target-mips/helper.h |5

[Qemu-devel] [PATCH 11/12] target-mips: enable features in MIPS32R5-generic core

2014-06-19 Thread Leon Alrae
Signed-off-by: Leon Alrae --- target-mips/translate_init.c |9 +++-- 1 files changed, 7 insertions(+), 2 deletions(-) diff --git a/target-mips/translate_init.c b/target-mips/translate_init.c index 561eeb0..1f199fd 100644 --- a/target-mips/translate_init.c +++ b/target-mips

[Qemu-devel] [PATCH 10/12] target-mips: update cpu_save/cpu_load to support BadInstr registers

2014-06-19 Thread Leon Alrae
Signed-off-by: Leon Alrae --- target-mips/machine.c |8 1 files changed, 8 insertions(+), 0 deletions(-) diff --git a/target-mips/machine.c b/target-mips/machine.c index 966c5ef..a51b344 100644 --- a/target-mips/machine.c +++ b/target-mips/machine.c @@ -26,6 +26,10 @@ static void

[Qemu-devel] [PATCH 09/12] target-mips: save cpu state if instruction can cause an exception

2014-06-19 Thread Leon Alrae
Execution of these instructions can trigger exceptions which are supposed to update BadInstr/BadInstrP. Therefore saving cpu state in order capture the opcode. Signed-off-by: Leon Alrae --- target-mips/translate.c | 19 +++ 1 files changed, 19 insertions(+), 0 deletions

[Qemu-devel] [PATCH 02/12] target-mips: update cpu_save/cpu_load to support KScratch registers

2014-06-19 Thread Leon Alrae
Signed-off-by: Leon Alrae --- target-mips/machine.c |8 1 files changed, 8 insertions(+), 0 deletions(-) diff --git a/target-mips/machine.c b/target-mips/machine.c index 0496faa..966c5ef 100644 --- a/target-mips/machine.c +++ b/target-mips/machine.c @@ -144,6 +144,9 @@ void

[Qemu-devel] [PATCH 12/12] target-mips: enable features in MIPS64R6-generic core

2014-06-19 Thread Leon Alrae
Signed-off-by: Leon Alrae --- target-mips/translate_init.c |7 ++- 1 files changed, 6 insertions(+), 1 deletions(-) diff --git a/target-mips/translate_init.c b/target-mips/translate_init.c index 1f199fd..0deaee7 100644 --- a/target-mips/translate_init.c +++ b/target-mips

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

2014-06-24 Thread Leon Alrae
case OPC_DAHI: >> +check_insn(ctx, ISA_MIPS32R6); >> +check_mips_64(ctx); >> +if (rs != 0) { >> +tcg_gen_addi_i64(cpu_gpr[rs], cpu_gpr[rs], (int64_t)imm << >> 32); > > Small nitpicking: even if it is guarded by #ifdef, in theory the _tl > type should be used there, to match the register type. I'll correct it. Thanks, Leon

Re: [Qemu-devel] [PATCH v2 22/22] target-mips: define a new generic CPU supporting MIPS64R6

2014-06-24 Thread Leon Alrae
On 19/06/2014 23:16, Aurelien Jarno wrote: > On Wed, Jun 11, 2014 at 04:19:52PM +0100, Leon Alrae wrote: >> Signed-off-by: Leon Alrae >> --- >> target-mips/translate_init.c | 29 + >> 1 files changed, 29 insertions(+), 0 deletions(-) >

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

2014-06-24 Thread Leon Alrae
v, i32, i32, i32) >> +DEF_HELPER_4(float_msubf_d, i64, env, i64, i64, i64) >> + > > Why not using FOP_PROTO here? > I'll correct it. Thanks, Leon

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

2014-06-24 Thread Leon Alrae
On 11/06/2014 17:52, Richard Henderson wrote: > On 06/11/2014 08:19 AM, Leon Alrae wrote: >> +case OPC_BEQZC: >> +tcg_gen_setcondi_tl(TCG_COND_EQ, bcond, t0, 0); >> +break; > ... >> +/* Compact branches don't have dela

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

2014-08-12 Thread Leon Alrae
ping On 05/08/2014 10:26, Leon Alrae wrote: > ping > > http://patchwork.ozlabs.org/patch/365066/ > http://patchwork.ozlabs.org/patch/365042/ > http://patchwork.ozlabs.org/patch/365046/ > http://patchwork.ozlabs.org/patch/365056/ > http://patchwork.ozlabs.org/patch/365059/

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

2014-08-22 Thread Leon Alrae
ping Anybody? There hasn't been any feedback on this patchset for almost 2 months now... On 12/08/2014 12:36, Leon Alrae wrote: > ping > > On 05/08/2014 10:26, Leon Alrae wrote: >> ping >> >> http://patchwork.ozlabs.org/patch/365066/ >> http://patc

[Qemu-devel] [PATCH] target-mips: fix decoding of microMIPS POOL32Axf instructions

2013-08-01 Thread Leon Alrae
These are not DSP instructions, thus there is no "ac" field. For more details please refer to instruction encoding of MULT, MULTU, MADD, MADDU, MSUB, MSUBU, MFHI, MFLO, MTHI, MTLO in MIPS Architecture for Programmers Volume II-B: The microMIPS32 Instruction Set Signed-off-by:

Re: [Qemu-devel] [PATCH] target-mips: fix decoding of microMIPS POOL32Axf instructions

2013-08-05 Thread Leon Alrae
On 03/08/13 23:01, Aurelien Jarno wrote: > On Thu, Aug 01, 2013 at 11:02:27AM +0100, Leon Alrae wrote: >> These are not DSP instructions, thus there is no "ac" field. >> >> For more details please refer to instruction encoding of >> MULT, MULTU, MADD, MADDU, M

Re: [Qemu-devel] [PATCH] target-mips: fix decoding of microMIPS POOL32Axf instructions

2013-08-05 Thread Leon Alrae
On 05/08/13 11:50, Aurelien Jarno wrote: > On Mon, Aug 05, 2013 at 08:41:52AM +0100, Leon Alrae wrote: >> On 03/08/13 23:01, Aurelien Jarno wrote: >>> On Thu, Aug 01, 2013 at 11:02:27AM +0100, Leon Alrae wrote: >>>> These are not DSP instructions, thus there is no

[Qemu-devel] [PATCH v2] target-mips: fix decoding of microMIPS POOL32Axf instructions

2013-08-05 Thread Leon Alrae
: The microMIPS32 Instruction Set MIPS Architecture for Programmers Volume IV-e: The MIPS DSP Module for the microMIPS32 Architecture Signed-off-by: Leon Alrae --- target-mips/translate.c | 58 ++ 1 files changed, 53 insertions(+), 5 deletions

[Qemu-devel] [PATCH v3] target-mips: fix decoding of microMIPS POOL32Axf instructions

2013-08-06 Thread Leon Alrae
: The microMIPS32 Instruction Set MIPS Architecture for Programmers Volume IV-e: The MIPS DSP Module for the microMIPS32 Architecture Signed-off-by: Leon Alrae --- Changes from v2: Do not ignore bits 14 and 15 for case 0x35 Changes from v1: Add DSP version of listed instructions target-mips

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

2014-10-08 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_AWRAP indicating enabled 32-bit address wrapping. Signed-off-by: Leon Alrae Reviewed-by: Aurelien Jarno --- v2: * set hflag indicating 32

[Qemu-devel] [PATCH v4 05/21] target-mips: extract decode_opc_special* from decode_opc

2014-10-08 Thread Leon Alrae
Creating separate decode functions for special, special2 and special3 instructions to ease adding new R6 instructions and removing legacy instructions. Signed-off-by: Leon Alrae Reviewed-by: Aurelien Jarno --- target-mips/translate.c | 1678 --- 1

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

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

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

2014-10-08 Thread Leon Alrae
Also consider OPC_SPIM instruction as deleted in R6 because it is overlaping with MIPS32R6 SDBBP. Signed-off-by: Leon Alrae Reviewed-by: Aurelien Jarno --- v2: * check_insn_opc_removed() moved to decode_opc_special2_legacy() --- disas/mips.c| 5 ++ target-mips/translate.c | 121

[Qemu-devel] [PATCH v4 14/21] target-mips: add AUI, LSA and PCREL instruction families

2014-10-08 Thread Leon Alrae
Signed-off-by: Leon Alrae --- v3: * use sextract32 instead of open coding the bit field extraction * replace _i64 with _tl in DAHI, DATI and DAUI * fix misleading LDPC comment --- disas/mips.c| 42 ++- target-mips/translate.c | 197

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

2014-10-08 Thread Leon Alrae
functions will contain instructions which were removed in R6. Signed-off-by: Leon Alrae Reviewed-by: Aurelien Jarno --- v2: * imm contains shifted value --- target-mips/translate.c | 228 +--- 1 file changed, 160 insertions(+), 68 deletions(-) diff --gi

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

2014-10-08 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 Reviewed-by: Yongbok Kim --- v3: * remove line modifying CP0_Status_rw_bitmask as this is done while

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

2014-10-08 Thread Leon Alrae
returns y if |y| > |x|, otherwise maxnum(x,y) Signed-off-by: Leon Alrae Reviewed-by: Aurelien Jarno --- v3: * rename abs argument to ismag --- fpu/softfloat.c | 37 +++-- include/fpu/softfloat.h | 4 2 files changed, 35 insertions(+),

[Qemu-devel] [PATCH v4 21/21] target-mips: define a new generic CPU supporting MIPS64 Release 6 ISA

2014-10-08 Thread Leon Alrae
Signed-off-by: Leon Alrae --- v3: * add comment to make it clear that the current definition of MIPS64R6-generic CPU does not contain support for all MIPS64R6 features yet. --- target-mips/translate_init.c | 30 ++ 1 file changed, 30 insertions(+) diff --git a

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

2014-10-08 Thread Leon Alrae
From: Yongbok Kim Signed-off-by: Yongbok Kim Signed-off-by: Leon Alrae Reviewed-by: Aurelien Jarno --- v3: * bitswap: use gen_load_gpr instead of optimizing very unlikely case and making it less readable v2: * have separate bitswap and dbitswap helpers and use common function * use

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

2014-10-08 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 Reviewed-by: Aurelien Jarno --- hw/mips/mips_malta.c | 10 +- 1 file changed, 5 insertions(+), 5 deletions

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

2014-10-08 Thread Leon Alrae
From: Yongbok Kim Signed-off-by: Yongbok Kim Signed-off-by: Leon Alrae Reviewed-by: Aurelien Jarno --- 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 9d13bc0

[Qemu-devel] [PATCH v4 13/21] target-mips: add compact and CP1 branches

2014-10-08 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. Add also BC1EQZ and BC1NEZ instructions. Signed-off-by: Yongbok Kim Signed-off-by: Leon Alrae

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

2014-10-08 Thread Leon Alrae
From: Yongbok Kim Signed-off-by: Yongbok Kim Signed-off-by: Leon Alrae Reviewed-by: Aurelien Jarno --- disas/mips.c| 44 +++ target-mips/helper.h| 27 +++ target-mips/op_helper.c | 111 ++ target-mips/translate.c | 206

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

2014-10-08 Thread Leon Alrae
. Signed-off-by: Leon Alrae Reviewed-by: Yongbok Kim --- v4: * in gen_sel_d and gen_sel_s: do not 'return' on invalid instruction, so temps are always freed * fix style issue v3: * use FOP_PROTO for new instructions and create FLOAT_RINT macro to be consistent * use TCG_CALL_NO_RWG_S

Re: [Qemu-devel] [PATCH 03/20] target-mips: move common funcs to cpu.h

2014-10-10 Thread Leon Alrae
HELPER_ST(sd, stq, uint64_t) > +#endif > +#undef HELPER_ST > + I'm not sure if moving this to cpu.h is a good idea - it won't be used anywhere else than in op_helper.c and msa_helper.c (and probably these static inlines will generate warnings in clang). Only msa_ld_df and msa_st_df in msa_helper.c need them, thus in my opinion it will be better just to move these 2 functions from msa_helper.c to op_helper.c. Regards, Leon

Re: [Qemu-devel] [PATCH 04/20] target-mips: add 8, 16, 32, 64 bits load and store

2014-10-10 Thread Leon Alrae
LPER_ST(st16, stw, uint16_t) > +HELPER_ST(st32, stl, int32_t) > +HELPER_ST(st64, stq, int64_t) > #undef HELPER_ST > > #endif /* !defined (__MIPS_CPU_H__) */ > do_ld8, do_ld32 and do_ld64 are duplications of existing do_lbu, do_lw and do_ld. Similarily with do_st*. Leon

Re: [Qemu-devel] [PATCH 06/20] target-mips: add MSA opcode enum

2014-10-10 Thread Leon Alrae
+OPC_MSA_FSOR_df = (0x9 << 22) | OPC_MSA_3RF_1C, > +OPC_MSA_FSEQ_df = (0xA << 22) | OPC_MSA_3RF_1A, > +OPC_MSA_FTQ_df = (0xA << 22) | OPC_MSA_3RF_1B, > +OPC_MSA_FSUNE_df= (0xA << 22) | OPC_MSA_3RF_1C, > +OPC_MSA_FSUEQ_df= (0xB << 22) | OPC_MSA_3RF_1A, > +OPC_MSA_FSNE_df = (0xB << 22) | OPC_MSA_3RF_1C, > +OPC_MSA_FSLT_df = (0xC << 22) | OPC_MSA_3RF_1A, > +OPC_MSA_FMIN_df = (0xC << 22) | OPC_MSA_3RF_1B, > +OPC_MSA_MULR_Q_df = (0xC << 22) | OPC_MSA_3RF_1C, > +OPC_MSA_FSULT_df= (0xD << 22) | OPC_MSA_3RF_1A, > +OPC_MSA_FMIN_A_df = (0xD << 22) | OPC_MSA_3RF_1B, > +OPC_MSA_MADDR_Q_df = (0xD << 22) | OPC_MSA_3RF_1C, > +OPC_MSA_FSLE_df = (0xE << 22) | OPC_MSA_3RF_1A, > +OPC_MSA_FMAX_df = (0xE << 22) | OPC_MSA_3RF_1B, > +OPC_MSA_MSUBR_Q_df = (0xE << 22) | OPC_MSA_3RF_1C, > +OPC_MSA_FSULE_df= (0xF << 22) | OPC_MSA_3RF_1A, > +OPC_MSA_FMAX_A_df = (0xF << 22) | OPC_MSA_3RF_1B, > + > +/* BIT instruction df(bits 22..16) = _B _H _W _D */ > +OPC_MSA_SLLI_df = (0x0 << 23) | OPC_MSA_BIT_09, > +OPC_MSA_SAT_S_df= (0x0 << 23) | OPC_MSA_BIT_0A, > +OPC_MSA_SRAI_df = (0x1 << 23) | OPC_MSA_BIT_09, > +OPC_MSA_SAT_U_df= (0x1 << 23) | OPC_MSA_BIT_0A, > +OPC_MSA_SRLI_df = (0x2 << 23) | OPC_MSA_BIT_09, > +OPC_MSA_SRARI_df= (0x2 << 23) | OPC_MSA_BIT_0A, > +OPC_MSA_BCLRI_df= (0x3 << 23) | OPC_MSA_BIT_09, > +OPC_MSA_SRLRI_df= (0x3 << 23) | OPC_MSA_BIT_0A, > +OPC_MSA_BSETI_df= (0x4 << 23) | OPC_MSA_BIT_09, > +OPC_MSA_BNEGI_df= (0x5 << 23) | OPC_MSA_BIT_09, > +OPC_MSA_BINSLI_df = (0x6 << 23) | OPC_MSA_BIT_09, > +OPC_MSA_BINSRI_df = (0x7 << 23) | OPC_MSA_BIT_09, > +}; > + > /* global register indices */ > static TCGv_ptr cpu_env; > static TCGv cpu_gpr[32], cpu_PC; > Otherwise it looks good to me: Reviewed-by: Leon Alrae Leon

Re: [Qemu-devel] [PATCH 08/20] target-mips: add msa_helper.c

2014-10-10 Thread Leon Alrae
On 14/07/2014 10:55, Yongbok Kim wrote: > add msa_helper.c > > Signed-off-by: Yongbok Kim > --- > target-mips/Makefile.objs |2 +- > target-mips/msa_helper.c | 196 > + > 2 files changed, 197 insertions(+), 1 deletions(-) > create mode 100644 t

Re: [Qemu-devel] [PATCH 09/20] target-mips: add MSA branch instructions

2014-10-10 Thread Leon Alrae
op1 == OPC_MSA_BZ_H || > + op1 == OPC_MSA_BZ_W || > + op1 == OPC_MSA_BZ_D || > + op1 == OPC_MSA_BNZ_B || > + op1 == OPC_MSA_BNZ_H || > + op1 == OPC_MSA_BNZ_W || > + op1 == OPC_MSA_BNZ_D)) { > +gen_msa_branch(env, ctx, op1); can't this be merged into the switch below? > +} else if (ctx->CP0_Config1 & (1 << CP0C1_FP)) { > check_cp1_enabled(ctx); > -op1 = MASK_CP1(ctx->opcode); > + > switch (op1) { > case OPC_MFHC1: > case OPC_MTHC1: > Regards, Leon

Re: [Qemu-devel] [PATCH v4 14/21] target-mips: add AUI, LSA and PCREL instruction families

2014-10-14 Thread Leon Alrae
111011.rs.1.<--imm16> ALUIPC I couldn't come up with better name having reasonable length, any suggestions are welcome. Thanks, Leon

[Qemu-devel] [PULL 01/28] target-mips: define ISA_MIPS64R6

2014-10-15 Thread Leon Alrae
Signed-off-by: Leon Alrae Reviewed-by: Aurelien Jarno --- target-mips/mips-defs.h | 28 +++- 1 file changed, 19 insertions(+), 9 deletions(-) diff --git a/target-mips/mips-defs.h b/target-mips/mips-defs.h index 9dfa516..6cb62b2 100644 --- a/target-mips/mips-defs.h +++ b

[Qemu-devel] [PULL 00/28] target-mips queue

2014-10-15 Thread Leon Alrae
Hi, This pull request has been assembled from pending target-mips patches which look good to me and received in my opinion sufficient review comments. They were tested mainly in context of MIPS. Please have a look and pull. Thanks, Leon Cc: Peter Maydell Cc: Aurelien Jarno The following

[Qemu-devel] [PULL 03/28] target-mips: add SELEQZ and SELNEZ instructions

2014-10-15 Thread Leon Alrae
Signed-off-by: Leon Alrae Reviewed-by: Aurelien Jarno Reviewed-by: James Hogan --- disas/mips.c| 8 target-mips/translate.c | 18 -- 2 files changed, 24 insertions(+), 2 deletions(-) diff --git a/disas/mips.c b/disas/mips.c index 2106b57..b950e53 100644

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

2014-10-15 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 Reviewed-by: Aurelien Jarno --- disas/mips.c| 4 target

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

2014-10-15 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_AWRAP indicating enabled 32-bit address wrapping. Signed-off-by: Leon Alrae Reviewed-by: Aurelien Jarno --- target-mips/cpu.h | 18

[Qemu-devel] [PULL 05/28] target-mips: extract decode_opc_special* from decode_opc

2014-10-15 Thread Leon Alrae
Creating separate decode functions for special, special2 and special3 instructions to ease adding new R6 instructions and removing legacy instructions. Signed-off-by: Leon Alrae Reviewed-by: Aurelien Jarno --- target-mips/translate.c | 1678 --- 1

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

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

[Qemu-devel] [PULL 04/28] target-mips: move LL and SC instructions

2014-10-15 Thread Leon Alrae
The encoding of LL and SC instruction has changed in MIPS32 Release 6. Signed-off-by: Leon Alrae Reviewed-by: Aurelien Jarno Reviewed-by: James Hogan --- disas/mips.c| 9 - target-mips/translate.c | 28 ++-- 2 files changed, 34 insertions(+), 3

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

2014-10-15 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 Reviewed-by: Aurelien Jarno --- disas/mips.c| 16 +++ target-mips/translate.c | 343 +

  1   2   3   4   5   6   7   8   9   10   >