On 6/8/21 7:39 AM, Bruno Piazera Larsen wrote:
That's odd. We already have more arguments than the number of argument
registers... A 5x slowdown is distinctly odd.
I did some more digging and the problem is not with ppc_radix64_check_prot, the
problem is ppc_radix64_xlate, which currently has 7 arguments and we're
increasing to 8. 7 feels like the correct number, but I couldn't find docs
supporting it, so I could be wrong.
According to tcg/ppc/tcg-target.c.inc, there are 8 argument registers for ppc
hosts. But now I see you didn't actually say on which host you observed the
problem... It's 6 argument registers for x86_64 host.
That means we'd have to define radix_ctx_t (or however we call it) in
radix64.h, setup the struct on ppc_xlate, then pass it to ppc_radix64_xlate.
Well, if you're going to change the xlate interface, you want to do that across
all of them. So, not call it radix_ctx_t.
From looking at the code, it seems the most useful bits to put in the struct
are: eaddr, g_addr, h_addr, {h,g}_prot, {g,h}_page_size, mmu_idx and
guest_visible. They all seem reasonable to me, but I might be missing something
again.
I don't think h/g should be in this struct. I think h/g should use different
struct instances, because they are different accesses.
r~