public inbox for kvm@vger.kernel.org
 help / color / mirror / Atom feed
From: Avi Kivity <avi@redhat.com>
To: Paolo Bonzini <pbonzini@redhat.com>
Cc: kvm@vger.kernel.org, Marcelo Tosatti <mtosatti@redhat.com>
Subject: Re: [PATCH] KVM: i8259: initialize IMR to 0xff on reset
Date: Mon, 30 Aug 2010 16:53:12 +0300	[thread overview]
Message-ID: <4C7BB7C8.3080205@redhat.com> (raw)
In-Reply-To: <4C7BB3D0.3050906@redhat.com>

  On 08/30/2010 04:36 PM, Paolo Bonzini wrote:
> On 08/30/2010 11:20 AM, Avi Kivity wrote:
>> Otherwise, a wily interrupt can slip through while the guest isn't 
>> prepared
>> for it (and while the irq base is zero).
>>
>> Signed-off-by: Avi Kivity<avi@redhat.com>
>> ---
>>   arch/x86/kvm/i8259.c |    2 +-
>>   1 files changed, 1 insertions(+), 1 deletions(-)
>>
>> diff --git a/arch/x86/kvm/i8259.c b/arch/x86/kvm/i8259.c
>> index 8d10c06..5de9ee0 100644
>> --- a/arch/x86/kvm/i8259.c
>> +++ b/arch/x86/kvm/i8259.c
>> @@ -275,7 +275,7 @@ void kvm_pic_reset(struct kvm_kpic_state *s)
>>
>>       s->last_irr = 0;
>>       s->irr = 0;
>> -    s->imr = 0;
>> +    s->imr = 0xff;
>>       s->isr = 0;
>>       s->isr_ack = 0xff;
>>       s->priority_add = 0;
>
> Sounds sane, but the datasheet says explicitly that upon reset "The 
> Interrupt Mask Register is cleared"...  (FWIW, I checked because it 
> looked like QEMU and Xen also had the same behavior of setting IMR to 
> zero).

Hm, right.

Reading the spec, the correct approach is not to do a full reset on 
ICW1(D4=1), instead just do what the spec says (which is different from 
reset).  I'll try it out.

-- 
error compiling committee.c: too many arguments to function


      reply	other threads:[~2010-08-30 13:53 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-08-30  9:20 [PATCH] KVM: i8259: initialize IMR to 0xff on reset Avi Kivity
2010-08-30  9:22 ` Avi Kivity
2010-08-30 13:36 ` Paolo Bonzini
2010-08-30 13:53   ` Avi Kivity [this message]

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=4C7BB7C8.3080205@redhat.com \
    --to=avi@redhat.com \
    --cc=kvm@vger.kernel.org \
    --cc=mtosatti@redhat.com \
    --cc=pbonzini@redhat.com \
    /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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox