From mboxrd@z Thu Jan 1 00:00:00 1970 From: Avi Kivity Subject: Re: [PATCH] add acpi powerbutton support Date: Mon, 14 Jan 2008 19:34:02 +0200 Message-ID: <478B9D0A.5010901@qumranet.com> References: <20080104183158.GA14002@bogon.ms20.nix> <47809A8F.5090803@qumranet.com> <20080107115916.GA24050@bogon.ms20.nix> <20080107120223.GB24050@bogon.ms20.nix> <47821EC8.4020308@qumranet.com> <47833938.1020609@qumranet.com> <20080109180001.GA11240@bogon.ms20.nix> <4789DB74.5070901@qumranet.com> <478A1694.1010307@qumranet.com> <20080114102326.GB8987@bogon.ms20.nix> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="------------080301070007030603020306" Cc: kvm-devel-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f@public.gmane.org To: Guido Guenther Return-path: In-Reply-To: <20080114102326.GB8987-DVvpyRRQz99DDGxTMhc9XQ@public.gmane.org> List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: kvm-devel-bounces-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f@public.gmane.org Errors-To: kvm-devel-bounces-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f@public.gmane.org List-Id: kvm.vger.kernel.org This is a multi-part message in MIME format. --------------080301070007030603020306 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Guido Guenther wrote: > >> - backout the madt interrupt source override changes >> > Should these stay, but with active low instead of active high? > They can go away, since active low is the default. For reference, I'm attaching the patches I'm using. -- error compiling committee.c: too many arguments to function --------------080301070007030603020306 Content-Type: text/x-patch; name="0001-kvm-bios-pci-interrupts-are-active-low.patch" Content-Transfer-Encoding: 7bit Content-Disposition: inline; filename="0001-kvm-bios-pci-interrupts-are-active-low.patch" >>From 736880c1e550f84778e0cd13ae7dd27988dee902 Mon Sep 17 00:00:00 2001 From: Avi Kivity Date: Mon, 14 Jan 2008 17:34:11 +0200 Subject: [PATCH] kvm: bios: pci interrupts are active low Signed-off-by: Avi Kivity --- bios/acpi-dsdt.dsl | 16 ++++++++-------- 1 files changed, 8 insertions(+), 8 deletions(-) diff --git a/bios/acpi-dsdt.dsl b/bios/acpi-dsdt.dsl index df255ce..92fd126 100755 --- a/bios/acpi-dsdt.dsl +++ b/bios/acpi-dsdt.dsl @@ -382,7 +382,7 @@ DefinitionBlock ( Name(_HID, EISAID("PNP0C0F")) // PCI interrupt link Name(_UID, 1) Name(_PRS, ResourceTemplate(){ - Interrupt (, Level, ActiveHigh, Shared) + Interrupt (, Level, ActiveLow, Shared) { 5, 9, 10, 11 } }) Method (_STA, 0, NotSerialized) @@ -402,7 +402,7 @@ DefinitionBlock ( { Name (PRR0, ResourceTemplate () { - Interrupt (, Level, ActiveHigh, Shared) + Interrupt (, Level, ActiveLow, Shared) {1} }) CreateDWordField (PRR0, 0x05, TMP) @@ -427,7 +427,7 @@ DefinitionBlock ( Name(_HID, EISAID("PNP0C0F")) // PCI interrupt link Name(_UID, 2) Name(_PRS, ResourceTemplate(){ - Interrupt (, Level, ActiveHigh, Shared) + Interrupt (, Level, ActiveLow, Shared) { 5, 9, 10, 11 } }) Method (_STA, 0, NotSerialized) @@ -447,7 +447,7 @@ DefinitionBlock ( { Name (PRR0, ResourceTemplate () { - Interrupt (, Level, ActiveHigh, Shared) + Interrupt (, Level, ActiveLow, Shared) {1} }) CreateDWordField (PRR0, 0x05, TMP) @@ -472,7 +472,7 @@ DefinitionBlock ( Name(_HID, EISAID("PNP0C0F")) // PCI interrupt link Name(_UID, 3) Name(_PRS, ResourceTemplate(){ - Interrupt (, Level, ActiveHigh, Shared) + Interrupt (, Level, ActiveLow, Shared) { 5, 9, 10, 11 } }) Method (_STA, 0, NotSerialized) @@ -492,7 +492,7 @@ DefinitionBlock ( { Name (PRR0, ResourceTemplate () { - Interrupt (, Level, ActiveHigh, Shared) + Interrupt (, Level, ActiveLow, Shared) {1} }) CreateDWordField (PRR0, 0x05, TMP) @@ -517,7 +517,7 @@ DefinitionBlock ( Name(_HID, EISAID("PNP0C0F")) // PCI interrupt link Name(_UID, 4) Name(_PRS, ResourceTemplate(){ - Interrupt (, Level, ActiveHigh, Shared) + Interrupt (, Level, ActiveLow, Shared) { 5, 9, 10, 11 } }) Method (_STA, 0, NotSerialized) @@ -537,7 +537,7 @@ DefinitionBlock ( { Name (PRR0, ResourceTemplate () { - Interrupt (, Level, ActiveHigh, Shared) + Interrupt (, Level, ActiveLow, Shared) {1} }) CreateDWordField (PRR0, 0x05, TMP) -- 1.5.3.7 --------------080301070007030603020306 Content-Type: text/x-patch; name="0002-kvm-bios-don-t-advertise-the-pci-interrupts-as-act.patch" Content-Transfer-Encoding: 7bit Content-Disposition: inline; filename*0="0002-kvm-bios-don-t-advertise-the-pci-interrupts-as-act.patc"; filename*1="h" >>From 96ecf8e23154baa8020c58316cc013b8fa28689c Mon Sep 17 00:00:00 2001 From: Avi Kivity Date: Mon, 14 Jan 2008 17:47:35 +0200 Subject: [PATCH] kvm: bios: don't advertise the pci interrupts as active high Signed-off-by: Avi Kivity --- bios/rombios32.c | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-) diff --git a/bios/rombios32.c b/bios/rombios32.c index 967c119..ebfbb24 100755 --- a/bios/rombios32.c +++ b/bios/rombios32.c @@ -1369,7 +1369,7 @@ void acpi_bios_init(void) intsrcovr = (struct madt_intsrcovr*)(io_apic + 1); for ( i = 0; i < 16; i++ ) { - if ( PCI_ISA_IRQ_MASK & (1U << i) ) { + if ( 0 && (PCI_ISA_IRQ_MASK & (1U << i) )) { memset(intsrcovr, 0, sizeof(*intsrcovr)); intsrcovr->type = APIC_XRUPT_OVERRIDE; intsrcovr->length = sizeof(*intsrcovr); -- 1.5.3.7 --------------080301070007030603020306 Content-Type: text/x-patch; name="0003-kvm-qemu-invert-pci-interrupts-so-they-are-active.patch" Content-Transfer-Encoding: 7bit Content-Disposition: inline; filename*0="0003-kvm-qemu-invert-pci-interrupts-so-they-are-active.patch" >>From 5a5564a0998f42c5394090167d0dbf1e111dde10 Mon Sep 17 00:00:00 2001 From: Avi Kivity Date: Mon, 14 Jan 2008 17:48:51 +0200 Subject: [PATCH] kvm: qemu: invert pci interrupts so they are active low qemu treats them as active high, but they really are active low. Signed-off-by: Avi Kivity --- qemu/qemu-kvm.c | 2 ++ 1 files changed, 2 insertions(+), 0 deletions(-) diff --git a/qemu/qemu-kvm.c b/qemu/qemu-kvm.c index dd84686..33db263 100644 --- a/qemu/qemu-kvm.c +++ b/qemu/qemu-kvm.c @@ -742,6 +742,8 @@ int kvm_get_phys_ram_page_bitmap(unsigned char *bitmap) int kvm_set_irq(int irq, int level) { + if ((1 << irq) & 0xe20) + level ^= 1; return kvm_set_irq_level(kvm_context, irq, level); } -- 1.5.3.7 --------------080301070007030603020306 Content-Type: text/x-patch; name="0004-KVM-Hack-pci-pic-irqs-to-be-inverted-relative-to-io.patch" Content-Transfer-Encoding: 7bit Content-Disposition: inline; filename*0="0004-KVM-Hack-pci-pic-irqs-to-be-inverted-relative-to-io.pat"; filename*1="ch" >>From 1d578b022cfc4973ae3da3b3c639ab41f7a84f28 Mon Sep 17 00:00:00 2001 From: Avi Kivity Date: Mon, 14 Jan 2008 17:29:38 +0200 Subject: [PATCH] KVM: Hack pci pic irqs to be inverted relative to ioapic irqs PCI irqs are active low, but the pic wants them active high. Signed-off-by: Avi Kivity --- arch/x86/kvm/x86.c | 9 +++++++-- 1 files changed, 7 insertions(+), 2 deletions(-) diff --git a/arch/x86/kvm/x86.c b/arch/x86/kvm/x86.c index 77d57ff..ffce026 100644 --- a/arch/x86/kvm/x86.c +++ b/arch/x86/kvm/x86.c @@ -1434,16 +1434,21 @@ long kvm_arch_vm_ioctl(struct file *filp, break; case KVM_IRQ_LINE: { struct kvm_irq_level irq_event; + int isa_irq_level; r = -EFAULT; if (copy_from_user(&irq_event, argp, sizeof irq_event)) goto out; if (irqchip_in_kernel(kvm)) { mutex_lock(&kvm->lock); - if (irq_event.irq < 16) + if (irq_event.irq < 16) { + isa_irq_level = irq_event.level; + if ((1 << irq_event.irq) & 0xe20) + isa_irq_level ^= 1; kvm_pic_set_irq(pic_irqchip(kvm), irq_event.irq, - irq_event.level); + isa_irq_level); + } kvm_ioapic_set_irq(kvm->arch.vioapic, irq_event.irq, irq_event.level); -- 1.5.3.7 --------------080301070007030603020306 Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Disposition: inline ------------------------------------------------------------------------- Check out the new SourceForge.net Marketplace. It's the best place to buy or sell services for just about anything Open Source. http://ad.doubleclick.net/clk;164216239;13503038;w?http://sf.net/marketplace --------------080301070007030603020306 Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Disposition: inline _______________________________________________ kvm-devel mailing list kvm-devel-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f@public.gmane.org https://lists.sourceforge.net/lists/listinfo/kvm-devel --------------080301070007030603020306--