mbox series

[0/2] target/m68k: fix two writes to %sr

Message ID 20220913142818.7802-1-richard.henderson@linaro.org
Headers show
Series target/m68k: fix two writes to %sr | expand

Message

Richard Henderson Sept. 13, 2022, 2:28 p.m. UTC
The second was described by Mark in the lobby of KVM Forum.
The first was found by inspection of other uses of gen_helper_set_sr.

r~

Richard Henderson (2):
  target/m68k: Fix MACSR to CCR
  target/m68k: Perform writback before modifying SR

 target/m68k/translate.c | 14 +++++++++-----
 1 file changed, 9 insertions(+), 5 deletions(-)

Comments

Mark Cave-Ayland Sept. 13, 2022, 4:29 p.m. UTC | #1
On 13/09/2022 15:28, Richard Henderson wrote:

> The second was described by Mark in the lobby of KVM Forum.
> The first was found by inspection of other uses of gen_helper_set_sr.
> 
> r~
> 
> Richard Henderson (2):
>    target/m68k: Fix MACSR to CCR
>    target/m68k: Perform writback before modifying SR
> 
>   target/m68k/translate.c | 14 +++++++++-----
>   1 file changed, 9 insertions(+), 5 deletions(-)

I've applied these on top of my MacOS virtual memory branch at 
https://github.com/mcayland/qemu/commits/q800.upstream2-vm and I can confirm that 
MacOS 8.1 now boots here with virtual memory enabled :)

Possibly it might be worth including a tidied-up version of the "WIP: target/m68k: 
always exit_tb when changing sr with andi/ori/eori" commit from that branch which is 
also related to switching between supervisor and user modes under MacOS. Shall I tidy 
it up and send it to the list?


ATB,

Mark.
Laurent Vivier Sept. 13, 2022, 4:35 p.m. UTC | #2
Le 13/09/2022 à 18:29, Mark Cave-Ayland a écrit :
> On 13/09/2022 15:28, Richard Henderson wrote:
> 
>> The second was described by Mark in the lobby of KVM Forum.
>> The first was found by inspection of other uses of gen_helper_set_sr.
>>
>> r~
>>
>> Richard Henderson (2):
>>    target/m68k: Fix MACSR to CCR
>>    target/m68k: Perform writback before modifying SR
>>
>>   target/m68k/translate.c | 14 +++++++++-----
>>   1 file changed, 9 insertions(+), 5 deletions(-)
> 
> I've applied these on top of my MacOS virtual memory branch at 
> https://github.com/mcayland/qemu/commits/q800.upstream2-vm and I can confirm that MacOS 8.1 now 
> boots here with virtual memory enabled :)
> 
> Possibly it might be worth including a tidied-up version of the "WIP: target/m68k: always exit_tb 
> when changing sr with andi/ori/eori" commit from that branch which is also related to switching 
> between supervisor and user modes under MacOS. Shall I tidy it up and send it to the list?

Yes, send it to the list. I plan to do a PR for m68k soon.

Thanks,
Laurent
Richard Henderson Sept. 13, 2022, 5:15 p.m. UTC | #3
On 9/13/22 17:29, Mark Cave-Ayland wrote:
> Possibly it might be worth including a tidied-up version of the "WIP: target/m68k: always 
> exit_tb when changing sr with andi/ori/eori" commit from that branch which is also related 
> to switching between supervisor and user modes under MacOS. Shall I tidy it up and send it 
> to the list?

I peeked at the patch in your tree, and it looks good.
By inspection, strldsr needs to exit the TB as well.


r~
Howard Spoelstra Sept. 14, 2022, 4:48 p.m. UTC | #4
On Tue, Sep 13, 2022 at 6:29 PM Mark Cave-Ayland <
mark.cave-ayland@ilande.co.uk> wrote:

> On 13/09/2022 15:28, Richard Henderson wrote:
>
> > The second was described by Mark in the lobby of KVM Forum.
> > The first was found by inspection of other uses of gen_helper_set_sr.
> >
> > r~
> >
> > Richard Henderson (2):
> >    target/m68k: Fix MACSR to CCR
> >    target/m68k: Perform writback before modifying SR
> >
> >   target/m68k/translate.c | 14 +++++++++-----
> >   1 file changed, 9 insertions(+), 5 deletions(-)
>
> I've applied these on top of my MacOS virtual memory branch at
> https://github.com/mcayland/qemu/commits/q800.upstream2-vm and I can
> confirm that
> MacOS 8.1 now boots here with virtual memory enabled :)
>
> Possibly it might be worth including a tidied-up version of the "WIP:
> target/m68k:
> always exit_tb when changing sr with andi/ori/eori" commit from that
> branch which is
> also related to switching between supervisor and user modes under MacOS.
> Shall I tidy
> it up and send it to the list?
>
>
> ATB,
>
> Mark.
>
>
I've compiled the branch mentioned above with a fully updated MSYS2 on
windows. The executable hangs when running Mac OS 8 with Virtual Memory
enabled. On a fast machine I see Error 7 as before, on a slower machine,
the boot screen just hangs with no error shown. A Linux build does work,
also on the slower machine.

Best,
Howard
Howard Spoelstra Sept. 14, 2022, 5:08 p.m. UTC | #5
On Wed, Sep 14, 2022 at 6:48 PM Howard Spoelstra <hsp.cat7@gmail.com> wrote:

>
>
> On Tue, Sep 13, 2022 at 6:29 PM Mark Cave-Ayland <
> mark.cave-ayland@ilande.co.uk> wrote:
>
>> On 13/09/2022 15:28, Richard Henderson wrote:
>>
>> > The second was described by Mark in the lobby of KVM Forum.
>> > The first was found by inspection of other uses of gen_helper_set_sr.
>> >
>> > r~
>> >
>> > Richard Henderson (2):
>> >    target/m68k: Fix MACSR to CCR
>> >    target/m68k: Perform writback before modifying SR
>> >
>> >   target/m68k/translate.c | 14 +++++++++-----
>> >   1 file changed, 9 insertions(+), 5 deletions(-)
>>
>> I've applied these on top of my MacOS virtual memory branch at
>> https://github.com/mcayland/qemu/commits/q800.upstream2-vm and I can
>> confirm that
>> MacOS 8.1 now boots here with virtual memory enabled :)
>>
>> Possibly it might be worth including a tidied-up version of the "WIP:
>> target/m68k:
>> always exit_tb when changing sr with andi/ori/eori" commit from that
>> branch which is
>> also related to switching between supervisor and user modes under MacOS.
>> Shall I tidy
>> it up and send it to the list?
>>
>>
>> ATB,
>>
>> Mark.
>>
>>
> I've compiled the branch mentioned above with a fully updated MSYS2 on
> windows. The executable hangs when running Mac OS 8 with Virtual Memory
> enabled. On a fast machine I see Error 7 as before, on a slower machine,
> the boot screen just hangs with no error shown. A Linux build does work,
> also on the slower machine.
>
> Best,
> Howard
>

ps: a debug enabled non-stripped build will run with Virtual Memory enabled
on Windows.