[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [PATCH v2] target/i386: Give IRQs a chance when resetting HF_INHIBIT
From: |
Ruihan Li |
Subject: |
Re: [PATCH v2] target/i386: Give IRQs a chance when resetting HF_INHIBIT_IRQ_MASK |
Date: |
Mon, 15 Apr 2024 19:57:53 +0900 |
Hi Paolo,
On Mon, Apr 15, 2024 at 11:32:51AM +0200, Paolo Bonzini wrote:
> What do you think about writing this:
>
> > /* If several instructions disable interrupts, only the first does it.
> > */
> > if (inhibit && !(s->flags & HF_INHIBIT_IRQ_MASK)) {
> > gen_set_hflag(s, HF_INHIBIT_IRQ_MASK);
> > - } else {
> > + inhibit_reset = false;
> > + } else if (!inhibit && (s->flags & HF_INHIBIT_IRQ_MASK)) {
> > gen_reset_hflag(s, HF_INHIBIT_IRQ_MASK);
> > + inhibit_reset = true;
> > + } else {
> > + inhibit_reset = false;
> > }
>
> in a slightly simpler manner:
>
> inhibit_reset = false;
> if (s->flags & HF_INHIBIT_IRQ_MASK) {
> gen_reset_hflag(s, HF_INHIBIT_IRQ_MASK);
> inhibit_reset = true;
> } else if (inhibit) {
> gen_set_hflag(s, HF_INHIBIT_IRQ_MASK);
> }
Yes, I agree with you that your changes look a bit clearer. I have
tested your changes and verified that they fix the reported bug.
> No need to submit v3, I can do the change myself when applying.
Thank you for your review. Feel free to do that.
Thanks,
Ruihan Li