[Top][All Lists]
[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
- Re: [Qemu-devel] [RFC PATCH] disable execution of SWP/SWPB, (continued)
- Re: [Qemu-devel] [RFC PATCH] disable execution of SWP/SWPB, Peter Maydell, 2012/04/17
- [Qemu-devel] [PATCH] Undefine SWP instruction unless SCTLR.SW bit is set, Alexey Starikovskiy, 2012/04/17
- Re: [Qemu-devel] [PATCH] Undefine SWP instruction unless SCTLR.SW bit is set, Peter Maydell, 2012/04/17
- Re: [Qemu-devel] [PATCH] Undefine SWP instruction unless SCTLR.SW bit is set, Alexey Starikovskiy, 2012/04/17
- Re: [Qemu-devel] [PATCH] Undefine SWP instruction unless SCTLR.SW bit is set, Peter Maydell, 2012/04/17
- [Qemu-devel] [PATCH v2] Undefine SWP instruction unless SCTLR.SW bit is set, Alexey Starikovskiy, 2012/04/17
- Re: [Qemu-devel] [PATCH v2] Undefine SWP instruction unless SCTLR.SW bit is set, Peter Maydell, 2012/04/17
- [Qemu-devel] [PATCH v3] Undefine SWP instruction unless SCTLR.SW bit is set, Alexey Starikovskiy, 2012/04/17
- Re: [Qemu-devel] [PATCH v3] Undefine SWP instruction unless SCTLR.SW bit is set, Peter Maydell, 2012/04/17
- Re: [Qemu-devel] [PATCH v3] Undefine SWP instruction unless SCTLR.SW bit is set, Alexey Starikovskiy, 2012/04/17
- Re: [Qemu-devel] [PATCH v3] Undefine SWP instruction unless SCTLR.SW bit is set,
Peter Maydell <=
- [Qemu-devel] [PATCH v4] Undefine SWP instruction unless SCTLR.SW bit is set, Alexey Starikovskiy, 2012/04/17