From: Laurent Vivier <laurent@vivier.eu>
To: Richard Henderson <richard.henderson@linaro.org>, qemu-devel@nongnu.org
Subject: Re: [PATCH v2 1/2] target/m68k: Reject immediate as destination in gen_ea_mode
Date: Wed, 15 Mar 2023 17:41:57 +0100 [thread overview]
Message-ID: <a427c95b-277e-2ade-bf1a-b94f30cefa32@vivier.eu> (raw)
In-Reply-To: <20230309201604.3885359-2-richard.henderson@linaro.org>
Le 09/03/2023 à 21:16, Richard Henderson a écrit :
> In theory this should never happen, as all such instructions
> are illegal. This is checked in e.g. gen_lea_mode and
> gen_ea_mode_fp but not here. In case something higher up
> isn't checking modes properly, return NULL_QREG. This will
> result in an illegal instruction exception being raised.
>
> Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
> ---
> target/m68k/translate.c | 4 ++++
> 1 file changed, 4 insertions(+)
>
> diff --git a/target/m68k/translate.c b/target/m68k/translate.c
> index 422f4652f1..e16c608ef8 100644
> --- a/target/m68k/translate.c
> +++ b/target/m68k/translate.c
> @@ -894,6 +894,10 @@ static TCGv gen_ea_mode(CPUM68KState *env, DisasContext *s, int mode, int reg0,
> case 3: /* pc index+displacement. */
> goto do_indirect;
> case 4: /* Immediate. */
> + /* Should never be used for an output or RMW input. */
> + if (what == EA_STORE || addrp) {
> + return NULL_QREG;
> + }
> /* Sign extend values for consistency. */
> switch (opsize) {
> case OS_BYTE:
Reviewed-by: Laurent Vivier <laurent@vivier.eu>
next prev parent reply other threads:[~2023-03-15 16:42 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-03-09 20:16 [PATCH v2 0/2] target/m68k: Reject immediate as destination Richard Henderson
2023-03-09 20:16 ` [PATCH v2 1/2] target/m68k: Reject immediate as destination in gen_ea_mode Richard Henderson
2023-03-10 10:03 ` Laurent Vivier
2023-03-15 16:41 ` Laurent Vivier [this message]
2023-03-09 20:16 ` [PATCH v2 2/2] linux-user/m68k: Handle EXCP_ADDRESS in cpu_loop Richard Henderson
2023-03-15 18:16 ` Laurent Vivier
2023-03-16 14:23 ` Richard Henderson
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=a427c95b-277e-2ade-bf1a-b94f30cefa32@vivier.eu \
--to=laurent@vivier.eu \
--cc=qemu-devel@nongnu.org \
--cc=richard.henderson@linaro.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 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).