* [PULL 0/3] misc tcg-related patches
@ 2020-07-25 16:05 Richard Henderson
2020-07-25 16:05 ` [PULL 1/3] tcg: update comments for save_iotlb_data in cputlb Richard Henderson
` (3 more replies)
0 siblings, 4 replies; 5+ messages in thread
From: Richard Henderson @ 2020-07-25 16:05 UTC (permalink / raw)
To: qemu-devel; +Cc: peter.maydell
The following changes since commit 7adfbea8fd1efce36019a0c2f198ca73be9d3f18:
Merge remote-tracking branch 'remotes/ehabkost/tags/x86-next-for-5.1-pull-request' into staging (2020-07-24 10:52:20 +0100)
are available in the Git repository at:
https://github.com/rth7680/qemu.git tags/pull-tcg-20200725
for you to fetch changes up to 3cb3a7720b01830abd5fbb81819dbb9271bf7821:
target/i386: Save cc_op before loop insns (2020-07-24 14:29:35 -0700)
----------------------------------------------------------------
Fix some cputlb commentary
Fix an hppa temporary leak
Fix an i386 translation issue with loop insns
----------------------------------------------------------------
Alex Bennée (1):
tcg: update comments for save_iotlb_data in cputlb
Richard Henderson (2):
target/hppa: Free some temps in do_sub
target/i386: Save cc_op before loop insns
accel/tcg/cputlb.c | 11 +++++------
target/hppa/translate.c | 2 ++
target/i386/translate.c | 1 +
3 files changed, 8 insertions(+), 6 deletions(-)
^ permalink raw reply [flat|nested] 5+ messages in thread
* [PULL 1/3] tcg: update comments for save_iotlb_data in cputlb
2020-07-25 16:05 [PULL 0/3] misc tcg-related patches Richard Henderson
@ 2020-07-25 16:05 ` Richard Henderson
2020-07-25 16:05 ` [PULL 2/3] target/hppa: Free some temps in do_sub Richard Henderson
` (2 subsequent siblings)
3 siblings, 0 replies; 5+ messages in thread
From: Richard Henderson @ 2020-07-25 16:05 UTC (permalink / raw)
To: qemu-devel; +Cc: peter.maydell, Emilio G . Cota, Alex Bennée
From: Alex Bennée <alex.bennee@linaro.org>
I missed Emilio's review comments:
Message-ID: <20200718205107.GA994221@sff>
and the patch got merged. Correcting the comments now.
Reviewed-by: Emilio G. Cota <cota@braap.org>
Signed-off-by: Alex Bennée <alex.bennee@linaro.org>
Message-Id: <20200720122358.26881-1-alex.bennee@linaro.org>
Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
---
accel/tcg/cputlb.c | 11 +++++------
1 file changed, 5 insertions(+), 6 deletions(-)
diff --git a/accel/tcg/cputlb.c b/accel/tcg/cputlb.c
index d370aedb47..5698292749 100644
--- a/accel/tcg/cputlb.c
+++ b/accel/tcg/cputlb.c
@@ -1075,10 +1075,8 @@ static uint64_t io_readx(CPUArchState *env, CPUIOTLBEntry *iotlbentry,
/*
* Save a potentially trashed IOTLB entry for later lookup by plugin.
- *
- * We also need to track the thread storage address because the RCU
- * cleanup that runs when we leave the critical region (the current
- * execution) is actually in a different thread.
+ * This is read by tlb_plugin_lookup if the iotlb entry doesn't match
+ * because of the side effect of io_writex changing memory layout.
*/
static void save_iotlb_data(CPUState *cs, hwaddr addr,
MemoryRegionSection *section, hwaddr mr_offset)
@@ -1408,8 +1406,9 @@ void *tlb_vaddr_to_host(CPUArchState *env, abi_ptr addr,
* This almost never fails as the memory access being instrumented
* should have just filled the TLB. The one corner case is io_writex
* which can cause TLB flushes and potential resizing of the TLBs
- * loosing the information we need. In those cases we need to recover
- * data from a copy of the io_tlb entry.
+ * losing the information we need. In those cases we need to recover
+ * data from a copy of the iotlbentry. As long as this always occurs
+ * from the same thread (which a mem callback will be) this is safe.
*/
bool tlb_plugin_lookup(CPUState *cpu, target_ulong addr, int mmu_idx,
--
2.25.1
^ permalink raw reply related [flat|nested] 5+ messages in thread
* [PULL 2/3] target/hppa: Free some temps in do_sub
2020-07-25 16:05 [PULL 0/3] misc tcg-related patches Richard Henderson
2020-07-25 16:05 ` [PULL 1/3] tcg: update comments for save_iotlb_data in cputlb Richard Henderson
@ 2020-07-25 16:05 ` Richard Henderson
2020-07-25 16:05 ` [PULL 3/3] target/i386: Save cc_op before loop insns Richard Henderson
2020-07-26 18:52 ` [PULL 0/3] misc tcg-related patches Peter Maydell
3 siblings, 0 replies; 5+ messages in thread
From: Richard Henderson @ 2020-07-25 16:05 UTC (permalink / raw)
To: qemu-devel; +Cc: peter.maydell, Sven Schnelle, Philippe Mathieu-Daudé
Two temps allocated but not freed. Do enough subtractions
within a single TB and one can run out of temps entirely.
Fixes: b2167459ae ("target-hppa: Implement basic arithmetic")
Buglink: https://bugs.launchpad.net/qemu/+bug/1880287
Tested-by: Sven Schnelle <svens@stackframe.org>
Reviewed-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
Message-Id: <20200720174039.517902-1-richard.henderson@linaro.org>
---
target/hppa/translate.c | 2 ++
1 file changed, 2 insertions(+)
diff --git a/target/hppa/translate.c b/target/hppa/translate.c
index 52d7bea1ea..4bd22d4820 100644
--- a/target/hppa/translate.c
+++ b/target/hppa/translate.c
@@ -1294,6 +1294,8 @@ static void do_sub(DisasContext *ctx, unsigned rt, TCGv_reg in1,
save_or_nullify(ctx, cpu_psw_cb_msb, cb_msb);
save_gpr(ctx, rt, dest);
tcg_temp_free(dest);
+ tcg_temp_free(cb);
+ tcg_temp_free(cb_msb);
/* Install the new nullification. */
cond_free(&ctx->null_cond);
--
2.25.1
^ permalink raw reply related [flat|nested] 5+ messages in thread
* [PULL 3/3] target/i386: Save cc_op before loop insns
2020-07-25 16:05 [PULL 0/3] misc tcg-related patches Richard Henderson
2020-07-25 16:05 ` [PULL 1/3] tcg: update comments for save_iotlb_data in cputlb Richard Henderson
2020-07-25 16:05 ` [PULL 2/3] target/hppa: Free some temps in do_sub Richard Henderson
@ 2020-07-25 16:05 ` Richard Henderson
2020-07-26 18:52 ` [PULL 0/3] misc tcg-related patches Peter Maydell
3 siblings, 0 replies; 5+ messages in thread
From: Richard Henderson @ 2020-07-25 16:05 UTC (permalink / raw)
To: qemu-devel; +Cc: peter.maydell, Alex Bennée
We forgot to update cc_op before these branch insns,
which lead to losing track of the current eflags.
Buglink: https://bugs.launchpad.net/qemu/+bug/1888165
Reviewed-by: Alex Bennée <alex.bennee@linaro.org>
Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
Message-Id: <20200720154028.477457-1-richard.henderson@linaro.org>
---
target/i386/translate.c | 1 +
1 file changed, 1 insertion(+)
diff --git a/target/i386/translate.c b/target/i386/translate.c
index a1d31f09c1..caea6f5fb1 100644
--- a/target/i386/translate.c
+++ b/target/i386/translate.c
@@ -7148,6 +7148,7 @@ static target_ulong disas_insn(DisasContext *s, CPUState *cpu)
l1 = gen_new_label();
l2 = gen_new_label();
l3 = gen_new_label();
+ gen_update_cc_op(s);
b &= 3;
switch(b) {
case 0: /* loopnz */
--
2.25.1
^ permalink raw reply related [flat|nested] 5+ messages in thread
* Re: [PULL 0/3] misc tcg-related patches
2020-07-25 16:05 [PULL 0/3] misc tcg-related patches Richard Henderson
` (2 preceding siblings ...)
2020-07-25 16:05 ` [PULL 3/3] target/i386: Save cc_op before loop insns Richard Henderson
@ 2020-07-26 18:52 ` Peter Maydell
3 siblings, 0 replies; 5+ messages in thread
From: Peter Maydell @ 2020-07-26 18:52 UTC (permalink / raw)
To: Richard Henderson; +Cc: QEMU Developers
On Sat, 25 Jul 2020 at 17:05, Richard Henderson
<richard.henderson@linaro.org> wrote:
>
> The following changes since commit 7adfbea8fd1efce36019a0c2f198ca73be9d3f18:
>
> Merge remote-tracking branch 'remotes/ehabkost/tags/x86-next-for-5.1-pull-request' into staging (2020-07-24 10:52:20 +0100)
>
> are available in the Git repository at:
>
> https://github.com/rth7680/qemu.git tags/pull-tcg-20200725
>
> for you to fetch changes up to 3cb3a7720b01830abd5fbb81819dbb9271bf7821:
>
> target/i386: Save cc_op before loop insns (2020-07-24 14:29:35 -0700)
>
> ----------------------------------------------------------------
> Fix some cputlb commentary
> Fix an hppa temporary leak
> Fix an i386 translation issue with loop insns
>
> ---------------------------------------------------------------
Applied, thanks.
Please update the changelog at https://wiki.qemu.org/ChangeLog/5.1
for any user-visible changes.
-- PMM
^ permalink raw reply [flat|nested] 5+ messages in thread
end of thread, other threads:[~2020-07-26 18:53 UTC | newest]
Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2020-07-25 16:05 [PULL 0/3] misc tcg-related patches Richard Henderson
2020-07-25 16:05 ` [PULL 1/3] tcg: update comments for save_iotlb_data in cputlb Richard Henderson
2020-07-25 16:05 ` [PULL 2/3] target/hppa: Free some temps in do_sub Richard Henderson
2020-07-25 16:05 ` [PULL 3/3] target/i386: Save cc_op before loop insns Richard Henderson
2020-07-26 18:52 ` [PULL 0/3] misc tcg-related patches Peter Maydell
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).