All of lore.kernel.org
 help / color / mirror / Atom feed
From: Helge Deller <deller@gmx.de>
To: Richard Henderson <richard.henderson@linaro.org>,
	deller@kernel.org, qemu-devel@nongnu.org
Subject: Re: [PATCH 1/5] target/hppa: Fix unaligned double word accesses for hppa64
Date: Sun, 3 Mar 2024 06:33:42 +0100	[thread overview]
Message-ID: <34a994a5-f815-415e-90a1-baf37e54a897@gmx.de> (raw)
In-Reply-To: <4f6bbf0f-20d2-4599-a8b3-5fb0a381d6dd@linaro.org>

On 3/3/24 03:10, Richard Henderson wrote:
> On 3/2/24 12:35, deller@kernel.org wrote:
>> From: Guenter Roeck <linux@roeck-us.net>
>>
>> Unaligned 64-bit accesses were found in Linux to clobber carry bits,
>> resulting in bad results if an arithmetic operation involving a
>> carry bit was executed after an unaligned 64-bit operation.
>>
>> hppa 2.0 defines additional carry bits in PSW register bits 32..39.
>> When restoring PSW after executing an unaligned instruction trap,
>> those bits were not cleared and ended up to be active all the time.
>> Clearing bit 32..39 in psw prior to restoring it solves the problem.
>>
>> Fixes: 931adff31478 ("target/hppa: Update cpu_hppa_get/put_psw for hppa64")
>> Cc: Richard Henderson <richard.henderson@linaro.org>
>> Cc: Charlie Jenkins <charlie@rivosinc.com>
>> Cc: Helge Deller <deller@gmx.de>
>> Signed-off-by: Guenter Roeck <linux@roeck-us.net>
>> Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
>> ---
>>   target/hppa/helper.c | 7 ++++++-
>>   1 file changed, 6 insertions(+), 1 deletion(-)
>>
>> diff --git a/target/hppa/helper.c b/target/hppa/helper.c
>> index 859644c47a..7b798d1227 100644
>> --- a/target/hppa/helper.c
>> +++ b/target/hppa/helper.c
>> @@ -76,7 +76,12 @@ void cpu_hppa_put_psw(CPUHPPAState *env, target_ulong psw)
>>       }
>>       psw &= ~reserved;
>> -    env->psw = psw & ~(PSW_N | PSW_V | PSW_CB);
>> +    if (hppa_is_pa20(env)) {
>> +        env->psw = psw & ~(PSW_N | PSW_V | PSW_CB | 0xff00000000ull);
>> +    } else {
>> +        env->psw = psw & ~(PSW_N | PSW_V | PSW_CB);
>> +    }
>
> https://patchew.org/QEMU/20240217015811.1975411-1-linux@roeck-us.net/
> was the better version.

Oh, yes. Will use that one in the pull request.
Thanks!
Helge



  reply	other threads:[~2024-03-03  5:34 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-03-02 22:35 [PATCH 0/5] HPPA64 updates deller
2024-03-02 22:35 ` [PATCH 1/5] target/hppa: Fix unaligned double word accesses for hppa64 deller
2024-03-03  2:10   ` Richard Henderson
2024-03-03  5:33     ` Helge Deller [this message]
2024-03-02 22:35 ` [PATCH 2/5] target/hppa: Restore unwind_breg before calculating ior deller
2024-03-03  2:27   ` Richard Henderson
2024-03-02 22:35 ` [PATCH 3/5] pc-bios/meson: Add hppa-firmware64.img blob deller
2024-03-03  2:29   ` Richard Henderson
2024-03-02 22:35 ` [PATCH 4/5] pc-bios/README: Add information about hppa-firmware deller
2024-03-03  2:29   ` Richard Henderson
2024-03-02 22:35 ` [PATCH 5/5] roms/hppa: Add build rules for hppa-firmware deller
2024-03-03  2:30   ` 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=34a994a5-f815-415e-90a1-baf37e54a897@gmx.de \
    --to=deller@gmx.de \
    --cc=deller@kernel.org \
    --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 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.