qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Qemu-devel] qemu-system-hppa first steps


From: Richard Henderson
Subject: Re: [Qemu-devel] qemu-system-hppa first steps
Date: Mon, 2 Oct 2017 11:36:31 -0400
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.3.0

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

[Prev in Thread] Current Thread [Next in Thread]