Re: [Qemu-devel] [PATCH] rtc: introduce nmi disable bit handler for cmos

2015-12-17 Thread Gonglei (Arei)
> > From: Paolo Bonzini [mailto:paolo.bonz...@gmail.com] On Behalf Of Paolo > Bonzini > Sent: Thursday, December 17, 2015 4:37 PM > > > On 17/12/2015 08:17, Gonglei (Arei) wrote: > >> On 16/12/2015 11:28, Gonglei (Arei) wrote: > >>> I'll move the global nmi_disabled into RTCState, then I have to

Re: [Qemu-devel] [PATCH] rtc: introduce nmi disable bit handler for cmos

2015-12-17 Thread Paolo Bonzini
On 17/12/2015 08:17, Gonglei (Arei) wrote: >> On 16/12/2015 11:28, Gonglei (Arei) wrote: >>> I'll move the global nmi_disabled into RTCState, then I have to add a global >> RTCState >>> Variable so that other C files can use the rtc_state->external_nmi_disabled. >> >> Hmm, I think it should be do

Re: [Qemu-devel] [PATCH] rtc: introduce nmi disable bit handler for cmos

2015-12-16 Thread Gonglei (Arei)
Hello Paolo, > > > On 16/12/2015 11:28, Gonglei (Arei) wrote: > > I'll move the global nmi_disabled into RTCState, then I have to add a global > RTCState > > Variable so that other C files can use the rtc_state->external_nmi_disabled. > > Hmm, I think it should be done differently. This is a l

Re: [Qemu-devel] [PATCH] rtc: introduce nmi disable bit handler for cmos

2015-12-16 Thread Paolo Bonzini
On 16/12/2015 11:28, Gonglei (Arei) wrote: > I'll move the global nmi_disabled into RTCState, then I have to add a global > RTCState > Variable so that other C files can use the rtc_state->external_nmi_disabled. Hmm, I think it should be done differently. This is a layering violation, the NMI_

Re: [Qemu-devel] [PATCH] rtc: introduce nmi disable bit handler for cmos

2015-12-16 Thread Gonglei (Arei)
> > On 15/12/2015 19:53, Radim Krcmar wrote: > > 2015-12-15 05:43-0500, Paolo Bonzini: > >>> Hi Paolo, > >>> > >>> /* for KVM_GET/SET_VCPU_EVENTS */ > >>> struct kvm_vcpu_events { > >>> ... > >>> struct { > >>> __u8 injected; > >>> __u8 pending; > >>> __u8 masked; >

Re: [Qemu-devel] [PATCH] rtc: introduce nmi disable bit handler for cmos

2015-12-16 Thread Paolo Bonzini
On 15/12/2015 19:53, Radim Krcmar wrote: > 2015-12-15 05:43-0500, Paolo Bonzini: >>> Hi Paolo, >>> >>> /* for KVM_GET/SET_VCPU_EVENTS */ >>> struct kvm_vcpu_events { >>> ... >>> struct { >>> __u8 injected; >>> __u8 pending; >>> __u8 masked; >>> __u

Re: [Qemu-devel] [PATCH] rtc: introduce nmi disable bit handler for cmos

2015-12-16 Thread Gonglei (Arei)
Hi, > -Original Message- > From: Radim Krcmar [mailto:rkrc...@redhat.com] > Subject: Re: [PATCH] rtc: introduce nmi disable bit handler for cmos > > 2015-12-15 05:43-0500, Paolo Bonzini: > >> Hi Paolo, > >> > >> /* for KVM_GET/SET_VCPU_EVENTS */ > >> struct kvm_vcpu_events { > >> ... > >

Re: [Qemu-devel] [PATCH] rtc: introduce nmi disable bit handler for cmos

2015-12-15 Thread Radim Krcmar
2015-12-15 05:43-0500, Paolo Bonzini: >> Hi Paolo, >> >> /* for KVM_GET/SET_VCPU_EVENTS */ >> struct kvm_vcpu_events { >> ... >> struct { >> __u8 injected; >> __u8 pending; >> __u8 masked; >> __u8 pad; >> } nmi; >> ... >> >> I found that

Re: [Qemu-devel] [PATCH] rtc: introduce nmi disable bit handler for cmos

2015-12-15 Thread Paolo Bonzini
> Hi Paolo, > > /* for KVM_GET/SET_VCPU_EVENTS */ > struct kvm_vcpu_events { > ... > struct { > __u8 injected; > __u8 pending; > __u8 masked; > __u8 pad; > } nmi; > ... > > I found that the nmi.masked property does these enable or di

Re: [Qemu-devel] [PATCH] rtc: introduce nmi disable bit handler for cmos

2015-12-15 Thread Gonglei (Arei)
Hi Paolo, /* for KVM_GET/SET_VCPU_EVENTS */ struct kvm_vcpu_events { ... struct { __u8 injected; __u8 pending; __u8 masked; __u8 pad; } nmi; ... I found that the nmi.masked property does these enable or disable NMI jobs. S

Re: [Qemu-devel] [PATCH] rtc: introduce nmi disable bit handler for cmos

2015-12-14 Thread Gonglei (Arei)
> -Original Message- > From: Eduardo Habkost [mailto:ehabk...@redhat.com] > Sent: Tuesday, December 15, 2015 2:17 AM > To: Gonglei (Arei) > Cc: qemu-devel@nongnu.org; pbonz...@redhat.com; r...@twiddle.net; > ke...@koconnor.net; Huangpeng (Peter) > Subject: Re: [PATCH] rtc: introduce nmi dis

Re: [Qemu-devel] [PATCH] rtc: introduce nmi disable bit handler for cmos

2015-12-14 Thread Gonglei (Arei)
> From: Paolo Bonzini [mailto:pbonz...@redhat.com] > Sent: Monday, December 14, 2015 9:37 PM > On 14/12/2015 14:27, Gonglei (Arei) wrote: > > > >> > >> On 14/12/2015 13:49, Gonglei (Arei) wrote: > >>> This patch introduce nmi disable bit handler to fix the problem > >>> and make the emulate

Re: [Qemu-devel] [PATCH] rtc: introduce nmi disable bit handler for cmos

2015-12-14 Thread Eduardo Habkost
On Sat, Dec 12, 2015 at 09:15:46PM +0800, Gonglei wrote: > The Non-Maskable Interrupt (NMI) Enable bit is 0x80 bit of > Port 0x70 (and its aliases). This bit must be 0b to enable > the hardware chipset to send a Non-Maskable Interrupt. When > set to a 1b, NMI's are disabled. This bit is commonly ac

Re: [Qemu-devel] [PATCH] rtc: introduce nmi disable bit handler for cmos

2015-12-14 Thread Paolo Bonzini
On 14/12/2015 14:27, Gonglei (Arei) wrote: > >> >> On 14/12/2015 13:49, Gonglei (Arei) wrote: >>> This patch introduce nmi disable bit handler to fix the problem >>> and make the emulated CMOS like the real hardware. > > I think that this only works with -machine kernel_irqchip=o

Re: [Qemu-devel] [PATCH] rtc: introduce nmi disable bit handler for cmos

2015-12-14 Thread Gonglei (Arei)
> > On 14/12/2015 13:49, Gonglei (Arei) wrote: > >>> > > This patch introduce nmi disable bit handler to fix the problem > >>> > > and make the emulated CMOS like the real hardware. > >> > > >> > I think that this only works with -machine kernel_irqchip=off, however. > > IIRCC, the kernel_irqchip

Re: [Qemu-devel] [PATCH] rtc: introduce nmi disable bit handler for cmos

2015-12-14 Thread Paolo Bonzini
On 14/12/2015 13:49, Gonglei (Arei) wrote: >>> > > This patch introduce nmi disable bit handler to fix the problem and >>> > > make the emulated CMOS like the real hardware. >> > >> > I think that this only works with -machine kernel_irqchip=off, however. > IIRCC, the kernel_irqchip is disabled

Re: [Qemu-devel] [PATCH] rtc: introduce nmi disable bit handler for cmos

2015-12-14 Thread Gonglei (Arei)
Hi Paolo, Thanks for your comments firstly. > Subject: Re: [PATCH] rtc: introduce nmi disable bit handler for cmos > > > > On 12/12/2015 14:15, Gonglei wrote: > > The Non-Maskable Interrupt (NMI) Enable bit is 0x80 bit of Port 0x70 > > (and its aliases). This bit must be 0b to enable the hardw

Re: [Qemu-devel] [PATCH] rtc: introduce nmi disable bit handler for cmos

2015-12-14 Thread Paolo Bonzini
On 12/12/2015 14:15, Gonglei wrote: > The Non-Maskable Interrupt (NMI) Enable bit is 0x80 bit of > Port 0x70 (and its aliases). This bit must be 0b to enable > the hardware chipset to send a Non-Maskable Interrupt. When > set to a 1b, NMI's are disabled. This bit is commonly accessed > by applica

[Qemu-devel] [PATCH] rtc: introduce nmi disable bit handler for cmos

2015-12-12 Thread Gonglei
The Non-Maskable Interrupt (NMI) Enable bit is 0x80 bit of Port 0x70 (and its aliases). This bit must be 0b to enable the hardware chipset to send a Non-Maskable Interrupt. When set to a 1b, NMI's are disabled. This bit is commonly accessed by applications, BIOS, and even the operating system since