qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: David Hildenbrand <david@redhat.com>
To: Ilya Leoshkevich <iii@linux.ibm.com>,
	Richard Henderson <richard.henderson@linaro.org>,
	Thomas Huth <thuth@redhat.com>
Cc: qemu-s390x@nongnu.org, qemu-devel@nongnu.org
Subject: Re: [PATCH 1/2] target/s390x: Define TARGET_HAS_PRECISE_SMC
Date: Mon, 7 Aug 2023 17:31:37 +0200	[thread overview]
Message-ID: <6961d8e4-7b26-b205-1ffd-4d4b721fe2e2@redhat.com> (raw)
In-Reply-To: <20230807114921.438881-1-iii@linux.ibm.com>

On 07.08.23 13:48, Ilya Leoshkevich wrote:
> PoP (Sequence of Storage References -> Instruction Fetching) says:
> 
>      ... if a store that is conceptually earlier is
>      made by the same CPU using the same effective
>      address as that by which the instruction is subse-
>      quently fetched, the updated information is obtained ...
> 
> QEMU already has support for this in the common code; enable it for
> s390x.


Figuring out what TARGET_HAS_PRECISE_SMC is all about, I only learned 
from git history

commit d720b93d0bcfe1beb729245b9ed1e5f071a24bd5
Author: Fabrice Bellard <fabrice@bellard.org>
Date:   Sun Apr 25 17:57:43 2004 +0000

     precise self modifying code support


     git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@745 
c046a42c-6fe2-441c-8c8c-71466251a162



AFAIU, precise SMC is stricter compared to what we have right now. So i 
suspect that this patch is actually fixing SMC behavior: for example, 
when a basic block ends up modifying itself.

Were there any BUG reports? (does patch #2 test for that and can 
reproduce the original issue?)

> 
> Signed-off-by: Ilya Leoshkevich <iii@linux.ibm.com>
> ---
>   target/s390x/cpu.h | 2 ++
>   1 file changed, 2 insertions(+)
> 
> diff --git a/target/s390x/cpu.h b/target/s390x/cpu.h
> index eb5b65b7d3a..304029e57cf 100644
> --- a/target/s390x/cpu.h
> +++ b/target/s390x/cpu.h
> @@ -36,6 +36,8 @@
>   /* The z/Architecture has a strong memory model with some store-after-load re-ordering */
>   #define TCG_GUEST_DEFAULT_MO      (TCG_MO_ALL & ~TCG_MO_ST_LD)
>   
> +#define TARGET_HAS_PRECISE_SMC
> +
>   #define TARGET_INSN_START_EXTRA_WORDS 2
>   
>   #define MMU_USER_IDX 0

-- 
Cheers,

David / dhildenb



  parent reply	other threads:[~2023-08-07 15:32 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-08-07 11:48 [PATCH 1/2] target/s390x: Define TARGET_HAS_PRECISE_SMC Ilya Leoshkevich
2023-08-07 11:48 ` [PATCH 2/2] tests/tcg/s390x: Test precise self-modifying code handling Ilya Leoshkevich
2023-08-07 15:31 ` David Hildenbrand [this message]
2023-08-07 16:13   ` [PATCH 1/2] target/s390x: Define TARGET_HAS_PRECISE_SMC Ilya Leoshkevich
2023-08-07 16:14     ` David Hildenbrand

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=6961d8e4-7b26-b205-1ffd-4d4b721fe2e2@redhat.com \
    --to=david@redhat.com \
    --cc=iii@linux.ibm.com \
    --cc=qemu-devel@nongnu.org \
    --cc=qemu-s390x@nongnu.org \
    --cc=richard.henderson@linaro.org \
    --cc=thuth@redhat.com \
    /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 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).