diff options
author | Linus Torvalds <torvalds@linux-foundation.org> | 2012-06-15 20:17:15 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2012-06-15 20:17:15 -0400 |
commit | 069915b94642b05c9b45fee36862157026b36614 (patch) | |
tree | b983c4968a7483f22bf64ea5c1c70e00daa9f455 /drivers | |
parent | 41c8c535237e9cea522024548c5bc37f7d34a81f (diff) | |
parent | b9e0d95c041ca2d7ad297ee37c2e9cfab67a188f (diff) |
Merge tag 'stable/for-linus-3.5-rc2-tag' of git://git.kernel.org/pub/scm/linux/kernel/git/konrad/xen
Pull five Xen bug-fixes from Konrad Rzeszutek Wilk:
- When booting as PVHVM we would try to use PV console - but would not validate
the parameters causing us to crash during restore b/c we re-use the wrong event
channel.
- When booting on machines with SR-IOV PCI bridge we didn't check for the bridge
and tried to use it.
- Under AMD machines would advertise the APERFMPERF resulting in needless amount
of MSRs from the guest.
- A global value (xen_released_pages) was not subtracted at bootup when pages
were added back in. This resulted in the balloon worker having the wrong
account of how many pages were truly released.
- Fix dead-lock when xen-blkfront is run in the same domain as xen-blkback.
* tag 'stable/for-linus-3.5-rc2-tag' of git://git.kernel.org/pub/scm/linux/kernel/git/konrad/xen:
xen: mark local pages as FOREIGN in the m2p_override
xen/setup: filter APERFMPERF cpuid feature out
xen/balloon: Subtract from xen_released_pages the count that is populated.
xen/pci: Check for PCI bridge before using it.
xen/events: Add WARN_ON when quick lookup found invalid type.
xen/hvc: Check HVM_PARAM_CONSOLE_[EVTCHN|PFN] for correctness.
xen/hvc: Fix error cases around HVM_PARAM_CONSOLE_PFN
xen/hvc: Collapse error logic.
Diffstat (limited to 'drivers')
-rw-r--r-- | drivers/tty/hvc/hvc_xen.c | 31 | ||||
-rw-r--r-- | drivers/xen/events.c | 9 | ||||
-rw-r--r-- | drivers/xen/pci.c | 2 |
3 files changed, 27 insertions, 15 deletions
diff --git a/drivers/tty/hvc/hvc_xen.c b/drivers/tty/hvc/hvc_xen.c index d3d91dae065..944eaeb8e0c 100644 --- a/drivers/tty/hvc/hvc_xen.c +++ b/drivers/tty/hvc/hvc_xen.c | |||
@@ -214,24 +214,24 @@ static int xen_hvm_console_init(void) | |||
214 | /* already configured */ | 214 | /* already configured */ |
215 | if (info->intf != NULL) | 215 | if (info->intf != NULL) |
216 | return 0; | 216 | return 0; |
217 | 217 | /* | |
218 | * If the toolstack (or the hypervisor) hasn't set these values, the | ||
219 | * default value is 0. Even though mfn = 0 and evtchn = 0 are | ||
220 | * theoretically correct values, in practice they never are and they | ||
221 | * mean that a legacy toolstack hasn't initialized the pv console correctly. | ||
222 | */ | ||
218 | r = hvm_get_parameter(HVM_PARAM_CONSOLE_EVTCHN, &v); | 223 | r = hvm_get_parameter(HVM_PARAM_CONSOLE_EVTCHN, &v); |
219 | if (r < 0) { | 224 | if (r < 0 || v == 0) |
220 | kfree(info); | 225 | goto err; |
221 | return -ENODEV; | ||
222 | } | ||
223 | info->evtchn = v; | 226 | info->evtchn = v; |
224 | hvm_get_parameter(HVM_PARAM_CONSOLE_PFN, &v); | 227 | v = 0; |
225 | if (r < 0) { | 228 | r = hvm_get_parameter(HVM_PARAM_CONSOLE_PFN, &v); |
226 | kfree(info); | 229 | if (r < 0 || v == 0) |
227 | return -ENODEV; | 230 | goto err; |
228 | } | ||
229 | mfn = v; | 231 | mfn = v; |
230 | info->intf = ioremap(mfn << PAGE_SHIFT, PAGE_SIZE); | 232 | info->intf = ioremap(mfn << PAGE_SHIFT, PAGE_SIZE); |
231 | if (info->intf == NULL) { | 233 | if (info->intf == NULL) |
232 | kfree(info); | 234 | goto err; |
233 | return -ENODEV; | ||
234 | } | ||
235 | info->vtermno = HVC_COOKIE; | 235 | info->vtermno = HVC_COOKIE; |
236 | 236 | ||
237 | spin_lock(&xencons_lock); | 237 | spin_lock(&xencons_lock); |
@@ -239,6 +239,9 @@ static int xen_hvm_console_init(void) | |||
239 | spin_unlock(&xencons_lock); | 239 | spin_unlock(&xencons_lock); |
240 | 240 | ||
241 | return 0; | 241 | return 0; |
242 | err: | ||
243 | kfree(info); | ||
244 | return -ENODEV; | ||
242 | } | 245 | } |
243 | 246 | ||
244 | static int xen_pv_console_init(void) | 247 | static int xen_pv_console_init(void) |
diff --git a/drivers/xen/events.c b/drivers/xen/events.c index 6908e4ce2a0..7595581d032 100644 --- a/drivers/xen/events.c +++ b/drivers/xen/events.c | |||
@@ -827,6 +827,9 @@ int bind_evtchn_to_irq(unsigned int evtchn) | |||
827 | handle_edge_irq, "event"); | 827 | handle_edge_irq, "event"); |
828 | 828 | ||
829 | xen_irq_info_evtchn_init(irq, evtchn); | 829 | xen_irq_info_evtchn_init(irq, evtchn); |
830 | } else { | ||
831 | struct irq_info *info = info_for_irq(irq); | ||
832 | WARN_ON(info == NULL || info->type != IRQT_EVTCHN); | ||
830 | } | 833 | } |
831 | 834 | ||
832 | out: | 835 | out: |
@@ -862,6 +865,9 @@ static int bind_ipi_to_irq(unsigned int ipi, unsigned int cpu) | |||
862 | xen_irq_info_ipi_init(cpu, irq, evtchn, ipi); | 865 | xen_irq_info_ipi_init(cpu, irq, evtchn, ipi); |
863 | 866 | ||
864 | bind_evtchn_to_cpu(evtchn, cpu); | 867 | bind_evtchn_to_cpu(evtchn, cpu); |
868 | } else { | ||
869 | struct irq_info *info = info_for_irq(irq); | ||
870 | WARN_ON(info == NULL || info->type != IRQT_IPI); | ||
865 | } | 871 | } |
866 | 872 | ||
867 | out: | 873 | out: |
@@ -939,6 +945,9 @@ int bind_virq_to_irq(unsigned int virq, unsigned int cpu) | |||
939 | xen_irq_info_virq_init(cpu, irq, evtchn, virq); | 945 | xen_irq_info_virq_init(cpu, irq, evtchn, virq); |
940 | 946 | ||
941 | bind_evtchn_to_cpu(evtchn, cpu); | 947 | bind_evtchn_to_cpu(evtchn, cpu); |
948 | } else { | ||
949 | struct irq_info *info = info_for_irq(irq); | ||
950 | WARN_ON(info == NULL || info->type != IRQT_VIRQ); | ||
942 | } | 951 | } |
943 | 952 | ||
944 | out: | 953 | out: |
diff --git a/drivers/xen/pci.c b/drivers/xen/pci.c index b84bf0b6cc3..18fff88254e 100644 --- a/drivers/xen/pci.c +++ b/drivers/xen/pci.c | |||
@@ -59,7 +59,7 @@ static int xen_add_device(struct device *dev) | |||
59 | 59 | ||
60 | #ifdef CONFIG_ACPI | 60 | #ifdef CONFIG_ACPI |
61 | handle = DEVICE_ACPI_HANDLE(&pci_dev->dev); | 61 | handle = DEVICE_ACPI_HANDLE(&pci_dev->dev); |
62 | if (!handle) | 62 | if (!handle && pci_dev->bus->bridge) |
63 | handle = DEVICE_ACPI_HANDLE(pci_dev->bus->bridge); | 63 | handle = DEVICE_ACPI_HANDLE(pci_dev->bus->bridge); |
64 | #ifdef CONFIG_PCI_IOV | 64 | #ifdef CONFIG_PCI_IOV |
65 | if (!handle && pci_dev->is_virtfn) | 65 | if (!handle && pci_dev->is_virtfn) |