* [Qemu-devel] [6009] Fix smsw for x86_64 guest and bigendian host case
@ 2008-12-13 15:51 malc
2008-12-13 16:13 ` Stuart Brady
0 siblings, 1 reply; 3+ messages in thread
From: malc @ 2008-12-13 15:51 UTC (permalink / raw)
To: qemu-devel
Revision: 6009
http://svn.sv.gnu.org/viewvc/?view=rev&root=qemu&revision=6009
Author: malc
Date: 2008-12-13 15:51:14 +0000 (Sat, 13 Dec 2008)
Log Message:
-----------
Fix smsw for x86_64 guest and bigendian host case
Modified Paths:
--------------
trunk/target-i386/translate.c
Modified: trunk/target-i386/translate.c
===================================================================
--- trunk/target-i386/translate.c 2008-12-13 12:33:02 UTC (rev 6008)
+++ trunk/target-i386/translate.c 2008-12-13 15:51:14 UTC (rev 6009)
@@ -7078,7 +7078,11 @@
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 */
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [Qemu-devel] [6009] Fix smsw for x86_64 guest and bigendian host case
2008-12-13 15:51 [Qemu-devel] [6009] Fix smsw for x86_64 guest and bigendian host case malc
@ 2008-12-13 16:13 ` Stuart Brady
2008-12-13 20:16 ` malc
0 siblings, 1 reply; 3+ messages in thread
From: Stuart Brady @ 2008-12-13 16:13 UTC (permalink / raw)
To: qemu-devel
On Sat, Dec 13, 2008 at 03:51:14PM +0000, malc wrote:
> +#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
Hmm -- shouldn't REG_L_OFFSET be added instead of using #ifdefs?
--
Stuart Brady
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [Qemu-devel] [6009] Fix smsw for x86_64 guest and bigendian host case
2008-12-13 16:13 ` Stuart Brady
@ 2008-12-13 20:16 ` malc
0 siblings, 0 replies; 3+ messages in thread
From: malc @ 2008-12-13 20:16 UTC (permalink / raw)
To: qemu-devel
On Sat, 13 Dec 2008, Stuart Brady wrote:
> On Sat, Dec 13, 2008 at 03:51:14PM +0000, malc wrote:
>> +#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
>
> Hmm -- shouldn't REG_L_OFFSET be added instead of using #ifdefs?
Probably not. This mixes GPRs with CRs, that said the core idea is sound.
--
mailto:av1474@comtv.ru
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2008-12-13 20:17 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2008-12-13 15:51 [Qemu-devel] [6009] Fix smsw for x86_64 guest and bigendian host case malc
2008-12-13 16:13 ` Stuart Brady
2008-12-13 20:16 ` malc
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).