Re: [Qemu-devel] [PATCH] Introduce QEMU_NEW()

2011-07-25 Thread Max Filippov
qemu_malloc() is type-unsafe as it returns a void pointer. Introduce QEMU_NEW() (and QEMU_NEWZ()), which return the correct type. Just use g_new() and g_new0() These bypass qemu_malloc(). Are we okay with that? Yes.  We can just make qemu_malloc use g_malloc. It would be also possible

Re: [Qemu-devel] Welcome to the Qemu-devel mailing list (Digest mode)

2011-08-05 Thread Max Filippov
Dear,     Is anyone can help me? I'm deeply in trouble. I want boot by kernel by qemu, i want boot from dhcp, but i got error, i have no idea on this, two days... i cannot find the solution. Anyone knows why? Thanks very much. [...] bellow is kernel error message: [   13.087298] VFS:

[Qemu-devel] signed division overflow workaround

2011-08-12 Thread Max Filippov
Hello. +            case 13: /*QUOSi*/ +                tcg_gen_div_i32(cpu_R[RRR_R], cpu_R[RRR_S], cpu_R[RRR_T]); +                break; I'm currently developing test suite for xtensa port and found that with this implementation of QUOS (signed 32-bit division) guest that divide 0x8000

Re: [Qemu-devel] signed division overflow workaround

2011-08-12 Thread Max Filippov
Hello. +            case 13: /*QUOSi*/ +                tcg_gen_div_i32(cpu_R[RRR_R], cpu_R[RRR_S], cpu_R[RRR_T]); +                break; I'm currently developing test suite for xtensa port and found that with this implementation of QUOS (signed 32-bit division) guest that divide

Re: [Qemu-devel] The reason behind block linking constraint?

2011-08-18 Thread Max Filippov
Hi, all  I am trying to figure out why QEMU put some constraints on block linking (chaining). Take x86 as an example, there are two places put constraints on block linking, gen_goto_tb and cpu_exec. - gen_goto_tb (target-i386/translate.c) ---  /* NOTE: we handle

Re: [Qemu-devel] The reason behind block linking constraint?

2011-08-18 Thread Max Filippov
If we link a TB with another TB from the different page, then the second TB may disappear when the memory mapping changes and the subsequent direct jump from the first TB will crash qemu.  Perhaps the guest OS swap the second TB out of the guest memory, is it what you mean? I meant TLB

[Qemu-devel] [PATCH v3 31/32] MAINTAINERS: add xtensa maintainer

2011-08-31 Thread Max Filippov
Add myself as target-xtensa and DC232B maintainer. Signed-off-by: Max Filippov jcmvb...@gmail.com --- MAINTAINERS | 13 + 1 files changed, 13 insertions(+), 0 deletions(-) diff --git a/MAINTAINERS b/MAINTAINERS index 508ea1e..72b2099 100644 --- a/MAINTAINERS +++ b/MAINTAINERS

[Qemu-devel] [PATCH v3 24/32] target-xtensa: implement interrupt option

2011-08-31 Thread Max Filippov
See ISA, 4.4.6 (interrupt option), 4.4.7 (high priority interrupt option) and 4.4.8 (timer interrupt option) for details. Signed-off-by: Max Filippov jcmvb...@gmail.com --- v2 - v3 changes: - handle IRQ deassertion for INTTYPE_LEVEL interrupts only; - initialize PS at reset in accordance

[Qemu-devel] [PATCH v3 21/32] target-xtensa: implement extended L32R

2011-08-31 Thread Max Filippov
See ISA, 4.3.3 for details. TB flag XTENSA_TBFLAG_LITBASE is used to track enable bit of LITBASE SR. Signed-off-by: Max Filippov jcmvb...@gmail.com --- v2 - v3 changes: - correctly mask stored litbase value on wsr. --- target-xtensa/cpu.h |6 ++ target-xtensa/helper.c|1

[Qemu-devel] [PATCH v3 28/32] target-xtensa: add gdb support

2011-08-31 Thread Max Filippov
not support operations with privileged SRs (see http://sourceware.org/ml/gdb/2011-07/msg00075.html). This support may be enabled, see NUM_CORE_REGS comment in the gdbstub.c Signed-off-by: Max Filippov jcmvb...@gmail.com --- gdbstub.c | 96 +++ target-xtensa

[Qemu-devel] [PATCH v3 30/32] target-xtensa: add dc232b core and board

2011-08-31 Thread Max Filippov
This is Diamond 232L Standard Core Rev.B (LE). Signed-off-by: Max Filippov jcmvb...@gmail.com --- Makefile.target |1 + hw/xtensa_dc232b.c| 112 target-xtensa/gdb-config-dc232b.c | 261 + target-xtensa

[Qemu-devel] [PATCH v3 12/32] target-xtensa: implement LSAI group

2011-08-31 Thread Max Filippov
- base + offset load/store operations for 1/2/4 byte values; - cache operations (not implemented); - multiprocessor synchronization operations. Signed-off-by: Max Filippov jcmvb...@gmail.com --- target-xtensa/cpu.h |1 + target-xtensa/translate.c | 89

[Qemu-devel] [PATCH v3 22/32] target-xtensa: implement unaligned exception option

2011-08-31 Thread Max Filippov
See ISA, 4.4.4 for details. Correct (aligned as per ISA) address for unaligned access is generated in case this option is not enabled. Signed-off-by: Max Filippov jcmvb...@gmail.com --- target-xtensa/helper.c|4 ++- target-xtensa/op_helper.c | 26 target

[Qemu-devel] [PATCH v3 13/32] target-xtensa: mark reserved and TBD opcodes

2011-08-31 Thread Max Filippov
Reserved opcodes must generate illegal instruction exception. Usually they signal emulation quality problems. Not implemented opcodes are good to see. Signed-off-by: Max Filippov jcmvb...@gmail.com --- target-xtensa/translate.c | 110 - 1 files

[Qemu-devel] [PATCH v3 05/32] target-xtensa: implement RT0 group

2011-08-31 Thread Max Filippov
NEG and ABS are the only members of RT0 group. Signed-off-by: Max Filippov jcmvb...@gmail.com --- target-xtensa/translate.c | 19 +++ 1 files changed, 19 insertions(+), 0 deletions(-) diff --git a/target-xtensa/translate.c b/target-xtensa/translate.c index 2ff5838..dcbc0ae

[Qemu-devel] [PATCH v3 08/32] target-xtensa: implement JX/RET0/CALLX

2011-08-31 Thread Max Filippov
Group SNM0 (indirect jumps and calls). Signed-off-by: Max Filippov jcmvb...@gmail.com --- target-xtensa/translate.c | 43 +++ 1 files changed, 43 insertions(+), 0 deletions(-) diff --git a/target-xtensa/translate.c b/target-xtensa/translate.c index

[Qemu-devel] [PATCH v3 06/32] target-xtensa: add sample board

2011-08-31 Thread Max Filippov
Sample board and sample CPU core are used for debug and may be used for development of custom SoC emulators. This board has two fixed size memory regions for DTCM and ITCM and variable length SRAM region. Signed-off-by: Max Filippov jcmvb...@gmail.com --- Makefile.target|1 + hw

[Qemu-devel] [PATCH v3 14/32] target-xtensa: implement SYNC group

2011-08-31 Thread Max Filippov
All operations in this group are no-ops, because there are no delayed side effects. Signed-off-by: Max Filippov jcmvb...@gmail.com --- target-xtensa/translate.c | 31 ++- 1 files changed, 30 insertions(+), 1 deletions(-) diff --git a/target-xtensa/translate.c b

[Qemu-devel] [PATCH v3 02/32] target-xtensa: add target to the configure script

2011-08-31 Thread Max Filippov
Signed-off-by: Max Filippov jcmvb...@gmail.com --- configure| 12 +++- default-configs/xtensa-softmmu.mak |1 + default-configs/xtensaeb-softmmu.mak |1 + 3 files changed, 13 insertions(+), 1 deletions(-) create mode 100644 default-configs/xtensa

[Qemu-devel] [PATCH v3 25/32] target-xtensa: implement accurate window check

2011-08-31 Thread Max Filippov
See ISA, 4.7.1.3 for details. Window check is inserted before commands that push used register watermark beyond its current level. Used register watermark is reset on instructions that change WINDOW_BASE/WINDOW_START SRs. Signed-off-by: Max Filippov jcmvb...@gmail.com --- target-xtensa

[Qemu-devel] [PATCH v3 29/32] target-xtensa: implement memory protection options

2011-08-31 Thread Max Filippov
- TLB opcode group; - region protection option (ISA, 4.6.3); - region translation option (ISA, 4.6.4); - MMU option (ISA, 4.6.5). Cache control attribute bits are not used by this implementation. Signed-off-by: Max Filippov jcmvb...@gmail.com --- target-xtensa/cpu.h | 56

[Qemu-devel] [PATCH v3 26/32] target-xtensa: implement CPENABLE and PRID SRs

2011-08-31 Thread Max Filippov
Signed-off-by: Max Filippov jcmvb...@gmail.com --- hw/xtensa_sample.c|1 + target-xtensa/cpu.h |2 ++ target-xtensa/translate.c |7 +++ 3 files changed, 10 insertions(+), 0 deletions(-) diff --git a/hw/xtensa_sample.c b/hw/xtensa_sample.c index 9f7733b..c2ad48a

[Qemu-devel] [PATCH v3 19/32] target-xtensa: implement windowed registers

2011-08-31 Thread Max Filippov
is in separate patch. Signed-off-by: Max Filippov jcmvb...@gmail.com --- target-xtensa/cpu.h |8 ++ target-xtensa/helper.c|1 + target-xtensa/helpers.h |8 ++ target-xtensa/op_helper.c | 185 + target-xtensa/translate.c | 144

[Qemu-devel] [PATCH v3 09/32] target-xtensa: add special and user registers

2011-08-31 Thread Max Filippov
or uregnames are considered valid. Signed-off-by: Max Filippov jcmvb...@gmail.com --- target-xtensa/cpu.h |7 ++ target-xtensa/translate.c | 47 +++- 2 files changed, 52 insertions(+), 2 deletions(-) diff --git a/target-xtensa/cpu.h b/target

[Qemu-devel] [PATCH v3 11/32] target-xtensa: implement shifts (ST1 and RST1 groups)

2011-08-31 Thread Max Filippov
- ST1: SAR (shift amount special register) manipulation, NSA(U); - RST1: shifts, 16-bit multiplication. Signed-off-by: Max Filippov jcmvb...@gmail.com --- target-xtensa/cpu.h |4 + target-xtensa/helpers.h |2 + target-xtensa/op_helper.c | 14 +++ target-xtensa/translate.c

[Qemu-devel] [PATCH v3 20/32] target-xtensa: implement loop option

2011-08-31 Thread Max Filippov
looping code verifies actual LEND value. Invalidation may be avoided for the TB at the new LEND address if there's a way to associate LEND address with TB at compilation time and later verify that it doesn't change. Signed-off-by: Max Filippov jcmvb...@gmail.com --- target-xtensa/cpu.h |3

[Qemu-devel] [PATCH v3 03/32] target-xtensa: implement disas_xtensa_insn

2011-08-31 Thread Max Filippov
Set up disas_xtensa_insn switch structure, mark required options on high level groups. Implement arithmetic/bit logic/jump/call0. Implement code generation loop with single step/breakpoint checking. Signed-off-by: Max Filippov jcmvb...@gmail.com --- target-xtensa/cpu.h | 67

[Qemu-devel] [PATCH v3 16/32] target-xtensa: add PS register and access control

2011-08-31 Thread Max Filippov
Signed-off-by: Max Filippov jcmvb...@gmail.com --- target-xtensa/cpu.h | 53 - target-xtensa/helper.c|1 + target-xtensa/translate.c | 29 3 files changed, 77 insertions(+), 6 deletions(-) diff --git a/target

[Qemu-devel] [PATCH v3 01/32] target-xtensa: add target stubs

2011-08-31 Thread Max Filippov
Signed-off-by: Max Filippov jcmvb...@gmail.com --- Makefile.target |2 + arch_init.c |2 + arch_init.h |1 + cpu-exec.c|2 + elf.h |2 + hw/xtensa_pic.c | 38 ++ target-xtensa

[Qemu-devel] [PATCH v3 27/32] target-xtensa: implement relocatable vectors

2011-08-31 Thread Max Filippov
See ISA, 4.4.3 for details. Vector addresses recorded in core configuration are absolute values that correspond to default VECBASE value. Signed-off-by: Max Filippov jcmvb...@gmail.com --- target-xtensa/cpu.h |2 ++ target-xtensa/helper.c| 18 -- target-xtensa

[Qemu-devel] [PATCH v3 04/32] target-xtensa: implement narrow instructions

2011-08-31 Thread Max Filippov
Instructions with op0 = 8 are 2 bytes long, others are 3 bytes long. Signed-off-by: Max Filippov jcmvb...@gmail.com --- target-xtensa/translate.c | 54 + 1 files changed, 54 insertions(+), 0 deletions(-) diff --git a/target-xtensa/translate.c b

[Qemu-devel] [PATCH v3 10/32] target-xtensa: implement RST3 group

2011-08-31 Thread Max Filippov
- access to Special Registers (wsr, rsr); - access to User Registers (wur, rur); - misc. operations option (value clamp, sign extension, min, max); - conditional moves. Signed-off-by: Max Filippov jcmvb...@gmail.com --- target-xtensa/translate.c | 161

[Qemu-devel] [PATCH v3 00/32] target-xtensa: new target architecture

2011-08-31 Thread Max Filippov
by the testsuite; - improve interrupt option implementation. Git tree is available at git://jcmvbkbc.spb.ru/dumb/qemu-xtensa.git xtensa Max Filippov (32): target-xtensa: add target stubs target-xtensa: add target to the configure script target-xtensa: implement disas_xtensa_insn target-xtensa: implement

[Qemu-devel] [PATCH v3 17/32] target-xtensa: implement exceptions

2011-08-31 Thread Max Filippov
- mark privileged opcodes with ring check; - make debug exception on exception handler entry. Signed-off-by: Max Filippov jcmvb...@gmail.com --- cpu-exec.c|6 +++ target-xtensa/cpu.h | 67 target-xtensa/helper.c| 37

[Qemu-devel] [PATCH v3 23/32] target-xtensa: implement SIMCALL

2011-08-31 Thread Max Filippov
Tensilica iss provides support for applications running in freestanding environment through SIMCALL command. It is used by Tensilica libc to access argc/argv, for file I/O, etc. Note that simcalls that accept buffer addresses expect virtual addresses. Signed-off-by: Max Filippov jcmvb

[Qemu-devel] [PATCH v3 18/32] target-xtensa: implement RST2 group (32 bit mul/div/rem)

2011-08-31 Thread Max Filippov
Signed-off-by: Max Filippov jcmvb...@gmail.com --- v2 - v3 changes: - handle integer overflow for QUOS/REMS. --- target-xtensa/translate.c | 77 - 1 files changed, 76 insertions(+), 1 deletions(-) diff --git a/target-xtensa/translate.c b/target

[Qemu-devel] [PATCH v3 07/32] target-xtensa: implement conditional jumps

2011-08-31 Thread Max Filippov
- BZ (comparison to zero); - BI0 (comparison to signed immediate); - BI1 (comparison to unsigned immediate); - B (two registers comparison, bit sets comparison); - BEQZ.N/BNEZ.N (narrow comparison to zero). Signed-off-by: Max Filippov jcmvb...@gmail.com --- target-xtensa/translate.c | 164

[Qemu-devel] [PATCH v3 15/32] target-xtensa: implement CACHE group

2011-08-31 Thread Max Filippov
All operations in this group are no-ops, because cache ought to be transparent to applications. However cache may be abused, then we'll need to actually implement these opcodes. Signed-off-by: Max Filippov jcmvb...@gmail.com --- target-xtensa/translate.c | 95

[Qemu-devel] [PATCH v4 00/32] target-xtensa: new target architecture

2011-09-01 Thread Max Filippov
of identifiers starting with _[A-Z]. Git tree is available at git://jcmvbkbc.spb.ru/dumb/qemu-xtensa.git xtensa Max Filippov (32): target-xtensa: add target stubs target-xtensa: add target to the configure script target-xtensa: implement disas_xtensa_insn target-xtensa: implement narrow

[Qemu-devel] [PATCH v4 05/32] target-xtensa: implement RT0 group

2011-09-01 Thread Max Filippov
NEG and ABS are the only members of RT0 group. Signed-off-by: Max Filippov jcmvb...@gmail.com --- target-xtensa/translate.c | 19 +++ 1 files changed, 19 insertions(+), 0 deletions(-) diff --git a/target-xtensa/translate.c b/target-xtensa/translate.c index 7404098..c9e2c06

[Qemu-devel] [PATCH v4 02/32] target-xtensa: add target to the configure script

2011-09-01 Thread Max Filippov
Signed-off-by: Max Filippov jcmvb...@gmail.com --- configure| 12 +++- default-configs/xtensa-softmmu.mak |1 + default-configs/xtensaeb-softmmu.mak |1 + 3 files changed, 13 insertions(+), 1 deletions(-) create mode 100644 default-configs/xtensa

[Qemu-devel] [PATCH v4 17/32] target-xtensa: implement exceptions

2011-09-01 Thread Max Filippov
- mark privileged opcodes with ring check; - make debug exception on exception handler entry. Signed-off-by: Max Filippov jcmvb...@gmail.com --- cpu-exec.c|6 +++ target-xtensa/cpu.h | 67 target-xtensa/helper.c| 37

[Qemu-devel] [PATCH v4 20/32] target-xtensa: implement loop option

2011-09-01 Thread Max Filippov
looping code verifies actual LEND value. Invalidation may be avoided for the TB at the new LEND address if there's a way to associate LEND address with TB at compilation time and later verify that it doesn't change. Signed-off-by: Max Filippov jcmvb...@gmail.com --- target-xtensa/cpu.h |3

[Qemu-devel] [PATCH v4 30/32] target-xtensa: add dc232b core and board

2011-09-01 Thread Max Filippov
This is Diamond 232L Standard Core Rev.B (LE). Signed-off-by: Max Filippov jcmvb...@gmail.com --- Makefile.target |1 + hw/xtensa_dc232b.c| 112 target-xtensa/gdb-config-dc232b.c | 261 + target-xtensa

[Qemu-devel] [PATCH v4 01/32] target-xtensa: add target stubs

2011-09-01 Thread Max Filippov
Signed-off-by: Max Filippov jcmvb...@gmail.com --- Makefile.target |2 + arch_init.c |2 + arch_init.h |1 + cpu-exec.c|2 + elf.h |2 + hw/xtensa_pic.c | 38 ++ target-xtensa

[Qemu-devel] [PATCH v4 27/32] target-xtensa: implement relocatable vectors

2011-09-01 Thread Max Filippov
See ISA, 4.4.3 for details. Vector addresses recorded in core configuration are absolute values that correspond to default VECBASE value. Signed-off-by: Max Filippov jcmvb...@gmail.com --- target-xtensa/cpu.h |2 ++ target-xtensa/helper.c| 18 -- target-xtensa

[Qemu-devel] [PATCH v4 23/32] target-xtensa: implement SIMCALL

2011-09-01 Thread Max Filippov
Tensilica iss provides support for applications running in freestanding environment through SIMCALL command. It is used by Tensilica libc to access argc/argv, for file I/O, etc. Note that simcalls that accept buffer addresses expect virtual addresses. Signed-off-by: Max Filippov jcmvb

[Qemu-devel] [PATCH v4 31/32] MAINTAINERS: add xtensa maintainer

2011-09-01 Thread Max Filippov
Add myself as target-xtensa and DC232B maintainer. Signed-off-by: Max Filippov jcmvb...@gmail.com --- MAINTAINERS | 13 + 1 files changed, 13 insertions(+), 0 deletions(-) diff --git a/MAINTAINERS b/MAINTAINERS index 508ea1e..72b2099 100644 --- a/MAINTAINERS +++ b/MAINTAINERS

[Qemu-devel] [PATCH v4 22/32] target-xtensa: implement unaligned exception option

2011-09-01 Thread Max Filippov
See ISA, 4.4.4 for details. Correct (aligned as per ISA) address for unaligned access is generated in case this option is not enabled. Signed-off-by: Max Filippov jcmvb...@gmail.com --- target-xtensa/helper.c|4 ++- target-xtensa/op_helper.c | 26 target

[Qemu-devel] [PATCH v4 18/32] target-xtensa: implement RST2 group (32 bit mul/div/rem)

2011-09-01 Thread Max Filippov
Signed-off-by: Max Filippov jcmvb...@gmail.com --- target-xtensa/translate.c | 77 - 1 files changed, 76 insertions(+), 1 deletions(-) diff --git a/target-xtensa/translate.c b/target-xtensa/translate.c index 4c9db9e..de5f947 100644 --- a/target

[Qemu-devel] [PATCH v4 07/32] target-xtensa: implement conditional jumps

2011-09-01 Thread Max Filippov
- BZ (comparison to zero); - BI0 (comparison to signed immediate); - BI1 (comparison to unsigned immediate); - B (two registers comparison, bit sets comparison); - BEQZ.N/BNEZ.N (narrow comparison to zero). Signed-off-by: Max Filippov jcmvb...@gmail.com --- target-xtensa/translate.c | 164

[Qemu-devel] [PATCH v4 26/32] target-xtensa: implement CPENABLE and PRID SRs

2011-09-01 Thread Max Filippov
Signed-off-by: Max Filippov jcmvb...@gmail.com --- hw/xtensa_sample.c|1 + target-xtensa/cpu.h |2 ++ target-xtensa/translate.c |7 +++ 3 files changed, 10 insertions(+), 0 deletions(-) diff --git a/hw/xtensa_sample.c b/hw/xtensa_sample.c index 9f7733b..c2ad48a

[Qemu-devel] [PATCH v4 10/32] target-xtensa: implement RST3 group

2011-09-01 Thread Max Filippov
- access to Special Registers (wsr, rsr); - access to User Registers (wur, rur); - misc. operations option (value clamp, sign extension, min, max); - conditional moves. Signed-off-by: Max Filippov jcmvb...@gmail.com --- target-xtensa/translate.c | 161

[Qemu-devel] [PATCH v4 29/32] target-xtensa: implement memory protection options

2011-09-01 Thread Max Filippov
- TLB opcode group; - region protection option (ISA, 4.6.3); - region translation option (ISA, 4.6.4); - MMU option (ISA, 4.6.5). Cache control attribute bits are not used by this implementation. Signed-off-by: Max Filippov jcmvb...@gmail.com --- target-xtensa/cpu.h | 56

[Qemu-devel] [PATCH v4 19/32] target-xtensa: implement windowed registers

2011-09-01 Thread Max Filippov
is in separate patch. Signed-off-by: Max Filippov jcmvb...@gmail.com --- target-xtensa/cpu.h |8 ++ target-xtensa/helper.c|1 + target-xtensa/helpers.h |8 ++ target-xtensa/op_helper.c | 185 + target-xtensa/translate.c | 144

[Qemu-devel] [PATCH v4 24/32] target-xtensa: implement interrupt option

2011-09-01 Thread Max Filippov
See ISA, 4.4.6 (interrupt option), 4.4.7 (high priority interrupt option) and 4.4.8 (timer interrupt option) for details. Signed-off-by: Max Filippov jcmvb...@gmail.com --- hw/xtensa_pic.c | 96 target-xtensa/cpu.h | 45 +- target

[Qemu-devel] [PATCH v4 21/32] target-xtensa: implement extended L32R

2011-09-01 Thread Max Filippov
See ISA, 4.3.3 for details. TB flag XTENSA_TBFLAG_LITBASE is used to track enable bit of LITBASE SR. Signed-off-by: Max Filippov jcmvb...@gmail.com --- target-xtensa/cpu.h |6 ++ target-xtensa/helper.c|1 + target-xtensa/translate.c | 37

[Qemu-devel] [PATCH v4 25/32] target-xtensa: implement accurate window check

2011-09-01 Thread Max Filippov
See ISA, 4.7.1.3 for details. Window check is inserted before commands that push used register watermark beyond its current level. Used register watermark is reset on instructions that change WINDOW_BASE/WINDOW_START SRs. Signed-off-by: Max Filippov jcmvb...@gmail.com --- target-xtensa

[Qemu-devel] [PATCH v4 16/32] target-xtensa: add PS register and access control

2011-09-01 Thread Max Filippov
Signed-off-by: Max Filippov jcmvb...@gmail.com --- target-xtensa/cpu.h | 53 - target-xtensa/helper.c|1 + target-xtensa/translate.c | 29 3 files changed, 77 insertions(+), 6 deletions(-) diff --git a/target

[Qemu-devel] [PATCH v4 14/32] target-xtensa: implement SYNC group

2011-09-01 Thread Max Filippov
All operations in this group are no-ops, because there are no delayed side effects. Signed-off-by: Max Filippov jcmvb...@gmail.com --- target-xtensa/translate.c | 31 ++- 1 files changed, 30 insertions(+), 1 deletions(-) diff --git a/target-xtensa/translate.c b

[Qemu-devel] [PATCH v4 11/32] target-xtensa: implement shifts (ST1 and RST1 groups)

2011-09-01 Thread Max Filippov
- ST1: SAR (shift amount special register) manipulation, NSA(U); - RST1: shifts, 16-bit multiplication. Signed-off-by: Max Filippov jcmvb...@gmail.com --- target-xtensa/cpu.h |4 + target-xtensa/helpers.h |2 + target-xtensa/op_helper.c | 14 +++ target-xtensa/translate.c

[Qemu-devel] [PATCH v4 12/32] target-xtensa: implement LSAI group

2011-09-01 Thread Max Filippov
- base + offset load/store operations for 1/2/4 byte values; - cache operations (not implemented); - multiprocessor synchronization operations. Signed-off-by: Max Filippov jcmvb...@gmail.com --- target-xtensa/cpu.h |1 + target-xtensa/translate.c | 89

[Qemu-devel] [PATCH v4 13/32] target-xtensa: mark reserved and TBD opcodes

2011-09-01 Thread Max Filippov
Reserved opcodes must generate illegal instruction exception. Usually they signal emulation quality problems. Not implemented opcodes are good to see. Signed-off-by: Max Filippov jcmvb...@gmail.com --- target-xtensa/translate.c | 110 - 1 files

[Qemu-devel] [PATCH v4 06/32] target-xtensa: add sample board

2011-09-01 Thread Max Filippov
Sample board and sample CPU core are used for debug and may be used for development of custom SoC emulators. This board has two fixed size memory regions for DTCM and ITCM and variable length SRAM region. Signed-off-by: Max Filippov jcmvb...@gmail.com --- Makefile.target|1 + hw

[Qemu-devel] [PATCH v4 04/32] target-xtensa: implement narrow instructions

2011-09-01 Thread Max Filippov
Instructions with op0 = 8 are 2 bytes long, others are 3 bytes long. Signed-off-by: Max Filippov jcmvb...@gmail.com --- target-xtensa/translate.c | 54 + 1 files changed, 54 insertions(+), 0 deletions(-) diff --git a/target-xtensa/translate.c b

[Qemu-devel] [PATCH v4 03/32] target-xtensa: implement disas_xtensa_insn

2011-09-01 Thread Max Filippov
Set up disas_xtensa_insn switch structure, mark required options on high level groups. Implement arithmetic/bit logic/jump/call0. Implement code generation loop with single step/breakpoint checking. Signed-off-by: Max Filippov jcmvb...@gmail.com --- target-xtensa/cpu.h | 67

[Qemu-devel] [PATCH v4 15/32] target-xtensa: implement CACHE group

2011-09-01 Thread Max Filippov
All operations in this group are no-ops, because cache ought to be transparent to applications. However cache may be abused, then we'll need to actually implement these opcodes. Signed-off-by: Max Filippov jcmvb...@gmail.com --- target-xtensa/translate.c | 95

[Qemu-devel] [PATCH v4 08/32] target-xtensa: implement JX/RET0/CALLX

2011-09-01 Thread Max Filippov
Group SNM0 (indirect jumps and calls). Signed-off-by: Max Filippov jcmvb...@gmail.com --- target-xtensa/translate.c | 43 +++ 1 files changed, 43 insertions(+), 0 deletions(-) diff --git a/target-xtensa/translate.c b/target-xtensa/translate.c index

[Qemu-devel] [PATCH v4 28/32] target-xtensa: add gdb support

2011-09-01 Thread Max Filippov
not support operations with privileged SRs (see http://sourceware.org/ml/gdb/2011-07/msg00075.html). This support may be enabled, see NUM_CORE_REGS comment in the gdbstub.c Signed-off-by: Max Filippov jcmvb...@gmail.com --- gdbstub.c | 96 +++ target-xtensa

[Qemu-devel] [PATCH v4 09/32] target-xtensa: add special and user registers

2011-09-01 Thread Max Filippov
or uregnames are considered valid. Signed-off-by: Max Filippov jcmvb...@gmail.com --- target-xtensa/cpu.h |7 ++ target-xtensa/translate.c | 47 +++- 2 files changed, 52 insertions(+), 2 deletions(-) diff --git a/target-xtensa/cpu.h b/target

Re: [Qemu-devel] [PATCH v4 00/32] target-xtensa: new target architecture

2011-09-05 Thread Max Filippov
I just had a very quick look and it Looks good to me too. Would be awesome if Max could provide something to test with in binary form. Maybe we could put it on the wiki's download page. Tarball of my current kernel and rootfs is available at

[Qemu-devel] [PATCH v5 17/33] target-xtensa: implement exceptions

2011-09-05 Thread Max Filippov
- mark privileged opcodes with ring check; - make debug exception on exception handler entry. Signed-off-by: Max Filippov jcmvb...@gmail.com --- cpu-exec.c|6 +++ target-xtensa/cpu.h | 67 target-xtensa/helper.c| 37

[Qemu-devel] [PATCH v5 29/33] target-xtensa: implement memory protection options

2011-09-05 Thread Max Filippov
- TLB opcode group; - region protection option (ISA, 4.6.3); - region translation option (ISA, 4.6.4); - MMU option (ISA, 4.6.5). Cache control attribute bits are not used by this implementation. Signed-off-by: Max Filippov jcmvb...@gmail.com --- target-xtensa/cpu.h | 56

[Qemu-devel] [PATCH v5 16/33] target-xtensa: add PS register and access control

2011-09-05 Thread Max Filippov
Signed-off-by: Max Filippov jcmvb...@gmail.com --- target-xtensa/cpu.h | 53 - target-xtensa/helper.c|1 + target-xtensa/translate.c | 29 3 files changed, 77 insertions(+), 6 deletions(-) diff --git a/target

[Qemu-devel] [PATCH v5 30/33] target-xtensa: implement boolean option

2011-09-05 Thread Max Filippov
See ISA, 4.3.9 Signed-off-by: Max Filippov jcmvb...@gmail.com --- target-xtensa/cpu.h |1 + target-xtensa/translate.c | 109 +++-- 2 files changed, 86 insertions(+), 24 deletions(-) diff --git a/target-xtensa/cpu.h b/target-xtensa/cpu.h index

[Qemu-devel] [PATCH v5 25/33] target-xtensa: implement accurate window check

2011-09-05 Thread Max Filippov
See ISA, 4.7.1.3 for details. Window check is inserted before commands that push used register watermark beyond its current level. Used register watermark is reset on instructions that change WINDOW_BASE/WINDOW_START SRs. Signed-off-by: Max Filippov jcmvb...@gmail.com --- target-xtensa

[Qemu-devel] [PATCH v5 21/33] target-xtensa: implement extended L32R

2011-09-05 Thread Max Filippov
See ISA, 4.3.3 for details. TB flag XTENSA_TBFLAG_LITBASE is used to track enable bit of LITBASE SR. Signed-off-by: Max Filippov jcmvb...@gmail.com --- target-xtensa/cpu.h |6 ++ target-xtensa/helper.c|1 + target-xtensa/translate.c | 37

[Qemu-devel] [PATCH v5 18/33] target-xtensa: implement RST2 group (32 bit mul/div/rem)

2011-09-05 Thread Max Filippov
Signed-off-by: Max Filippov jcmvb...@gmail.com --- target-xtensa/translate.c | 77 - 1 files changed, 76 insertions(+), 1 deletions(-) diff --git a/target-xtensa/translate.c b/target-xtensa/translate.c index dccd453..bc04a10 100644 --- a/target

[Qemu-devel] [PATCH v5 27/33] target-xtensa: implement relocatable vectors

2011-09-05 Thread Max Filippov
See ISA, 4.4.3 for details. Vector addresses recorded in core configuration are absolute values that correspond to default VECBASE value. Signed-off-by: Max Filippov jcmvb...@gmail.com --- target-xtensa/cpu.h |2 ++ target-xtensa/helper.c| 18 -- target-xtensa

[Qemu-devel] [PATCH v5 23/33] target-xtensa: implement SIMCALL

2011-09-05 Thread Max Filippov
Tensilica iss provides support for applications running in freestanding environment through SIMCALL command. It is used by Tensilica libc to access argc/argv, for file I/O, etc. Note that simcalls that accept buffer addresses expect virtual addresses. Signed-off-by: Max Filippov jcmvb

[Qemu-devel] [PATCH v5 07/33] target-xtensa: implement conditional jumps

2011-09-05 Thread Max Filippov
- BZ (comparison to zero); - BI0 (comparison to signed immediate); - BI1 (comparison to unsigned immediate); - B (two registers comparison, bit sets comparison); - BEQZ.N/BNEZ.N (narrow comparison to zero). Signed-off-by: Max Filippov jcmvb...@gmail.com --- target-xtensa/translate.c | 164

[Qemu-devel] [PATCH v5 09/33] target-xtensa: add special and user registers

2011-09-05 Thread Max Filippov
or uregnames are considered valid. Signed-off-by: Max Filippov jcmvb...@gmail.com --- target-xtensa/cpu.h |7 ++ target-xtensa/translate.c | 49 +++- 2 files changed, 54 insertions(+), 2 deletions(-) diff --git a/target-xtensa/cpu.h b/target

[Qemu-devel] [PATCH v5 22/33] target-xtensa: implement unaligned exception option

2011-09-05 Thread Max Filippov
See ISA, 4.4.4 for details. Correct (aligned as per ISA) address for unaligned access is generated in case this option is not enabled. Signed-off-by: Max Filippov jcmvb...@gmail.com --- target-xtensa/helper.c|4 ++- target-xtensa/op_helper.c | 26 target

[Qemu-devel] [PATCH v5 03/33] target-xtensa: implement disas_xtensa_insn

2011-09-05 Thread Max Filippov
Set up disas_xtensa_insn switch structure, mark required options on high level groups. Implement arithmetic/bit logic/jump/call0. Implement code generation loop with single step/breakpoint checking. Signed-off-by: Max Filippov jcmvb...@gmail.com --- target-xtensa/cpu.h | 67

[Qemu-devel] [PATCH v5 15/33] target-xtensa: implement CACHE group

2011-09-05 Thread Max Filippov
All operations in this group are no-ops, because cache ought to be transparent to applications. However cache may be abused, then we'll need to actually implement these opcodes. Signed-off-by: Max Filippov jcmvb...@gmail.com --- target-xtensa/translate.c | 95

[Qemu-devel] [PATCH v5 32/33] MAINTAINERS: add xtensa maintainer

2011-09-05 Thread Max Filippov
Add myself as target-xtensa and DC232B maintainer. Signed-off-by: Max Filippov jcmvb...@gmail.com --- MAINTAINERS | 13 + 1 files changed, 13 insertions(+), 0 deletions(-) diff --git a/MAINTAINERS b/MAINTAINERS index 508ea1e..72b2099 100644 --- a/MAINTAINERS +++ b/MAINTAINERS

[Qemu-devel] [PATCH v5 05/33] target-xtensa: implement RT0 group

2011-09-05 Thread Max Filippov
NEG and ABS are the only members of RT0 group. Signed-off-by: Max Filippov jcmvb...@gmail.com --- target-xtensa/translate.c | 19 +++ 1 files changed, 19 insertions(+), 0 deletions(-) diff --git a/target-xtensa/translate.c b/target-xtensa/translate.c index 4dfca2b..92547d2

[Qemu-devel] [PATCH v5 13/33] target-xtensa: mark reserved and TBD opcodes

2011-09-05 Thread Max Filippov
Reserved opcodes must generate illegal instruction exception. Usually they signal emulation quality problems. Not implemented opcodes are good to see. Signed-off-by: Max Filippov jcmvb...@gmail.com --- target-xtensa/translate.c | 110 - 1 files

[Qemu-devel] [PATCH v5 11/33] target-xtensa: implement shifts (ST1 and RST1 groups)

2011-09-05 Thread Max Filippov
- ST1: SAR (shift amount special register) manipulation, NSA(U); - RST1: shifts, 16-bit multiplication. Signed-off-by: Max Filippov jcmvb...@gmail.com --- target-xtensa/cpu.h |4 + target-xtensa/helpers.h |2 + target-xtensa/op_helper.c | 14 +++ target-xtensa/translate.c

[Qemu-devel] [PATCH v5 01/33] target-xtensa: add target stubs

2011-09-05 Thread Max Filippov
Signed-off-by: Max Filippov jcmvb...@gmail.com --- Makefile.target |2 + arch_init.c |2 + arch_init.h |1 + cpu-exec.c|2 + elf.h |2 + hw/xtensa_pic.c | 38 ++ target-xtensa

[Qemu-devel] [PATCH v5 12/33] target-xtensa: implement LSAI group

2011-09-05 Thread Max Filippov
- base + offset load/store operations for 1/2/4 byte values; - cache operations (not implemented); - multiprocessor synchronization operations. Signed-off-by: Max Filippov jcmvb...@gmail.com --- target-xtensa/cpu.h |1 + target-xtensa/translate.c | 89

[Qemu-devel] [PATCH v5 08/33] target-xtensa: implement JX/RET0/CALLX

2011-09-05 Thread Max Filippov
Group SNM0 (indirect jumps and calls). Signed-off-by: Max Filippov jcmvb...@gmail.com --- target-xtensa/translate.c | 43 +++ 1 files changed, 43 insertions(+), 0 deletions(-) diff --git a/target-xtensa/translate.c b/target-xtensa/translate.c index

[Qemu-devel] [PATCH v5 10/33] target-xtensa: implement RST3 group

2011-09-05 Thread Max Filippov
- access to Special Registers (wsr, rsr); - access to User Registers (wur, rur); - misc. operations option (value clamp, sign extension, min, max); - conditional moves. Signed-off-by: Max Filippov jcmvb...@gmail.com --- target-xtensa/translate.c | 161

[Qemu-devel] [PATCH v5 04/33] target-xtensa: implement narrow instructions

2011-09-05 Thread Max Filippov
Instructions with op0 = 8 are 2 bytes long, others are 3 bytes long. Signed-off-by: Max Filippov jcmvb...@gmail.com --- target-xtensa/translate.c | 54 + 1 files changed, 54 insertions(+), 0 deletions(-) diff --git a/target-xtensa/translate.c b

[Qemu-devel] [PATCH v5 20/33] target-xtensa: implement loop option

2011-09-05 Thread Max Filippov
looping code verifies actual LEND value. Invalidation may be avoided for the TB at the new LEND address if there's a way to associate LEND address with TB at compilation time and later verify that it doesn't change. Signed-off-by: Max Filippov jcmvb...@gmail.com --- target-xtensa/cpu.h |3

[Qemu-devel] [PATCH v5 06/33] target-xtensa: add sample board

2011-09-05 Thread Max Filippov
Sample board and sample CPU core are used for debug and may be used for development of custom SoC emulators. This board has two fixed size memory regions for DTCM and ITCM and variable length SRAM region. Signed-off-by: Max Filippov jcmvb...@gmail.com --- Makefile.target|1 + hw

[Qemu-devel] [PATCH v5 28/33] target-xtensa: add gdb support

2011-09-05 Thread Max Filippov
not support operations with privileged SRs (see http://sourceware.org/ml/gdb/2011-07/msg00075.html). This support may be enabled, see NUM_CORE_REGS comment in the gdbstub.c Signed-off-by: Max Filippov jcmvb...@gmail.com --- gdbstub.c | 96 +++ target-xtensa

[Qemu-devel] [PATCH v5 02/33] target-xtensa: add target to the configure script

2011-09-05 Thread Max Filippov
Signed-off-by: Max Filippov jcmvb...@gmail.com --- configure| 12 +++- default-configs/xtensa-softmmu.mak |1 + default-configs/xtensaeb-softmmu.mak |1 + 3 files changed, 13 insertions(+), 1 deletions(-) create mode 100644 default-configs/xtensa

[Qemu-devel] [PATCH v5 00/32] target-xtensa: new target architecture

2011-09-05 Thread Max Filippov
, comparison order, missing braces); - turn WINDOWBASE_BOUND and WINDOWSTART_BIT macros into inline functions; - convert sample boards to memory API. Git tree is available at git://jcmvbkbc.spb.ru/dumb/qemu-xtensa.git xtensa Max Filippov (33): target-xtensa: add target stubs target-xtensa: add target

[Qemu-devel] [PATCH v5 24/33] target-xtensa: implement interrupt option

2011-09-05 Thread Max Filippov
See ISA, 4.4.6 (interrupt option), 4.4.7 (high priority interrupt option) and 4.4.8 (timer interrupt option) for details. Signed-off-by: Max Filippov jcmvb...@gmail.com --- hw/xtensa_pic.c | 96 target-xtensa/cpu.h | 45 +- target

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