Skip to contentSkip to conversation

sparc hflags support?

Qemu-devel Robert Reif 3 participants 4 messages Nov 4, 2007 – Nov 5, 2007

lore
Share & tools
lore
#0 lore raw

I'm looking at adding more complete support for different sparc32 CPUs, MMUs, cache controllers and systems.

Each CPU/MMU/cache controller combination is slightly different and requires its own unique state. For example the two CPUs currently supported save the boot mode in different bits in the MMU control
register: 0x2000 for the SuperSparc and 0x4000 for the TurboSparc. Others bits will need to be saved in the MMU and cache controllers as better hardware emulation is added.

It looks like other architectures handle this by computing hflags in the target directories but sparc determines the flags value to save in common code.

Are there plans to add hflags support to sparc? I'm willing work on it but I don't have the experience yet to tackle a job like this without help.

#1 lore raw
Quoted 9 lines · Robert Reif

I'm looking at adding more complete support for different sparc32 CPUs, MMUs, cache controllers and systems.

Each CPU/MMU/cache controller combination is slightly different and requires its own unique state. For example the two CPUs currently supported save the boot mode in different bits in the MMU control
register: 0x2000 for the SuperSparc and 0x4000 for the TurboSparc. Others bits will need to be saved in the MMU and cache controllers as better hardware emulation is added.

If it's something that only changes rarely (e.g. when switching from early boot to a real OS environment) you can just do a tb flush.

Does mmu/cache mode actually effect the instruction semantics?

Paul

#2 lore raw
Quoted 11 lines · Paul Brook
Quoted 9 lines · Robert Reif

I'm looking at adding more complete support for different sparc32 CPUs, MMUs, cache controllers and systems.

Each CPU/MMU/cache controller combination is slightly different and requires its own unique state. For example the two CPUs currently supported save the boot mode in different bits in the MMU control
register: 0x2000 for the SuperSparc and 0x4000 for the TurboSparc. Others bits will need to be saved in the MMU and cache controllers as better hardware emulation is added.

Quoted 2 lines

If it's something that only changes rarely (e.g. when switching from early boot to a real OS environment) you can just do a tb flush.

Boot mode is used even earlier. It's enabled on reset and it forces the boot rom to occupy all of the address space. Boot rom disables it after relocating itself and enabling the MMU. On Sparc the MMU is never disabled after that, even during boot.

Quoted 1 line

Does mmu/cache mode actually effect the instruction semantics?

No, only instruction fetches, though I don't know about the cache controllers.

#3 lore raw
In reply to Robert Reif
Quoted 2 lines · Robert Reif

I'm looking at adding more complete support for different sparc32 CPUs, MMUs, cache controllers and systems.

Great! The only problems I see are that OpenBIOS support needs to be added for the new CPUs and supporting all CPUs with one image may become a bit complex.

Quoted 6 lines

Each CPU/MMU/cache controller combination is slightly different and requires its own unique state. For example the two CPUs currently supported save the boot mode in different bits in the MMU control
register: 0x2000 for the SuperSparc and 0x4000 for the TurboSparc. Others bits will need to be saved in the MMU and cache controllers as better hardware emulation is added.

I think other targets have better design for supporting different CPU types, for example MIPS and PPC.

Quoted 7 lines

It looks like other architectures handle this by computing hflags in the target directories but sparc determines the flags value to save in common code.

Are there plans to add hflags support to sparc? I'm willing work on it but I don't have the experience yet to tackle a job like this without help.

It could bring some performance benefit. Just try to move the tb flags computation to op_helper.c. Every time hflags elements change, recompute the flags. I'd be happy to try to help you.