All of lore.kernel.org
 help / color / mirror / Atom feed
From: Michael Tokarev <mjt@tls.msk.ru>
To: qemu-devel@nongnu.org
Cc: qemu-stable@nongnu.org, Paolo Bonzini <pbonzini@redhat.com>,
	Michael Tokarev <mjt@tls.msk.ru>
Subject: [Stable-8.2.1 56/71] accel/tcg: Revert mapping of PCREL translation block to multiple virtual addresses
Date: Sun, 28 Jan 2024 20:50:19 +0300	[thread overview]
Message-ID: <20240128175035.812352-2-mjt@tls.msk.ru> (raw)
In-Reply-To: <qemu-stable-8.2.1-20240128204849@cover.tls.msk.ru>

From: Paolo Bonzini <pbonzini@redhat.com>

This is causing regressions that have not been analyzed yet.  Revert the
change on stable branches.

Cc: qemu-stable@nongnu.org
Cc: Michael Tokarev <mjt@tls.msk.ru>
Related: https://gitlab.com/qemu-project/qemu/-/issues/2092
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Signed-off-by: Michael Tokarev <mjt@tls.msk.ru>

diff --git a/accel/tcg/cpu-exec.c b/accel/tcg/cpu-exec.c
index c938eb96f8..6a4af14d32 100644
--- a/accel/tcg/cpu-exec.c
+++ b/accel/tcg/cpu-exec.c
@@ -183,7 +183,7 @@ static bool tb_lookup_cmp(const void *p, const void *d)
     const TranslationBlock *tb = p;
     const struct tb_desc *desc = d;
 
-    if ((tb_cflags(tb) & CF_PCREL || tb->pc == desc->pc) &&
+    if (tb->pc == desc->pc &&
         tb_page_addr0(tb) == desc->page_addr0 &&
         tb->cs_base == desc->cs_base &&
         tb->flags == desc->flags &&
@@ -233,7 +233,7 @@ static TranslationBlock *tb_htable_lookup(CPUState *cpu, vaddr pc,
         return NULL;
     }
     desc.page_addr0 = phys_pc;
-    h = tb_hash_func(phys_pc, (cflags & CF_PCREL ? 0 : pc),
+    h = tb_hash_func(phys_pc, pc,
                      flags, cs_base, cflags);
     return qht_lookup_custom(&tb_ctx.htable, &desc, h, tb_lookup_cmp);
 }
diff --git a/accel/tcg/tb-maint.c b/accel/tcg/tb-maint.c
index 3d2a896220..0d069a081e 100644
--- a/accel/tcg/tb-maint.c
+++ b/accel/tcg/tb-maint.c
@@ -47,7 +47,7 @@ static bool tb_cmp(const void *ap, const void *bp)
     const TranslationBlock *a = ap;
     const TranslationBlock *b = bp;
 
-    return ((tb_cflags(a) & CF_PCREL || a->pc == b->pc) &&
+    return (a->pc == b->pc &&
             a->cs_base == b->cs_base &&
             a->flags == b->flags &&
             (tb_cflags(a) & ~CF_INVALID) == (tb_cflags(b) & ~CF_INVALID) &&
@@ -916,7 +916,7 @@ static void do_tb_phys_invalidate(TranslationBlock *tb, bool rm_from_page_list)
 
     /* remove the TB from the hash list */
     phys_pc = tb_page_addr0(tb);
-    h = tb_hash_func(phys_pc, (orig_cflags & CF_PCREL ? 0 : tb->pc),
+    h = tb_hash_func(phys_pc, tb->pc,
                      tb->flags, tb->cs_base, orig_cflags);
     if (!qht_remove(&tb_ctx.htable, tb, h)) {
         return;
@@ -983,7 +983,7 @@ TranslationBlock *tb_link_page(TranslationBlock *tb)
     tb_record(tb);
 
     /* add in the hash table */
-    h = tb_hash_func(tb_page_addr0(tb), (tb->cflags & CF_PCREL ? 0 : tb->pc),
+    h = tb_hash_func(tb_page_addr0(tb), tb->pc,
                      tb->flags, tb->cs_base, tb->cflags);
     qht_insert(&tb_ctx.htable, tb, h, &existing_tb);
 
diff --git a/accel/tcg/translate-all.c b/accel/tcg/translate-all.c
index 79a88f5fb7..c1708afcb0 100644
--- a/accel/tcg/translate-all.c
+++ b/accel/tcg/translate-all.c
@@ -327,9 +327,7 @@ TranslationBlock *tb_gen_code(CPUState *cpu,
 
     gen_code_buf = tcg_ctx->code_gen_ptr;
     tb->tc.ptr = tcg_splitwx_to_rx(gen_code_buf);
-    if (!(cflags & CF_PCREL)) {
-        tb->pc = pc;
-    }
+    tb->pc = pc;
     tb->cs_base = cs_base;
     tb->flags = flags;
     tb->cflags = cflags;
-- 
2.39.2



  parent reply	other threads:[~2024-01-28 17:52 UTC|newest]

Thread overview: 25+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-01-28 17:50 [Stable-8.2.1 00/71] Patch Round-up for stable 8.2.1, frozen on 2024-01-27 Michael Tokarev
2024-01-28 17:50 ` [Stable-8.2.1 55/71] acpi/tests/avocado/bits: wait for 200 seconds for SHUTDOWN event from bits VM Michael Tokarev
2024-01-28 17:50 ` Michael Tokarev [this message]
2024-01-28 17:50 ` [Stable-8.2.1 57/71] tcg/s390x: Fix encoding of VRIc, VRSa, VRSc insns Michael Tokarev
2024-01-28 17:50 ` [Stable-8.2.1 58/71] coroutine-ucontext: Save fake stack for pooled coroutine Michael Tokarev
2024-01-28 17:50 ` [Stable-8.2.1 59/71] block/io: clear BDRV_BLOCK_RECURSE flag after recursing in bdrv_co_block_status Michael Tokarev
2024-01-28 17:50 ` [Stable-8.2.1 60/71] linux-user: Fixed cpu restore with pc 0 on SIGBUS Michael Tokarev
2024-01-28 17:50 ` [Stable-8.2.1 61/71] linux-user/riscv: Adjust vdso signal frame cfa offsets Michael Tokarev
2024-03-03 10:33   ` Andreas Schwab
2024-03-03 11:06     ` Andreas Schwab
2024-03-03 12:58     ` Michael Tokarev
2024-03-03 15:11       ` Andreas Schwab
2024-03-06  4:27     ` Alistair Francis
2024-03-06 11:31       ` Andreas Schwab
2024-03-28 13:41       ` Andreas Schwab
2024-01-28 17:50 ` [Stable-8.2.1 62/71] tcg/arm: Fix SIGILL in tcg_out_qemu_st_direct Michael Tokarev
2024-01-28 17:50 ` [Stable-8.2.1 63/71] virtio-net: correctly copy vnet header when flushing TX Michael Tokarev
2024-01-28 17:50 ` [Stable-8.2.1 64/71] block/blklogwrites: Fix a bug when logging "write zeroes" operations Michael Tokarev
2024-01-28 17:50 ` [Stable-8.2.1 65/71] iotests: add filter_qmp_generated_node_ids() Michael Tokarev
2024-01-28 17:50 ` [Stable-8.2.1 66/71] iotests: port 141 to Python for reliable QMP testing Michael Tokarev
2024-01-28 17:50 ` [Stable-8.2.1 67/71] monitor: only run coroutine commands in qemu_aio_context Michael Tokarev
2024-01-28 17:50 ` [Stable-8.2.1 68/71] qtest: bump aspeed_smc-test timeout to 6 minutes Michael Tokarev
2024-01-28 17:50 ` [Stable-8.2.1 69/71] target/xtensa: fix OOB TLB entry access Michael Tokarev
2024-01-28 17:50 ` [Stable-8.2.1 70/71] target/arm: Fix A64 scalar SQSHRN and SQRSHRN Michael Tokarev
2024-01-28 17:50 ` [Stable-8.2.1 71/71] target/arm: Fix incorrect aa64_tidcp1 feature check Michael Tokarev

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20240128175035.812352-2-mjt@tls.msk.ru \
    --to=mjt@tls.msk.ru \
    --cc=pbonzini@redhat.com \
    --cc=qemu-devel@nongnu.org \
    --cc=qemu-stable@nongnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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.