Re: [PATCH v3 0/2] Copy-on-write poison recovery

2022-10-25 Thread Shuai Xue



在 2022/10/23 PM11:52, Shuai Xue 写道:
> 
> 
> 在 2022/10/22 AM4:01, Tony Luck 写道:
>> Part 1 deals with the process that triggered the copy on write
>> fault with a store to a shared read-only page. That process is
>> send a SIGBUS with the usual machine check decoration to specify
>> the virtual address of the lost page, together with the scope.
>>
>> Part 2 sets up to asynchronously take the page with the uncorrected
>> error offline to prevent additional machine check faults. H/t to
>> Miaohe Lin  and Shuai Xue 
>> for pointing me to the existing function to queue a call to
>> memory_failure().
>>
>> On x86 there is some duplicate reporting (because the error is
>> also signalled by the memory controller as well as by the core
>> that triggered the machine check). Console logs look like this:
>>
>> [ 1647.723403] mce: [Hardware Error]: Machine check events logged
>>  Machine check from kernel copy routine
>>
>> [ 1647.723414] MCE: Killing einj_mem_uc:3600 due to hardware memory 
>> corruption fault at 7f3309503400
>>  x86 fault handler sends SIGBUS to child process
>>
>> [ 1647.735183] Memory failure: 0x905b92d: recovery action for dirty LRU 
>> page: Recovered
>>  Async call to memory_failure() from copy on write path
> 
> The recovery action might also be handled asynchronously in CMCI 
> uc_decode_notifier
> handler signaled by memory controller, right?
> 
> I have a one more memory failure log than yours.
> 
> [ 3187.485742] MCE: Killing einj_mem_uc:31746 due to hardware memory 
> corruption fault at 7fc4bf7cf400
> [ 3187.740620] Memory failure: 0x1a3b80: recovery action for dirty LRU page: 
> Recovered
>   uc_decode_notifier() processes memory controller report
> 
> [ 3187.748272] Memory failure: 0x1a3b80: already hardware poisoned
>   Workqueue: events memory_failure_work_func // queued by 
> ghes_do_memory_failure
> 
> [ 3187.754194] Memory failure: 0x1a3b80: already hardware poisoned
>   Workqueue: events memory_failure_work_func // queued by 
> __wp_page_copy_user
> 
> [ 3188.615920] MCE: Killing einj_mem_uc:31745 due to hardware memory 
> corruption fault at 7fc4bf7cf400
> 
> Best Regards,
> Shuai

Tested-by: Shuai Xue 

Thank you.
Shuai

> 
>>
>> [ 1647.748397] Memory failure: 0x905b92d: already hardware poisoned
>>  uc_decode_notifier() processes memory controller report
>>
>> [ 1647.761313] MCE: Killing einj_mem_uc:3599 due to hardware memory 
>> corruption fault at 7f3309503400
>>  Parent process tries to read poisoned page. Page has been unmapped, so
>>  #PF handler sends SIGBUS
>>
>>
>> Tony Luck (2):
>>   mm, hwpoison: Try to recover from copy-on write faults
>>   mm, hwpoison: When copy-on-write hits poison, take page offline
>>
>>  include/linux/highmem.h | 24 
>>  include/linux/mm.h  |  5 -
>>  mm/memory.c | 32 ++--
>>  3 files changed, 50 insertions(+), 11 deletions(-)
>>


Re: [PATCH] powerpc: Save AMR/IAMR when switching tasks

2022-10-25 Thread Samuel Holland
On 9/21/22 00:17, Christophe Leroy wrote:
> Le 21/09/2022 à 05:33, Samuel Holland a écrit :
>> On 9/19/22 07:37, Michael Ellerman wrote:
>>> Christophe Leroy  writes:
 Le 16/09/2022 à 07:05, Samuel Holland a écrit :
> With CONFIG_PREEMPT=y (involuntary preemption enabled), it is possible
> to switch away from a task inside copy_{from,to}_user. This left the CPU
> with userspace access enabled until after the next IRQ or privilege
> level switch, when AMR/IAMR got reset to AMR_KU[AE]P_BLOCKED. Then, when
> switching back to the original task, the userspace access would fault:

 This is not supposed to happen. You never switch away from a task
 magically. Task switch will always happen in an interrupt, that means
 copy_{from,to}_user() get interrupted.
>>>
>>> Unfortunately this isn't true when CONFIG_PREEMPT=y.
>>>
>>> We can switch away without an interrupt via:
>>>__copy_tofrom_user()
>>>  -> __copy_tofrom_user_power7()
>>> -> exit_vmx_usercopy()
>>>-> preempt_enable()
>>>   -> __preempt_schedule()
>>>  -> preempt_schedule()
>>> -> preempt_schedule_common()
>>>-> __schedule()
>>>
>>> I do some boot tests with CONFIG_PREEMPT=y, but I realise now those are
>>> all on Power8, which is a bit of an oversight on my part.
>>>
>>> And clearly no one else tests it, until now :)
>>>
>>> I think the root of our problem is that our KUAP lock/unlock is at too
>>> high a level, ie. we do it in C around the low-level copy to/from.
>>>
>>> eg:
>>>
>>> static inline unsigned long
>>> raw_copy_to_user(void __user *to, const void *from, unsigned long n)
>>> {
>>> unsigned long ret;
>>>
>>> allow_write_to_user(to, n);
>>> ret = __copy_tofrom_user(to, (__force const void __user *)from, n);
>>> prevent_write_to_user(to, n);
>>> return ret;
>>> }
>>>
>>> There's a reason we did that, which is that we have various different
>>> KUAP methods on different platforms, not a simple instruction like other
>>> arches.
>>>
>>> But that means we have that exit_vmx_usercopy() being called deep in the
>>> guts of __copy_tofrom_user(), with KUAP disabled, and then we call into
>>> the preempt machinery and eventually schedule.
>>>
>>> I don't see an easy way to fix that "properly", it would be a big change
>>> to all platforms to push the KUAP save/restore down into the low level
>>> asm code.
>>>
>>> But I think the patch below does fix it, although it abuses things a
>>> little. Namely it only works because the 64s KUAP code can handle a
>>> double call to prevent, and doesn't need the addresses or size for the
>>> allow.
>>>
>>> Still I think it might be our best option for an easy fix.
>>>
>>> Samuel, can you try this on your system and check it works for you?
>>
>> It looks like your patch works. Thanks for the correct fix!
> 
> Instead of the patch from Michael, could you try by replacing 
> preempt_enable() by preempt_enable_no_resched() in exit_vmx_usercopy() ?

I finally got a chance to test this, and the simpler fix of using
preempt_enable_no_resched() works as well.

>> I replaced my patch with the one below, and enabled
>> CONFIG_PPC_KUAP_DEBUG=y, and I was able to do several kernel builds
>> without any crashes or splats in dmesg.
> 
> Did you try CONFIG_PPC_KUAP_DEBUG without the patch ? Did it detect any 
> problem ?

I believe I did at one point, and it did not detect anything.

Regards,
Samuel



Re: Linux 6.1-rc2

2022-10-25 Thread Michael Ellerman
Guenter Roeck  writes:
> On Tue, Oct 25, 2022 at 09:41:50AM -0700, Linus Torvalds wrote:
>> On Tue, Oct 25, 2022 at 9:24 AM Guenter Roeck  wrote:
>> >
>> > Build results:
>> > total: 152 pass: 152 fail: 0
>> > Qemu test results:
>> > total: 499 pass: 499 fail: 0
>> 
>> Woo-hoo!
>> 
>> That was quick, for once.
>> 
>
> Yes, it was. I now have an even better one, with a new personal
> milestone reached (500 qemu boot tests):
>
> Build results:
>   total: 152 pass: 152 fail: 0
> Qemu test results:
>   total: 500 pass: 500 fail: 0
>  ^^^
>
> ... after getting yet another qemu machine to boot.
>
>> > Runtime warnings
>> 
>> Oh.
>> 
>> Well, close enough, and those fixes are presumably pending too.
>> 
>
> Let's hope so. I think I forgot to copy the ppc maintainers last week,
> so we'll see if we get some feedback on the status of those problems.

I have those in my fixes-test branch. While testing one of them I
stumbled on some issues that I've been trying to confirm are existing
and not regressions.

But I plan for those fixes to hit rc3.

cheers


Re: [PATCH v3 3/3] powerpc: mm: support page table check

2022-10-25 Thread Russell Currey
On Mon, 2022-10-24 at 11:35 +1100, Rohan McLure wrote:
> On creation and clearing of a page table mapping, instrument such
> calls
> by invoking page_table_check_pte_set and page_table_check_pte_clear
> respectively. These calls serve as a sanity check against illegal
> mappings.
> 
> Enable ARCH_SUPPORTS_PAGE_TABLE_CHECK for all ppc64, and 32-bit
> platforms implementing Book3S.
> 
> Change pud_pfn to be a runtime bug rather than a build bug as it is
> consumed by page_table_check_pud_{clear,set} which are not called.
> 
> See also:
> 
> riscv support in commit 3fee229a8eb9 ("riscv/mm: enable
> ARCH_SUPPORTS_PAGE_TABLE_CHECK")
> arm64 in commit 42b2547137f5 ("arm64/mm: enable
> ARCH_SUPPORTS_PAGE_TABLE_CHECK")
> x86_64 in commit d283d422c6c4 ("x86: mm: add x86_64 support for page
> table
> check")
> 
> Signed-off-by: Rohan McLure 

Reviewed-by: Russell Currey 


Re: [PATCH v9 4/7] powerpc/code-patching: Verify instruction patch succeeded

2022-10-25 Thread Benjamin Gray
It occurred to me that we don't require holding a lock when patching
text. Many use cases do hold text_mutex, but it's not required, so it's
possible for this warning to show false positives.

If we do want text_mutex be held, then lockdep_assert_held(_mutex)
ought to be added too.


Re: [linux-next:master] BUILD REGRESSION 89bf6e28373beef9577fa71f996a5f73a569617c

2022-10-25 Thread Doug Berger

On 10/25/2022 3:41 PM, Jakub Kicinski wrote:

On Wed, 26 Oct 2022 01:17:48 +0800 kernel test robot wrote:

drivers/net/ethernet/broadcom/genet/bcmgenet.c:1497:5-13: ERROR: invalid 
reference to the index variable of the iterator on line 1475


CC Doug
Thanks for highlighting this for me, but I happened to catch it from the 
linux-mm list and was just looking into it.


It looks to me like a false positive since I am initializing the 
loc_rule variable in all paths outside of the list_for_each_entry() loop 
prior to its use on line 1497.


If desired I can submit a new patch to make coccinelle happy.
-Doug


Re: [PATCH v4 2/6] powerpc/module: Handle caller-saved TOC in module linker

2022-10-25 Thread Benjamin Gray
On Tue, 2022-10-25 at 13:10 +1100, Andrew Donnellan wrote:
> On Mon, 2022-10-10 at 11:29 +1100, Benjamin Gray wrote:
> > > A function symbol may set a value in the st_other field to
> > > indicate
> > > the TOC should be treated as caller-saved. The linker should
> > > ensure> the
> > > current TOC is saved before calling it and restore the TOC>
> > > afterwards,
> > > much like external calls.
> 
> As I suggested on the last revision, worth mentioning here that it's
> the '.localentry , 1' directive we're talking about here.

Ah right, whoops. Added "For example, GCC and Clang support a
'.localentry , 1' directive to set this explicitly in assembly."

The exact method for doing this seems to be nonstandard (GCC supports
arbitrary value in 1--7, Clang special cases only 1), so originally I
was avoiding specifying how it is set.

> > > @@ -632,7 +643,8 @@ int apply_relocate_add(Elf64_Shdr *sechdrs,
> > > case R_PPC_REL24:
> > > /* FIXME: Handle weak symbols here --RR
> > > */
> > > if (sym->st_shndx == SHN_UNDEF ||
> > > -   sym->st_shndx == SHN_LIVEPATCH) {
> > > +   sym->st_shndx == SHN_LIVEPATCH ||
> > > +   need_r2save_stub(sym->st_other)) {
> > > /* External: go via stub */
> 
> Perhaps this comment should be updated to mention that there are non-
> external but external-like calls?
> 
> Otherwise
> 
> Reviewed-by: Andrew Donnellan 

Updated to "/* May use different / not preserve TOC: go via stub */",
will add your reviewed-by in the next version. For now I'll wait for
any other feedback before sending it.
> > 


Re: [linux-next:master] BUILD REGRESSION 89bf6e28373beef9577fa71f996a5f73a569617c

2022-10-25 Thread Jakub Kicinski
On Tue, 25 Oct 2022 16:04:15 -0700 Doug Berger wrote:
> > On Wed, 26 Oct 2022 01:17:48 +0800 kernel test robot wrote:  
> >> drivers/net/ethernet/broadcom/genet/bcmgenet.c:1497:5-13: ERROR: invalid 
> >> reference to the index variable of the iterator on line 1475  
> > 
> > CC Doug  
> Thanks for highlighting this for me, but I happened to catch it from the 
> linux-mm list and was just looking into it.
> 
> It looks to me like a false positive since I am initializing the 
> loc_rule variable in all paths outside of the list_for_each_entry() loop 
> prior to its use on line 1497.

Ack, indeed the code looks right. Thanks for investigating.

> If desired I can submit a new patch to make coccinelle happy.

I wonder if Cocci can detect writes. Let me add Julia for visibility.

If not we can use a different variable for the "check if already
exists" iteration? It could make the code easier to follow, IMHO.
Or leave it be.


Re: [linux-next:master] BUILD REGRESSION 89bf6e28373beef9577fa71f996a5f73a569617c

2022-10-25 Thread Jakub Kicinski
On Wed, 26 Oct 2022 01:17:48 +0800 kernel test robot wrote:
> drivers/net/ethernet/broadcom/genet/bcmgenet.c:1497:5-13: ERROR: invalid 
> reference to the index variable of the iterator on line 1475

CC Doug 


Re: [PATCH v2 3/4] PCI: mvebu: Include explicitly

2022-10-25 Thread Thomas Petazzoni
On Tue, 25 Oct 2022 13:51:46 -0500
Bjorn Helgaas  wrote:

> From: Bjorn Helgaas 
> 
> pci-mvebu.c uses irq_domain_add_linear() and related interfaces but relies
> on  but doesn't include it directly; it relies on the
> fact that  includes it.
> 
> Include  directly to remove this implicit dependency.
> 
> Signed-off-by: Bjorn Helgaas 
> ---
>  drivers/pci/controller/pci-mvebu.c | 1 +
>  1 file changed, 1 insertion(+)

Acked-by: Thomas Petazzoni 

Thanks!

Thomas
-- 
Thomas Petazzoni, CTO, Bootlin
Embedded Linux and Kernel engineering
https://bootlin.com


Re: [PATCH v2 0/4] PCI: Remove unnecessary includes

2022-10-25 Thread Conor Dooley
On Tue, Oct 25, 2022 at 01:51:43PM -0500, Bjorn Helgaas wrote:
> From: Bjorn Helgaas 
> 
> Many host controller drivers #include  even though they
> don't need it.  Remove the unnecessary #includes.
> 
> v1: https://lore.kernel.org/all/20221019195452.37606-1-helg...@kernel.org/
> 
> Changes from v1 to v2:
>   - Include  explicitly in altera-msi and microchip,
> which don't need  itself, but relied on it to include
> 
>   - Include  explicitly in mvebu, which needs both it
> and 
> 
> Bjorn Helgaas (4):
>   PCI: altera-msi: Include  explicitly
>   PCI: microchip: Include  explicitly
>   PCI: mvebu: Include  explicitly
>   PCI: Remove unnecessary  includes

>  drivers/pci/controller/pcie-microchip-host.c | 2 +-

Hey Bjorn, actually did the build this time rather than visually
inspecting... For the microchip bits:
Reviewed-by: Conor Dooley 
Thanks!



[PATCH v2 4/4] PCI: Remove unnecessary includes

2022-10-25 Thread Bjorn Helgaas
From: Bjorn Helgaas 

Many host controller drivers #include  even though they
don't need it.  Remove the unnecessary #includes.

Signed-off-by: Bjorn Helgaas 
---
 drivers/pci/controller/cadence/pci-j721e.c   | 1 -
 drivers/pci/controller/dwc/pci-layerscape.c  | 1 -
 drivers/pci/controller/dwc/pcie-armada8k.c   | 1 -
 drivers/pci/controller/dwc/pcie-tegra194.c   | 1 -
 drivers/pci/controller/pci-v3-semi.c | 1 -
 drivers/pci/controller/pci-xgene-msi.c   | 1 -
 drivers/pci/controller/pci-xgene.c   | 1 -
 drivers/pci/controller/pcie-altera-msi.c | 1 -
 drivers/pci/controller/pcie-iproc-platform.c | 1 -
 drivers/pci/controller/pcie-iproc.c  | 1 -
 drivers/pci/controller/pcie-microchip-host.c | 1 -
 drivers/pci/controller/pcie-rockchip-host.c  | 1 -
 drivers/pci/controller/pcie-xilinx-cpm.c | 1 -
 drivers/pci/controller/pcie-xilinx-nwl.c | 1 -
 14 files changed, 14 deletions(-)

diff --git a/drivers/pci/controller/cadence/pci-j721e.c 
b/drivers/pci/controller/cadence/pci-j721e.c
index a82f845cc4b5..cc83a8925ce0 100644
--- a/drivers/pci/controller/cadence/pci-j721e.c
+++ b/drivers/pci/controller/cadence/pci-j721e.c
@@ -15,7 +15,6 @@
 #include 
 #include 
 #include 
-#include 
 #include 
 #include 
 #include 
diff --git a/drivers/pci/controller/dwc/pci-layerscape.c 
b/drivers/pci/controller/dwc/pci-layerscape.c
index 879b8692f96a..ed5fb492fe08 100644
--- a/drivers/pci/controller/dwc/pci-layerscape.c
+++ b/drivers/pci/controller/dwc/pci-layerscape.c
@@ -13,7 +13,6 @@
 #include 
 #include 
 #include 
-#include 
 #include 
 #include 
 #include 
diff --git a/drivers/pci/controller/dwc/pcie-armada8k.c 
b/drivers/pci/controller/dwc/pcie-armada8k.c
index dc469ef8e99b..5c999e15c357 100644
--- a/drivers/pci/controller/dwc/pcie-armada8k.c
+++ b/drivers/pci/controller/dwc/pcie-armada8k.c
@@ -21,7 +21,6 @@
 #include 
 #include 
 #include 
-#include 
 
 #include "pcie-designware.h"
 
diff --git a/drivers/pci/controller/dwc/pcie-tegra194.c 
b/drivers/pci/controller/dwc/pcie-tegra194.c
index 1b6b437823d2..02d78a12b6e7 100644
--- a/drivers/pci/controller/dwc/pcie-tegra194.c
+++ b/drivers/pci/controller/dwc/pcie-tegra194.c
@@ -21,7 +21,6 @@
 #include 
 #include 
 #include 
-#include 
 #include 
 #include 
 #include 
diff --git a/drivers/pci/controller/pci-v3-semi.c 
b/drivers/pci/controller/pci-v3-semi.c
index 154a5398633c..784fcf35599c 100644
--- a/drivers/pci/controller/pci-v3-semi.c
+++ b/drivers/pci/controller/pci-v3-semi.c
@@ -22,7 +22,6 @@
 #include 
 #include 
 #include 
-#include 
 #include 
 #include 
 #include 
diff --git a/drivers/pci/controller/pci-xgene-msi.c 
b/drivers/pci/controller/pci-xgene-msi.c
index bfa259781b69..5efc6e56559f 100644
--- a/drivers/pci/controller/pci-xgene-msi.c
+++ b/drivers/pci/controller/pci-xgene-msi.c
@@ -10,7 +10,6 @@
 #include 
 #include 
 #include 
-#include 
 #include 
 #include 
 #include 
diff --git a/drivers/pci/controller/pci-xgene.c 
b/drivers/pci/controller/pci-xgene.c
index 549d3bd6d1c2..887b4941ff32 100644
--- a/drivers/pci/controller/pci-xgene.c
+++ b/drivers/pci/controller/pci-xgene.c
@@ -14,7 +14,6 @@
 #include 
 #include 
 #include 
-#include 
 #include 
 #include 
 #include 
diff --git a/drivers/pci/controller/pcie-altera-msi.c 
b/drivers/pci/controller/pcie-altera-msi.c
index 4366e042e98b..65e8a20cc442 100644
--- a/drivers/pci/controller/pcie-altera-msi.c
+++ b/drivers/pci/controller/pcie-altera-msi.c
@@ -14,7 +14,6 @@
 #include 
 #include 
 #include 
-#include 
 #include 
 #include 
 #include 
diff --git a/drivers/pci/controller/pcie-iproc-platform.c 
b/drivers/pci/controller/pcie-iproc-platform.c
index 538115246c79..4142a73e611d 100644
--- a/drivers/pci/controller/pcie-iproc-platform.c
+++ b/drivers/pci/controller/pcie-iproc-platform.c
@@ -12,7 +12,6 @@
 #include 
 #include 
 #include 
-#include 
 #include 
 #include 
 
diff --git a/drivers/pci/controller/pcie-iproc.c 
b/drivers/pci/controller/pcie-iproc.c
index 2519201b0e51..83029bdfd884 100644
--- a/drivers/pci/controller/pcie-iproc.c
+++ b/drivers/pci/controller/pcie-iproc.c
@@ -18,7 +18,6 @@
 #include 
 #include 
 #include 
-#include 
 #include 
 #include 
 
diff --git a/drivers/pci/controller/pcie-microchip-host.c 
b/drivers/pci/controller/pcie-microchip-host.c
index 57b2a62f52c8..0ebf7015e9af 100644
--- a/drivers/pci/controller/pcie-microchip-host.c
+++ b/drivers/pci/controller/pcie-microchip-host.c
@@ -13,7 +13,6 @@
 #include 
 #include 
 #include 
-#include 
 #include 
 #include 
 #include 
diff --git a/drivers/pci/controller/pcie-rockchip-host.c 
b/drivers/pci/controller/pcie-rockchip-host.c
index 7352b5ff8d35..c96c0f454570 100644
--- a/drivers/pci/controller/pcie-rockchip-host.c
+++ b/drivers/pci/controller/pcie-rockchip-host.c
@@ -28,7 +28,6 @@
 #include 
 #include 
 #include 
-#include 
 #include 
 #include 
 #include 
diff --git a/drivers/pci/controller/pcie-xilinx-cpm.c 
b/drivers/pci/controller/pcie-xilinx-cpm.c
index e4ab48041eb6..4a787a941674 100644
--- 

[PATCH v2 3/4] PCI: mvebu: Include explicitly

2022-10-25 Thread Bjorn Helgaas
From: Bjorn Helgaas 

pci-mvebu.c uses irq_domain_add_linear() and related interfaces but relies
on  but doesn't include it directly; it relies on the
fact that  includes it.

Include  directly to remove this implicit dependency.

Signed-off-by: Bjorn Helgaas 
---
 drivers/pci/controller/pci-mvebu.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/drivers/pci/controller/pci-mvebu.c 
b/drivers/pci/controller/pci-mvebu.c
index 1ced73726a26..73db99035c2b 100644
--- a/drivers/pci/controller/pci-mvebu.c
+++ b/drivers/pci/controller/pci-mvebu.c
@@ -13,6 +13,7 @@
 #include 
 #include 
 #include 
+#include 
 #include 
 #include 
 #include 
-- 
2.25.1



[PATCH v2 2/4] PCI: microchip: Include explicitly

2022-10-25 Thread Bjorn Helgaas
From: Bjorn Helgaas 

pcie-microchip-host.c uses irq_domain_add_linear() and related interfaces,
so it needs  but doesn't include it directly; it relies
on the fact that  includes it.

But pcie-microchip-host.c *doesn't* need  itself.  Include
 directly to remove this implicit dependency so a future
patch can drop .

Signed-off-by: Bjorn Helgaas 
---
 drivers/pci/controller/pcie-microchip-host.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/drivers/pci/controller/pcie-microchip-host.c 
b/drivers/pci/controller/pcie-microchip-host.c
index 7263d175b5ad..57b2a62f52c8 100644
--- a/drivers/pci/controller/pcie-microchip-host.c
+++ b/drivers/pci/controller/pcie-microchip-host.c
@@ -9,6 +9,7 @@
 
 #include 
 #include 
+#include 
 #include 
 #include 
 #include 
-- 
2.25.1



[PATCH v2 0/4] PCI: Remove unnecessary includes

2022-10-25 Thread Bjorn Helgaas
From: Bjorn Helgaas 

Many host controller drivers #include  even though they
don't need it.  Remove the unnecessary #includes.

v1: https://lore.kernel.org/all/20221019195452.37606-1-helg...@kernel.org/

Changes from v1 to v2:
  - Include  explicitly in altera-msi and microchip,
which don't need  itself, but relied on it to include

  - Include  explicitly in mvebu, which needs both it
and 

Bjorn Helgaas (4):
  PCI: altera-msi: Include  explicitly
  PCI: microchip: Include  explicitly
  PCI: mvebu: Include  explicitly
  PCI: Remove unnecessary  includes

 drivers/pci/controller/cadence/pci-j721e.c   | 1 -
 drivers/pci/controller/dwc/pci-layerscape.c  | 1 -
 drivers/pci/controller/dwc/pcie-armada8k.c   | 1 -
 drivers/pci/controller/dwc/pcie-tegra194.c   | 1 -
 drivers/pci/controller/pci-mvebu.c   | 1 +
 drivers/pci/controller/pci-v3-semi.c | 1 -
 drivers/pci/controller/pci-xgene-msi.c   | 1 -
 drivers/pci/controller/pci-xgene.c   | 1 -
 drivers/pci/controller/pcie-altera-msi.c | 2 +-
 drivers/pci/controller/pcie-iproc-platform.c | 1 -
 drivers/pci/controller/pcie-iproc.c  | 1 -
 drivers/pci/controller/pcie-microchip-host.c | 2 +-
 drivers/pci/controller/pcie-rockchip-host.c  | 1 -
 drivers/pci/controller/pcie-xilinx-cpm.c | 1 -
 drivers/pci/controller/pcie-xilinx-nwl.c | 1 -
 15 files changed, 3 insertions(+), 14 deletions(-)

-- 
2.25.1



[PATCH v2 1/4] PCI: altera-msi: Include explicitly

2022-10-25 Thread Bjorn Helgaas
From: Bjorn Helgaas 

pcie-altera-msi.c uses irq_domain_add_linear() and related interfaces, so
it needs  but doesn't include it directly; it relies on
the fact that  includes it.

But pcie-altera-msi.c *doesn't* need  itself.  Include
 directly to remove this implicit dependency so a future
patch can drop .

Signed-off-by: Bjorn Helgaas 
---
 drivers/pci/controller/pcie-altera-msi.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/drivers/pci/controller/pcie-altera-msi.c 
b/drivers/pci/controller/pcie-altera-msi.c
index 7b1d3ebc34ec..4366e042e98b 100644
--- a/drivers/pci/controller/pcie-altera-msi.c
+++ b/drivers/pci/controller/pcie-altera-msi.c
@@ -9,6 +9,7 @@
 
 #include 
 #include 
+#include 
 #include 
 #include 
 #include 
-- 
2.25.1



[PATCH net-next] eth: fealnx: delete the driver for Myson MTD-800

2022-10-25 Thread Jakub Kicinski
The git history for this driver seems to be completely
automated / tree wide changes. I can't find any boards
or systems which would use this chip. Google search
shows pictures of towel warmers and no networking products.

Signed-off-by: Jakub Kicinski 
---
CC: tsbog...@alpha.franken.de
CC: m...@ellerman.id.au
CC: npig...@gmail.com
CC: christophe.le...@csgroup.eu
CC: lukas.bulw...@gmail.com
CC: a...@arndb.de
CC: step...@networkplumber.org
CC: shay...@amazon.com
CC: l...@kernel.org
CC: m...@semihalf.com
CC: pe...@nvidia.com
CC: wsa+rene...@sang-engineering.com
CC: linux-m...@vger.kernel.org
CC: linuxppc-dev@lists.ozlabs.org
---
 arch/mips/configs/mtx1_defconfig  |1 -
 arch/powerpc/configs/ppc6xx_defconfig |1 -
 drivers/net/ethernet/Kconfig  |   10 -
 drivers/net/ethernet/Makefile |1 -
 drivers/net/ethernet/fealnx.c | 1953 -
 5 files changed, 1966 deletions(-)
 delete mode 100644 drivers/net/ethernet/fealnx.c

diff --git a/arch/mips/configs/mtx1_defconfig b/arch/mips/configs/mtx1_defconfig
index edf9634aa8ee..89a1511d2ee4 100644
--- a/arch/mips/configs/mtx1_defconfig
+++ b/arch/mips/configs/mtx1_defconfig
@@ -284,7 +284,6 @@ CONFIG_IXGB=m
 CONFIG_SKGE=m
 CONFIG_SKY2=m
 CONFIG_MYRI10GE=m
-CONFIG_FEALNX=m
 CONFIG_NATSEMI=m
 CONFIG_NS83820=m
 CONFIG_S2IO=m
diff --git a/arch/powerpc/configs/ppc6xx_defconfig 
b/arch/powerpc/configs/ppc6xx_defconfig
index d23deb94b36e..115d40be5481 100644
--- a/arch/powerpc/configs/ppc6xx_defconfig
+++ b/arch/powerpc/configs/ppc6xx_defconfig
@@ -461,7 +461,6 @@ CONFIG_MV643XX_ETH=m
 CONFIG_SKGE=m
 CONFIG_SKY2=m
 CONFIG_MYRI10GE=m
-CONFIG_FEALNX=m
 CONFIG_NATSEMI=m
 CONFIG_NS83820=m
 CONFIG_PCMCIA_AXNET=m
diff --git a/drivers/net/ethernet/Kconfig b/drivers/net/ethernet/Kconfig
index 1917da784191..323ec56e8a74 100644
--- a/drivers/net/ethernet/Kconfig
+++ b/drivers/net/ethernet/Kconfig
@@ -132,16 +132,6 @@ source "drivers/net/ethernet/mscc/Kconfig"
 source "drivers/net/ethernet/microsoft/Kconfig"
 source "drivers/net/ethernet/moxa/Kconfig"
 source "drivers/net/ethernet/myricom/Kconfig"
-
-config FEALNX
-   tristate "Myson MTD-8xx PCI Ethernet support"
-   depends on PCI
-   select CRC32
-   select MII
-   help
- Say Y here to support the Myson MTD-800 family of PCI-based Ethernet
- cards. 
-
 source "drivers/net/ethernet/ni/Kconfig"
 source "drivers/net/ethernet/natsemi/Kconfig"
 source "drivers/net/ethernet/neterion/Kconfig"
diff --git a/drivers/net/ethernet/Makefile b/drivers/net/ethernet/Makefile
index 0d872d4efcd1..2fedbaa545eb 100644
--- a/drivers/net/ethernet/Makefile
+++ b/drivers/net/ethernet/Makefile
@@ -64,7 +64,6 @@ obj-$(CONFIG_NET_VENDOR_MICROCHIP) += microchip/
 obj-$(CONFIG_NET_VENDOR_MICROSEMI) += mscc/
 obj-$(CONFIG_NET_VENDOR_MOXART) += moxa/
 obj-$(CONFIG_NET_VENDOR_MYRI) += myricom/
-obj-$(CONFIG_FEALNX) += fealnx.o
 obj-$(CONFIG_NET_VENDOR_NATSEMI) += natsemi/
 obj-$(CONFIG_NET_VENDOR_NETERION) += neterion/
 obj-$(CONFIG_NET_VENDOR_NETRONOME) += netronome/
diff --git a/drivers/net/ethernet/fealnx.c b/drivers/net/ethernet/fealnx.c
deleted file mode 100644
index ed18450fd2cc..
--- a/drivers/net/ethernet/fealnx.c
+++ /dev/null
@@ -1,1953 +0,0 @@
-/*
-   Written 1998-2000 by Donald Becker.
-
-   This software may be used and distributed according to the terms of
-   the GNU General Public License (GPL), incorporated herein by reference.
-   Drivers based on or derived from this code fall under the GPL and must
-   retain the authorship, copyright and license notice.  This file is not
-   a complete program and may only be used when the entire operating
-   system is licensed under the GPL.
-
-   The author may be reached as bec...@scyld.com, or C/O
-   Scyld Computing Corporation
-   410 Severn Ave., Suite 210
-   Annapolis MD 21403
-
-   Support information and updates available at
-   http://www.scyld.com/network/pci-skeleton.html
-
-   Linux kernel updates:
-
-   Version 2.51, Nov 17, 2001 (jgarzik):
-   - Add ethtool support
-   - Replace some MII-related magic numbers with constants
-
-*/
-
-#define DRV_NAME   "fealnx"
-
-static int debug;  /* 1-> print debug message */
-static int max_interrupt_work = 20;
-
-/* Maximum number of multicast addresses to filter (vs. Rx-all-multicast). */
-static int multicast_filter_limit = 32;
-
-/* Set the copy breakpoint for the copy-only-tiny-frames scheme. */
-/* Setting to > 1518 effectively disables this feature.  */
-static int rx_copybreak;
-
-/* Used to pass the media type, etc.*/
-/* Both 'options[]' and 'full_duplex[]' should exist for driver */
-/* interoperability.*/
-/* The media type is usually passed in 'options[]'. */
-#define MAX_UNITS 8/* More are supported, limit only on options */

Re: Linux 6.1-rc2

2022-10-25 Thread Guenter Roeck
On Tue, Oct 25, 2022 at 09:41:50AM -0700, Linus Torvalds wrote:
> On Tue, Oct 25, 2022 at 9:24 AM Guenter Roeck  wrote:
> >
> > Build results:
> > total: 152 pass: 152 fail: 0
> > Qemu test results:
> > total: 499 pass: 499 fail: 0
> 
> Woo-hoo!
> 
> That was quick, for once.
> 

Yes, it was. I now have an even better one, with a new personal
milestone reached (500 qemu boot tests):

Build results:
total: 152 pass: 152 fail: 0
Qemu test results:
total: 500 pass: 500 fail: 0
   ^^^

... after getting yet another qemu machine to boot.

> > Runtime warnings
> 
> Oh.
> 
> Well, close enough, and those fixes are presumably pending too.
> 

Let's hope so. I think I forgot to copy the ppc maintainers last week,
so we'll see if we get some feedback on the status of those problems.

Thanks,
Guenter


[linux-next:master] BUILD REGRESSION 89bf6e28373beef9577fa71f996a5f73a569617c

2022-10-25 Thread kernel test robot
tree/branch: 
https://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git master
branch HEAD: 89bf6e28373beef9577fa71f996a5f73a569617c  Add linux-next specific 
files for 20221025

Error/Warning reports:

https://lore.kernel.org/linux-mm/202210110857.9s0txvnn-...@intel.com
https://lore.kernel.org/linux-mm/202210240729.zs46cfzo-...@intel.com
https://lore.kernel.org/linux-mm/202210251946.et92yahg-...@intel.com
https://lore.kernel.org/llvm/202210260009.9qq1jxzi-...@intel.com

Error/Warning: (recently discovered and may have been fixed)

drivers/net/ethernet/broadcom/genet/bcmgenet.c:1497:5-13: ERROR: invalid 
reference to the index variable of the iterator on line 1475
drivers/scsi/pm8001/pm8001_sas.c:996 pm8001_abort_task() warn: variable 
dereferenced before check 'task' (see line 986)

Unverified Error/Warning (likely false positive, please contact us if 
interested):

ERROR: modpost: "devm_ioremap" [drivers/net/ethernet/altera/altera_tse.ko] 
undefined!
ERROR: modpost: "ioremap" [drivers/net/ethernet/fujitsu/fmvj18x_cs.ko] 
undefined!
ERROR: modpost: "ioremap" [drivers/tty/ipwireless/ipwireless.ko] undefined!
ERROR: modpost: "iounmap" [drivers/net/ethernet/fujitsu/fmvj18x_cs.ko] 
undefined!
ERROR: modpost: "iounmap" [drivers/tty/ipwireless/ipwireless.ko] undefined!
mm/khugepaged.c:1729:7: warning: variable 'index' is used uninitialized 
whenever 'if' condition is true [-Wsometimes-uninitialized]
mm/khugepaged.c:1729:7: warning: variable 'nr' is used uninitialized whenever 
'if' condition is true [-Wsometimes-uninitialized]

Error/Warning ids grouped by kconfigs:

gcc_recent_errors
|-- ia64-randconfig-c033-20221025
|   `-- 
drivers-net-ethernet-broadcom-genet-bcmgenet.c:ERROR:invalid-reference-to-the-index-variable-of-the-iterator-on-line
`-- x86_64-randconfig-m001-20221024
`-- 
drivers-scsi-pm8001-pm8001_sas.c-pm8001_abort_task()-warn:variable-dereferenced-before-check-task-(see-line-)
clang_recent_errors
|-- arm-randconfig-r013-20221024
|   |-- 
drivers-phy-mediatek-phy-mtk-hdmi-mt2701.c:warning:result-of-comparison-of-constant-with-expression-of-type-typeof-(_Generic((mask_)-char:(unsigned-char)-unsigned-char:(unsigned-char)-signed-char:(uns
|   |-- 
drivers-phy-mediatek-phy-mtk-hdmi-mt8173.c:warning:result-of-comparison-of-constant-with-expression-of-type-typeof-(_Generic((mask_)-char:(unsigned-char)-unsigned-char:(unsigned-char)-signed-char:(uns
|   |-- 
drivers-phy-mediatek-phy-mtk-mipi-dsi-mt8173.c:warning:result-of-comparison-of-constant-with-expression-of-type-typeof-(_Generic((mask_)-char:(unsigned-char)-unsigned-char:(unsigned-char)-signed-char:
|   |-- 
drivers-phy-mediatek-phy-mtk-mipi-dsi-mt8183.c:warning:result-of-comparison-of-constant-with-expression-of-type-typeof-(_Generic((mask_)-char:(unsigned-char)-unsigned-char:(unsigned-char)-signed-char:
|   `-- 
fs-ntfs3-namei.c:warning:variable-uni1-is-used-uninitialized-whenever-if-condition-is-true
|-- arm-randconfig-r014-20221024
|   |-- 
drivers-phy-mediatek-phy-mtk-hdmi-mt2701.c:warning:result-of-comparison-of-constant-with-expression-of-type-typeof-(_Generic((mask_)-char:(unsigned-char)-unsigned-char:(unsigned-char)-signed-char:(uns
|   |-- 
drivers-phy-mediatek-phy-mtk-hdmi-mt8173.c:warning:result-of-comparison-of-constant-with-expression-of-type-typeof-(_Generic((mask_)-char:(unsigned-char)-unsigned-char:(unsigned-char)-signed-char:(uns
|   |-- 
drivers-phy-mediatek-phy-mtk-mipi-dsi-mt8173.c:warning:result-of-comparison-of-constant-with-expression-of-type-typeof-(_Generic((mask_)-char:(unsigned-char)-unsigned-char:(unsigned-char)-signed-char:
|   |-- 
drivers-phy-mediatek-phy-mtk-mipi-dsi-mt8183.c:warning:result-of-comparison-of-constant-with-expression-of-type-typeof-(_Generic((mask_)-char:(unsigned-char)-unsigned-char:(unsigned-char)-signed-char:
|   |-- 
drivers-phy-mediatek-phy-mtk-tphy.c:warning:result-of-comparison-of-constant-with-expression-of-type-typeof-(_Generic((mask_)-char:(unsigned-char)-unsigned-char:(unsigned-char)-signed-char:(unsigned-c
|   `-- 
fs-ntfs3-namei.c:warning:variable-uni1-is-used-uninitialized-whenever-if-condition-is-true
|-- hexagon-randconfig-r045-20221023
|   |-- 
drivers-phy-mediatek-phy-mtk-hdmi-mt2701.c:warning:result-of-comparison-of-constant-with-expression-of-type-typeof-(_Generic((mask_)-char:(unsigned-char)-unsigned-char:(unsigned-char)-signed-char:(uns
|   |-- 
drivers-phy-mediatek-phy-mtk-hdmi-mt8173.c:warning:result-of-comparison-of-constant-with-expression-of-type-typeof-(_Generic((mask_)-char:(unsigned-char)-unsigned-char:(unsigned-char)-signed-char:(uns
|   |-- 
drivers-phy-mediatek-phy-mtk-mipi-dsi-mt8173.c:warning:result-of-comparison-of-constant-with-expression-of-type-typeof-(_Generic((mask_)-char:(unsigned-char)-unsigned-char:(unsigned-char)-signed-char:
|   |-- 
drivers-phy-mediatek-phy-mtk-mipi-dsi-mt8183.c:warning:result-of-comparison-of-constant-with-expression-of-type-typeof-(_Generic((mask_)-char:(unsign

Re: Linux 6.1-rc2

2022-10-25 Thread Linus Torvalds
On Tue, Oct 25, 2022 at 9:24 AM Guenter Roeck  wrote:
>
> Build results:
> total: 152 pass: 152 fail: 0
> Qemu test results:
> total: 499 pass: 499 fail: 0

Woo-hoo!

That was quick, for once.

> Runtime warnings

Oh.

Well, close enough, and those fixes are presumably pending too.

  Linus


Re: Linux 6.1-rc2

2022-10-25 Thread Guenter Roeck
On Sun, Oct 23, 2022 at 04:03:45PM -0700, Linus Torvalds wrote:
> Hmm. Usually rc2 is a pretty quiet week, and it mostly started out
> that way too, but then things took a turn for the strange. End result:
> 6.1-rc2 ended up being unusually large.
> 
> The main reason is fairly benign, though: Mauro had screwed up the
> media tree pull request during the merge window, so rc2 ends up having
> a "oops, here's the part that was missing" moment. Since it had all
> been in linux-next (yes, I checked, so nobody else should try that
> trick), I ended up pulling that missing part during the rc2 week.
> 
> But if you ignore that media tree portion, things look pretty normal for an 
> rc2.
> 
> Anyway, ignoring those media changes, we have a little bit of
> everything in here - arch updates, drivers (gpu, device mapper,
> networking), EFI, some core kernel fixes (mm, scheduler, cgroup,
> networking). The full shortlog is appended (and that shortlog does
> include the media pieces).
> 
> Please do go test,

Build results:
total: 152 pass: 152 fail: 0
Qemu test results:
total: 499 pass: 499 fail: 0



Runtime warnings

powerpc
---

BUG: using smp_processor_id() in preemptible [] code: swapper/0/1

Not a new problem (seen as far back as v5.15.y), but fixed by:
"powerpc/64s: Disable preemption in hash lazy mmu mode"
"powerpc/64s: Fix hash__change_memory_range preemption warning"
"powerpc: fix reschedule bug in KUAP-unlocked user copy"

at:
https://patchwork.ozlabs.org/project/linuxppc-dev/patch/20221013151647.1857994-1-npig...@gmail.com/
https://patchwork.ozlabs.org/project/linuxppc-dev/patch/20221013151647.1857994-2-npig...@gmail.com/
https://patchwork.ozlabs.org/project/linuxppc-dev/patch/20221013151647.1857994-3-npig...@gmail.com/


WARNING: inconsistent lock state
inconsistent {IN-SOFTIRQ-W} -> {SOFTIRQ-ON-W} usage.

Fixed by:
"powerpc/64s: Add lockdep for HPTE lock"
"powerpc/64s: make HPTE lock and native_tlbie_lock irq-safe"
"powerpc/64s: make linear_map_hash_lock a raw spinlock:

at:
https://patchwork.ozlabs.org/project/linuxppc-dev/patch/20221013230710.1987253-1-npig...@gmail.com/
https://patchwork.ozlabs.org/project/linuxppc-dev/patch/20221013230710.1987253-2-npig...@gmail.com/
https://patchwork.ozlabs.org/project/linuxppc-dev/patch/20221013230710.1987253-3-npig...@gmail.com/

Guenter


Re: [PATCH v3 1/2] mm, hwpoison: Try to recover from copy-on write faults

2022-10-25 Thread 堀口 直也
On Fri, Oct 21, 2022 at 01:01:19PM -0700, Tony Luck wrote:
> If the kernel is copying a page as the result of a copy-on-write
> fault and runs into an uncorrectable error, Linux will crash because
> it does not have recovery code for this case where poison is consumed
> by the kernel.
> 
> It is easy to set up a test case. Just inject an error into a private
> page, fork(2), and have the child process write to the page.
> 
> I wrapped that neatly into a test at:
> 
>   git://git.kernel.org/pub/scm/linux/kernel/git/aegl/ras-tools.git
> 
> just enable ACPI error injection and run:
> 
>   # ./einj_mem-uc -f copy-on-write
> 
> Add a new copy_user_highpage_mc() function that uses copy_mc_to_kernel()
> on architectures where that is available (currently x86 and powerpc).
> When an error is detected during the page copy, return VM_FAULT_HWPOISON
> to caller of wp_page_copy(). This propagates up the call stack. Both x86
> and powerpc have code in their fault handler to deal with this code by
> sending a SIGBUS to the application.
> 
> Note that this patch avoids a system crash and signals the process that
> triggered the copy-on-write action. It does not take any action for the
> memory error that is still in the shared page. To handle that a call to
> memory_failure() is needed. But this cannot be done from wp_page_copy()
> because it holds mmap_lock(). Perhaps the architecture fault handlers
> can deal with this loose end in a subsequent patch?
> 
> On Intel/x86 this loose end will often be handled automatically because
> the memory controller provides an additional notification of the h/w
> poison in memory, the handler for this will call memory_failure(). This
> isn't a 100% solution. If there are multiple errors, not all may be
> logged in this way.
> 
> Reviewed-by: Dan Williams 
> Signed-off-by: Tony Luck 

Thank you for the update. Looks good to me.

Reviewed-by: Naoya Horiguchi