All of lore.kernel.org
 help / color / mirror / Atom feed
* [Qemu-devel] [PATCH] linux-user/sparc/signal.c: Remove unnecessary comment
@ 2018-10-09 18:40 Peter Maydell
  2018-10-09 19:45 ` Laurent Vivier
  2018-10-12 18:34 ` Laurent Vivier
  0 siblings, 2 replies; 4+ messages in thread
From: Peter Maydell @ 2018-10-09 18:40 UTC (permalink / raw)
  To: qemu-devel; +Cc: patches, Laurent Vivier, Riku Voipio

Remove a comment suggesting that we need to call tb_flush()
after writing the SPARC signal frame trampoline insns.
This isn't necessary in QEMU, because (even if the guest
architecture requires explicit icache maintenance) we
ensure that memory writes result in invalidation of
translated code from that memory.

Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
---
Found (with grep) while looking at what parts of the tree call
tb_flush()...

 linux-user/sparc/signal.c | 4 ----
 1 file changed, 4 deletions(-)

diff --git a/linux-user/sparc/signal.c b/linux-user/sparc/signal.c
index b4c60aa4468..e44e99993c6 100644
--- a/linux-user/sparc/signal.c
+++ b/linux-user/sparc/signal.c
@@ -258,10 +258,6 @@ void setup_frame(int sig, struct target_sigaction *ka,
         __put_user(val32, &sf->insns[1]);
         if (err)
             goto sigsegv;
-
-        /* Flush instruction space. */
-        // flush_sig_insns(current->mm, (unsigned long) &(sf->insns[0]));
-        // tb_flush(env);
     }
     unlock_user(sf, sf_addr, sizeof(struct target_signal_frame));
     return;
-- 
2.19.0

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

* Re: [Qemu-devel] [PATCH] linux-user/sparc/signal.c: Remove unnecessary comment
  2018-10-09 18:40 [Qemu-devel] [PATCH] linux-user/sparc/signal.c: Remove unnecessary comment Peter Maydell
@ 2018-10-09 19:45 ` Laurent Vivier
  2018-10-09 20:42   ` Richard Henderson
  2018-10-12 18:34 ` Laurent Vivier
  1 sibling, 1 reply; 4+ messages in thread
From: Laurent Vivier @ 2018-10-09 19:45 UTC (permalink / raw)
  To: Peter Maydell, qemu-devel; +Cc: patches, Riku Voipio

Le 09/10/2018 à 20:40, Peter Maydell a écrit :
> Remove a comment suggesting that we need to call tb_flush()
> after writing the SPARC signal frame trampoline insns.
> This isn't necessary in QEMU, because (even if the guest
> architecture requires explicit icache maintenance) we
> ensure that memory writes result in invalidation of
> translated code from that memory.

By curiosity, where/how is it done?

Thanks,
Laurent

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

* Re: [Qemu-devel] [PATCH] linux-user/sparc/signal.c: Remove unnecessary comment
  2018-10-09 19:45 ` Laurent Vivier
@ 2018-10-09 20:42   ` Richard Henderson
  0 siblings, 0 replies; 4+ messages in thread
From: Richard Henderson @ 2018-10-09 20:42 UTC (permalink / raw)
  To: Laurent Vivier, Peter Maydell, qemu-devel; +Cc: Riku Voipio, patches

On 10/9/18 12:45 PM, Laurent Vivier wrote:
> Le 09/10/2018 à 20:40, Peter Maydell a écrit :
>> Remove a comment suggesting that we need to call tb_flush()
>> after writing the SPARC signal frame trampoline insns.
>> This isn't necessary in QEMU, because (even if the guest
>> architecture requires explicit icache maintenance) we
>> ensure that memory writes result in invalidation of
>> translated code from that memory.
> 
> By curiosity, where/how is it done?

Guest pages that have had code translated from them are mprotect'd read-only.
The host SIGSEGV handler notices writes to such pages, invalidates the
translated code, and marks the page read-write again.  At which point the guest
program continues.


r~

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

* Re: [Qemu-devel] [PATCH] linux-user/sparc/signal.c: Remove unnecessary comment
  2018-10-09 18:40 [Qemu-devel] [PATCH] linux-user/sparc/signal.c: Remove unnecessary comment Peter Maydell
  2018-10-09 19:45 ` Laurent Vivier
@ 2018-10-12 18:34 ` Laurent Vivier
  1 sibling, 0 replies; 4+ messages in thread
From: Laurent Vivier @ 2018-10-12 18:34 UTC (permalink / raw)
  To: Peter Maydell, qemu-devel; +Cc: patches, Riku Voipio

On 09/10/2018 20:40, Peter Maydell wrote:
> Remove a comment suggesting that we need to call tb_flush()
> after writing the SPARC signal frame trampoline insns.
> This isn't necessary in QEMU, because (even if the guest
> architecture requires explicit icache maintenance) we
> ensure that memory writes result in invalidation of
> translated code from that memory.
> 
> Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
> ---
> Found (with grep) while looking at what parts of the tree call
> tb_flush()...
> 
>  linux-user/sparc/signal.c | 4 ----

Applied to my branch linux-user-for-3.1

Thanks,
Laurent

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

end of thread, other threads:[~2018-10-12 18:34 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-10-09 18:40 [Qemu-devel] [PATCH] linux-user/sparc/signal.c: Remove unnecessary comment Peter Maydell
2018-10-09 19:45 ` Laurent Vivier
2018-10-09 20:42   ` Richard Henderson
2018-10-12 18:34 ` Laurent Vivier

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.