qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: "Jiaxun Yang" <jiaxun.yang@flygoat.com>
To: "Philippe Mathieu-Daudé" <f4bug@amsat.org>,
	"BALATON Zoltan via" <qemu-devel@nongnu.org>
Subject: Re: [PATCH 1/2] hw/mips: bootloader: Fix write_ulong
Date: Sun, 05 Dec 2021 15:25:36 +0000	[thread overview]
Message-ID: <33dac041-a041-4880-82a1-cbdc9035e6da@www.fastmail.com> (raw)
In-Reply-To: <cb7f6ba2-60b7-2da4-4248-749c78aec1b4@amsat.org>



在2021年12月2日十二月 下午6:01,Philippe Mathieu-Daudé写道:
> On 12/2/21 11:51, Jiaxun Yang wrote:
>> 在2021年11月30日十一月 下午9:52,Philippe Mathieu-Daudé写道:
>>> On 11/30/21 22:17, Jiaxun Yang wrote:
>>>> bl_gen_write_ulong uses sd for both 32 and 64 bit CPU,
>>>> while sd is illegal on 32 bit CPUs.
>>>>
>>>> Replace sd with sw on 32bit CPUs.
>>>>
>>>> Fixes: 3ebbf86 ("hw/mips: Add a bootloader helper")
>>>> Signed-off-by: Jiaxun Yang <jiaxun.yang@flygoat.com>
>>>> ---
>>>> Should be backported to 6.0 onwards.
>>>> ---
>>>>  hw/mips/bootloader.c | 6 +++++-
>>>>  1 file changed, 5 insertions(+), 1 deletion(-)
>>>>
>>>> diff --git a/hw/mips/bootloader.c b/hw/mips/bootloader.c
>>>> index 6ec8314490..99991f8b2b 100644
>>>> --- a/hw/mips/bootloader.c
>>>> +++ b/hw/mips/bootloader.c
>>>> @@ -182,7 +182,11 @@ void bl_gen_write_ulong(uint32_t **p, target_ulong addr, target_ulong val)
>>>>  {
>>>>      bl_gen_load_ulong(p, BL_REG_K0, val);
>>>>      bl_gen_load_ulong(p, BL_REG_K1, addr);
>>>> -    bl_gen_sd(p, BL_REG_K0, BL_REG_K1, 0x0);
>>>> +    if (bootcpu_supports_isa(ISA_MIPS3)) {
>>>> +        bl_gen_sd(p, BL_REG_K0, BL_REG_K1, 0x0);
>>>> +    } else {
>>>> +        bl_gen_sw(p, BL_REG_K0, BL_REG_K1, 0x0);
>>>> +    }
>>>
>>> We have bl_gen_load_ulong(); having bl_gen_store_ulong()
>>> would make the API even. Mind sending a patch? Otherwise:
>> 
>> Should I revisit this set or start another patch?
>
> Another patch :)

Just revisited the code and bl_gen_load_ulong means load a target_ulong
immedaite number, not load from memory so it's not even.

I'd leave it as is.

Thanks.

-- 
- Jiaxun


  reply	other threads:[~2021-12-05 15:27 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-11-30 21:17 [PATCH 0/2] MIPS misc fixes Jiaxun Yang
2021-11-30 21:17 ` [PATCH 1/2] hw/mips: bootloader: Fix write_ulong Jiaxun Yang
2021-11-30 21:52   ` Philippe Mathieu-Daudé
2021-12-02 10:51     ` Jiaxun Yang
2021-12-02 18:01       ` Philippe Mathieu-Daudé
2021-12-05 15:25         ` Jiaxun Yang [this message]
2021-11-30 21:17 ` [PATCH 2/2] hw/mips/boston: Fix load_elf error detection Jiaxun Yang
2021-11-30 21:54   ` Philippe Mathieu-Daudé
2021-12-02 18:02 ` [PATCH 0/2] MIPS misc fixes Philippe Mathieu-Daudé

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=33dac041-a041-4880-82a1-cbdc9035e6da@www.fastmail.com \
    --to=jiaxun.yang@flygoat.com \
    --cc=f4bug@amsat.org \
    --cc=qemu-devel@nongnu.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).