Check in MSR if the SF bit is set (64bit mode is enabled) Signed-off-by: Laurent Vivier <lvivier@xxxxxxxxxx> --- powerpc/emulator.c | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/powerpc/emulator.c b/powerpc/emulator.c index 1215c4f..b66c1d7 100644 --- a/powerpc/emulator.c +++ b/powerpc/emulator.c @@ -32,12 +32,26 @@ static void test_illegal(void) report_prefix_pop(); } +static void test_64bit(void) +{ + uint64_t msr; + + report_prefix_push("64bit"); + + asm("mfmsr %[msr]": [msr] "=r" (msr)); + + report("detected", msr & 0x8000000000000000UL); + + report_prefix_pop(); +} + int main(void) { handle_exception(0x700, program_check_handler, (void *)&is_invalid); report_prefix_push("emulator"); + test_64bit(); test_illegal(); report_prefix_pop(); -- 2.5.0 -- To unsubscribe from this list: send the line "unsubscribe kvm" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html