File tree Expand file tree Collapse file tree 3 files changed +17
-4
lines changed Expand file tree Collapse file tree 3 files changed +17
-4
lines changed Original file line number Diff line number Diff line change 23
23
#define ACPI_MADT_GICC_LENGTH \
24
24
(acpi_gbl_FADT.header.revision < 6 ? 76 : 80)
25
25
26
- #define BAD_MADT_GICC_ENTRY (entry , end ) \
27
- (!(entry) || (unsigned long)( entry) + sizeof(*(entry)) > (end) || \
28
- (entry)->header.length != ACPI_MADT_GICC_LENGTH)
26
+ #define BAD_MADT_GICC_ENTRY (entry , end ) \
27
+ (!(entry) || (entry)->header.length != ACPI_MADT_GICC_LENGTH || \
28
+ (unsigned long) (entry) + ACPI_MADT_GICC_LENGTH > (end) )
29
29
30
30
/* Basic configuration for ACPI */
31
31
#ifdef CONFIG_ACPI
Original file line number Diff line number Diff line change @@ -191,8 +191,10 @@ struct pci_bus *pci_acpi_scan_root(struct acpi_pci_root *root)
191
191
return NULL ;
192
192
193
193
root_ops = kzalloc_node (sizeof (* root_ops ), GFP_KERNEL , node );
194
- if (!root_ops )
194
+ if (!root_ops ) {
195
+ kfree (ri );
195
196
return NULL ;
197
+ }
196
198
197
199
ri -> cfg = pci_acpi_setup_ecam_mapping (root );
198
200
if (!ri -> cfg ) {
Original file line number Diff line number Diff line change @@ -29,6 +29,17 @@ static int arm_pmu_acpi_register_irq(int cpu)
29
29
return - EINVAL ;
30
30
31
31
gsi = gicc -> performance_interrupt ;
32
+
33
+ /*
34
+ * Per the ACPI spec, the MADT cannot describe a PMU that doesn't
35
+ * have an interrupt. QEMU advertises this by using a GSI of zero,
36
+ * which is not known to be valid on any hardware despite being
37
+ * valid per the spec. Take the pragmatic approach and reject a
38
+ * GSI of zero for now.
39
+ */
40
+ if (!gsi )
41
+ return 0 ;
42
+
32
43
if (gicc -> flags & ACPI_MADT_PERFORMANCE_IRQ_MODE )
33
44
trigger = ACPI_EDGE_SENSITIVE ;
34
45
else
You can’t perform that action at this time.
0 commit comments