On 10/01/2017 04:27 PM, Helge Deller wrote:
> What I'm absolutely missing knowledge in is the emulation code in
> qemu to really be able to emulate the missing hppa assembler instructions.
> For example, the space registers, some other PSW bits, and so on.

[CC-ing the list for posterity]

For emulating system, I believe that we will require TARGET_LONG_BITS == 64
(even for pa1.1), and make our space registers 32 bits wide (even for pa2.0).
Thus we will always have a 64-bit virtual address space and never (as is
architecturally allowable) a 96-bit virtual address space.

There may be clever things we can do with mmu_idx to speed things up for
running Linux, which makes very little use of space registers.  However to
begin let us open-code exactly what the hardware does and afterward see what
needs to be optimized:

  pa1.1 or pa2.0 with psw.w=0:
        gva = space{0:31} : offset{0:31}
            = (space << 32) | (offset & 0x0000_0000_ffff_ffff)

  pa2.0 with psw.w=1:
        gva = space{0:1} : (space{2:31} | offset{2:31}) : offset{32:63}
            = (space << 32) | (offset & 0x3fff_ffff_ffff_ffff)

We may want to store the space registers in env pre-shifted as a uint64_t to
minimize the operations required to compute the GVA at runtime.

You'll want helper functions to compute this both directly in C and with TCG
operations for the translator.  They'd be no-ops for -linux-user.

Implementing the space registers themselves should be straight-forward.  There
are comments in many (most?) of the places that should be modified.  Take care
to leave -linux-user unmodified.

Let's take the rest case-by-case as it comes up?


r~

Reply via email to