diff mbox series

[RFC,v3,25/56] exec: use cpu_reset_interrupt

Message ID 20181019010625.25294-26-cota@braap.org
State New
Headers show
Series per-CPU locks | expand

Commit Message

Emilio Cota Oct. 19, 2018, 1:05 a.m. UTC
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(-)

Comments

Richard Henderson Oct. 21, 2018, 1:17 p.m. UTC | #1
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~
Emilio Cota Oct. 22, 2018, 11:28 p.m. UTC | #2
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
diff mbox series

Patch

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