Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > linux.kernel > #1416954 > unrolled thread
| Started by | Rui Wang <rui.y.wang@intel.com> |
|---|---|
| First post | 2016-06-08 09:20 +0200 |
| Last post | 2016-06-10 14:50 +0200 |
| Articles | 4 — 2 participants |
Back to article view | Back to linux.kernel
This discussion starts older than the indexed window; earlier articles aren't shown. The article labeled Started by
below is the oldest one visible, not the original post.
[PATCH V2 2/3] x86/ioapic: Fix wrong pointers in ioapic_setup_resources() Rui Wang <rui.y.wang@intel.com> - 2016-06-08 09:20 +0200
[tip:x86/urgent] x86/ioapic: Fix wrong pointers in ioapic_setup_resources() tip-bot for Rui Wang <tipbot@zytor.com> - 2016-06-10 11:50 +0200
[tip:x86/apic] x86/ioapic: Fix incorrect pointers in ioapic_setup_resources() tip-bot for Rui Wang <tipbot@zytor.com> - 2016-06-10 14:10 +0200
[tip:x86/urgent] x86/ioapic: Fix incorrect pointers in ioapic_setup_resources() tip-bot for Rui Wang <tipbot@zytor.com> - 2016-06-10 14:50 +0200
| From | Rui Wang <rui.y.wang@intel.com> |
|---|---|
| Date | 2016-06-08 09:20 +0200 |
| Subject | [PATCH V2 2/3] x86/ioapic: Fix wrong pointers in ioapic_setup_resources() |
| Message-ID | <rHFWp-5tG-23@gated-at.bofh.it> |
On a 4-socket brickland, hot-removing one ioapic is fine. Hot-removing
the 2nd one causes panic in mp_unregister_ioapic() while calling
release_resource(). It is because the iomem_res pointer has already been
released when removing the first ioapic.
Fix it by assigning the correct pointers to ioapics[i].iomem_res in
ioapic_setup_resources().
To explain the use of &res[num] here: res is assigned to ioapic_resources,
and later in ioapic_insert_resources() we do
struct resource *r = ioapic_resources;
for_each_ioapic(i) {
insert_resource(&iomem_resource, r);
r++;
}
Here r is treated as an arry of struct resource, and the r++ ensures that
each element of the array is inserted separately. Thus we should call
release_resouce() on each element at &res[num].
Signed-off-by: Rui Wang <rui.y.wang@intel.com>
---
arch/x86/kernel/apic/io_apic.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/arch/x86/kernel/apic/io_apic.c b/arch/x86/kernel/apic/io_apic.c
index 84e33ff..446702e 100644
--- a/arch/x86/kernel/apic/io_apic.c
+++ b/arch/x86/kernel/apic/io_apic.c
@@ -2588,8 +2588,8 @@ static struct resource * __init ioapic_setup_resources(void)
res[num].flags = IORESOURCE_MEM | IORESOURCE_BUSY;
snprintf(mem, IOAPIC_RESOURCE_NAME_SIZE, "IOAPIC %u", i);
mem += IOAPIC_RESOURCE_NAME_SIZE;
+ ioapics[i].iomem_res = &res[num];
num++;
- ioapics[i].iomem_res = res;
}
ioapic_resources = res;
--
1.8.3.1
[toc] | [next] | [standalone]
| From | tip-bot for Rui Wang <tipbot@zytor.com> |
|---|---|
| Date | 2016-06-10 11:50 +0200 |
| Subject | [tip:x86/urgent] x86/ioapic: Fix wrong pointers in ioapic_setup_resources() |
| Message-ID | <rIreF-2SG-7@gated-at.bofh.it> |
| In reply to | #1416954 |
Commit-ID: 0e1c672041819474181a41ce07e4734750789170
Gitweb: http://git.kernel.org/tip/0e1c672041819474181a41ce07e4734750789170
Author: Rui Wang <rui.y.wang@intel.com>
AuthorDate: Wed, 8 Jun 2016 14:59:52 +0800
Committer: Thomas Gleixner <tglx@linutronix.de>
CommitDate: Fri, 10 Jun 2016 11:41:47 +0200
x86/ioapic: Fix wrong pointers in ioapic_setup_resources()
On a 4-socket brickland, hot-removing one ioapic is fine. Hot-removing
the 2nd one causes panic in mp_unregister_ioapic() while calling
release_resource(). It is because the iomem_res pointer has already been
released when removing the first ioapic.
To explain the use of &res[num] here: res is assigned to ioapic_resources,
and later in ioapic_insert_resources() we do
struct resource *r = ioapic_resources;
for_each_ioapic(i) {
insert_resource(&iomem_resource, r);
r++;
}
Here r is treated as an arry of struct resource, and the r++ ensures that
each element of the array is inserted separately. Thus we should call
release_resouce() on each element at &res[num].
Fix it by assigning the correct pointers to ioapics[i].iomem_res in
ioapic_setup_resources().
Signed-off-by: Rui Wang <rui.y.wang@intel.com>
Cc: tony.luck@intel.com
Cc: linux-pci@vger.kernel.org
Cc: rjw@rjwysocki.net
Cc: linux-acpi@vger.kernel.org
Cc: bhelgaas@google.com
Link: http://lkml.kernel.org/r/1465369193-4816-3-git-send-email-rui.y.wang@intel.com
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
---
arch/x86/kernel/apic/io_apic.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/arch/x86/kernel/apic/io_apic.c b/arch/x86/kernel/apic/io_apic.c
index 84e33ff..446702e 100644
--- a/arch/x86/kernel/apic/io_apic.c
+++ b/arch/x86/kernel/apic/io_apic.c
@@ -2588,8 +2588,8 @@ static struct resource * __init ioapic_setup_resources(void)
res[num].flags = IORESOURCE_MEM | IORESOURCE_BUSY;
snprintf(mem, IOAPIC_RESOURCE_NAME_SIZE, "IOAPIC %u", i);
mem += IOAPIC_RESOURCE_NAME_SIZE;
+ ioapics[i].iomem_res = &res[num];
num++;
- ioapics[i].iomem_res = res;
}
ioapic_resources = res;
[toc] | [prev] | [next] | [standalone]
| From | tip-bot for Rui Wang <tipbot@zytor.com> |
|---|---|
| Date | 2016-06-10 14:10 +0200 |
| Subject | [tip:x86/apic] x86/ioapic: Fix incorrect pointers in ioapic_setup_resources() |
| Message-ID | <rItqa-4nJ-13@gated-at.bofh.it> |
| In reply to | #1416954 |
Commit-ID: 3d98217b6726e0c342ac6363346bd9751fd61ec9
Gitweb: http://git.kernel.org/tip/3d98217b6726e0c342ac6363346bd9751fd61ec9
Author: Rui Wang <rui.y.wang@intel.com>
AuthorDate: Wed, 8 Jun 2016 14:59:52 +0800
Committer: Ingo Molnar <mingo@kernel.org>
CommitDate: Fri, 10 Jun 2016 13:55:03 +0200
x86/ioapic: Fix incorrect pointers in ioapic_setup_resources()
On a 4-socket Brickland system, hot-removing one ioapic is fine.
Hot-removing the 2nd one causes panic in mp_unregister_ioapic()
while calling release_resource().
It is because the iomem_res pointer has already been released
when removing the first ioapic.
To explain the use of &res[num] here: res is assigned to ioapic_resources,
and later in ioapic_insert_resources() we do:
struct resource *r = ioapic_resources;
for_each_ioapic(i) {
insert_resource(&iomem_resource, r);
r++;
}
Here 'r' is treated as an arry of 'struct resource', and the r++ ensures
that each element of the array is inserted separately. Thus we should call
release_resouce() on each element at &res[num].
Fix it by assigning the correct pointers to ioapics[i].iomem_res in
ioapic_setup_resources().
Signed-off-by: Rui Wang <rui.y.wang@intel.com>
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Cc: tony.luck@intel.com
Cc: linux-pci@vger.kernel.org
Cc: rjw@rjwysocki.net
Cc: linux-acpi@vger.kernel.org
Cc: bhelgaas@google.com
Link: http://lkml.kernel.org/r/1465369193-4816-3-git-send-email-rui.y.wang@intel.com
Signed-off-by: Ingo Molnar <mingo@kernel.org>
Signed-off-by: Ingo Molnar <mingo@kernel.org>
---
arch/x86/kernel/apic/io_apic.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/arch/x86/kernel/apic/io_apic.c b/arch/x86/kernel/apic/io_apic.c
index 84e33ff..446702e 100644
--- a/arch/x86/kernel/apic/io_apic.c
+++ b/arch/x86/kernel/apic/io_apic.c
@@ -2588,8 +2588,8 @@ static struct resource * __init ioapic_setup_resources(void)
res[num].flags = IORESOURCE_MEM | IORESOURCE_BUSY;
snprintf(mem, IOAPIC_RESOURCE_NAME_SIZE, "IOAPIC %u", i);
mem += IOAPIC_RESOURCE_NAME_SIZE;
+ ioapics[i].iomem_res = &res[num];
num++;
- ioapics[i].iomem_res = res;
}
ioapic_resources = res;
[toc] | [prev] | [next] | [standalone]
| From | tip-bot for Rui Wang <tipbot@zytor.com> |
|---|---|
| Date | 2016-06-10 14:50 +0200 |
| Subject | [tip:x86/urgent] x86/ioapic: Fix incorrect pointers in ioapic_setup_resources() |
| Message-ID | <rIu2R-4CJ-9@gated-at.bofh.it> |
| In reply to | #1416954 |
Commit-ID: 9d98bcec731756b8688b59ec998707924d716d7b
Gitweb: http://git.kernel.org/tip/9d98bcec731756b8688b59ec998707924d716d7b
Author: Rui Wang <rui.y.wang@intel.com>
AuthorDate: Wed, 8 Jun 2016 14:59:52 +0800
Committer: Ingo Molnar <mingo@kernel.org>
CommitDate: Fri, 10 Jun 2016 14:45:54 +0200
x86/ioapic: Fix incorrect pointers in ioapic_setup_resources()
On a 4-socket Brickland system, hot-removing one ioapic is fine.
Hot-removing the 2nd one causes panic in mp_unregister_ioapic()
while calling release_resource().
It is because the iomem_res pointer has already been released
when removing the first ioapic.
To explain the use of &res[num] here: res is assigned to ioapic_resources,
and later in ioapic_insert_resources() we do:
struct resource *r = ioapic_resources;
for_each_ioapic(i) {
insert_resource(&iomem_resource, r);
r++;
}
Here 'r' is treated as an arry of 'struct resource', and the r++ ensures
that each element of the array is inserted separately. Thus we should call
release_resouce() on each element at &res[num].
Fix it by assigning the correct pointers to ioapics[i].iomem_res in
ioapic_setup_resources().
Signed-off-by: Rui Wang <rui.y.wang@intel.com>
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Cc: tony.luck@intel.com
Cc: linux-pci@vger.kernel.org
Cc: rjw@rjwysocki.net
Cc: linux-acpi@vger.kernel.org
Cc: bhelgaas@google.com
Link: http://lkml.kernel.org/r/1465369193-4816-3-git-send-email-rui.y.wang@intel.com
Signed-off-by: Ingo Molnar <mingo@kernel.org>
---
arch/x86/kernel/apic/io_apic.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/arch/x86/kernel/apic/io_apic.c b/arch/x86/kernel/apic/io_apic.c
index 84e33ff..446702e 100644
--- a/arch/x86/kernel/apic/io_apic.c
+++ b/arch/x86/kernel/apic/io_apic.c
@@ -2588,8 +2588,8 @@ static struct resource * __init ioapic_setup_resources(void)
res[num].flags = IORESOURCE_MEM | IORESOURCE_BUSY;
snprintf(mem, IOAPIC_RESOURCE_NAME_SIZE, "IOAPIC %u", i);
mem += IOAPIC_RESOURCE_NAME_SIZE;
+ ioapics[i].iomem_res = &res[num];
num++;
- ioapics[i].iomem_res = res;
}
ioapic_resources = res;
[toc] | [prev] | [standalone]
Back to top | Article view | linux.kernel
csiph-web