All of lore.kernel.org
 help / color / mirror / Atom feed
* [Qemu-devel] [PULL for-2.12 0/1] target/hppa: Fix for glibc 2.27
@ 2018-03-26 16:50 Richard Henderson
  2018-03-26 16:50 ` [Qemu-devel] [PULL 1/1] target/hppa: Include priv level in user-only iaoq Richard Henderson
  2018-03-27 13:10 ` [Qemu-devel] [PULL for-2.12 0/1] target/hppa: Fix for glibc 2.27 Peter Maydell
  0 siblings, 2 replies; 3+ messages in thread
From: Richard Henderson @ 2018-03-26 16:50 UTC (permalink / raw)
  To: qemu-devel; +Cc: peter.maydell

The following changes since commit 2ffd221d07a671f72354a063d3080f244ec80b20:

  Merge remote-tracking branch 'remotes/jasowang/tags/net-pull-request' into staging (2018-03-26 11:02:50 +0100)

are available in the Git repository at:

  git://github.com/rth7680/qemu.git tags/pull-hppa-20180327

for you to fetch changes up to ebd0e151149a6280ea9f4cd9638aea517bb3238b:

  target/hppa: Include priv level in user-only iaoq (2018-03-26 22:56:57 +0800)

----------------------------------------------------------------
Fix glibc 2.27 for hppa-linux-user

----------------------------------------------------------------
Richard Henderson (1):
      target/hppa: Include priv level in user-only iaoq

 target/hppa/cpu.h       |  4 ++--
 target/hppa/translate.c | 12 ++++--------
 2 files changed, 6 insertions(+), 10 deletions(-)

^ permalink raw reply	[flat|nested] 3+ messages in thread

* [Qemu-devel] [PULL 1/1] target/hppa: Include priv level in user-only iaoq
  2018-03-26 16:50 [Qemu-devel] [PULL for-2.12 0/1] target/hppa: Fix for glibc 2.27 Richard Henderson
@ 2018-03-26 16:50 ` Richard Henderson
  2018-03-27 13:10 ` [Qemu-devel] [PULL for-2.12 0/1] target/hppa: Fix for glibc 2.27 Peter Maydell
  1 sibling, 0 replies; 3+ messages in thread
From: Richard Henderson @ 2018-03-26 16:50 UTC (permalink / raw)
  To: qemu-devel; +Cc: peter.maydell

A recent glibc change relies on the fact that the iaoq must be 3,
and computes an address based on that.  QEMU had been ignoring the
priv level for user-only, which produced an incorrect address.

Reported-by: John David Anglin <dave.anglin@bell.net>
Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
---
 target/hppa/cpu.h       |  4 ++--
 target/hppa/translate.c | 12 ++++--------
 2 files changed, 6 insertions(+), 10 deletions(-)

diff --git a/target/hppa/cpu.h b/target/hppa/cpu.h
index 19dd12a93e..861bbb1f16 100644
--- a/target/hppa/cpu.h
+++ b/target/hppa/cpu.h
@@ -305,8 +305,8 @@ static inline void cpu_get_tb_cpu_state(CPUHPPAState *env, target_ulong *pc,
        incomplete virtual address.  This also means that we must separate
        out current cpu priviledge from the low bits of IAOQ_F.  */
 #ifdef CONFIG_USER_ONLY
-    *pc = env->iaoq_f;
-    *cs_base = env->iaoq_b;
+    *pc = env->iaoq_f & -4;
+    *cs_base = env->iaoq_b & -4;
 #else
     /* ??? E, T, H, L, B, P bits need to be here, when implemented.  */
     flags |= env->psw & (PSW_W | PSW_C | PSW_D);
diff --git a/target/hppa/translate.c b/target/hppa/translate.c
index 6499b392f9..c532889b1f 100644
--- a/target/hppa/translate.c
+++ b/target/hppa/translate.c
@@ -1909,9 +1909,6 @@ static DisasJumpType do_ibranch(DisasContext *ctx, TCGv_reg dest,
  */
 static TCGv_reg do_ibranch_priv(DisasContext *ctx, TCGv_reg offset)
 {
-#ifdef CONFIG_USER_ONLY
-    return offset;
-#else
     TCGv_reg dest;
     switch (ctx->privilege) {
     case 0:
@@ -1931,7 +1928,6 @@ static TCGv_reg do_ibranch_priv(DisasContext *ctx, TCGv_reg offset)
         break;
     }
     return dest;
-#endif
 }
 
 #ifdef CONFIG_USER_ONLY
@@ -1967,7 +1963,7 @@ static DisasJumpType do_page_zero(DisasContext *ctx)
         goto do_sigill;
     }
 
-    switch (ctx->iaoq_f) {
+    switch (ctx->iaoq_f & -4) {
     case 0x00: /* Null pointer call */
         gen_excp_1(EXCP_IMP);
         return DISAS_NORETURN;
@@ -1978,7 +1974,7 @@ static DisasJumpType do_page_zero(DisasContext *ctx)
 
     case 0xe0: /* SET_THREAD_POINTER */
         tcg_gen_st_reg(cpu_gr[26], cpu_env, offsetof(CPUHPPAState, cr[27]));
-        tcg_gen_mov_reg(cpu_iaoq_f, cpu_gr[31]);
+        tcg_gen_ori_reg(cpu_iaoq_f, cpu_gr[31], 3);
         tcg_gen_addi_reg(cpu_iaoq_b, cpu_iaoq_f, 4);
         return DISAS_IAQ_N_UPDATED;
 
@@ -4697,8 +4693,8 @@ static int hppa_tr_init_disas_context(DisasContextBase *dcbase,
 #ifdef CONFIG_USER_ONLY
     ctx->privilege = MMU_USER_IDX;
     ctx->mmu_idx = MMU_USER_IDX;
-    ctx->iaoq_f = ctx->base.pc_first;
-    ctx->iaoq_b = ctx->base.tb->cs_base;
+    ctx->iaoq_f = ctx->base.pc_first | MMU_USER_IDX;
+    ctx->iaoq_b = ctx->base.tb->cs_base | MMU_USER_IDX;
 #else
     ctx->privilege = (ctx->tb_flags >> TB_FLAG_PRIV_SHIFT) & 3;
     ctx->mmu_idx = (ctx->tb_flags & PSW_D ? ctx->privilege : MMU_PHYS_IDX);
-- 
2.14.3

^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [Qemu-devel] [PULL for-2.12 0/1] target/hppa: Fix for glibc 2.27
  2018-03-26 16:50 [Qemu-devel] [PULL for-2.12 0/1] target/hppa: Fix for glibc 2.27 Richard Henderson
  2018-03-26 16:50 ` [Qemu-devel] [PULL 1/1] target/hppa: Include priv level in user-only iaoq Richard Henderson
@ 2018-03-27 13:10 ` Peter Maydell
  1 sibling, 0 replies; 3+ messages in thread
From: Peter Maydell @ 2018-03-27 13:10 UTC (permalink / raw)
  To: Richard Henderson; +Cc: QEMU Developers

On 26 March 2018 at 17:50, Richard Henderson
<richard.henderson@linaro.org> wrote:
> The following changes since commit 2ffd221d07a671f72354a063d3080f244ec80b20:
>
>   Merge remote-tracking branch 'remotes/jasowang/tags/net-pull-request' into staging (2018-03-26 11:02:50 +0100)
>
> are available in the Git repository at:
>
>   git://github.com/rth7680/qemu.git tags/pull-hppa-20180327
>
> for you to fetch changes up to ebd0e151149a6280ea9f4cd9638aea517bb3238b:
>
>   target/hppa: Include priv level in user-only iaoq (2018-03-26 22:56:57 +0800)
>
> ----------------------------------------------------------------
> Fix glibc 2.27 for hppa-linux-user
>
> ----------------------------------------------------------------
> Richard Henderson (1):
>       target/hppa: Include priv level in user-only iaoq
>
>  target/hppa/cpu.h       |  4 ++--
>  target/hppa/translate.c | 12 ++++--------
>  2 files changed, 6 insertions(+), 10 deletions(-)

Applied, thanks.

-- PMM

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2018-03-27 13:10 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-03-26 16:50 [Qemu-devel] [PULL for-2.12 0/1] target/hppa: Fix for glibc 2.27 Richard Henderson
2018-03-26 16:50 ` [Qemu-devel] [PULL 1/1] target/hppa: Include priv level in user-only iaoq Richard Henderson
2018-03-27 13:10 ` [Qemu-devel] [PULL for-2.12 0/1] target/hppa: Fix for glibc 2.27 Peter Maydell

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.