target/hppa: Allow, but diagnose, LDCW aligned only mod 4
PATCH 1/1 target/hppa: Allow, but diagnose, LDCW aligned only mod 4
The PA-RISC 1.1 specification says that LDCW must be aligned mod 16 or the operation is undefined. However, real hardware only generates an unaligned access trap for unaligned mod 4.
Match real hardware, but diagnose with GUEST_ERROR a violation of the specification.
---
Helge, can you please test this against your failing kernel? You will of course want to add -D logfile -d guest_errors to you qemu command-line.
r~
--- target/hppa/helper.h | 2 ++ target/hppa/op_helper.c | 9 +++++++++ target/hppa/translate.c | 6 +++++- 3 files changed, 16 insertions(+), 1 deletion(-)
target/hppa/helper.h +2 -0
@@ -17,6 +17,8 @@ DEF_HELPER_FLAGS_3(stby_b_parallel, TCG_CALL_NO_WG, void, env, tl, tr) DEF_HELPER_FLAGS_3(stby_e, TCG_CALL_NO_WG, void, env, tl, tr) DEF_HELPER_FLAGS_3(stby_e_parallel, TCG_CALL_NO_WG, void, env, tl, tr) +DEF_HELPER_FLAGS_1(ldc_check, TCG_CALL_NO_RWG, void, tl) + DEF_HELPER_FLAGS_4(probe, TCG_CALL_NO_WG, tr, env, tl, i32, i32)DEF_HELPER_FLAGS_1 (loaded_fr0,TCG_CALL_NO_RWG , void, env)
target/hppa/op_helper.c +9 -0
@@ -153,6 +153,15 @@ void HELPER(stby_e_parallel)(CPUHPPAState *env, target_ulong addr,do_stby_e (env, addr, val, true,GETPC ()); } +void HELPER (ldc_check )(target_ulong addr) +{ +if (unlikely (addr &0xf )) { +qemu_log_mask (LOG_GUEST_ERROR , +"Undefined ldc to address unaligned mod 16: " + TARGET_FMT_lx"\n" , addr); + } +} +target_ureg HELPER (probe )(CPUHPPAState *env,target_ulong addr,uint32_t level,uint32_t want) {
target/hppa/translate.c +5 -1
@@ -2942,7 +2942,7 @@ static bool trans_st(DisasContext *ctx, arg_ldst *a)static bool trans_ldc (DisasContext *ctx,arg_ldst *a) { -MemOp mop =MO_TEUL |MO_ALIGN_16 | a->size; +MemOp mop =MO_TE |MO_ALIGN | a->size;TCGv_reg zero, dest, ofs;TCGv_tl addr;
@@ -2958,8 +2958,12 @@ static bool trans_ldc(DisasContext *ctx, arg_ldst *a)form_gva (ctx, &addr, &ofs, a->b, a->x, a->scale ? a->size :0 , a->disp, a->sp, a->m, ctx->mmu_idx ==MMU_PHYS_IDX ); + +gen_helper_ldc_check (addr); zero =tcg_const_reg (0 );tcg_gen_atomic_xchg_reg (dest, addr, zero, ctx->mmu_idx, mop); +tcg_temp_free (zero); +if (a->m) {save_gpr (ctx, a->b, ofs); }
Signature · 1 line
2.20.1
Quoted 7 lines · Richard Henderson
The PA-RISC 1.1 specification says that LDCW must be aligned mod 16 or the operation is undefined. However, real hardware only generates an unaligned access trap for unaligned mod 4.
Match real hardware, but diagnose with
GUEST_ERRORa violation of the specification.
Quoted 7 lines
Reported-by Helge Deller <[email protected]>Suggested-by John David Anglin <[email protected]>Signed-off-by Richard Henderson <[email protected]>Helge, can you please test this against your failing kernel? You will of course want to add -D logfile -d
guest_errorsto you qemu command-line.
Yes, works as expected.
Thanks!
Please add:
[deller]$ tail -f logfile
Undefined ldc to address unaligned mod 16: 00000504fa6c7848 Undefined ldc to address unaligned mod 16: 00000504fa6c7a48 Undefined ldc to address unaligned mod 16: 00000506f9434848 Undefined ldc to address unaligned mod 16: 00000506f9434a48 Undefined ldc to address unaligned mod 16: 00000508fa036848 Undefined ldc to address unaligned mod 16: 00000508fa036a48 Undefined ldc to address unaligned mod 16: 0000050afa8c4848 Undefined ldc to address unaligned mod 16: 0000050afa8c4a48 Undefined ldc to address unaligned mod 16: 0000050cf94d1848 Undefined ldc to address unaligned mod 16: 0000050cf94d1a48
....
Quoted 70 lines
r~
--- target/hppa/helper.h | 2 ++ target/hppa/op_helper.c | 9 +++++++++ target/hppa/translate.c | 6 +++++- 3 files changed, 16 insertions(+), 1 deletion(-)target/hppa/helper.h +2
-0@@ -17,6 +17,8 @@ DEF_HELPER_FLAGS_3(stby_b_parallel, TCG_CALL_NO_WG, void, env, tl, tr) DEF_HELPER_FLAGS_3(stby_e, TCG_CALL_NO_WG, void, env, tl, tr) DEF_HELPER_FLAGS_3(stby_e_parallel, TCG_CALL_NO_WG, void, env, tl, tr) +DEF_HELPER_FLAGS_1(ldc_check, TCG_CALL_NO_RWG, void, tl) + DEF_HELPER_FLAGS_4(probe, TCG_CALL_NO_WG, tr, env, tl, i32, i32)DEF_HELPER_FLAGS_1 (loaded_fr0,TCG_CALL_NO_RWG , void, env)target/hppa/op_helper.c +9
-0@@ -153,6 +153,15 @@ void HELPER(stby_e_parallel)(CPUHPPAState *env, target_ulong addr,do_stby_e (env, addr, val, true,GETPC ()); } +void HELPER (ldc_check )(target_ulong addr) +{ +if (unlikely (addr &0xf )) { +qemu_log_mask (LOG_GUEST_ERROR , +"Undefined ldc to address unaligned mod 16: " + TARGET_FMT_lx"\n" , addr); + } +} +target_ureg HELPER (probe )(CPUHPPAState *env,target_ulong addr,uint32_t level,uint32_t want) {target/hppa/translate.c +5
-1@@ -2942,7 +2942,7 @@ static bool trans_st(DisasContext *ctx, arg_ldst *a)static bool trans_ldc (DisasContext *ctx,arg_ldst *a) { -MemOp mop =MO_TEUL |MO_ALIGN_16 | a->size; +MemOp mop =MO_TE |MO_ALIGN | a->size;TCGv_reg zero, dest, ofs;TCGv_tl addr;@@ -2958,8 +2958,12 @@ static bool trans_ldc(DisasContext *ctx, arg_ldst *a)form_gva (ctx, &addr, &ofs, a->b, a->x, a->scale ? a->size :0 , a->disp, a->sp, a->m, ctx->mmu_idx ==MMU_PHYS_IDX ); + +gen_helper_ldc_check (addr); zero =tcg_const_reg (0 );tcg_gen_atomic_xchg_reg (dest, addr, zero, ctx->mmu_idx, mop); +tcg_temp_free (zero); +if (a->m) {save_gpr (ctx, a->b, ofs); }
Quoted 69 lines · Helge Deller
Quoted 7 lines · Richard Henderson
The PA-RISC 1.1 specification says that LDCW must be aligned mod 16 or the operation is undefined. However, real hardware only generates an unaligned access trap for unaligned mod 4.
Match real hardware, but diagnose with
GUEST_ERRORa violation of the specification.Quoted 7 lines
Reported-by Helge Deller <[email protected]>Suggested-by John David Anglin <[email protected]>Signed-off-by Richard Henderson <[email protected]>Helge, can you please test this against your failing kernel? You will of course want to add -D logfile -d
guest_errorsto you qemu command-line.Yes, works as expected.
Thanks!Please add:
Tested-by Helge Deller <[email protected]>[deller]$ tail -f logfile
Undefined ldc to address unaligned mod 16:00000504fa6c7848Undefined ldc to address unaligned mod 16:00000504fa6c7a48Undefined ldc to address unaligned mod 16:00000506f9434848Undefined ldc to address unaligned mod 16:00000506f9434a48Undefined ldc to address unaligned mod 16:00000508fa036848Undefined ldc to address unaligned mod 16:00000508fa036a48Undefined ldc to address unaligned mod 16:0000050afa8c4848Undefined ldc to address unaligned mod 16:0000050afa8c4a48Undefined ldc to address unaligned mod 16:0000050cf94d1848Undefined ldc to address unaligned mod 16:0000050cf94d1a48
....Quoted 31 lines
r~
--- target/hppa/helper.h | 2 ++ target/hppa/op_helper.c | 9 +++++++++ target/hppa/translate.c | 6 +++++- 3 files changed, 16 insertions(+), 1 deletion(-)target/hppa/helper.h +2
-0@@ -17,6 +17,8 @@ DEF_HELPER_FLAGS_3(stby_b_parallel, TCG_CALL_NO_WG, void, env, tl, tr) DEF_HELPER_FLAGS_3(stby_e, TCG_CALL_NO_WG, void, env, tl, tr) DEF_HELPER_FLAGS_3(stby_e_parallel, TCG_CALL_NO_WG, void, env, tl, tr) +DEF_HELPER_FLAGS_1(ldc_check, TCG_CALL_NO_RWG, void, tl) + DEF_HELPER_FLAGS_4(probe, TCG_CALL_NO_WG, tr, env, tl, i32, i32)DEF_HELPER_FLAGS_1 (loaded_fr0,TCG_CALL_NO_RWG , void, env)target/hppa/op_helper.c +0
-0@@ -153,6 +153,15 @@ void HELPER(stby_e_parallel)(CPUHPPAState *env, target_ulong addr,do_stby_e (env, addr, val, true,GETPC ()); }
Quoted 5 lines
target/hppa/op_helper.c void HELPER(stby_e_parallel)(CPUHPPAState *env, target_ulong addr, · line 160
Quoted 5 lines
target/hppa/op_helper.c +5
-0+void HELPER (ldc_check )(target_ulong addr) +{ +if (unlikely (addr &0xf )) { +qemu_log_mask (LOG_GUEST_ERROR , + "Undefined ldc to address unaligned mod 16: "
"to unaligned address mod 16"?
Quoted 13 lines
Quoted 13 lines
target/hppa/op_helper.c +4
-0+ TARGET_FMT_lx "\n", addr); + } +} +target_ureg HELPER (probe )(CPUHPPAState *env,target_ulong addr,uint32_t level,uint32_t want) {target/hppa/translate.c +0
-0@@ -2942,7 +2942,7 @@ static bool trans_st(DisasContext *ctx, arg_ldst *a)
Quoted 4 lines
target/hppa/translate.c static bool trans_st(DisasContext *ctx, arg_ldst *a) · line 2945
Quoted 4 lines
target/hppa/translate.c +1
-1static bool trans_ldc (DisasContext *ctx,arg_ldst *a) { -MemOp mop =MO_TEUL |MO_ALIGN_16 | a->size; +MemOp mop =MO_TE |MO_ALIGN | a->size;
Hmmm you changed MO_TEUL -> MO_TE, so from MO_32 to MO_8.
Per your description, shouldn't this be MO_TEUL | MO_ALIGN_4?
Quoted 19 lines
Quoted 17 lines
target/hppa/translate.c +4
-0TCGv_reg zero, dest, ofs;TCGv_tl addr;@@ -2958,8 +2958,12 @@ static bool trans_ldc(DisasContext *ctx, arg_ldst *a)form_gva (ctx, &addr, &ofs, a->b, a->x, a->scale ? a->size :0 , a->disp, a->sp, a->m, ctx->mmu_idx ==MMU_PHYS_IDX ); + +gen_helper_ldc_check (addr); zero =tcg_const_reg (0 );tcg_gen_atomic_xchg_reg (dest, addr, zero, ctx->mmu_idx, mop); +tcg_temp_free (zero); +if (a->m) {save_gpr (ctx, a->b, ofs); }
Quoted 104 lines · Philippe Mathieu-Daudé
Quoted 69 lines · Helge Deller
Quoted 7 lines · Richard Henderson
The PA-RISC 1.1 specification says that LDCW must be aligned mod 16 or the operation is undefined. However, real hardware only generates an unaligned access trap for unaligned mod 4.
Match real hardware, but diagnose with
GUEST_ERRORa violation of the specification.Quoted 7 lines
Reported-by Helge Deller <[email protected]>Suggested-by John David Anglin <[email protected]>Signed-off-by Richard Henderson <[email protected]>Helge, can you please test this against your failing kernel? You will of course want to add -D logfile -d
guest_errorsto you qemu command-line.Yes, works as expected.
Thanks!Please add:
Tested-by Helge Deller <[email protected]>[deller]$ tail -f logfile
Undefined ldc to address unaligned mod 16:00000504fa6c7848Undefined ldc to address unaligned mod 16:00000504fa6c7a48Undefined ldc to address unaligned mod 16:00000506f9434848Undefined ldc to address unaligned mod 16:00000506f9434a48Undefined ldc to address unaligned mod 16:00000508fa036848Undefined ldc to address unaligned mod 16:00000508fa036a48Undefined ldc to address unaligned mod 16:0000050afa8c4848Undefined ldc to address unaligned mod 16:0000050afa8c4a48Undefined ldc to address unaligned mod 16:0000050cf94d1848Undefined ldc to address unaligned mod 16:0000050cf94d1a48
....Quoted 31 lines
r~
---
target/hppa/helper.h | 2 ++
target/hppa/op_helper.c| 9 +++++++++
target/hppa/translate.c| 6 +++++-3 files changed, 16 insertions(+), 1 deletion(-)target/hppa/helper.h +2
-0@@ -17,6 +17,8 @@ DEF_HELPER_FLAGS_3(stby_b_parallel, TCG_CALL_NO_WG, void, env, tl, tr) DEF_HELPER_FLAGS_3(stby_e, TCG_CALL_NO_WG, void, env, tl, tr) DEF_HELPER_FLAGS_3(stby_e_parallel, TCG_CALL_NO_WG, void, env, tl, tr) +DEF_HELPER_FLAGS_1(ldc_check, TCG_CALL_NO_RWG, void, tl) + DEF_HELPER_FLAGS_4(probe, TCG_CALL_NO_WG, tr, env, tl, i32, i32) DEF_HELPER_FLAGS_1(loaded_fr0, TCG_CALL_NO_RWG, void, env)target/hppa/op_helper.c +0
-0@@ -153,6 +153,15 @@ void HELPER(stby_e_parallel)(CPUHPPAState *env, target_ulong addr, do_stby_e(env, addr, val, true, GETPC()); }Quoted 5 lines
target/hppa/op_helper.c void HELPER(stby_e_parallel)(CPUHPPAState *env, target_ulong addr, · line 160
Quoted 5 lines
target/hppa/op_helper.c +5
-0+void HELPER (ldc_check )(target_ulong addr) +{ + if (unlikely(addr & 0xf)) { + qemu_log_mask(LOG_GUEST_ERROR, + "Undefined ldc to address unaligned mod 16: ""to unaligned address mod 16"?
Quoted 13 lines
Quoted 13 lines
target/hppa/op_helper.c +4
-0+ TARGET_FMT_lx "\n", addr); + } +} + target_ureg HELPER(probe)(CPUHPPAState *env, target_ulong addr, uint32_t level, uint32_t want) {target/hppa/translate.c +0
-0@@ -2942,7 +2942,7 @@ static bool trans_st(DisasContext *ctx, arg_ldst *a)Quoted 4 lines
target/hppa/translate.c static bool trans_st(DisasContext *ctx, arg_ldst *a) · line 2945
Quoted 4 lines
target/hppa/translate.c +1
-1static bool trans_ldc(DisasContext *ctx, arg_ldst *a) { - MemOp mop = MO_TEUL | MO_ALIGN_16 | a->size; + MemOp mop = MO_TE | MO_ALIGN | a->size;Hmmm you changed
MO_TEUL->MO_TE, so fromMO_32toMO_8.Per your description, shouldn't this be
MO_TEUL|MO_ALIGN_4?Quoted 3 lines
Quoted 3 lines
target/hppa/translate.c +0
-0TCGv_reg zero, dest, ofs; TCGv_tl addr;
Quoted 6 lines
Quoted 6 lines
target/hppa/translate.c static bool trans_ldc(DisasContext *ctx, arg_ldst *a) · line 2962
Quoted 6 lines
target/hppa/translate.c +2
-0@@ -2958,8 +2958,12 @@ static bool trans_ldc(DisasContext *ctx, arg_ldst *a) form_gva(ctx, &addr, &ofs, a->b, a->x, a->scale ? a->size : 0, a->disp, a->sp, a->m, ctx->mmu_idx == MMU_PHYS_IDX); + + gen_helper_ldc_check(addr);
Actually, for 64-bit the address is allowed to be 4-byte aligned, as long as the "co" completer is given, e.g. this would be OK: "ldcw,co 0(addr),%reg". Maybe adding something like (if TARGET_32BIT...) now would make sense, so we don't get it wrong when 64bit gets added?
Helge
Quoted 11 lines
Quoted 10 lines
Quoted 8 lines
target/hppa/translate.c +2
-0zero = tcg_const_reg(0); tcg_gen_atomic_xchg_reg(dest, addr, zero, ctx->mmu_idx, mop); + tcg_temp_free(zero); + if (a->m) { save_gpr(ctx, a->b, ofs); }
Quoted 2 lines · Helge Deller
Maybe adding something like (if
TARGET_32BIT...) now would make sense, so we don't get it wrong when 64bit gets added?
I'll add a "TODO: HPPA64" comment.
r~
This is not related to the patch but there is one other corner issue with the load and clear instructions.
When the target register is GR0, the instruction may be implemented as a normal load and clear which clears memory, or it may be aliased to the equivalent-sized load instruction, in which case it behaves exactly like that prefetch instruction and does not clear the data in memory.
See page 6-12 on PA 2.0 architecture.
Don't know what was actually done.
Regards,
Dave
Signature · 1 line
John David Anglin [email protected]
Quoted 7 lines · Philippe Mathieu-Daudé
Quoted 2 lines
Quoted 2 lines
- MemOp mop =
MO_TEUL|MO_ALIGN_16|a->size;
+ MemOp mop =MO_TE|MO_ALIGN|a->size;Hmmm you changed
MO_TEUL->MO_TE, so fromMO_32toMO_8.Per your description, shouldn't this be
MO_TEUL|MO_ALIGN_4?
The "UL" part is also being added by a->size. This code was written this way in preparation for the 64-bit ldc, and the bug was not noticable because we don't have that yet.
r~
Philippe Mathieu-Daudé
Reviewed-byQuoted 5 lines · Richard Henderson
Quoted 4 lines · Philippe Mathieu-Daudé
Quoted 2 lines
Quoted 2 lines
- MemOp mop =
MO_TEUL|MO_ALIGN_16|a->size;
+ MemOp mop =MO_TE|MO_ALIGN|a->size;
Quoted 7 lines
Quoted 3 lines
Hmmm you changed
MO_TEUL->MO_TE, so fromMO_32toMO_8.Per your description, shouldn't this be
MO_TEUL|MO_ALIGN_4?The "UL" part is also being added by
a->size. This code was written this way in preparation for the 64-bit ldc, and the bug was not noticable because we don't have that yet.
Ah I missed the a->size.
So on 32-bit the hw trap doesn't trap on unaligned 16, but traps on unaligned 4.
On 64-bit we don't know yet, but IIUC we expect to not trap on unaligned 8.
Looking at target/hppa/insns.decode:
&ldst t b x disp sp m scale size
@ldstx ...... b:5 x:5 sp:2 scale:1 ....... m:1 t:5 &ldst disp=0
@ldim5 ...... b:5 ..... sp:2 ......... t:5 \
&ldst disp=%im5_16 x=0 scale=0 m=%ma_to_mldc 000011 ..... ..... .. . 1 -- 0111 ...... @ldim5 size=2 ldc 000011 ..... ..... .. . 0 -- 0111 ...... @ldstx size=2
We have a->size = 2 = MO_32 = MO_UL.
So do you plan to add LDCD from PA2.0 using size=3, OK.
From "exec/memop.h":
* MO_ALIGN supposes the alignment size is the size of a memory access. *
* There are three options:
* - unaligned access permitted (MO_UNALN).
* - an alignment to the size of an access (MO_ALIGN);
Ah so with LDCW we already access a word, so MO_ALIGN -> MO_ALIGN_4.
With LDLD we'll have MO_ALIGN -> MO_ALIGN_8.
Now "MemOp mop = MO_TE | MO_ALIGN | a->size;" makes sense!
The power of your decodetree script amazed me again :)
Quoted 4 lines · Richard Henderson
The PA-RISC 1.1 specification says that LDCW must be aligned mod 16 or the operation is undefined. However, real hardware only generates an unaligned access trap for unaligned mod 4.
This Linux kernel commit seems relevant:
/* From: "Jim Hull" <jim.hull of hp.com>
I've attached a summary of the change, but basically, for PA 2.0, as long as the ",CO" (coherent operation) completer is specified, then the 16-byte alignment requirement for ldcw and ldcd is relaxed, and instead they only require "natural" alignment (4-byte for ldcw, 8-byte for ldcd). */
(I couldn't find the original post on
http://lists.parisc-linux.org/pipermail/parisc-linux/)
Maybe you can point to it in the description.
Quoted 84 lines
Match real hardware, but diagnose with
GUEST_ERRORa violation of the specification.Reported-by Helge Deller <[email protected]>Suggested-by John David Anglin <[email protected]>Signed-off-by Richard Henderson <[email protected]>---
Helge, can you please test this against your failing kernel? You will of course want to add -D logfile -d
guest_errorsto you qemu command-line.r~
--- target/hppa/helper.h | 2 ++ target/hppa/op_helper.c | 9 +++++++++ target/hppa/translate.c | 6 +++++- 3 files changed, 16 insertions(+), 1 deletion(-)target/hppa/helper.h +2
-0@@ -17,6 +17,8 @@ DEF_HELPER_FLAGS_3(stby_b_parallel, TCG_CALL_NO_WG, void, env, tl, tr) DEF_HELPER_FLAGS_3(stby_e, TCG_CALL_NO_WG, void, env, tl, tr) DEF_HELPER_FLAGS_3(stby_e_parallel, TCG_CALL_NO_WG, void, env, tl, tr) +DEF_HELPER_FLAGS_1(ldc_check, TCG_CALL_NO_RWG, void, tl) + DEF_HELPER_FLAGS_4(probe, TCG_CALL_NO_WG, tr, env, tl, i32, i32)DEF_HELPER_FLAGS_1 (loaded_fr0,TCG_CALL_NO_RWG , void, env)target/hppa/op_helper.c +9
-0@@ -153,6 +153,15 @@ void HELPER(stby_e_parallel)(CPUHPPAState *env, target_ulong addr,do_stby_e (env, addr, val, true,GETPC ()); } +void HELPER (ldc_check )(target_ulong addr) +{ +if (unlikely (addr &0xf )) { +qemu_log_mask (LOG_GUEST_ERROR , +"Undefined ldc to address unaligned mod 16: " + TARGET_FMT_lx"\n" , addr); + } +} +target_ureg HELPER (probe )(CPUHPPAState *env,target_ulong addr,uint32_t level,uint32_t want) {target/hppa/translate.c +5
-2@@ -2942,7 +2942,7 @@ static bool trans_st(DisasContext *ctx, arg_ldst *a)static bool trans_ldc (DisasContext *ctx,arg_ldst *a) { -MemOp mop =MO_TEUL |MO_ALIGN_16 | a->size; +MemOp mop =MO_TE |MO_ALIGN | a->size;TCGv_reg zero, dest, ofs;TCGv_tl addr;@@ -2958,8 +2958,12 @@ static bool trans_ldc(DisasContext *ctx, arg_ldst *a)form_gva (ctx, &addr, &ofs, a->b, a->x, a->scale ? a->size :0 , a->disp, a->sp, a->m, ctx->mmu_idx ==MMU_PHYS_IDX ); + +gen_helper_ldc_check (addr); zero =tcg_const_reg (0 );tcg_gen_atomic_xchg_reg (dest, addr, zero, ctx->mmu_idx, mop); +tcg_temp_free (zero); +if (a->m) {save_gpr (ctx, a->b, ofs); } --2.20.1
Quoted 9 lines · Philippe Mathieu-Daudé
Quoted 4 lines · Richard Henderson
The PA-RISC 1.1 specification says that LDCW must be aligned mod 16 or the operation is undefined. However, real hardware only generates an unaligned access trap for unaligned mod 4.
This Linux kernel commit seems relevant:
Quoted 8 lines
/* From: "Jim Hull" <jim.hull of hp.com>
I've attached a summary of the change, but basically, for PA 2.0, as long as the ",CO" (coherent operation) completer is specified, then the 16-byte alignment requirement for ldcw and ldcd is relaxed, and instead they only require "natural" alignment (4-byte for ldcw, 8-byte for ldcd). */
It isn't completely relevant. We don't implement hppa 2.0.
I added a TODO comment for HPPA64, as I said in reply to Dave Anglin elsewhere in this thread.
r~
Quoted 19 lines · Richard Henderson
Quoted 9 lines · Philippe Mathieu-Daudé
Quoted 4 lines · Richard Henderson
The PA-RISC 1.1 specification says that LDCW must be aligned mod 16 or the operation is undefined. However, real hardware only generates an unaligned access trap for unaligned mod 4.
This Linux kernel commit seems relevant:
Quoted 8 lines
/* From: "Jim Hull" <jim.hull of hp.com>
I've attached a summary of the change, but basically, for PA 2.0, as long as the ",CO" (coherent operation) completer is specified, then the 16-byte alignment requirement for ldcw and ldcd is relaxed, and instead they only require "natural" alignment (4-byte for ldcw, 8-byte for ldcd). */
Quoted 4 lines
It isn't completely relevant. We don't implement hppa 2.0.
I added a TODO comment for HPPA64, as I said in reply to Dave Anglin elsewhere in this thread.
I agree. A TODO comment should be sufficient for now.
Thanks!
Helge
Quoted 12 lines · Richard Henderson
Quoted 11 lines · Philippe Mathieu-Daudé
Quoted 4 lines · Richard Henderson
The PA-RISC 1.1 specification says that LDCW must be aligned mod 16 or the operation is undefined. However, real hardware only generates an unaligned access trap for unaligned mod 4.
This Linux kernel commit seems relevant:
Quoted 8 lines
Quoted 6 lines
/* From: "Jim Hull" <jim.hull of hp.com>
I've attached a summary of the change, but basically, for PA 2.0, as long as the ",CO" (coherent operation) completer is specified, then the 16-byte alignment requirement for ldcw and ldcd is relaxed, and instead they only require "natural" alignment (4-byte for ldcw, 8-byte for ldcd). */It isn't completely relevant. We don't implement hppa 2.0.
Oh... It was late and I misread it as:
if (PA2)
...
else
... "instead of PA 2.0 ... the 16-byte alignment ... is relaxed, and insted only require "natural" alignment ..."
endif
Quoted 3 lines
I added a TODO comment for HPPA64, as I said in reply to Dave Anglin elsewhere in this thread.