On 21.11.2010, at 11:44, Andreas Färber wrote:
Am 16.11.2010 um 00:43 schrieb Alexander Graf:
On 16.11.2010, at 00:39, Andreas Färber wrote:
Dereference function descriptors.
Just putting this out there. In addition to function descriptor deref (still in need of macros like LOAD_REG_ADDR_IMMEDIATE and LOAD_REG_ADDR) I checked whether it makes any difference whether we simulate the original ba by a bctr - not noticably. Also FYI my unsuccessful ldscript attempts.
arch/ppc/qemu/start.S | 30 ++++++++++++++++++++++++++++++ arch/ppc64/qemu/ldscript | 43 +++++++++++++++++++++++++++++++++++++++++-- 2 files changed, 71 insertions(+), 2 deletions(-)
diff --git a/arch/ppc/qemu/start.S b/arch/ppc/qemu/start.S index 6cf20cf..1a63082 100644 --- a/arch/ppc/qemu/start.S +++ b/arch/ppc/qemu/start.S @@ -274,15 +274,33 @@ GLOBL(__vectors):
call_dsi_exception: LOAD_REG_IMMEDIATE(r3, dsi_exception) +#ifdef __powerpc64__
- ld r3, 0(r3)
+#endif
Have you checked if .dsi_exception is available? Usually the dotted one is the version without indirection.
Not yet, but that wouldn't spare us the special-handling for ppc64 either, since ppc wouldn't know the dotted version, right? Should we #define it then? Linux uses LOAD_ADDR_REG() macro, going via GOT, which wouldn't work ATM.
Yeah, in the first couple versions of ppc kvm code, I just #define'd it :). The code definitely is more readable without #ifdefs in the middle of it. Maybe you can even get some clever preprocessor magic to append the dot automatically:
LOAD_CCALL_IMMEDIATE(r3, dsi_exception)
#define LOAD_CCALL_IMMEDIATE(a, b) LOAD_REG_IMMEDIATE(a, . # b)
or so, no idea if it's actually possible :)
Alex