[Qemu-devel] [RFC v3 25/56] exec: use cpu_reset_interrupt

Emilio G. Cota posted 56 patches 7 years, 3 months ago
There is a newer version of this series
[Qemu-devel] [RFC v3 25/56] exec: use cpu_reset_interrupt
Posted by Emilio G. Cota 7 years, 3 months ago
Cc: Peter Crosthwaite <crosthwaite.peter@gmail.com>
Cc: Richard Henderson <rth@twiddle.net>
Signed-off-by: Emilio G. Cota <cota@braap.org>
---
 exec.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/exec.c b/exec.c
index 4fd831ef06..6006902975 100644
--- a/exec.c
+++ b/exec.c
@@ -776,7 +776,7 @@ static int cpu_common_post_load(void *opaque, int version_id)
 
     /* 0x01 was CPU_INTERRUPT_EXIT. This line can be removed when the
        version_id is increased. */
-    cpu->interrupt_request &= ~0x01;
+    cpu_reset_interrupt(cpu, ~0x01);
     tlb_flush(cpu);
 
     /* loadvm has just updated the content of RAM, bypassing the
-- 
2.17.1


Re: [Qemu-devel] [RFC v3 25/56] exec: use cpu_reset_interrupt
Posted by Richard Henderson 7 years, 3 months ago
On 10/19/18 2:05 AM, Emilio G. Cota wrote:
> -    cpu->interrupt_request &= ~0x01;
> +    cpu_reset_interrupt(cpu, ~0x01);

cpu_reset_interrupt(cpu, 1);

Although this is during vmload, and I'm not sure what locks you really want to
play with here.  Perhaps it's ok...


r~

Re: [Qemu-devel] [RFC v3 25/56] exec: use cpu_reset_interrupt
Posted by Emilio G. Cota 7 years, 3 months ago
On Sun, Oct 21, 2018 at 14:17:01 +0100, Richard Henderson wrote:
> On 10/19/18 2:05 AM, Emilio G. Cota wrote:
> > -    cpu->interrupt_request &= ~0x01;
> > +    cpu_reset_interrupt(cpu, ~0x01);
> 
> cpu_reset_interrupt(cpu, 1);

Ouch. Fixed.

> Although this is during vmload, and I'm not sure what locks you really want to
> play with here.  Perhaps it's ok...

I checked with check-qtest that it's OK -- note that the lock
is initialized right after the CPU thread is created.

I'd like to keep the locked version, so that race checkers don't
get confused.

Thanks,

		Emilio