Check in MSR if the SF bit is set (64bit mode is enabled) Signed-off-by: Laurent Vivier <lvivier@xxxxxxxxxx> Reviewed-by: Thomas Huth <thuth@xxxxxxxxxx> --- powerpc/emulator.c | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/powerpc/emulator.c b/powerpc/emulator.c index 1d4f164..d97090c 100644 --- a/powerpc/emulator.c +++ b/powerpc/emulator.c @@ -43,6 +43,19 @@ 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(int argc, char **argv) { int i; @@ -57,6 +70,7 @@ int main(int argc, char **argv) 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