qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Qemu-devel] Self-modifying test case for mttcg


From: Alexander Spyridakis
Subject: Re: [Qemu-devel] Self-modifying test case for mttcg
Date: Thu, 23 Jul 2015 16:42:46 +0200

On 23 July 2015 at 12:04, Andrew Jones <address@hidden> wrote:
> One more observation; to make this work for aarch64 you'll need to modify
> your instruction modification. The add immediate can't be changed with
> +-1 like it can for arm. Please make sure the code works for both, even
> if you need to do
>
> #ifdef __arm__
> asm volatile(arm asm)
> #else
> asm volatile(aarch64 asm)
> #endif

Yes I already did something like this on my original repo (ptr points
to seg0), will update it:
#ifdef ARCH_ARM
            (int *)seg0++;
        } else {
            (int *)seg0--;
        }
#elif ARCH_AARCH64
            *ptr |= 1 << 11;
            *ptr &= ~(1 << 10);
        } else {
            *ptr |= 1 << 10;
            *ptr &= ~(1 << 11);
        }
#endif

> Also, if you need a flip-flopping flag, why not use xor instead of
> a counter mod 2?

You are right xor is more straightforward.

Best regards.



reply via email to

[Prev in Thread] Current Thread [Next in Thread]