From: Jay Khandkar <jaykhandkar2002@gmail.com>
To: Peter Maydell <peter.maydell@linaro.org>
Cc: qemu-devel@nongnu.org, pbonzini@redhat.com, mst@redhat.com
Subject: Re: [PATCH] hw/intc: Handle software disabling of APIC correctly
Date: Fri, 29 Jul 2022 23:04:47 +0530 [thread overview]
Message-ID: <YuQaN9GScQJ4ZXC+@thinkpad.localdomain> (raw)
In-Reply-To: <CAFEAcA_sBoNCvUEaTOC26Om5vZKeZvLLJS1edkPM-pbswzQvzA@mail.gmail.com>
On Fri, Jul 29, 2022 at 06:09:01PM +0100, Peter Maydell wrote:
> On Tue, 12 Jul 2022 at 19:38, Jay Khandkar <jaykhandkar2002@gmail.com> wrote:
> >
> > When the local APIC is in a software disabled state, all local interrupt
> > sources must be masked and all attempts to unmask them should be
> > ignored. Currently, we don't do either. Fix this by handling it
> > correctly in apic_mem_write().
> >
> > Signed-off-by: Jay Khandkar <jaykhandkar2002@gmail.com>
> > ---
> > hw/intc/apic.c | 16 +++++++++++++---
> > 1 file changed, 13 insertions(+), 3 deletions(-)
> >
> > diff --git a/hw/intc/apic.c b/hw/intc/apic.c
> > index 3df11c34d6..493c70af62 100644
> > --- a/hw/intc/apic.c
> > +++ b/hw/intc/apic.c
> > @@ -792,9 +792,16 @@ static void apic_mem_write(void *opaque, hwaddr addr, uint64_t val,
> > s->dest_mode = val >> 28;
> > break;
> > case 0x0f:
> > - s->spurious_vec = val & 0x1ff;
> > - apic_update_irq(s);
> > - break;
> > + {
> > + s->spurious_vec = val & 0x1ff;
> > + if (!(val & APIC_SPURIO_ENABLED)) {
> > + for (int i = 0; i < APIC_LVT_NB; i++) {
> > + s->lvt[i] |= APIC_LVT_MASKED;
> > + }
> > + }
> > + apic_update_irq(s);
> > + break;
> > + }
>
> What are the braces for here ? There's no local variable declaration...
>
> thanks
> -- PMM
You are right, the braces are unnecessary for that part. I just put them in to
create a neat visually separate block. Can get rid of them.
Thanks,
Jay
next prev parent reply other threads:[~2022-07-29 17:36 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-07-12 14:18 [PATCH] hw/intc: Handle software disabling of APIC correctly Jay Khandkar
2022-07-29 16:45 ` Jay Khandkar
2022-07-29 17:09 ` Peter Maydell
2022-07-29 17:34 ` Jay Khandkar [this message]
2022-08-17 10:50 ` Michael S. Tsirkin
2022-09-07 17:59 ` Jay Khandkar
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=YuQaN9GScQJ4ZXC+@thinkpad.localdomain \
--to=jaykhandkar2002@gmail.com \
--cc=mst@redhat.com \
--cc=pbonzini@redhat.com \
--cc=peter.maydell@linaro.org \
--cc=qemu-devel@nongnu.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.