Fix smsw for x86_64 guest and bigendian host case
authormalc <malc@c046a42c-6fe2-441c-8c8c-71466251a162>
Sat, 13 Dec 2008 15:51:14 +0000 (15:51 +0000)
committermalc <malc@c046a42c-6fe2-441c-8c8c-71466251a162>
Sat, 13 Dec 2008 15:51:14 +0000 (15:51 +0000)
git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@6009 c046a42c-6fe2-441c-8c8c-71466251a162

target-i386/translate.c

index 0fd509a590d87e8fc9e8c06b6fb1050478389e8a..3c71c957d276aab72eddef6e89c9023170bc699e 100644 (file)
@@ -7078,7 +7078,11 @@ static target_ulong disas_insn(DisasContext *s, target_ulong pc_start)
             break;
         case 4: /* smsw */
             gen_svm_check_intercept(s, pc_start, SVM_EXIT_READ_CR0);
+#if defined TARGET_X86_64 && defined WORDS_BIGENDIAN
+            tcg_gen_ld32u_tl(cpu_T[0], cpu_env, offsetof(CPUX86State,cr[0]) + 4);
+#else
             tcg_gen_ld32u_tl(cpu_T[0], cpu_env, offsetof(CPUX86State,cr[0]));
+#endif
             gen_ldst_modrm(s, modrm, OT_WORD, OR_TMP0, 1);
             break;
         case 6: /* lmsw */