• R/O
  • HTTP
  • SSH
  • HTTPS

Commit

Tags
No Tags

Frequently used words (click to add to your profile)

javac++androidlinuxc#windowsobjective-ccocoa誰得qtpythonphprubygameguibathyscaphec計画中(planning stage)翻訳omegatframeworktwitterdomtestvb.netdirectxゲームエンジンbtronarduinopreviewer

Commit MetaInfo

Revisionebd0e151149a6280ea9f4cd9638aea517bb3238b (tree)
Time2018-03-26 23:56:57
AuthorRichard Henderson <richard.henderson@lina...>
CommiterRichard Henderson

Log Message

target/hppa: Include priv level in user-only iaoq

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>

Change Summary

Incremental Difference

--- 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,
305305 incomplete virtual address. This also means that we must separate
306306 out current cpu priviledge from the low bits of IAOQ_F. */
307307 #ifdef CONFIG_USER_ONLY
308- *pc = env->iaoq_f;
309- *cs_base = env->iaoq_b;
308+ *pc = env->iaoq_f & -4;
309+ *cs_base = env->iaoq_b & -4;
310310 #else
311311 /* ??? E, T, H, L, B, P bits need to be here, when implemented. */
312312 flags |= env->psw & (PSW_W | PSW_C | PSW_D);
--- a/target/hppa/translate.c
+++ b/target/hppa/translate.c
@@ -1909,9 +1909,6 @@ static DisasJumpType do_ibranch(DisasContext *ctx, TCGv_reg dest,
19091909 */
19101910 static TCGv_reg do_ibranch_priv(DisasContext *ctx, TCGv_reg offset)
19111911 {
1912-#ifdef CONFIG_USER_ONLY
1913- return offset;
1914-#else
19151912 TCGv_reg dest;
19161913 switch (ctx->privilege) {
19171914 case 0:
@@ -1931,7 +1928,6 @@ static TCGv_reg do_ibranch_priv(DisasContext *ctx, TCGv_reg offset)
19311928 break;
19321929 }
19331930 return dest;
1934-#endif
19351931 }
19361932
19371933 #ifdef CONFIG_USER_ONLY
@@ -1967,7 +1963,7 @@ static DisasJumpType do_page_zero(DisasContext *ctx)
19671963 goto do_sigill;
19681964 }
19691965
1970- switch (ctx->iaoq_f) {
1966+ switch (ctx->iaoq_f & -4) {
19711967 case 0x00: /* Null pointer call */
19721968 gen_excp_1(EXCP_IMP);
19731969 return DISAS_NORETURN;
@@ -1978,7 +1974,7 @@ static DisasJumpType do_page_zero(DisasContext *ctx)
19781974
19791975 case 0xe0: /* SET_THREAD_POINTER */
19801976 tcg_gen_st_reg(cpu_gr[26], cpu_env, offsetof(CPUHPPAState, cr[27]));
1981- tcg_gen_mov_reg(cpu_iaoq_f, cpu_gr[31]);
1977+ tcg_gen_ori_reg(cpu_iaoq_f, cpu_gr[31], 3);
19821978 tcg_gen_addi_reg(cpu_iaoq_b, cpu_iaoq_f, 4);
19831979 return DISAS_IAQ_N_UPDATED;
19841980
@@ -4697,8 +4693,8 @@ static int hppa_tr_init_disas_context(DisasContextBase *dcbase,
46974693 #ifdef CONFIG_USER_ONLY
46984694 ctx->privilege = MMU_USER_IDX;
46994695 ctx->mmu_idx = MMU_USER_IDX;
4700- ctx->iaoq_f = ctx->base.pc_first;
4701- ctx->iaoq_b = ctx->base.tb->cs_base;
4696+ ctx->iaoq_f = ctx->base.pc_first | MMU_USER_IDX;
4697+ ctx->iaoq_b = ctx->base.tb->cs_base | MMU_USER_IDX;
47024698 #else
47034699 ctx->privilege = (ctx->tb_flags >> TB_FLAG_PRIV_SHIFT) & 3;
47044700 ctx->mmu_idx = (ctx->tb_flags & PSW_D ? ctx->privilege : MMU_PHYS_IDX);