All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 0/4] target/m68k: MacOS supervisor/user mode switch fixes
@ 2022-09-17 11:25 Mark Cave-Ayland
  2022-09-17 11:25 ` [PATCH 1/4] target/m68k: rename M68K_FEATURE_M68000 to M68K_FEATURE_M68K Mark Cave-Ayland
                   ` (3 more replies)
  0 siblings, 4 replies; 21+ messages in thread
From: Mark Cave-Ayland @ 2022-09-17 11:25 UTC (permalink / raw)
  To: laurent, richard.henderson, lucienmp.qemu, qemu-devel

This series fixes a couple of bugs that were discovered when trying to boot
MacOS on my github q800 branch with virtual memory enabled.

Patch 1 renames M68K_FEATURE_M68000 to M68K_FEATURE_M68K in order to clarify
that this feature indicates any Motorola 68K CPU rather than the 68000
specifically [1].

Patch 2 increases the size of the M68K features bitmap since there are already
32 features present, and we need to add one more.

Patch 3 fixes up the MOVE-from-SR instruction which is privileged from the
68010 CPU onwards to use a newly introduced M68K_FEATURE_MOVEFROMSR_PRIV
feature [2].

Patch 4 ensures that we always call gen_exit_tb() after writes to the SR
register since any change of the S bit can change the security context.

Signed-off-by: Mark Cave-Ayland <mark.cave-ayland@ilande.co.uk>

Notes:

[1] The m68k code currently contains a mix of real CPU features and pseudo
    features that represent each 680X0 CPU. In general QEMU maps features to
    CPUs which is why I've introduced the new M68K_FEATURE_MOVEFROMSR_PRIV
    feature, but there are still checks for specific 680X0 CPU models. This
    could do with a tidy-up, but without a specific set of test images across
    68K and Coldfire I don't feel I'm confident enough to do this.
    
[2] The existing code in MOVE-from-SR uses !m68k_feature(env, M68K_FEATURE_M68000)
    to suggest that the condition should match for any CPU that isn't a 68000 (i.e.
    68010 and later) but as we see from this series, this is not the case according
    to the code. Some of the Mac 68K folk have suggested there are likely other
    cases in target/m68k where the same assumption has been used and the check
    logic is incorrect, but again without specific examples it's difficult for me to
    test.


Mark Cave-Ayland (4):
  target/m68k: rename M68K_FEATURE_M68000 to M68K_FEATURE_M68K
  target/m68k: increase size of m68k CPU features from uint32_t to
    uint64_t
  target/m68k: use M68K_FEATURE_MOVEFROMSR_PRIV feature for move_from_sr
    privilege check
  target/m68k: always call gen_exit_tb() after writes to SR

 target/m68k/cpu.c       |  11 +++-
 target/m68k/cpu.h       |  13 ++--
 target/m68k/helper.c    |   2 +-
 target/m68k/op_helper.c |   2 +-
 target/m68k/translate.c | 142 +++++++++++++++++++++-------------------
 5 files changed, 91 insertions(+), 79 deletions(-)

-- 
2.30.2



^ permalink raw reply	[flat|nested] 21+ messages in thread

end of thread, other threads:[~2022-09-21 14:10 UTC | newest]

Thread overview: 21+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-09-17 11:25 [PATCH 0/4] target/m68k: MacOS supervisor/user mode switch fixes Mark Cave-Ayland
2022-09-17 11:25 ` [PATCH 1/4] target/m68k: rename M68K_FEATURE_M68000 to M68K_FEATURE_M68K Mark Cave-Ayland
2022-09-17 22:21   ` Philippe Mathieu-Daudé via
2022-09-19  8:15   ` Richard Henderson
2022-09-21 13:04   ` Laurent Vivier
2022-09-17 11:25 ` [PATCH 2/4] target/m68k: increase size of m68k CPU features from uint32_t to uint64_t Mark Cave-Ayland
2022-09-17 12:09   ` BALATON Zoltan
2022-09-17 22:27     ` Philippe Mathieu-Daudé via
2022-09-20 16:30       ` Mark Cave-Ayland
2022-09-20 16:34         ` Philippe Mathieu-Daudé via
2022-09-20 19:01         ` BALATON Zoltan
2022-09-21 13:14         ` Laurent Vivier
2022-09-20 16:25     ` Mark Cave-Ayland
2022-09-17 11:25 ` [PATCH 3/4] target/m68k: use M68K_FEATURE_MOVEFROMSR_PRIV feature for move_from_sr privilege check Mark Cave-Ayland
2022-09-19  8:15   ` Richard Henderson
2022-09-17 11:25 ` [PATCH 4/4] target/m68k: always call gen_exit_tb() after writes to SR Mark Cave-Ayland
2022-09-17 22:29   ` Philippe Mathieu-Daudé via
2022-09-19  8:13     ` Richard Henderson
2022-09-20 17:47       ` Philippe Mathieu-Daudé via
2022-09-19  8:13   ` Richard Henderson
2022-09-21 13:11   ` Laurent Vivier

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.