[tip:x86/pti] selftests/x86/mpx: Fix incorrect bounds with old _sigfault

2018-02-14 Thread tip-bot for Rui Wang
Commit-ID: 961888b1d76d84efc66a8f5604b06ac12ac2f978 Gitweb: https://git.kernel.org/tip/961888b1d76d84efc66a8f5604b06ac12ac2f978 Author: Rui Wang AuthorDate: Mon, 18 Dec 2017 16:34:10 +0800 Committer: Ingo Molnar CommitDate: Thu, 15 Feb 2018 01:15:52 +0100 selftests/x86/mpx: Fix

[tip:x86/pti] selftests/x86/mpx: Fix incorrect bounds with old _sigfault

2018-02-13 Thread tip-bot for Rui Wang
Commit-ID: d101567aec6653cc372af3b9b957299fee06cca8 Gitweb: https://git.kernel.org/tip/d101567aec6653cc372af3b9b957299fee06cca8 Author: Rui Wang AuthorDate: Mon, 18 Dec 2017 16:34:10 +0800 Committer: Ingo Molnar CommitDate: Tue, 13 Feb 2018 19:20:05 +0100 selftests/x86/mpx: Fix

[PATCH] x86/mpx/selftests: Fix wrong bounds with old _sigfault

2017-12-18 Thread Rui Wang
adow bounds for register 0 Fix it by using the correct offset of _lower/_upper in _sigfault. RHEL needs this patch to work. Fixes: e754aedc26ef ("x86/mpx, selftests: Add MPX self test") Signed-off-by: Rui Wang --- tools/testing/selftests/x86/mpx-mini-test.c | 27 ++

[tip:x86/urgent] x86/PCI: Implement pcibios_release_device to release IRQ from IOAPIC

2017-03-01 Thread tip-bot for Rui Wang
Commit-ID: 153654dbe595a68845ba14d5b0bfe299fa6a7e99 Gitweb: http://git.kernel.org/tip/153654dbe595a68845ba14d5b0bfe299fa6a7e99 Author: Rui Wang AuthorDate: Tue, 28 Feb 2017 21:34:28 +0800 Committer: Thomas Gleixner CommitDate: Wed, 1 Mar 2017 10:51:41 +0100 x86/PCI: Implement

[tip:x86/urgent] x86/ioapic: Split IOAPIC hot-removal into two steps

2017-03-01 Thread tip-bot for Rui Wang
Commit-ID: f2ae5da726172fcf82f7be801489dd585f6a38eb Gitweb: http://git.kernel.org/tip/f2ae5da726172fcf82f7be801489dd585f6a38eb Author: Rui Wang AuthorDate: Tue, 28 Feb 2017 21:34:29 +0800 Committer: Thomas Gleixner CommitDate: Wed, 1 Mar 2017 10:51:41 +0100 x86/ioapic: Split IOAPIC

[PATCH v2 0/2] Improvement on ioapic hotplug

2017-02-28 Thread Rui Wang
problem. IOAPIC hot-removal works correctly after applying this patchset. v2: 0001 Fixed a missing stub function causing compiling error on i386 0002 Fixed a typo on the subject line. Rui Wang (2): x86/PCI: Implement pcibios_release_device to release IRQ from IOAPIC x86/ioapic: Split IOA

[PATCH v2 2/2] x86/ioapic: Split IOAPIC hot-removal into two steps

2017-02-28 Thread Rui Wang
pcibios_release_device() of every PCI device under the same parent root bus, before the IOAPIC is hot-removed. This makes it possible for the IOAPIC to free any IRQ resource previously unable to get freed. v2: Fixed compiling error on i386 (missing stub of pci_ioapic_remove()) Signed-off-by: Rui Wang --- drivers

[PATCH v2 1/2] x86/PCI: Implement pcibios_release_device to release IRQ from IOAPIC

2017-02-28 Thread Rui Wang
a typo (pcibios_release_device) Signed-off-by: Rui Wang --- arch/x86/pci/common.c | 9 + 1 file changed, 9 insertions(+) diff --git a/arch/x86/pci/common.c b/arch/x86/pci/common.c index 0cb52ae..190e718 100644 --- a/arch/x86/pci/common.c +++ b/arch/x86/pci/common.c @@ -735,6 +735,15 @@ void

[PATCH 1/2] x86/PCI: Implement pci_release_device to release IRQ from IOAPIC

2017-02-27 Thread Rui Wang
f the PCI root bus, so we have the chance to hook every PCI device's pcibios_release_device(), before we remove the IOAPIC. This patch implements pcibios_release_device() on x86 to release any IRQ not released by the driver, so that the IOAPIC can then be safely hot-removed. Signed-off-b

[PATCH 0/2] Improvement on ioapic hotplug

2017-02-27 Thread Rui Wang
problem. IOAPIC hot-removal works correctly after applying this patchset. Rui Wang (2): x86/PCI: Implement pci_release_device to release IRQ from IOAPIC x86/ioapic: Split IOAPIC hot-removal into two steps arch/x86/pci/common.c | 9 + drivers/acpi/internal.h | 1 + drivers/acpi/

[PATCH 2/2] x86/ioapic: Split IOAPIC hot-removal into two steps

2017-02-27 Thread Rui Wang
pcibios_release_device() of every PCI device under the same parent root bus, before the IOAPIC is hot-removed. This makes it possible for the IOAPIC to free any IRQ resource previously unable to get freed. Signed-off-by: Rui Wang --- drivers/acpi/internal.h | 1 + drivers/acpi/ioapic.c | 22

[tip:x86/apic] x86/ioapic: Ignore root bridges without a companion ACPI device

2016-09-10 Thread tip-bot for Rui Wang
Commit-ID: d9c149d6ce1a94de578a4e323f6881fcb6b986ab Gitweb: http://git.kernel.org/tip/d9c149d6ce1a94de578a4e323f6881fcb6b986ab Author: Rui Wang AuthorDate: Sat, 10 Sep 2016 23:40:45 +0800 Committer: Ingo Molnar CommitDate: Sat, 10 Sep 2016 20:30:31 +0200 x86/ioapic: Ignore root

[PATCH] x86/ioapic: Ignore root bridges without a companion ACPI device

2016-09-10 Thread Rui Wang
Some PCI root bridges don't have a corresponding ACPI device. This can be the case on some old platforms. Don't call acpi_ioapic_add() on these bridges because they can't support ioapic hotplug. v2: Per Boris's review, removed the unnecessary local var; refined comment Sig

Re: 584c5c422f6c ("x86/ioapic: Support hot-removal of IOAPICs present during boot")

2016-09-10 Thread Rui Wang
On Sat, Sep 10, 2016 10:31 PM, Borislav Petkov wrote: > > On Sat, Sep 10, 2016 at 09:11:30PM +0800, Rui Wang wrote: > > Thanks for the analysis. Looks like acpi_gbl_root_node == 0. It is > > Is ACPI_HANDLE(root_bus->bridge) == ACPI_ROOT_OBJECT? > > Because this is wha

Re: 584c5c422f6c ("x86/ioapic: Support hot-removal of IOAPICs present during boot")

2016-09-10 Thread Rui Wang
On Sat, Sep 10, 2016 7:28 PM, Borislav Petkov wrote: > > 8143ef50 : > 8143ef50: e8 6b 16 42 00 callq 818605c0 > <__fentry__> > 8143ef55: 55 push %rbp > 8143ef56: 48 89 e5mov%rsp,%rbp > f

584c5c422f6c ("x86/ioapic: Support hot-removal of IOAPICs present during boot")

2016-09-09 Thread Rui Wang
On Saturday, September 10, 2016 6:07 AM, Borislav Petkov wrote: > > Hi, > > commit in $Subject from tip breaks booting on my SNB test box, it freezes > somewhere very early during boot. When I revert the aforementioned > commit ontop of Linus' master + tip/master from today, it boots fine. > > A

[tip:x86/apic] x86/ioapic: Support hot-removal of IOAPICs present during boot

2016-08-18 Thread tip-bot for Rui Wang
Commit-ID: 584c5c422f6c749ced1e0bc3c6837f650f64e1e1 Gitweb: http://git.kernel.org/tip/584c5c422f6c749ced1e0bc3c6837f650f64e1e1 Author: Rui Wang AuthorDate: Wed, 17 Aug 2016 16:00:34 +0800 Committer: Ingo Molnar CommitDate: Thu, 18 Aug 2016 11:45:18 +0200 x86/ioapic: Support hot

[tip:x86/apic] x86/ioapic: Fix lost IOAPIC resource after hot-removal and hotadd

2016-08-18 Thread tip-bot for Rui Wang
Commit-ID: 162b83bd5f1d7124e21da78bcf2685b9824d9ef0 Gitweb: http://git.kernel.org/tip/162b83bd5f1d7124e21da78bcf2685b9824d9ef0 Author: Rui Wang AuthorDate: Wed, 17 Aug 2016 16:00:36 +0800 Committer: Ingo Molnar CommitDate: Thu, 18 Aug 2016 11:45:18 +0200 x86/ioapic: Fix lost IOAPIC

[tip:x86/apic] x86/ioapic: Fix setup_res() failing to get resource

2016-08-18 Thread tip-bot for Rui Wang
Commit-ID: 6ab7eba5db93c11d61f6f7fbe21edbc875b26c1a Gitweb: http://git.kernel.org/tip/6ab7eba5db93c11d61f6f7fbe21edbc875b26c1a Author: Rui Wang AuthorDate: Wed, 17 Aug 2016 16:00:35 +0800 Committer: Ingo Molnar CommitDate: Thu, 18 Aug 2016 11:45:18 +0200 x86/ioapic: Fix setup_res

[tip:x86/apic] x86/ioapic: Fix IOAPIC failing to request resource

2016-08-18 Thread tip-bot for Rui Wang
Commit-ID: 624cad9d2907a0788b56e3ca664c5d7d02645ed4 Gitweb: http://git.kernel.org/tip/624cad9d2907a0788b56e3ca664c5d7d02645ed4 Author: Rui Wang AuthorDate: Wed, 17 Aug 2016 16:00:37 +0800 Committer: Ingo Molnar CommitDate: Thu, 18 Aug 2016 11:45:19 +0200 x86/ioapic: Fix IOAPIC failing

[tip:x86/apic] x86/ioapic: Change prototype of acpi_ioapic_add()

2016-08-18 Thread tip-bot for Rui Wang
Commit-ID: fe7bd58f5d25d5d655b1da4a084cc4ef6f085fee Gitweb: http://git.kernel.org/tip/fe7bd58f5d25d5d655b1da4a084cc4ef6f085fee Author: Rui Wang AuthorDate: Wed, 17 Aug 2016 16:00:33 +0800 Committer: Ingo Molnar CommitDate: Thu, 18 Aug 2016 11:45:18 +0200 x86/ioapic: Change prototype

[PATCH v4 4/5] x86/ioapic: Fix lost IOAPIC resource after hot-removal and hotadd

2016-08-17 Thread Rui Wang
appears in "_CRS" of each IOAPIC device. Both ranges should be claimed from /proc/iomem for exclusive use. Signed-off-by: Rui Wang --- drivers/acpi/ioapic.c | 36 1 file changed, 20 insertions(+), 16 deletions(-) diff --git a/drivers/acpi/ioapic.c

[PATCH v4 1/5] x86/ioapic: Change prototype of acpi_ioapic_add()

2016-08-17 Thread Rui Wang
Change the argument of acpi_ioapic_add() to a generic ACPI handle, and move its prototype from drivers/acpi/internal.h to include/linux/acpi.h so that it can be called from outside the pci_root driver. Signed-off-by: Rui Wang --- drivers/acpi/internal.h | 2 -- drivers/acpi/ioapic.c | 6

[PATCH v4 2/5] x86/ioapic: Support hot-removal of IOAPICs present during boot

2016-08-17 Thread Rui Wang
IOAPICs present during system boot aren't added to ioapic_list, thus are unable to be hot-removed. Fix it by calling acpi_ioapic_add() during root bus enumeration. Signed-off-by: Rui Wang Acked-by: Bjorn Helgaas --- drivers/acpi/pci_root.c | 10 ++ drivers/pci/setup-bus.c | 5 +++

[PATCH v4 5/5] x86/ioapic: Fix ioapic failing to request resource

2016-08-17 Thread Rui Wang
ecf). Fix it by using insert_resource() which can request resources by taking the conflicting resource as the parent. Signed-off-by: Rui Wang --- drivers/acpi/ioapic.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/drivers/acpi/ioapic.c b/drivers/acpi/ioapic.c inde

[PATCH v4 0/5] Fixing a set of bugs for ioapic hotplug

2016-08-17 Thread Rui Wang
ch so they wouldn't obscure the meat of the change, i.e., the addition of calls to acpi_ioapic_add()." * Removed acpi_ioapic_add() as an exported symbol. * Fixed some typos, and s/acpi/ACPI/, s/ioapic/IOAPIC/ throughout. * Fixed a warning from 0-day testing. Rui Wang (5): x8

[PATCH v4 3/5] x86/ioapic: Fix setup_res() failing to get resource

2016-08-17 Thread Rui Wang
acpi_dev_filter_resource_type() returns 0 on success, and 1 on failure. A return value of zero means there's a matching resource, so we should continue within setup_res() to get the resource. Signed-off-by: Rui Wang --- drivers/acpi/ioapic.c | 2 +- 1 file changed, 1 insertion(+), 1 del

[PATCH v3 0/5] Fixing a set of bugs for ioapic hotplug

2016-08-16 Thread Rui Wang
On Wed, Aug 17, 2016 8:36 AM Rafael J. Wysocki wrote: > On Wednesday, August 10, 2016 12:01:53 PM Rui Wang wrote: > > A set of patches fixing bugs found while testing IOAPIC hotplug. > > This should have been posted to the x...@kernel.org list too for the benefit > of the mai

[PATCH v3 4/5] x86/ioapic: Fix lost IOAPIC resource after hot-removal and hotadd

2016-08-09 Thread Rui Wang
appears in "_CRS" of each IOAPIC device. Both ranges should be claimed from /proc/iomem for exclusive use. Signed-off-by: Rui Wang --- drivers/acpi/ioapic.c | 36 1 file changed, 20 insertions(+), 16 deletions(-) diff --git a/drivers/acpi/ioapic.c

[PATCH v3 2/5] x86/ioapic: Support hot-removal of IOAPICs present during boot

2016-08-09 Thread Rui Wang
IOAPICs present during system boot aren't added to ioapic_list, thus are unable to be hot-removed. Fix it by calling acpi_ioapic_add() during root bus enumeration. Signed-off-by: Rui Wang --- drivers/acpi/pci_root.c | 10 ++ drivers/pci/setup-bus.c | 5 - 2 files change

[PATCH v3 1/5] x86/ioapic: Change prototype of acpi_ioapic_add()

2016-08-09 Thread Rui Wang
Change the argument of acpi_ioapic_add() to a generic ACPI handle, and move its prototype from drivers/acpi/internal.h to include/linux/acpi.h so that it can be called from outside the pci_root driver. Signed-off-by: Rui Wang --- drivers/acpi/internal.h | 2 -- drivers/acpi/ioapic.c | 6

[PATCH v3 0/5] Fixing a set of bugs for ioapic hotplug

2016-08-09 Thread Rui Wang
I/, s/ioapic/IOAPIC/ throughout. * Fixed a warning from 0-day testing. Rui Wang (5): x86/ioapic: Change prototype of acpi_ioapic_add() x86/ioapic: Support hot-removal of IOAPICs present during boot x86/ioapic: Fix setup_res() failing to get resource x86/ioapic: Fix lost IOAPIC resource af

[PATCH v3 3/5] x86/ioapic: Fix setup_res() failing to get resource

2016-08-09 Thread Rui Wang
acpi_dev_filter_resource_type() returns 0 on success, and 1 on failure. A return value of zero means there's a matching resource, so we should continue within setup_res() to get the resource. Signed-off-by: Rui Wang --- drivers/acpi/ioapic.c | 2 +- 1 file changed, 1 insertion(+), 1 del

[PATCH v3 5/5] x86/ioapic: Fix ioapic failing to request resource

2016-08-09 Thread Rui Wang
ecf). Fix it by using insert_resource() which can request resources by taking the conflicting resource as the parent. Signed-off-by: Rui Wang --- drivers/acpi/ioapic.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/drivers/acpi/ioapic.c b/drivers/acpi/ioapic.c inde

Re: [PATCH V5 1/3] x86/ioapic: Support hot-removal of IOAPICs present during boot

2016-08-08 Thread Rui Wang
On Tuesday, Aug 9, 2016 4:23 AM, Bjorn Helgaas wrote: > On Sun, Jun 26, 2016 at 11:44:57AM +0800, Rui Wang wrote: > > v5: Remove #ifdef CONFIG_X86 from setup-bus.c, making it neutral to > archs. > > v4: Add comments explaining when to call acpi_ioapic_add(). > > v3: Prev

[PATCH v2 0/5] Fixing a set of bugs for ioapic hotplug

2016-07-27 Thread Rui Wang
eat of the change, i.e., the addition of calls to acpi_ioapic_add()." * Removed acpi_ioapic_add() as an exported symbol. * Fixed some typos, and s/acpi/ACPI/, s/ioapic/IOAPIC/ throughout. * Fixed a warning from 0-day testing. Rui Wang (5): x86/ioapic: Change prototype of acpi_ioapic_add

[PATCH v2 2/5] x86/ioapic: Support hot-removal of IOAPICs present during boot

2016-07-27 Thread Rui Wang
IOAPICs present during system boot aren't added to ioapic_list, thus are unable to be hot-removed. Fix it by calling acpi_ioapic_add() during root bus enumeration. Signed-off-by: Rui Wang --- drivers/acpi/pci_root.c | 10 ++ drivers/pci/setup-bus.c | 5 - 2 files change

[PATCH v2 1/5] x86/ioapic: Change prototype of acpi_ioapic_add()

2016-07-27 Thread Rui Wang
Change the argument of acpi_ioapic_add() to a generic ACPI handle, and move its prototype from drivers/acpi/internal.h to include/linux/acpi.h so that it can be called from outside the pci_root driver. Signed-off-by: Rui Wang --- drivers/acpi/internal.h | 2 -- drivers/acpi/ioapic.c | 6

[PATCH v2 5/5] x86/ioapic: Fix ioapic failing to request resource

2016-07-27 Thread Rui Wang
ecf). Fix it by using insert_resource() which can request resources by taking the conflicting resource as the parent. Signed-off-by: Rui Wang --- drivers/acpi/ioapic.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/drivers/acpi/ioapic.c b/drivers/acpi/ioapic.c inde

[PATCH v2 4/5] x86/ioapic: Fix lost IOAPIC resource after hot-removal and hotadd

2016-07-27 Thread Rui Wang
appears in "_CRS" of each IOAPIC device. Both ranges should be claimed from /proc/iomem for exclusive use. Signed-off-by: Rui Wang --- drivers/acpi/ioapic.c | 36 1 file changed, 20 insertions(+), 16 deletions(-) diff --git a/drivers/acpi/ioapic.c

[PATCH v2 3/5] x86/ioapic: Fix setup_res() failing to get resource

2016-07-27 Thread Rui Wang
setup_res() doesn't actually get any resource because it mistakenly checks the return value of acpi_dev_filter_resource_type(), which returns 0 on success, and 1 on failure. Fix it by taking the return value of non-zero as failing to match the specified resource type. Signed-off-by: Rui

Re: [PATCH 3/4] x86/ioapic: Fix lost ioapic resource after hot-removal and hotadd

2016-07-26 Thread Rui Wang
On Wed, July 27, 2016 4:24 AM, Bjorn Helgaas wrote: > On Wed, Jul 27, 2016 at 12:13:16AM +0800, Rui Wang wrote: > > ioapic resource at 0xfecx gets lost from /proc/iomem after > > hot-removing and then hot-adding the ioapic devices. > > > > After system boot, i

Re: [PATCH 1/4] x86/ioapic: Support hot-removal of IOAPICs present during boot boot

2016-07-26 Thread Rui Wang
On Wed, July 27, 2016 4:20 AM Bjorn Helgaas wrote: > On Wed, Jul 27, 2016 at 12:13:14AM +0800, Rui Wang wrote: > > IOAPICs present during system boot aren't added to ioapic_list, thus > > are unable to be hot-removed. Fix it by calling > > acpi_ioapic_add() d

[PATCH 2/4] x86/ioapic: Fix setup_res() failing to get resource

2016-07-26 Thread Rui Wang
setup_res() doesn't actually get any resoure because it mistakenly checks the return value of acpi_dev_filter_resource_type(), which returns 0 on success, and 1 on failure. Fix it by taking the return value of non-zero as failing to match the specified resource type. Signed-off-by: Rui

[PATCH 3/4] x86/ioapic: Fix lost ioapic resource after hot-removal and hotadd

2016-07-26 Thread Rui Wang
exclusive use. Signed-off-by: Rui Wang --- drivers/acpi/ioapic.c | 36 1 file changed, 20 insertions(+), 16 deletions(-) diff --git a/drivers/acpi/ioapic.c b/drivers/acpi/ioapic.c index daf4a40..80b0b1a 100644 --- a/drivers/acpi/ioapic.c +++ b/drivers/acpi

[PATCH 1/4] x86/ioapic: Support hot-removal of IOAPICs present during boot

2016-07-26 Thread Rui Wang
IOAPICs present during system boot aren't added to ioapic_list, thus are unable to be hot-removed. Fix it by calling acpi_ioapic_add() during root bus enumeration. Signed-off-by: Rui Wang --- drivers/acpi/internal.h | 2 -- drivers/acpi/ioapic.c | 7 --- drivers/acpi/pci_root.c

[PATCH 4/4] x86/ioapic: Fix ioapic failing to request resource

2016-07-26 Thread Rui Wang
ecf). Fix it by using insert_resoure() which can request resources by taking the conflicting resource as the parent. Signed-off-by: Rui Wang --- drivers/acpi/ioapic.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/drivers/acpi/ioapic.c b/drivers/acpi/ioapic.c inde

[PATCH 0/4] Fixing a set of bugs for ioapic hotplug

2016-07-26 Thread Rui Wang
Hi all, The 1st patch has been discussed before Bjorn went on vacation. I've fixed all the issues. Bjorn, please advise how we'll move forward. The remaining patches fix newly found bugs while testing ioapic hotplug. Regards, Rui Rui Wang (4): x86/ioapic: Support hot-removal

[PATCH V5 1/3] x86/ioapic: Support hot-removal of IOAPICs present during boot

2016-06-25 Thread Rui Wang
ix it by calling acpi_ioapic_add() during root bus enumeration. Signed-off-by: Rui Wang --- drivers/acpi/internal.h | 2 -- drivers/acpi/ioapic.c | 7 --- drivers/acpi/pci_root.c | 13 - drivers/pci/setup-bus.c | 5 - include/linux/acpi.h| 6 ++ 5 files change

Re: [PATCH V4 1/3] x86/ioapic: Support hot-removal of IOAPICs present during boot

2016-06-24 Thread Rui Wang
On Fri, Jun 24, 2016 1:35 AM Bjorn Helgaas wrote: > On Thu, Jun 23, 2016 at 01:11:41PM +0800, Rui Wang wrote: > > On Wed, June 22, 2016 11:15 PM Bjorn Helgaas wrote: > > > [...] > > > > @@ -1779,8 +1780,12 @@ void __init > > >

Re: [PATCH V3 1/3] x86/ioapic: Support hot-removal of IOAPICs present during boot

2016-06-24 Thread Rui Wang
On Wed, June 22, 2016 10:54 PM Bjorn Helgaas wrote: > On Wed, Jun 22, 2016 at 03:13:32PM +0800, Rui Wang wrote: > > On Friday, June 17, 2016 1:10 AM, Bjorn Helgaas wrote: > > > ioapic_insert_resources() is x86-specific, but I'm not sure why; it > > > seems li

[PATCH V4 1/3] x86/ioapic: Support hot-removal of IOAPICs present during boot

2016-06-22 Thread Rui Wang
ff-by: Rui Wang --- drivers/acpi/internal.h | 2 -- drivers/acpi/ioapic.c | 7 --- drivers/acpi/pci_root.c | 13 - drivers/pci/setup-bus.c | 7 ++- include/linux/acpi.h| 3 +++ 5 files changed, 25 insertions(+), 7 deletions(-) diff --git a/drivers/acpi/internal.h b/dr

RE: [PATCH V3 1/3] x86/ioapic: Support hot-removal of IOAPICs present during boot

2016-06-22 Thread Rui Wang
On Friday, June 17, 2016 1:10 AM, Bjorn Helgaas wrote: > ioapic_insert_resources() is x86-specific, but I'm not sure why; it seems > like it does things that should be applicable to ia64 as well. > > acpi_ioapic_add() is not x86-specific, and it is called from > acpi_pci_root_add() for the hot-add

Re: [PATCH V3 1/3] x86/ioapic: Support hot-removal of IOAPICs present during boot

2016-06-11 Thread Rui Wang
On Saturday, June 11, 2016 12:43 AM, Bjorn Helgaas wrote: > On Wed, Jun 08, 2016 at 05:32:44PM +0800, Rui Wang wrote: > > @@ -1779,8 +1780,12 @@ void __init > > pci_assign_unassigned_resources(void) > > { > > struct pci_bus *root_bus; > > > > - list_f

[tip:x86/apic] x86/ioapic: Simplify ioapic_setup_resources()

2016-06-10 Thread tip-bot for Rui Wang
Commit-ID: 4855531eb8582a98cb905d2baf86021254d7a675 Gitweb: http://git.kernel.org/tip/4855531eb8582a98cb905d2baf86021254d7a675 Author: Rui Wang AuthorDate: Wed, 8 Jun 2016 14:59:53 +0800 Committer: Ingo Molnar CommitDate: Fri, 10 Jun 2016 14:48:18 +0200 x86/ioapic: Simplify

[tip:x86/urgent] x86/ioapic: Fix incorrect pointers in ioapic_setup_resources()

2016-06-10 Thread tip-bot for Rui Wang
Commit-ID: 9d98bcec731756b8688b59ec998707924d716d7b Gitweb: http://git.kernel.org/tip/9d98bcec731756b8688b59ec998707924d716d7b Author: Rui Wang AuthorDate: Wed, 8 Jun 2016 14:59:52 +0800 Committer: Ingo Molnar CommitDate: Fri, 10 Jun 2016 14:45:54 +0200 x86/ioapic: Fix incorrect

[tip:x86/apic] x86/ioapic: Fix incorrect pointers in ioapic_setup_resources()

2016-06-10 Thread tip-bot for Rui Wang
Commit-ID: 3d98217b6726e0c342ac6363346bd9751fd61ec9 Gitweb: http://git.kernel.org/tip/3d98217b6726e0c342ac6363346bd9751fd61ec9 Author: Rui Wang AuthorDate: Wed, 8 Jun 2016 14:59:52 +0800 Committer: Ingo Molnar CommitDate: Fri, 10 Jun 2016 13:55:03 +0200 x86/ioapic: Fix incorrect

[tip:x86/apic] x86/ioapic: Simplify ioapic_setup_resources()

2016-06-10 Thread tip-bot for Rui Wang
Commit-ID: 0286d538082b854b4e1f05b29c23556fa344e145 Gitweb: http://git.kernel.org/tip/0286d538082b854b4e1f05b29c23556fa344e145 Author: Rui Wang AuthorDate: Wed, 8 Jun 2016 14:59:53 +0800 Committer: Thomas Gleixner CommitDate: Fri, 10 Jun 2016 11:43:52 +0200 x86/ioapic: Simplify

[tip:x86/urgent] x86/ioapic: Fix wrong pointers in ioapic_setup_resources()

2016-06-10 Thread tip-bot for Rui Wang
Commit-ID: 0e1c672041819474181a41ce07e4734750789170 Gitweb: http://git.kernel.org/tip/0e1c672041819474181a41ce07e4734750789170 Author: Rui Wang AuthorDate: Wed, 8 Jun 2016 14:59:52 +0800 Committer: Thomas Gleixner CommitDate: Fri, 10 Jun 2016 11:41:47 +0200 x86/ioapic: Fix wrong

[PATCH V3 1/3] x86/ioapic: Support hot-removal of IOAPICs present during boot

2016-06-08 Thread Rui Wang
v3: Previous versions break mips. This version fixes it. IOAPICs present during system boot aren't added to ioapic_list, thus are unable to be hot-removed. Fix it by calling acpi_ioapic_add() during root bus enumeration. Signed-off-by: Rui Wang --- drivers/acpi/internal.h | 2 -- drivers

[PATCH V2 1/3] x86/ioapic: Support hot-removal of IOAPICs present during boot

2016-06-08 Thread Rui Wang
IOAPICs present during system boot aren't added to ioapic_list, thus are unable to be hot-removed. Fix it by calling acpi_ioapic_add() during root bus enumeration. Signed-off-by: Rui Wang --- drivers/acpi/internal.h | 2 -- drivers/acpi/ioapic.c | 7 --- drivers/acpi/pci_root.

[PATCH V2 0/3] ioapic hot-removal bugs

2016-06-08 Thread Rui Wang
ng to Thomas. Rui Wang (3): x86/ioapic: Support hot-removal of IOAPICs present during boot x86/ioapic: Fix wrong pointers in ioapic_setup_resources() x86/ioapic: Simplify ioapic_setup_resources() arch/x86/kernel/apic/io_apic.c | 18 +++--- drivers/acpi/internal.h

[PATCH V2 2/3] x86/ioapic: Fix wrong pointers in ioapic_setup_resources()

2016-06-08 Thread Rui Wang
ource, 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 --- arch/x86/kernel/apic/io_apic.c |

[PATCH V2 3/3] x86/ioapic: Simplify ioapic_setup_resources()

2016-06-08 Thread Rui Wang
Optimize the function by removing the variable 'num'. Signed-off-by: Rui Wang --- arch/x86/kernel/apic/io_apic.c | 18 +++--- 1 file changed, 7 insertions(+), 11 deletions(-) diff --git a/arch/x86/kernel/apic/io_apic.c b/arch/x86/kernel/apic/io_apic.c index 446702e..e587

Re: [PATCH 2/2] x86/ioapic: Fix wrong pointers in ioapic_setup_resources()

2016-06-07 Thread Rui Wang
On Tuesday, June 7, 2016 5:17 PM, Thomas Gleixner wrote: > On Tue, 7 Jun 2016, Rui Wang wrote: > > Also simplify the function by removing the redundant 'num' variable. > Please don't do that. This makes the patch hard to read. Split this into a > minimal bugfix,

[PATCH 0/2] ioapic hot-removal bugs

2016-06-07 Thread Rui Wang
-removing ioapics. On a 4-socket brickland, hot-removal of the 3 sockets can be done only after applying these two patches. Regards, Rui Rui Wang (2): Support hot-removal of IOAPICs present during boot x86/ioapic: Fix wrong pointers in ioapic_setup_resources() arch/x86/kernel/apic/io_apic.c | 18

[PATCH 1/2] x86/ioapic: Support hot-removal of IOAPICs present during boot

2016-06-07 Thread Rui Wang
IOAPICs present during system boot aren't added to ioapic_list, thus are unable to be hot-removed. Fix it by calling acpi_ioapic_add() during root bus enumeration. Signed-off-by: Rui Wang --- drivers/acpi/internal.h | 2 -- drivers/acpi/ioapic.c | 7 --- drivers/acpi/pci_root.

[PATCH 2/2] x86/ioapic: Fix wrong pointers in ioapic_setup_resources()

2016-06-07 Thread Rui Wang
74 1b [ 453.829861] RIP [] release_resource+0x22/0x80 [ 453.837188] RSP [ 453.841673] CR2: 0030 Fix it by assigning the correct pointers to ioapics[i].iomem_res in ioapic_setup_resources(). Also simplify the function by removing the redundant 'num' variable. Signed-

[PATCH v3 4/4] crypto: testmgr - Add a test case for import()/export()

2016-02-03 Thread Rui Wang
Modify __test_hash() so that hash import/export can be tested from within the kernel. The test is unconditionally done when a struct hash_testvec has its .np > 1. v3: make the test unconditional v2: Leverage template[i].np as suggested by Tim Chen Signed-off-by: Rui Wang --- crypto/testmg

Re: [PATCH v2 4/4] crypto: testmgr - Add a test case for import()/export()

2016-02-02 Thread Rui Wang
On Tue, Feb 2, 2016 10:45 PM Herbert Xu wrote: > > On Tue, Feb 02, 2016 at 10:16:34PM +0800, Rui Wang wrote: > > > > I initially made it unconditional, but then I found that it can easily > > hang the machine during boot due to any import/export bug in any of > > th

Re: [PATCH v2 4/4] crypto: testmgr - Add a test case for import()/export()

2016-02-02 Thread Rui Wang
On Mon, Feb 1, 2016 4:22 PM Herbert Xu wrote: > > On Wed, Jan 27, 2016 at 05:08:38PM +0800, Rui Wang wrote: > > > > diff --git a/crypto/testmgr.h b/crypto/testmgr.h index > > da0a8fd..451e7eb 100644 > > --- a/crypto/testmgr.h > > +++ b/crypto/testmgr.h >

Re: [PATCH v2 1/4] crypto x86/sha1_mb: Fix load failure

2016-02-02 Thread Rui Wang
On Monday, February 1, 2016 4:18 PM, Herbert Xu wrote: > > On Wed, Jan 27, 2016 at 05:08:35PM +0800, Rui Wang wrote: >> >> +static int sha1_mb_async_import(struct ahash_request *req, const void >> +*in) { >> +struct ahash_request *mcryptd_req = ahash_re

Re: [PATCH] ovl: fix getcwd() failure after unsuccessful rmdir

2016-02-01 Thread Rui Wang
On Sat, Jan 30, 2016 5:44 PM Konstantin Khlebnikov wrote: > On Fri, Jan 8, 2016 at 6:09 PM, Rui Wang wrote: > ovl_remove_upper() should do d_drop() only after it successfully > removes the dir, otherwise a subsequent getcwd() system call will > fail, breaking userspace programs.

[PATCH v2 4/4] crypto: testmgr - Add a test case for import()/export()

2016-01-27 Thread Rui Wang
Modify __test_hash() so that hash import/export can be tested from within the kernel by simply adding .partial = 1 to a hash algo's struct hash_testvec where .np > 1. v2: Leverage template[i].np as suggested by Tim Chen Signed-off-by: Rui Wang --- crypto/testmgr

[PATCH v2 3/4] crypto: algif_hash - wait for crypto_ahash_init() to complete

2016-01-27 Thread Rui Wang
hash_sendmsg/sendpage() need to wait for the completion of crypto_ahash_init() otherwise it can cause panic. Signed-off-by: Rui Wang --- crypto/algif_hash.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/crypto/algif_hash.c b/crypto/algif_hash.c index b4c24fe..83dc095

[PATCH v2 2/4] crypto: mcryptd - Fix load failure

2016-01-27 Thread Rui Wang
mcryptd_create_hash() fails by returning -EINVAL, causing any driver using mcryptd to fail to load. It is because it needs to set its statesize properly. Signed-off-by: Rui Wang --- crypto/mcryptd.c | 1 + 1 file changed, 1 insertion(+) diff --git a/crypto/mcryptd.c b/crypto/mcryptd.c index

[PATCH v2 1/4] crypto x86/sha1_mb: Fix load failure

2016-01-27 Thread Rui Wang
modprobe sha1_mb fails with the following message: modprobe: ERROR: could not insert 'sha1_mb': No such device It is because it needs to set its statesize and implement its import() and export() interface. Signed-off-by: Rui Wang --- arch/x86/crypto/sha-mb/sha1

[PATCH v2 0/4] Fix sha1_mb failure and testing import()/export()

2016-01-27 Thread Rui Wang
sha1_mb. patch04 adds a test case for import() and export(). A hash algo's import()/export() can be tested by simply adding .partial = 1 to its corresponding struct hash_testvec where .np > 1. v2: Leverage template[i].np in the test case as suggested by Tim Chen. Rui Wang (4): crypto x86

[PATCH 1/2] crypto: ghash-clmulni - Fix load failure

2015-11-29 Thread Rui Wang
rt()/export(), and must have a non- zero statesize. This patch has been tested with the algif_hash interface. The calculated digest values, after several rounds of import()s and export()s, match those calculated by tcrypt. Signed-off-by: Rui Wang --- arch/x86/crypto/ghash-clmulni-intel_glue.c | 26

[PATCH 0/2] crypto: Fix driver load failure

2015-11-29 Thread Rui Wang
ghash_clmulni_intel fails to load on Linux 4.3+ with the following message: "modprobe: ERROR: could not insert 'ghash_clmulni_intel': Invalid argument" These two patches need to go together, for the driver to load correctly. Rui Wang (2): crypto: ghash-clmulni - Fix l

[PATCH 2/2] crypto: cryptd - Assign statesize properly

2015-11-29 Thread Rui Wang
cryptd_create_hash() fails by returning -EINVAL. It is because after 8996eafdc ("crypto: ahash - ensure statesize is non-zero") all ahash drivers must have a non-zero statesize. This patch fixes the problem by properly assigning the statesize. Signed-off-by: Rui Wang --- crypto/cr

[PATCH] drm/mgag200: fix kernel hang in cursor code.

2015-11-18 Thread Rui Wang
the check early in the function can fix the problem. Signed-off-by: Rui Wang --- drivers/gpu/drm/mgag200/mgag200_cursor.c | 11 +-- 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/drivers/gpu/drm/mgag200/mgag200_cursor.c b/drivers/gpu/drm/mgag200/mgag200_cursor.c index 4f2068

BUG: drm/mgag200 NULL pointer dereference at 0000000000000060

2015-11-18 Thread Rui Wang
Hi All, Just found the following bug causing machine hang: [ 487.777538] BUG: unable to handle kernel NULL pointer dereference at 0060 [ 487.777554] IP: [] _raw_spin_lock+0xe/0x30 [ 487.777557] PGD 42e9f7067 PUD 42f2fa067 PMD 0 [ 487.777560] Oops: 0002 [#1] SMP ... [ 487.777618]

Re: drm/mgag200: doesn't work in panic context

2015-07-01 Thread Rui Wang
On Tuesday, June 30, 2015 11:24 PM, Daniel Vetter wrote: > On Tue, Jun 30, 2015 at 9:23 AM, Rui Wang wrote: > > But einj does something more than what an IPI can do, it injects hardware > > errors which trigger exceptions in NMI context... and the exception handler > > us

Re: drm/mgag200: doesn't work in panic context

2015-06-30 Thread Rui Wang
On Tuesday, June 30, 2015 2:37 PM, Daniel Vetter wrote: > On Tue, Jun 30, 2015 at 4:53 AM, Rui Wang wrote: > > > > I think testing can be done by injecting a fatal machine check > > exception via einj's debugfs interface. I can reproduce the hard hang every > time. &

Re: drm/mgag200: doesn't work in panic context

2015-06-29 Thread Rui Wang
On Monday, June 29, 2015 5:25 PM, Daniel Vetter wrote: > As long as the display is up and running we should have a fair stab at > showing the oops - it's just that no one has seriously bothered with > the necessary infastructure, automated testing (it won't work > otherwise) and driver work. I th

drm/mgag200: doesn't work in panic context

2015-06-26 Thread Rui Wang
Hi all, I'm here to report two panics which hang forever (the machine cannot reboot). It is because mgag200 doesn't work in panic context. It sleeps and allocates memory non-atomically. These were triggered while injecting machine checks using einj. 1) [321381.466885] [ cut here ]

Re: MCE bug?

2015-06-18 Thread Rui Wang
> On Wed, Jun 17, 2015 at 11:41:56AM +0200, Borislav Petkov wrote: >> And I was waiting in line to get a chance to do some injection on our >> EINJ box here too. But it seems you have the required setup already so >> if you want to give those changes a run, I've uploaded them here: >> >> git://g

MCE bug?

2015-06-16 Thread Rui Wang
Hi Boris & Tony, While injecting MCEs using einj, I encountered a panic: [0.305697] mce: CPU supports 22 MCE banks [0.310288] BUG: unable to handle kernel NULL pointer dereference at 0100 [0.319057] IP: [] __queue_wor

Re: [PATCH] drm: fb helper should avoid sleeping in panic context

2014-12-09 Thread rui wang
Hi Rob, Yes it's exactly what I'm doing. Please scroll down and review my patch. Thanks Rui On 12/10/14, Rob Clark wrote: > perhaps fb helpers could use __drm_modeset_lock_all() w/ trylock=true > in panic context? > > BR, > -R > > On Tue, Dec 9, 2014 at 7:09

[PATCH] drm: fb helper should avoid sleeping in panic context

2014-12-09 Thread rui wang
...@ffwll.ch, tony.l...@intel.com, b...@alien8.de, a...@redhat.com, rui.y.w...@intel.com Cc: linux-kernel@vger.kernel.org From: Rui Wang There are still some places in the fb helper that need to avoid sleeping in panic context. Here's an example: [ 65.615496] bad: scheduling from the idle t

Re: [PATCH] drm: fb helper should avoid sleeping in panic context

2014-12-05 Thread rui wang
l.com wrote: > From: Rui Wang > > There are still some places in the fb helper that need to avoid > sleeping in panic context. Here's an example: > > [ 65.615496] bad: scheduling from the idle thread! > [ 65.620747] CPU: 92 PID: 0 Comm: swapper/92 Tainted: G M

Re: Bug: Fatal errors result in infinite stream of error messages

2014-12-04 Thread rui wang
On 12/4/14, Borislav Petkov wrote: > On Wed, Dec 03, 2014 at 05:11:49PM +0800, rui wang wrote: >> The problem is because kdump fails to load a new kernel, and we're >> executing past crash_kexec() in panic(). And it calls >> bust_spinlocks(0) which calls into the GP

Bug: Fatal errors result in infinite stream of error messages

2014-12-03 Thread rui wang
Hi all, When a machine check panics while the kdump service isn't loaded (e.g. due to insufficient disk space), we see an infinite stream of error messages on the console, repeatedly, like this (The machine can never reboot): [ 82.733050] bad: scheduling from the idle thread! [ 82.738304] CPU

[no subject]

2014-12-03 Thread rui wang
-- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/

Re: [PATCH v3] x86/mce: Try printing all machine check banks known before panic

2014-11-22 Thread rui wang
On 11/22/14, Borislav Petkov wrote: > On Sat, Nov 22, 2014 at 10:16:49AM +0800, rui wang wrote: >> I think both possibilities are valid. But experiments show that the >> error logs are not in the dmesg preserved by kdump in /var/crash/ >> after panic and reboot, and no

Re: [PATCH v3] x86/mce: Try printing all machine check banks known before panic

2014-11-21 Thread rui wang
On 11/22/14, Borislav Petkov wrote: >... there are two possibilities: > > * error got logged into mcelog and is long out to dmesg. > > So we go look at dmesg. Not very easy to do when we panic, I know, so we > better make sure we have serial connected. > > > [ Btw., we can know when userspace is

Re: [PATCH v3] x86/mce: Try printing all machine check banks known before panic

2014-11-20 Thread rui wang
On 11/20/14, Borislav Petkov wrote: > On Wed, Nov 19, 2014 at 11:34:10PM +, Luck, Tony wrote: >> The SDM has this to say about EN=0 (in section 15.10.4.1 of volume 3B): >> >>When the EN flag is zero but the VAL and UC flags are one in >>the IA32_MCi_STATUS register, the reported uncorr

[PATCH v3 1/5] I/O Hook: core functions and Register Override

2014-04-15 Thread Rui Wang
, etc., similar to how a hardware register behaves when accessed. Jump Label is used, so when the hook is disabled (by default), this adds only a NOP to the core functions, with zero performance penalty. This patch is the first step towards the goal of emulating h/w events. Signed-off-by: Rui Wang

[PATCH v3 2/5] I/O Hook: Help functions to manage the hook

2014-04-15 Thread Rui Wang
Add the following kernel helper functions used to add/delete/query Register Overrides, and to start/stop the I/O Hook: iohook_add_ovrd iohook_query_ovrd iohook_cleanup_ovrd iohook_start_ovrd iohook_stop_ovrd iohook_get_status Signed-off-by: Rui Wang

  1   2   >