* [PATCH 1/2] Use defines instead of numbers for cpu hotplug @ 2010-10-24 11:00 Gleb Natapov 2010-10-24 11:00 ` [PATCH 2/2] Fix cpu/pci hotplug to generate level triggered interrupt Gleb Natapov 0 siblings, 1 reply; 3+ messages in thread From: Gleb Natapov @ 2010-10-24 11:00 UTC (permalink / raw) To: avi, mtosatti; +Cc: kvm Signed-off-by: Gleb Natapov <gleb@redhat.com> --- hw/acpi_piix4.c | 5 +++-- 1 files changed, 3 insertions(+), 2 deletions(-) diff --git a/hw/acpi_piix4.c b/hw/acpi_piix4.c index 1c8e4e2..1db5ee3 100644 --- a/hw/acpi_piix4.c +++ b/hw/acpi_piix4.c @@ -39,6 +39,7 @@ #define PCI_BASE 0xae00 #define PCI_EJ_BASE 0xae08 +#define PIIX4_CPU_HOTPLUG_STATUS 4 #define PIIX4_PCI_HOTPLUG_STATUS 2 struct gpe_regs { @@ -636,13 +637,13 @@ static void piix4_acpi_system_hot_add_init(PCIBus *bus, PIIX4PMState *s) #if defined(TARGET_I386) static void enable_processor(struct gpe_regs *g, int cpu) { - g->sts |= 4; + g->sts |= PIIX4_CPU_HOTPLUG_STATUS; g->cpus_sts[cpu/8] |= (1 << (cpu%8)); } static void disable_processor(struct gpe_regs *g, int cpu) { - g->sts |= 4; + g->sts |= PIIX4_CPU_HOTPLUG_STATUS; g->cpus_sts[cpu/8] &= ~(1 << (cpu%8)); } -- 1.7.1 ^ permalink raw reply related [flat|nested] 3+ messages in thread
* [PATCH 2/2] Fix cpu/pci hotplug to generate level triggered interrupt. 2010-10-24 11:00 [PATCH 1/2] Use defines instead of numbers for cpu hotplug Gleb Natapov @ 2010-10-24 11:00 ` Gleb Natapov 2010-10-24 14:12 ` Avi Kivity 0 siblings, 1 reply; 3+ messages in thread From: Gleb Natapov @ 2010-10-24 11:00 UTC (permalink / raw) To: avi, mtosatti; +Cc: kvm SCI is level triggered. cpu/pci hotplug should behave appropriately. Signed-off-by: Gleb Natapov <gleb@redhat.com> --- hw/acpi_piix4.c | 16 +++++++--------- 1 files changed, 7 insertions(+), 9 deletions(-) diff --git a/hw/acpi_piix4.c b/hw/acpi_piix4.c index 1db5ee3..de3bb88 100644 --- a/hw/acpi_piix4.c +++ b/hw/acpi_piix4.c @@ -111,7 +111,8 @@ static void pm_update_sci(PIIX4PMState *s) ACPI_BITMASK_POWER_BUTTON_ENABLE | ACPI_BITMASK_GLOBAL_LOCK_ENABLE | ACPI_BITMASK_TIMER_ENABLE)) != 0) || - (((s->gpe.sts & s->gpe.en) & PIIX4_PCI_HOTPLUG_STATUS) != 0); + (((s->gpe.sts & s->gpe.en) & + (PIIX4_CPU_HOTPLUG_STATUS | PIIX4_PCI_HOTPLUG_STATUS)) != 0); qemu_set_irq(s->irq, sci_level); /* schedule a timer interruption if needed */ @@ -610,20 +611,19 @@ static int piix4_device_hotplug(DeviceState *qdev, PCIDevice *dev, int state); static void piix4_acpi_system_hot_add_init(PCIBus *bus, PIIX4PMState *s) { - struct gpe_regs *gpe = &s->gpe; struct pci_status *pci0_status = &s->pci0_status; int i = 0, cpus = smp_cpus; while (cpus > 0) { - gpe->cpus_sts[i++] = (cpus < 8) ? (1 << cpus) - 1 : 0xff; + s->gpe.cpus_sts[i++] = (cpus < 8) ? (1 << cpus) - 1 : 0xff; cpus -= 8; } register_ioport_write(GPE_BASE, 4, 1, gpe_writeb, s); register_ioport_read(GPE_BASE, 4, 1, gpe_readb, s); - register_ioport_write(PROC_BASE, 32, 1, gpe_writeb, gpe); - register_ioport_read(PROC_BASE, 32, 1, gpe_readb, gpe); + register_ioport_write(PROC_BASE, 32, 1, gpe_writeb, s); + register_ioport_read(PROC_BASE, 32, 1, gpe_readb, s); register_ioport_write(PCI_BASE, 8, 4, pcihotplug_write, pci0_status); register_ioport_read(PCI_BASE, 8, 4, pcihotplug_read, pci0_status); @@ -665,10 +665,8 @@ void qemu_system_cpu_hot_add(int cpu, int state) enable_processor(&s->gpe, cpu); else disable_processor(&s->gpe, cpu); - if (s->gpe.en & 4) { - qemu_set_irq(s->irq, 1); - qemu_set_irq(s->irq, 0); - } + + pm_update_sci(s); } #endif -- 1.7.1 ^ permalink raw reply related [flat|nested] 3+ messages in thread
* Re: [PATCH 2/2] Fix cpu/pci hotplug to generate level triggered interrupt. 2010-10-24 11:00 ` [PATCH 2/2] Fix cpu/pci hotplug to generate level triggered interrupt Gleb Natapov @ 2010-10-24 14:12 ` Avi Kivity 0 siblings, 0 replies; 3+ messages in thread From: Avi Kivity @ 2010-10-24 14:12 UTC (permalink / raw) To: Gleb Natapov; +Cc: mtosatti, kvm On 10/24/2010 01:00 PM, Gleb Natapov wrote: > > register_ioport_write(GPE_BASE, 4, 1, gpe_writeb, s); > register_ioport_read(GPE_BASE, 4, 1, gpe_readb, s); > > - register_ioport_write(PROC_BASE, 32, 1, gpe_writeb, gpe); > - register_ioport_read(PROC_BASE, 32, 1, gpe_readb, gpe); > + register_ioport_write(PROC_BASE, 32, 1, gpe_writeb, s); > + register_ioport_read(PROC_BASE, 32, 1, gpe_readb, s); > This is unrelated - please split. -- error compiling committee.c: too many arguments to function ^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2010-10-24 14:12 UTC | newest] Thread overview: 3+ messages (download: mbox.gz follow: Atom feed -- links below jump to the message on this page -- 2010-10-24 11:00 [PATCH 1/2] Use defines instead of numbers for cpu hotplug Gleb Natapov 2010-10-24 11:00 ` [PATCH 2/2] Fix cpu/pci hotplug to generate level triggered interrupt Gleb Natapov 2010-10-24 14:12 ` Avi Kivity
This is a public inbox, see mirroring instructions for how to clone and mirror all data and code used for this inbox