qemu-devel
[Top][All Lists]
Advanced

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

Re: [Qemu-devel] [PATCH v3] Undefine SWP instruction unless SCTLR.SW bit


From: Peter Maydell
Subject: Re: [Qemu-devel] [PATCH v3] Undefine SWP instruction unless SCTLR.SW bit is set
Date: Tue, 17 Apr 2012 14:18:08 +0100

On 17 April 2012 14:11, Alexey Starikovskiy <address@hidden> wrote:
>> Adding this brace is incorrectly changing behaviour.
>> (I agree that it's pretty obscure and halfway to being an
>> outright bug. It all goes away with the cp15 rework anyway.)
> Should I add tb_flush() without braces too or set second if() only to
> avoid changing the bogus behavior?

No, tb_flush() is safe so it doesn't need to go in an extra if().

>>> +            /* This may enable/disable SWP instruction, so do TB flush too 
>>> */
>>> +                tb_flush(env);
>>> +            }
>> This is not the reason. You can perfectly well run user-mode with
>> a specific -cpu option. The reason for this ifdef is that the
>> Linux kernel has SWP emulation code, so SWP has to work either
>> because we force the implementation here to work, or by making
>> it take an UNDEF exception and then implementing it inside
>> linux-user/main.c. Doing the former is slightly simpler.
> Linux kernel _might_ have emulation for SWP depending on config.

Yes, but linux-user generally just supports emulating a "standard
all features enabled" kind of kernel. Feel free to submit a patch
which makes SWP UNDEF here and handles it in the linux-user code
if you think that would be cleaner, though.

> So, what should I do? Change comment?

That's the minimum requirement, yes.

-- PMM



reply via email to

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