Re: [PATCH v7 0/5] clk: add driver for the SiFive FU740

2021-04-12 Thread Andreas Schwab
On Mär 31 2021, Zong Li wrote:

> I found that the gemgxlpll was disabled immediately by power
> management after macb driver install. The mainline's defconfig doesn't
> enable CONFIG_PM, so the network is fine on it. The opensuse defconfig
> enables CONFIG_PM, and the patch
> 732374a0b440d9a79c8412f318a25cd37ba6f4e2 added the enable/disable
> callback functions, so the gemgxlpll PLL, I have no idea why power
> management disable it, I would keep trace it.

Does that mean that CONFIG_PM also affects the FU740?

Andreas.

-- 
Andreas Schwab, sch...@linux-m68k.org
GPG Key fingerprint = 7578 EB47 D4E5 4D69 2510  2552 DF73 E780 A9DA AEC1
"And now for something completely different."


Re: [PATCH v7 0/5] clk: add driver for the SiFive FU740

2021-03-29 Thread Andreas Schwab
On Mär 29 2021, Zong Li wrote:

> Yes, I could get the network problem by using the defconfig you
> provided, the system hung up when executing 'ifconfig' immediately
> after installing macb driver module, the network can work by only
> reverting the commit 732374a0b440d9a79c8412f318a25cd37ba6f4e2. But the
> network is fine by using the mainline's defconfig, this is a little
> bit weird, I will check that and try to find the difference.

My guess would be that it is an init dependency problem between the phy
driver and the clock driver, which causes the clock to be enabled too
late.

Andreas.

-- 
Andreas Schwab, sch...@linux-m68k.org
GPG Key fingerprint = 7578 EB47 D4E5 4D69 2510  2552 DF73 E780 A9DA AEC1
"And now for something completely different."


Re: [PATCH v2] lib: fix kconfig dependency on ARCH_WANT_FRAME_POINTERS

2021-03-28 Thread Andreas Schwab
On Mär 28 2021, Julian Braha wrote:

> diff --git a/lib/Kconfig.debug b/lib/Kconfig.debug
> index 2779c29d9981..8d53ed423899 100644
> --- a/lib/Kconfig.debug
> +++ b/lib/Kconfig.debug
> @@ -1665,7 +1665,7 @@ config LATENCYTOP
>   depends on DEBUG_KERNEL
>   depends on STACKTRACE_SUPPORT
>   depends on PROC_FS
> - select FRAME_POINTER if !MIPS && !PPC && !S390 && !MICROBLAZE && !ARM 
> && !ARC && !X86
> + select FRAME_POINTER if MIPS || PPC || S390 || MICROBLAZE || ARM || ARC 
> || X86

That doesn't look correct.  It reverses the condition without reversing
the result, which means the result is probably the opposite than intended.

The same expression occurs two more times in this file.  Do those need
to be changed as well?

Andreas.

-- 
Andreas Schwab, sch...@linux-m68k.org
GPG Key fingerprint = 7578 EB47 D4E5 4D69 2510  2552 DF73 E780 A9DA AEC1
"And now for something completely different."


Re: [PATCH 2/4] exec: remove compat_do_execve

2021-03-26 Thread Andreas Schwab
On Mär 26 2021, Christoph Hellwig wrote:

> Just call compat_do_execve instead.

ITYM compat_do_execveat here.

Andreas.

-- 
Andreas Schwab, sch...@linux-m68k.org
GPG Key fingerprint = 7578 EB47 D4E5 4D69 2510  2552 DF73 E780 A9DA AEC1
"And now for something completely different."


Re: [PATCH v3 11/17] riscv: Convert to GENERIC_CMDLINE

2021-03-26 Thread Andreas Schwab
On Mär 26 2021, Christophe Leroy wrote:

> diff --git a/arch/riscv/kernel/setup.c b/arch/riscv/kernel/setup.c
> index f8f15332caa2..e7c91ee478d1 100644
> --- a/arch/riscv/kernel/setup.c
> +++ b/arch/riscv/kernel/setup.c
> @@ -20,6 +20,7 @@
>  #include 
>  #include 
>  #include 
> +#include 
>  
>  #include 
>  #include 
> @@ -228,10 +229,8 @@ static void __init parse_dtb(void)
>   }
>  
>   pr_err("No DTB passed to the kernel\n");
> -#ifdef CONFIG_CMDLINE_FORCE
> - strlcpy(boot_command_line, CONFIG_CMDLINE, COMMAND_LINE_SIZE);
> + cmdline_build(boot_command_line, NULL, COMMAND_LINE_SIZE);
>   pr_info("Forcing kernel command line to: %s\n", boot_command_line);

Shouldn't that message become conditional in some way?

Andreas.

-- 
Andreas Schwab, sch...@linux-m68k.org
GPG Key fingerprint = 7578 EB47 D4E5 4D69 2510  2552 DF73 E780 A9DA AEC1
"And now for something completely different."


Re: [PATCH v7 0/5] clk: add driver for the SiFive FU740

2021-03-26 Thread Andreas Schwab
On Mär 26 2021, Zong Li wrote:

> 1. Boot on openSUSE-Tumbleweed-RISC-V-JeOS-hifiveunleashed.riscv64.raw.xz
> w/ plugging ethernet cable
>   - It seems that I encountered a different situation with you, my
> system hung up and I didn't see the boot message you mentioned yet.

That's exactly the issue.  The process is stuck in D.

Andreas.

-- 
Andreas Schwab, sch...@linux-m68k.org
GPG Key fingerprint = 7578 EB47 D4E5 4D69 2510  2552 DF73 E780 A9DA AEC1
"And now for something completely different."


Re: [PATCH v7 0/5] clk: add driver for the SiFive FU740

2021-03-25 Thread Andreas Schwab
On Mär 25 2021, Zong Li wrote:

> take a look at this again. Could you also let me know which bootloader
> you used (FSBL or U-boot-SPL)? Thanks.

U-Boot SPL

Please try this image:

http://download.opensuse.org/ports/riscv/tumbleweed/images/openSUSE-Tumbleweed-RISC-V-JeOS-hifiveunleashed.riscv64.raw.xz

Andreas.

-- 
Andreas Schwab, sch...@linux-m68k.org
GPG Key fingerprint = 7578 EB47 D4E5 4D69 2510  2552 DF73 E780 A9DA AEC1
"And now for something completely different."


Re: [PATCH v7 0/5] clk: add driver for the SiFive FU740

2021-03-24 Thread Andreas Schwab
Were you able to reproduce the problem?

Andreas.

-- 
Andreas Schwab, sch...@linux-m68k.org
GPG Key fingerprint = 7578 EB47 D4E5 4D69 2510  2552 DF73 E780 A9DA AEC1
"And now for something completely different."


Re: macb broken on HiFive Unleashed

2021-03-19 Thread Andreas Schwab
On Mär 19 2021, Yixun Lan wrote:

> what's the exact root cause? and any solution?

Try reverting the five commits starting with
732374a0b440d9a79c8412f318a25cd37ba6f4e2.

Andreas.

-- 
Andreas Schwab, sch...@linux-m68k.org
GPG Key fingerprint = 7578 EB47 D4E5 4D69 2510  2552 DF73 E780 A9DA AEC1
"And now for something completely different."


Re: [PATCH v7 0/5] clk: add driver for the SiFive FU740

2021-03-19 Thread Andreas Schwab
On Mär 19 2021, Zong Li wrote:

> Could you please point me out how to test the ethernet from your side?

Please use
<https://github.com/openSUSE/kernel-source/blob/stable/config/riscv64/default>.

Andreas.

-- 
Andreas Schwab, sch...@linux-m68k.org
GPG Key fingerprint = 7578 EB47 D4E5 4D69 2510  2552 DF73 E780 A9DA AEC1
"And now for something completely different."


Re: macb broken on HiFive Unleashed

2021-03-17 Thread Andreas Schwab
It turned out to be a broken clock driver.

Andreas.

-- 
Andreas Schwab, sch...@linux-m68k.org
GPG Key fingerprint = 7578 EB47 D4E5 4D69 2510  2552 DF73 E780 A9DA AEC1
"And now for something completely different."


Re: [PATCH v7 0/5] clk: add driver for the SiFive FU740

2021-03-16 Thread Andreas Schwab
On Dez 09 2020, Zong Li wrote:

> Add a driver for the SiFive FU740 PRCI IP block, which handles more
> clocks than FU540. These patches also refactor the original
> implementation by spliting the dependent-code of fu540 and fu740
> respectively.

That breaks ethernet on the fu540.

Andreas.

-- 
Andreas Schwab, sch...@linux-m68k.org
GPG Key fingerprint = 7578 EB47 D4E5 4D69 2510  2552 DF73 E780 A9DA AEC1
"And now for something completely different."


Re: macb broken on HiFive Unleashed

2021-03-13 Thread Andreas Schwab
On Mär 13 2021, Emil Renner Berthing wrote:

> As you can see I haven't updated OpenSBI or u-boot in a while

Does it also work if you use the u-boot SPL instead of FSBL?

Andreas.

-- 
Andreas Schwab, sch...@linux-m68k.org
GPG Key fingerprint = 7578 EB47 D4E5 4D69 2510  2552 DF73 E780 A9DA AEC1
"And now for something completely different."


Re: macb broken on HiFive Unleashed

2021-03-10 Thread Andreas Schwab
On Mär 09 2021, claudiu.bez...@microchip.com wrote:

> I don't have a SiFive HiFive Unleashed to investigate this. Can you check
> if reverting commits on macb driver b/w 5.10 and 5.11 solves your issues:
>
> git log --oneline v5.10..v5.11 -- drivers/net/ethernet/cadence/
> 1d0d561ad1d7 net: macb: Correct usage of MACB_CAPS_CLK_HW_CHG flag
> 1d608d2e0d51 Revert "macb: support the two tx descriptors on at91rm9200"
> 700d566e8171 net: macb: add support for sama7g5 emac interface
> ec771de654e4 net: macb: add support for sama7g5 gem interface
> f4de93f03ed8 net: macb: unprepare clocks in case of failure
> 38493da4e6a8 net: macb: add function to disable all macb clocks
> daafa1d33cc9 net: macb: add capability to not set the clock rate
> edac63861db7 net: macb: add userio bits as platform configuration
> 9e6cad531c9d net: macb: Fix passing zero to 'PTR_ERR'
> 0012eeb370f8 net: macb: fix NULL dereference due to no pcs_config method
> e4e143e26ce8 net: macb: add support for high speed interface

Unfortunately, that didn't help.

Andreas.

-- 
Andreas Schwab, sch...@linux-m68k.org
GPG Key fingerprint = 7578 EB47 D4E5 4D69 2510  2552 DF73 E780 A9DA AEC1
"And now for something completely different."


macb broken on HiFive Unleashed

2021-03-08 Thread Andreas Schwab
One of the changes to the macb driver between 5.10 and 5.11 has broken
the SiFive HiFive Unleashed.  These are the last messages before the
system hangs:

[   12.468674] libphy: Fixed MDIO Bus: probed
[   12.746518] macb 1009.ethernet: Registered clk switch 
'sifive-gemgxl-mgmt'
[   12.753119] macb 1009.ethernet: GEM doesn't support hardware ptp.
[   12.760178] libphy: MACB_mii_bus: probed
[   12.881792] MACsec IEEE 802.1AE
[   12.944426] macb 1009.ethernet eth0: Cadence GEM rev 0x10070109 at 
0x1009 irq 16 (70:b3:d5:92:f1:07)

Andreas.

-- 
Andreas Schwab, sch...@linux-m68k.org
GPG Key fingerprint = 7578 EB47 D4E5 4D69 2510  2552 DF73 E780 A9DA AEC1
"And now for something completely different."


Re: [RFC PATCH v1] powerpc: Enable KFENCE for PPC32

2021-03-03 Thread Andreas Schwab
On Mär 03 2021, Marco Elver wrote:

> On Wed, 3 Mar 2021 at 11:32, Christophe Leroy
>  wrote:
>> ./include/linux/kern_levels.h:5:18: warning: format '%zd' expects argument 
>> of type 'signed size_t',
>> but argument 3 has type 'ptrdiff_t' {aka 'const long int'} [-Wformat=]
>>  5 | #define KERN_SOH "\001"  /* ASCII Start Of Header */
>>|  ^~
>> ./include/linux/kern_levels.h:11:18: note: in expansion of macro 'KERN_SOH'
>> 11 | #define KERN_ERR KERN_SOH "3" /* error conditions */
>>|  ^~~~
>> ./include/linux/printk.h:343:9: note: in expansion of macro 'KERN_ERR'
>>343 |  printk(KERN_ERR pr_fmt(fmt), ##__VA_ARGS__)
>>| ^~~~
>> mm/kfence/report.c:233:3: note: in expansion of macro 'pr_err'
>>233 |   pr_err("Invalid free of 0x%p (in kfence-#%zd):\n", (void 
>> *)address,
>>|   ^~
>>
>> Christophe
>
> No this is not expected. Is 'signed size_t' != 'long int' on ppc32?

If you want to format a ptrdiff_t you should use %td.

Andreas.

-- 
Andreas Schwab, sch...@linux-m68k.org
GPG Key fingerprint = 7578 EB47 D4E5 4D69 2510  2552 DF73 E780 A9DA AEC1
"And now for something completely different."


Re: [PATCH] Revert "dts: phy: add GPIO number and active state used for phy reset"

2021-02-10 Thread Andreas Schwab
On Feb 04 2021, Palmer Dabbelt wrote:

> From: Palmer Dabbelt 
>
> VSC8541 phys need a special reset sequence, which the driver doesn't
> currentlny support.  As a result enabling the reset via GPIO essentially
> guarnteees that the device won't work correctly.
>
> This reverts commit a0fa9d727043da2238432471e85de0bdb8a8df65.
>
> Fixes: a0fa9d727043 ("dts: phy: add GPIO number and active state used for phy 
> reset")
> Cc: sta...@vger.kernel.org
> Signed-off-by: Palmer Dabbelt 

This fixes ethernet on the HiFive Unleashed with 5.10.12.

Andreas.

-- 
Andreas Schwab, sch...@linux-m68k.org
GPG Key fingerprint = 7578 EB47 D4E5 4D69 2510  2552 DF73 E780 A9DA AEC1
"And now for something completely different."


Re: [PATCH] arch: m68k: include: asm: Reconstruct the sentence in file sun3ints.h

2021-02-05 Thread Andreas Schwab
On Feb 05 2021, Bhaskar Chowdhury wrote:

> -/* master list of VME vectors -- don't fuck with this */
> +/* master list of VME vectors -- don't do anything with this */

don't mess with this

Andreas.

-- 
Andreas Schwab, sch...@linux-m68k.org
GPG Key fingerprint = 7578 EB47 D4E5 4D69 2510  2552 DF73 E780 A9DA AEC1
"And now for something completely different."


Re: [PATCH v2 0/3] fix macb phy probe failure if phy-reset is not handled

2021-02-04 Thread Andreas Schwab
On Jan 13 2021, Palmer Dabbelt wrote:

> On Tue, 10 Nov 2020 07:22:09 PST (-0800), sagar.ka...@sifive.com wrote:
>> HiFive Unleashed is having VSC8541-01 ethernet phy device and requires a
>> specific reset sequence of 0-1-0-1 in order to use it in unmanaged mode.
>> This series addresses a corner case where phy reset is not handled by boot
>> stages prior to linux.
>> Somewhat similar unreliable phy probe failure was reported and discussed
>> here [1].
>> The macb driver fails to detect the ethernet phy device if the bootloader
>> doesn't provide a proper reset sequence to the phy device or the phy itself
>> is in some invalid state. Currently, the FSBL or u-boot-spl is resetting
>> the phy device, and so there is no issue observed in the linux network
>> setup.
>>
>> The series is based on linux-5.10-rc5.
>> Patch 1: Add the OUI to the phy dt node to fix issue of missing mdio device
>> Patch 2 and 3:
>>  Resetting phy needs GPIO support so add to dt and defconfig.
>>
>> [1] https://lkml.org/lkml/2018/11/29/154
>>
>> To reproduce the issue:
>> Using FSBL:
>> 1. Comment out VSC8541 reset sequence in fsbl/main.c
>>from within the freedom-u540-c000-bootloader.
>> 2. Build and flash fsbl.bin to micro sdcard.
>>
>> Using u-boot:
>> 1. Comment out VSC8541 reset sequence in board/sifive/fu540/spl.c
>>from mainline u-boot source code.
>> 2. Build and flash u-boot binaries to micro sdcard.
>>
>> Boot the board and bootlog will show network setup failure messages as:
>>
>> [  1.069474] libphy: MACB_mii_bus: probed
>> [  1.073092] mdio_bus 1009.ethernet-: MDIO device at address 0
>> is missing
>> .
>> [  1.979252] macb 1009.ethernet eth0: Could not attach PHY (-19)
>>
>> 3. Now apply the series build, and boot kernel.
>> 4. MACB and VSC8541 driver get successfully probed and the network is set
>>without any failure.
>>
>>
>> So irrespective of whether the prior stages handle the phy reset sequence,
>> the probing is successful in both the cases of cold boot and warm boot.
>>
>> Change History:
>> ===
>> V2:
>> -Rebased v1 on linux kernel v5.10-rc3.
>>
>> V1:
>> -Ignore 4th patch as suggested and so removed it from the series.
>> -Verified this series on 5.7-rc5.
>>
>> V0: Base RFC patch. Verified on 5.7-rc2
>>
>> Sagar Shrikant Kadam (3):
>>   dts: phy: fix missing mdio device and probe failure of vsc8541-01
>> device
>>   dts: phy: add GPIO number and active state used for phy reset
>>   riscv: defconfig: enable gpio support for HiFive Unleashed
>>
>>  arch/riscv/boot/dts/sifive/hifive-unleashed-a00.dts | 2 ++
>>  arch/riscv/configs/defconfig| 2 ++
>>  2 files changed, 4 insertions(+)
>
> David pointed out I missed these, they're on fixes.  Thanks!

This is now on 5.10.12, and breaks ethernet on the Hifive Unleashed:

[   12.777976] macb 1009.ethernet: Registered clk switch 
'sifive-gemgxl-mgmt'
[   12.784559] macb 1009.ethernet: GEM doesn't support hardware ptp.
[   12.791629] libphy: MACB_mii_bus: probed
[   12.919728] MACsec IEEE 802.1AE
[   12.984676] macb 1009.ethernet eth0: Cadence GEM rev 0x10070109 at 
0x1009 irq 16 (70:b3:d5:92:f1:07)
[   14.030319] Microsemi VSC8541 SyncE 1009.ethernet-:00: 
phy_poll_reset failed: -110
[   14.038986] macb 1009.ethernet eth0: Could not attach PHY (-110)

Andreas.

-- 
Andreas Schwab, sch...@linux-m68k.org
GPG Key fingerprint = 7578 EB47 D4E5 4D69 2510  2552 DF73 E780 A9DA AEC1
"And now for something completely different."


[PATCH] powerpc/vdso: fix clock_gettime_fallback for vdso32

2021-01-11 Thread Andreas Schwab
The second argument of __kernel_clock_gettime64 points to a struct
__kernel_timespec, with 64-bit time_t, so use the clock_gettime64 syscall
in the fallback function for the 32-bit vdso.  Similarily,
clock_getres_fallback should use the clock_getres_time64 syscall, though
it isn't yet called from the 32-bit vdso.

Signed-off-by: Andreas Schwab 
---
 arch/powerpc/include/asm/vdso/gettimeofday.h | 8 
 1 file changed, 8 insertions(+)

diff --git a/arch/powerpc/include/asm/vdso/gettimeofday.h 
b/arch/powerpc/include/asm/vdso/gettimeofday.h
index 81671aa365b3..a26c12df2c9a 100644
--- a/arch/powerpc/include/asm/vdso/gettimeofday.h
+++ b/arch/powerpc/include/asm/vdso/gettimeofday.h
@@ -106,13 +106,21 @@ int gettimeofday_fallback(struct __kernel_old_timeval 
*_tv, struct timezone *_tz
 static __always_inline
 int clock_gettime_fallback(clockid_t _clkid, struct __kernel_timespec *_ts)
 {
+#ifndef __powerpc64__
+   return do_syscall_2(__NR_clock_gettime64, _clkid, (unsigned long)_ts);
+#else
return do_syscall_2(__NR_clock_gettime, _clkid, (unsigned long)_ts);
+#endif
 }
 
 static __always_inline
 int clock_getres_fallback(clockid_t _clkid, struct __kernel_timespec *_ts)
 {
+#ifndef __powerpc64__
+   return do_syscall_2(__NR_clock_getres_time64, _clkid, (unsigned 
long)_ts);
+#else
return do_syscall_2(__NR_clock_getres, _clkid, (unsigned long)_ts);
+#endif
 }
 
 #ifdef CONFIG_VDSO32
-- 
2.30.0


-- 
Andreas Schwab, sch...@linux-m68k.org
GPG Key fingerprint = 7578 EB47 D4E5 4D69 2510  2552 DF73 E780 A9DA AEC1
"And now for something completely different."


Re: [PATCH] sh: boards: Fix the cacography in irq.c

2021-01-01 Thread Andreas Schwab
On Nov 19 2020, Tang Bin wrote:

> The world 'swtich' is wrong, so fix it.

s/world/word/

Andreas.

-- 
Andreas Schwab, sch...@linux-m68k.org
GPG Key fingerprint = 7578 EB47 D4E5 4D69 2510  2552 DF73 E780 A9DA AEC1
"And now for something completely different."


Re: [PATCH 2/2] m68k: let clk_enable() return immediately if clk is NULL

2020-12-27 Thread Andreas Schwab
On Dez 27 2020, Defang Bo wrote:

> diff --git a/arch/m68k/coldfire/clk.c b/arch/m68k/coldfire/clk.c
> index 7bc666e..cf1ed97 100644
> --- a/arch/m68k/coldfire/clk.c
> +++ b/arch/m68k/coldfire/clk.c
> @@ -90,6 +90,9 @@ EXPORT_SYMBOL(clk_get);
>  int clk_enable(struct clk *clk)
>  {
>   unsigned long flags;
> + if (!clk)
> + return;

That fails to return a value.

Andreas.

-- 
Andreas Schwab, sch...@linux-m68k.org
GPG Key fingerprint = 7578 EB47 D4E5 4D69 2510  2552 DF73 E780 A9DA AEC1
"And now for something completely different."


Re: riscv+KASAN does not boot

2020-12-25 Thread Andreas Schwab
On Dez 25 2020, Dmitry Vyukov wrote:

> qemu-system-riscv64 \
> -machine virt -bios default -smp 1 -m 2G \
> -device virtio-blk-device,drive=hd0 \
> -drive file=buildroot-riscv64.ext4,if=none,format=raw,id=hd0 \
> -kernel arch/riscv/boot/Image \
> -nographic \
> -device virtio-rng-device,rng=rng0 -object
> rng-random,filename=/dev/urandom,id=rng0 \
> -netdev user,id=net0,host=10.0.2.10,hostfwd=tcp::10022-:22 -device
> virtio-net-device,netdev=net0 \
> -append "root=/dev/vda earlyprintk=serial console=ttyS0 oops=panic
> panic_on_warn=1 panic=86400"

Do you get more output with earlycon=sbi?

Andreas.

-- 
Andreas Schwab, sch...@linux-m68k.org
GPG Key fingerprint = 7578 EB47 D4E5 4D69 2510  2552 DF73 E780 A9DA AEC1
"And now for something completely different."


[PATCH] riscv: return -ENOSYS for syscall -1

2020-12-21 Thread Andreas Schwab
Properly return -ENOSYS for syscall -1 instead of leaving the return value
uninitialized.  This fixes the strace teststuite.

Fixes: 5340627e3fe0 ("riscv: add support for SECCOMP and SECCOMP_FILTER")
Signed-off-by: Andreas Schwab 
---
 arch/riscv/kernel/entry.S | 9 +
 1 file changed, 1 insertion(+), 8 deletions(-)

diff --git a/arch/riscv/kernel/entry.S b/arch/riscv/kernel/entry.S
index 524d918f3601..d07763001eb0 100644
--- a/arch/riscv/kernel/entry.S
+++ b/arch/riscv/kernel/entry.S
@@ -186,14 +186,7 @@ check_syscall_nr:
 * Syscall number held in a7.
 * If syscall number is above allowed value, redirect to ni_syscall.
 */
-   bge a7, t0, 1f
-   /*
-* Check if syscall is rejected by tracer, i.e., a7 == -1.
-* If yes, we pretend it was executed.
-*/
-   li t1, -1
-   beq a7, t1, ret_from_syscall_rejected
-   blt a7, t1, 1f
+   bgeu a7, t0, 1f
/* Call syscall */
la s0, sys_call_table
slli t0, a7, RISCV_LGPTR
-- 
2.29.0


-- 
Andreas Schwab, SUSE Labs, sch...@suse.de
GPG Key fingerprint = 0196 BAD8 1CE9 1970 F4BE  1748 E4D4 88E3 0EEA B9D7
"And now for something completely different."


Re: [PATCH] riscv: Fixed kernel test robot warning

2020-12-08 Thread Andreas Schwab
On Dez 09 2020, Souptick Joarder wrote:

> Kernel test robot throws below warning -
>
>arch/riscv/kernel/asm-offsets.c:14:6: warning: no previous prototype
> for 'asm_offsets' [-Wmissing-prototypes]
>   14 | void asm_offsets(void)
>  |  ^~~
>
> This patch should fixed it.

Or rename it to main, like most other asm-offsets files.

Andreas.

-- 
Andreas Schwab, sch...@linux-m68k.org
GPG Key fingerprint = 7578 EB47 D4E5 4D69 2510  2552 DF73 E780 A9DA AEC1
"And now for something completely different."


Re: [PATCH] riscv: Fixed kernel test robot warning

2020-12-08 Thread Andreas Schwab
On Dez 09 2020, Souptick Joarder wrote:

> On Wed, Dec 9, 2020 at 1:21 AM Andreas Schwab  wrote:
>>
>> On Dez 09 2020, Souptick Joarder wrote:
>>
>> > Kernel test robot throws below warning -
>> >
>> >arch/riscv/kernel/asm-offsets.c:14:6: warning: no previous prototype
>> > for 'asm_offsets' [-Wmissing-prototypes]
>> >   14 | void asm_offsets(void)
>> >  |  ^~~
>> >
>> > This patch should fixed it.
>>
>> Or rename it to main, like most other asm-offsets files.
>
> Few asm-offsets files named it as foo(). Does a rename to main() will
> work straight forward ?

Calling it main will suppress the warning, but other than that it is
completely irrelevant how you call it.

Andreas.

-- 
Andreas Schwab, sch...@linux-m68k.org
GPG Key fingerprint = 7578 EB47 D4E5 4D69 2510  2552 DF73 E780 A9DA AEC1
"And now for something completely different."


Re: [Y2038][time namespaces] Question regarding CLOCK_REALTIME support plans in Linux time namespaces

2020-11-26 Thread Andreas Schwab
On Nov 25 2020, Carlos O'Donell via Libc-alpha wrote:

> We might write a syscall interception framework using seccomp
> and SECCOMP_RET_TRACE, but that involves ptrace'ing the process
> under test, and is equivalent to a micro-sandbox. I'm not against
> that idea for testing; we would test what we ship.

seccomp and ptrace does not work with qemu linux-user.

Andreas.

-- 
Andreas Schwab, sch...@linux-m68k.org
GPG Key fingerprint = 7578 EB47 D4E5 4D69 2510  2552 DF73 E780 A9DA AEC1
"And now for something completely different."


Re: [PATCH] compiler.h: Fix barrier_data() on clang

2020-11-16 Thread Andreas Schwab
On Nov 16 2020, Nick Desaulniers wrote:

> A lot of VDSO's reset KBUILD_CFLAGS or use a new variable for their
> compiler flags.  As such, they're missing `-include` command line flag
> that injects include/linux/compiler_types.h,

It's not missing here.

Andreas.

-- 
Andreas Schwab, sch...@linux-m68k.org
GPG Key fingerprint = 7578 EB47 D4E5 4D69 2510  2552 DF73 E780 A9DA AEC1
"And now for something completely different."


Re: [PATCH] compiler.h: Fix barrier_data() on clang

2020-11-16 Thread Andreas Schwab
On Nov 16 2020, Randy Dunlap wrote:

> What kernel version are you building?

5.10-rc4

Andreas.

-- 
Andreas Schwab, sch...@linux-m68k.org
GPG Key fingerprint = 7578 EB47 D4E5 4D69 2510  2552 DF73 E780 A9DA AEC1
"And now for something completely different."


Re: [PATCH] compiler.h: Fix barrier_data() on clang

2020-11-16 Thread Andreas Schwab
On Okt 14 2020, Arvind Sankar wrote:

> Commit
>   815f0ddb346c ("include/linux/compiler*.h: make compiler-*.h mutually 
> exclusive")
>
> neglected to copy barrier_data() from compiler-gcc.h into
> compiler-clang.h. The definition in compiler-gcc.h was really to work
> around clang's more aggressive optimization, so this broke
> barrier_data() on clang, and consequently memzero_explicit() as well.
>
> For example, this results in at least the memzero_explicit() call in
> lib/crypto/sha256.c:sha256_transform() being optimized away by clang.
>
> Fix this by moving the definition of barrier_data() into compiler.h.
>
> Also move the gcc/clang definition of barrier() into compiler.h,
> __memory_barrier() is icc-specific (and barrier() is already defined
> using it in compiler-intel.h) and doesn't belong in compiler.h.
>
> Signed-off-by: Arvind Sankar 
> Fixes: 815f0ddb346c ("include/linux/compiler*.h: make compiler-*.h mutually 
> exclusive")

This breaks build on riscv:

  CC [M]  drivers/net/ethernet/emulex/benet/be_main.o
In file included from ./include/vdso/processor.h:10,
 from ./arch/riscv/include/asm/processor.h:11,
 from ./include/linux/prefetch.h:15,
 from drivers/net/ethernet/emulex/benet/be_main.c:14:
./arch/riscv/include/asm/vdso/processor.h: In function 'cpu_relax':
./arch/riscv/include/asm/vdso/processor.h:14:2: error: implicit declaration of 
function 'barrier' [-Werror=implicit-function-declaration]
   14 |  barrier();
  |  ^~~
cc1: some warnings being treated as errors
make[5]: *** [scripts/Makefile.build:283: 
drivers/net/ethernet/emulex/benet/be_main.o] Error 1
make[4]: *** [scripts/Makefile.build:500: drivers/net/ethernet/emulex/benet] 
Error 2
make[3]: *** [scripts/Makefile.build:500: drivers/net/ethernet/emulex] Error 2
make[2]: *** [scripts/Makefile.build:500: drivers/net/ethernet] Error 2
make[1]: *** [scripts/Makefile.build:500: drivers/net] Error 2
make: *** [Makefile:1799: drivers] Error 2

Andreas.

-- 
Andreas Schwab, sch...@linux-m68k.org
GPG Key fingerprint = 7578 EB47 D4E5 4D69 2510  2552 DF73 E780 A9DA AEC1
"And now for something completely different."


Re: [PATCH] powerpc/32s: Use relocation offset when setting early hash table

2020-11-07 Thread Andreas Schwab
On Nov 07 2020, Serge Belyshev wrote:

> Christophe Leroy  writes:
>
>> When calling early_hash_table(), the kernel hasn't been yet
>> relocated to its linking address, so data must be addressed
>> with relocation offset.
>>
>> Add relocation offset to write into Hash in early_hash_table().
>>
>> Reported-by: Erhard Furtner 
>> Reported-by: Andreas Schwab 
>> Fixes: 69a1593abdbc ("powerpc/32s: Setup the early hash table at all time.")
>> Signed-off-by: Christophe Leroy 
>
> Tested-by: Serge Belyshev 

Works here as well.

Thanks, Andreas.

-- 
Andreas Schwab, sch...@linux-m68k.org
GPG Key fingerprint = 7578 EB47 D4E5 4D69 2510  2552 DF73 E780 A9DA AEC1
"And now for something completely different."


Re: [PATCH 1/4] clk: sifive: Extract prci core to common base

2020-11-05 Thread Andreas Schwab
On Nov 05 2020, Zong Li wrote:

> I tried to add -M and -C option to find renames and copies, but it
> doesn't detect anything here.

-C40 finds a copy drivers/clk/sifive/{fu540-prci.c => sifive-prci.c}.

Andreas.

-- 
Andreas Schwab, sch...@linux-m68k.org
GPG Key fingerprint = 7578 EB47 D4E5 4D69 2510  2552 DF73 E780 A9DA AEC1
"And now for something completely different."


Re: [PATCH] powerpc/32s: Setup the early hash table at all time.

2020-11-03 Thread Andreas Schwab
On Nov 03 2020, Christophe Leroy wrote:

> Would you mind checking that with that patch reverted, you are able to
> boot a kernel built with CONFIG_KASAN ?

That doesn't exist.

Andreas.

-- 
Andreas Schwab, sch...@linux-m68k.org
GPG Key fingerprint = 7578 EB47 D4E5 4D69 2510  2552 DF73 E780 A9DA AEC1
"And now for something completely different."


Re: [PATCH] powerpc/32s: Setup the early hash table at all time.

2020-11-03 Thread Andreas Schwab
On Nov 03 2020, Christophe Leroy wrote:

> I tried again on QEMU with both pmac32_defconfig and your config, and it 
> boots.

Isn't it quite naïve to think that qemu provides an adequate test
environment for such lowlevel stuff?

Andreas.

-- 
Andreas Schwab, sch...@linux-m68k.org
GPG Key fingerprint = 7578 EB47 D4E5 4D69 2510  2552 DF73 E780 A9DA AEC1
"And now for something completely different."


Re: [PATCH] powerpc/32s: Setup the early hash table at all time.

2020-10-30 Thread Andreas Schwab
#
# Automatically generated file; DO NOT EDIT.
# Linux/powerpc 5.10.0-rc1 Kernel Configuration
#
CONFIG_CC_VERSION_TEXT="gcc-4.9 (SUSE Linux) 4.9.3"
CONFIG_CC_IS_GCC=y
CONFIG_GCC_VERSION=40903
CONFIG_LD_VERSION=23501
CONFIG_CLANG_VERSION=0
CONFIG_CC_CAN_LINK=y
CONFIG_CC_CAN_LINK_STATIC=y
CONFIG_CC_HAS_ASM_GOTO=y
CONFIG_IRQ_WORK=y
CONFIG_BUILDTIME_TABLE_SORT=y
CONFIG_THREAD_INFO_IN_TASK=y

#
# General setup
#
CONFIG_BROKEN_ON_SMP=y
CONFIG_INIT_ENV_ARG_LIMIT=32
# CONFIG_COMPILE_TEST is not set
CONFIG_LOCALVERSION=""
# CONFIG_LOCALVERSION_AUTO is not set
CONFIG_BUILD_SALT=""
CONFIG_HAVE_KERNEL_GZIP=y
CONFIG_HAVE_KERNEL_XZ=y
CONFIG_KERNEL_GZIP=y
# CONFIG_KERNEL_XZ is not set
CONFIG_DEFAULT_INIT=""
CONFIG_DEFAULT_HOSTNAME="(none)"
CONFIG_SWAP=y
CONFIG_SYSVIPC=y
CONFIG_SYSVIPC_SYSCTL=y
CONFIG_POSIX_MQUEUE=y
CONFIG_POSIX_MQUEUE_SYSCTL=y
CONFIG_WATCH_QUEUE=y
CONFIG_CROSS_MEMORY_ATTACH=y
CONFIG_USELIB=y
CONFIG_AUDIT=y
CONFIG_HAVE_ARCH_AUDITSYSCALL=y
CONFIG_AUDITSYSCALL=y

#
# IRQ subsystem
#
CONFIG_GENERIC_IRQ_SHOW=y
CONFIG_GENERIC_IRQ_SHOW_LEVEL=y
CONFIG_IRQ_DOMAIN=y
CONFIG_IRQ_FORCED_THREADING=y
CONFIG_SPARSE_IRQ=y
# CONFIG_GENERIC_IRQ_DEBUGFS is not set
# end of IRQ subsystem

CONFIG_GENERIC_TIME_VSYSCALL=y
CONFIG_GENERIC_CLOCKEVENTS=y
CONFIG_GENERIC_CMOS_UPDATE=y

#
# Timers subsystem
#
CONFIG_TICK_ONESHOT=y
CONFIG_NO_HZ_COMMON=y
# CONFIG_HZ_PERIODIC is not set
CONFIG_NO_HZ_IDLE=y
CONFIG_NO_HZ=y
CONFIG_HIGH_RES_TIMERS=y
# end of Timers subsystem

# CONFIG_PREEMPT_NONE is not set
CONFIG_PREEMPT_VOLUNTARY=y
# CONFIG_PREEMPT is not set

#
# CPU/Task time and stats accounting
#
CONFIG_TICK_CPU_ACCOUNTING=y
# CONFIG_VIRT_CPU_ACCOUNTING_NATIVE is not set
# CONFIG_IRQ_TIME_ACCOUNTING is not set
CONFIG_BSD_PROCESS_ACCT=y
CONFIG_BSD_PROCESS_ACCT_V3=y
CONFIG_TASKSTATS=y
CONFIG_TASK_DELAY_ACCT=y
CONFIG_TASK_XACCT=y
CONFIG_TASK_IO_ACCOUNTING=y
CONFIG_PSI=y
# CONFIG_PSI_DEFAULT_DISABLED is not set
# end of CPU/Task time and stats accounting

#
# RCU Subsystem
#
CONFIG_TINY_RCU=y
# CONFIG_RCU_EXPERT is not set
CONFIG_SRCU=y
CONFIG_TINY_SRCU=y
CONFIG_TASKS_RCU_GENERIC=y
CONFIG_TASKS_TRACE_RCU=y
# end of RCU Subsystem

CONFIG_IKCONFIG=y
CONFIG_IKCONFIG_PROC=y
# CONFIG_IKHEADERS is not set
CONFIG_LOG_BUF_SHIFT=18
CONFIG_PRINTK_SAFE_LOG_BUF_SHIFT=13

#
# Scheduler features
#
# end of Scheduler features

CONFIG_CGROUPS=y
CONFIG_PAGE_COUNTER=y
CONFIG_MEMCG=y
CONFIG_MEMCG_SWAP=y
CONFIG_MEMCG_KMEM=y
CONFIG_BLK_CGROUP=y
CONFIG_CGROUP_WRITEBACK=y
CONFIG_CGROUP_SCHED=y
CONFIG_FAIR_GROUP_SCHED=y
CONFIG_CFS_BANDWIDTH=y
CONFIG_RT_GROUP_SCHED=y
CONFIG_CGROUP_PIDS=y
# CONFIG_CGROUP_RDMA is not set
CONFIG_CGROUP_FREEZER=y
CONFIG_CGROUP_DEVICE=y
CONFIG_CGROUP_CPUACCT=y
# CONFIG_CGROUP_BPF is not set
# CONFIG_CGROUP_DEBUG is not set
CONFIG_SOCK_CGROUP_DATA=y
CONFIG_NAMESPACES=y
CONFIG_UTS_NS=y
CONFIG_IPC_NS=y
CONFIG_USER_NS=y
CONFIG_PID_NS=y
CONFIG_NET_NS=y
# CONFIG_CHECKPOINT_RESTORE is not set
CONFIG_SCHED_AUTOGROUP=y
# CONFIG_SYSFS_DEPRECATED is not set
CONFIG_RELAY=y
CONFIG_BLK_DEV_INITRD=y
CONFIG_INITRAMFS_SOURCE=""
CONFIG_RD_GZIP=y
CONFIG_RD_BZIP2=y
CONFIG_RD_LZMA=y
CONFIG_RD_XZ=y
CONFIG_RD_LZO=y
CONFIG_RD_LZ4=y
CONFIG_RD_ZSTD=y
CONFIG_BOOT_CONFIG=y
# CONFIG_CC_OPTIMIZE_FOR_PERFORMANCE is not set
CONFIG_CC_OPTIMIZE_FOR_SIZE=y
CONFIG_HAVE_LD_DEAD_CODE_DATA_ELIMINATION=y
# CONFIG_LD_DEAD_CODE_DATA_ELIMINATION is not set
CONFIG_SYSCTL=y
CONFIG_SYSCTL_EXCEPTION_TRACE=y
CONFIG_BPF=y
CONFIG_EXPERT=y
CONFIG_MULTIUSER=y
CONFIG_SGETMASK_SYSCALL=y
CONFIG_SYSFS_SYSCALL=y
CONFIG_FHANDLE=y
CONFIG_POSIX_TIMERS=y
CONFIG_PRINTK=y
CONFIG_BUG=y
CONFIG_ELF_CORE=y
CONFIG_BASE_FULL=y
CONFIG_FUTEX=y
CONFIG_FUTEX_PI=y
CONFIG_EPOLL=y
CONFIG_SIGNALFD=y
CONFIG_TIMERFD=y
CONFIG_EVENTFD=y
CONFIG_SHMEM=y
CONFIG_AIO=y
CONFIG_IO_URING=y
CONFIG_ADVISE_SYSCALLS=y
CONFIG_MEMBARRIER=y
CONFIG_KALLSYMS=y
CONFIG_KALLSYMS_ALL=y
CONFIG_KALLSYMS_BASE_RELATIVE=y
CONFIG_BPF_SYSCALL=y
# CONFIG_BPF_PRELOAD is not set
CONFIG_USERFAULTFD=y
CONFIG_ARCH_HAS_MEMBARRIER_CALLBACKS=y
CONFIG_ARCH_HAS_MEMBARRIER_SYNC_CORE=y
CONFIG_RSEQ=y
# CONFIG_DEBUG_RSEQ is not set
# CONFIG_EMBEDDED is not set
CONFIG_HAVE_PERF_EVENTS=y
# CONFIG_PC104 is not set

#
# Kernel Performance Events And Counters
#
# CONFIG_PERF_EVENTS is not set
# end of Kernel Performance Events And Counters

CONFIG_VM_EVENT_COUNTERS=y
CONFIG_SLUB_DEBUG=y
CONFIG_SLUB_MEMCG_SYSFS_ON=y
# CONFIG_COMPAT_BRK is not set
# CONFIG_SLAB is not set
CONFIG_SLUB=y
# CONFIG_SLOB is not set
CONFIG_SLAB_MERGE_DEFAULT=y
# CONFIG_SLAB_FREELIST_RANDOM is not set
# CONFIG_SLAB_FREELIST_HARDENED is not set
# CONFIG_SHUFFLE_PAGE_ALLOCATOR is not set
CONFIG_SYSTEM_DATA_VERIFICATION=y
# CONFIG_PROFILING is not set
# end of General setup

CONFIG_PPC32=y
# CONFIG_PPC64 is not set
CONFIG_PPC_BOOK3S_32=y

#
# Processor support
#
CONFIG_PPC_BOOK3S_6xx=y
# CONFIG_PPC_85xx is not set
# CONFIG_PPC_8xx is not set
# CONFIG_40x is not set
# CONFIG_44x is not set
# CONFIG_E200 is not set
# CONFIG_GENERIC_CPU is not set
# CONFIG_E300C2_CPU is not set
# 

Re: [PATCH] powerpc/32s: Setup the early hash table at all time.

2020-10-30 Thread Andreas Schwab
On Okt 30 2020, Michael Ellerman wrote:

> Andreas Schwab  writes:
>> On Okt 01 2020, Christophe Leroy wrote:
>>
>>> At the time being, an early hash table is set up when
>>> CONFIG_KASAN is selected.
>>>
>>> There is nothing wrong with setting such an early hash table
>>> all the time, even if it is not used. This is a statically
>>> allocated 256 kB table which lies in the init data section.
>>>
>>> This makes the code simpler and may in the future allow to
>>> setup early IO mappings with fixmap instead of hard coding BATs.
>>>
>>> Put create_hpte() and flush_hash_pages() in the .ref.text section
>>> in order to avoid warning for the reference to early_hash[]. This
>>> reference is removed by MMU_init_hw_patch() before init memory is
>>> freed.
>>
>> This breaks booting on the iBook G4.
>
> Do you get an oops or anything?

Nope, nothing at all.

Andreas.

-- 
Andreas Schwab, sch...@linux-m68k.org
GPG Key fingerprint = 7578 EB47 D4E5 4D69 2510  2552 DF73 E780 A9DA AEC1
"And now for something completely different."


Re: [PATCH] powerpc/32s: Setup the early hash table at all time.

2020-10-29 Thread Andreas Schwab
On Okt 01 2020, Christophe Leroy wrote:

> At the time being, an early hash table is set up when
> CONFIG_KASAN is selected.
>
> There is nothing wrong with setting such an early hash table
> all the time, even if it is not used. This is a statically
> allocated 256 kB table which lies in the init data section.
>
> This makes the code simpler and may in the future allow to
> setup early IO mappings with fixmap instead of hard coding BATs.
>
> Put create_hpte() and flush_hash_pages() in the .ref.text section
> in order to avoid warning for the reference to early_hash[]. This
> reference is removed by MMU_init_hw_patch() before init memory is
> freed.

This breaks booting on the iBook G4.

Andreas.

-- 
Andreas Schwab, sch...@linux-m68k.org
GPG Key fingerprint = 7578 EB47 D4E5 4D69 2510  2552 DF73 E780 A9DA AEC1
"And now for something completely different."


Re: [PATCH 1/3] powerpc/uaccess: Switch __put_user_size_allowed() to __put_user_asm_goto()

2020-10-29 Thread Andreas Schwab
#
# Automatically generated file; DO NOT EDIT.
# Linux/powerpc 5.10.0-rc1 Kernel Configuration
#
CONFIG_CC_VERSION_TEXT="gcc-4.9 (SUSE Linux) 4.9.3"
CONFIG_CC_IS_GCC=y
CONFIG_GCC_VERSION=40903
CONFIG_LD_VERSION=23501
CONFIG_CLANG_VERSION=0
CONFIG_CC_CAN_LINK=y
CONFIG_CC_CAN_LINK_STATIC=y
CONFIG_CC_HAS_ASM_GOTO=y
CONFIG_IRQ_WORK=y
CONFIG_BUILDTIME_TABLE_SORT=y
CONFIG_THREAD_INFO_IN_TASK=y

#
# General setup
#
CONFIG_INIT_ENV_ARG_LIMIT=32
# CONFIG_COMPILE_TEST is not set
CONFIG_LOCALVERSION=""
# CONFIG_LOCALVERSION_AUTO is not set
CONFIG_BUILD_SALT=""
CONFIG_HAVE_KERNEL_GZIP=y
CONFIG_HAVE_KERNEL_XZ=y
CONFIG_KERNEL_GZIP=y
# CONFIG_KERNEL_XZ is not set
CONFIG_DEFAULT_INIT=""
CONFIG_DEFAULT_HOSTNAME="(none)"
CONFIG_SWAP=y
CONFIG_SYSVIPC=y
CONFIG_SYSVIPC_SYSCTL=y
CONFIG_POSIX_MQUEUE=y
CONFIG_POSIX_MQUEUE_SYSCTL=y
CONFIG_WATCH_QUEUE=y
CONFIG_CROSS_MEMORY_ATTACH=y
CONFIG_USELIB=y
CONFIG_AUDIT=y
CONFIG_HAVE_ARCH_AUDITSYSCALL=y
CONFIG_AUDITSYSCALL=y

#
# IRQ subsystem
#
CONFIG_GENERIC_IRQ_SHOW=y
CONFIG_GENERIC_IRQ_SHOW_LEVEL=y
CONFIG_GENERIC_IRQ_MIGRATION=y
CONFIG_IRQ_DOMAIN=y
CONFIG_IRQ_FORCED_THREADING=y
CONFIG_SPARSE_IRQ=y
# CONFIG_GENERIC_IRQ_DEBUGFS is not set
# end of IRQ subsystem

CONFIG_GENERIC_TIME_VSYSCALL=y
CONFIG_GENERIC_CLOCKEVENTS=y
CONFIG_ARCH_HAS_TICK_BROADCAST=y
CONFIG_GENERIC_CLOCKEVENTS_BROADCAST=y
CONFIG_GENERIC_CMOS_UPDATE=y

#
# Timers subsystem
#
CONFIG_TICK_ONESHOT=y
CONFIG_NO_HZ_COMMON=y
# CONFIG_HZ_PERIODIC is not set
CONFIG_NO_HZ_IDLE=y
# CONFIG_NO_HZ_FULL is not set
CONFIG_NO_HZ=y
CONFIG_HIGH_RES_TIMERS=y
# end of Timers subsystem

# CONFIG_PREEMPT_NONE is not set
CONFIG_PREEMPT_VOLUNTARY=y
# CONFIG_PREEMPT is not set

#
# CPU/Task time and stats accounting
#
CONFIG_VIRT_CPU_ACCOUNTING=y
# CONFIG_TICK_CPU_ACCOUNTING is not set
CONFIG_VIRT_CPU_ACCOUNTING_NATIVE=y
# CONFIG_VIRT_CPU_ACCOUNTING_GEN is not set
CONFIG_BSD_PROCESS_ACCT=y
CONFIG_BSD_PROCESS_ACCT_V3=y
CONFIG_TASKSTATS=y
CONFIG_TASK_DELAY_ACCT=y
CONFIG_TASK_XACCT=y
CONFIG_TASK_IO_ACCOUNTING=y
CONFIG_PSI=y
# CONFIG_PSI_DEFAULT_DISABLED is not set
# end of CPU/Task time and stats accounting

# CONFIG_CPU_ISOLATION is not set

#
# RCU Subsystem
#
CONFIG_TREE_RCU=y
# CONFIG_RCU_EXPERT is not set
CONFIG_SRCU=y
CONFIG_TREE_SRCU=y
CONFIG_TASKS_RCU_GENERIC=y
CONFIG_TASKS_TRACE_RCU=y
CONFIG_RCU_STALL_COMMON=y
CONFIG_RCU_NEED_SEGCBLIST=y
# end of RCU Subsystem

CONFIG_BUILD_BIN2C=y
CONFIG_IKCONFIG=y
CONFIG_IKCONFIG_PROC=y
# CONFIG_IKHEADERS is not set
CONFIG_LOG_BUF_SHIFT=18
CONFIG_LOG_CPU_MAX_BUF_SHIFT=15
CONFIG_PRINTK_SAFE_LOG_BUF_SHIFT=13

#
# Scheduler features
#
CONFIG_UCLAMP_TASK=y
CONFIG_UCLAMP_BUCKETS_COUNT=5
# end of Scheduler features

CONFIG_ARCH_SUPPORTS_NUMA_BALANCING=y
CONFIG_CC_HAS_INT128=y
CONFIG_CGROUPS=y
CONFIG_PAGE_COUNTER=y
CONFIG_MEMCG=y
CONFIG_MEMCG_SWAP=y
CONFIG_MEMCG_KMEM=y
CONFIG_BLK_CGROUP=y
CONFIG_CGROUP_WRITEBACK=y
CONFIG_CGROUP_SCHED=y
CONFIG_FAIR_GROUP_SCHED=y
CONFIG_CFS_BANDWIDTH=y
CONFIG_RT_GROUP_SCHED=y
# CONFIG_UCLAMP_TASK_GROUP is not set
CONFIG_CGROUP_PIDS=y
CONFIG_CGROUP_RDMA=y
CONFIG_CGROUP_FREEZER=y
CONFIG_CGROUP_HUGETLB=y
CONFIG_CPUSETS=y
CONFIG_PROC_PID_CPUSET=y
CONFIG_CGROUP_DEVICE=y
CONFIG_CGROUP_CPUACCT=y
CONFIG_CGROUP_PERF=y
CONFIG_CGROUP_BPF=y
# CONFIG_CGROUP_DEBUG is not set
CONFIG_SOCK_CGROUP_DATA=y
CONFIG_NAMESPACES=y
CONFIG_UTS_NS=y
CONFIG_IPC_NS=y
CONFIG_USER_NS=y
CONFIG_PID_NS=y
CONFIG_NET_NS=y
CONFIG_CHECKPOINT_RESTORE=y
# CONFIG_SCHED_AUTOGROUP is not set
# CONFIG_SYSFS_DEPRECATED is not set
CONFIG_RELAY=y
CONFIG_BLK_DEV_INITRD=y
CONFIG_INITRAMFS_SOURCE=""
CONFIG_RD_GZIP=y
CONFIG_RD_BZIP2=y
CONFIG_RD_LZMA=y
CONFIG_RD_XZ=y
CONFIG_RD_LZO=y
CONFIG_RD_LZ4=y
CONFIG_RD_ZSTD=y
CONFIG_BOOT_CONFIG=y
# CONFIG_CC_OPTIMIZE_FOR_PERFORMANCE is not set
CONFIG_CC_OPTIMIZE_FOR_SIZE=y
CONFIG_HAVE_LD_DEAD_CODE_DATA_ELIMINATION=y
# CONFIG_LD_DEAD_CODE_DATA_ELIMINATION is not set
CONFIG_SYSCTL=y
CONFIG_SYSCTL_EXCEPTION_TRACE=y
CONFIG_BPF=y
CONFIG_EXPERT=y
CONFIG_MULTIUSER=y
CONFIG_SGETMASK_SYSCALL=y
CONFIG_SYSFS_SYSCALL=y
CONFIG_FHANDLE=y
CONFIG_POSIX_TIMERS=y
CONFIG_PRINTK=y
CONFIG_PRINTK_NMI=y
CONFIG_BUG=y
CONFIG_ELF_CORE=y
CONFIG_BASE_FULL=y
CONFIG_FUTEX=y
CONFIG_FUTEX_PI=y
CONFIG_EPOLL=y
CONFIG_SIGNALFD=y
CONFIG_TIMERFD=y
CONFIG_EVENTFD=y
CONFIG_SHMEM=y
CONFIG_AIO=y
CONFIG_IO_URING=y
CONFIG_ADVISE_SYSCALLS=y
CONFIG_MEMBARRIER=y
CONFIG_KALLSYMS=y
CONFIG_KALLSYMS_ALL=y
CONFIG_KALLSYMS_BASE_RELATIVE=y
CONFIG_BPF_SYSCALL=y
CONFIG_USERMODE_DRIVER=y
# CONFIG_BPF_PRELOAD is not set
CONFIG_USERFAULTFD=y
CONFIG_ARCH_HAS_MEMBARRIER_CALLBACKS=y
CONFIG_ARCH_HAS_MEMBARRIER_SYNC_CORE=y
CONFIG_RSEQ=y
# CONFIG_DEBUG_RSEQ is not set
# CONFIG_EMBEDDED is not set
CONFIG_HAVE_PERF_EVENTS=y
# CONFIG_PC104 is not set

#
# Kernel Performance Events And Counters
#
CONFIG_PERF_EVENTS=y
# end of Kernel Performance Events And Counters

CONFIG_VM_EVENT_COUNTERS=y
CONFIG_SLUB_DEBUG=y
CONFIG_SLUB_MEMCG_SYSFS_ON=y
# CONFIG_COMPAT_BRK is not set
# CONFIG_SLAB is not set
CONFIG_SLUB=y
# CONFIG_SLOB is not set

Re: [PATCH 1/3] powerpc/uaccess: Switch __put_user_size_allowed() to __put_user_asm_goto()

2020-10-28 Thread Andreas Schwab
On Okt 28 2020, Michael Ellerman wrote:

> What config and compiler are you using?

gcc 4.9.

Andreas.

-- 
Andreas Schwab, sch...@linux-m68k.org
GPG Key fingerprint = 7578 EB47 D4E5 4D69 2510  2552 DF73 E780 A9DA AEC1
"And now for something completely different."


Re: [PATCH 1/3] powerpc/uaccess: Switch __put_user_size_allowed() to __put_user_asm_goto()

2020-10-27 Thread Andreas Schwab
On Okt 28 2020, Andreas Schwab wrote:

> On Sep 04 2020, Christophe Leroy wrote:
>
>> __put_user_asm_goto() provides more flexibility to GCC and avoids using
>> a local variable to tell if the write succeeded or not.
>> GCC can then avoid implementing a cmp in the fast path.
>
> That breaks CLONE_CHILD_SETTID.  I'm getting an assertion failure in
> __libc_fork (THREAD_GETMEM (self, tid) != ppid).

This is what schedule_tail now looks like.  As you can see, put_user has
become a nop:

455c <.schedule_tail>:
455c:   7c 08 02 a6 mflrr0
4560:   f8 01 00 10 std r0,16(r1)
4564:   f8 21 ff 91 stdur1,-112(r1)
4568:   4b ff cd 4d bl  12b4 <.finish_task_switch>
456c:   4b ff c0 99 bl  604 <.balance_callback>
4570:   e8 6d 01 88 ld  r3,392(r13)
4574:   e9 23 06 b0 ld  r9,1712(r3)
4578:   2f a9 00 00 cmpdi   cr7,r9,0
457c:   41 9e 00 14 beq cr7,4590 <.schedule_tail+0x34>
4580:   38 80 00 00 li  r4,0
4584:   38 a0 00 00 li  r5,0
4588:   48 00 00 01 bl  4588 <.schedule_tail+0x2c>
4588: R_PPC64_REL24 .__task_pid_nr_ns
458c:   60 00 00 00 nop
4590:   48 00 00 01 bl  4590 <.schedule_tail+0x34>
4590: R_PPC64_REL24 .calculate_sigpending
4594:   60 00 00 00 nop
4598:   38 21 00 70 addir1,r1,112
459c:   e8 01 00 10 ld  r0,16(r1)
45a0:   7c 08 03 a6 mtlrr0
45a4:   4e 80 00 20 blr

This is schedule_tail in 5.9:

455c <.schedule_tail>:
455c:   7c 08 02 a6 mflrr0
4560:   fb c1 ff f0 std r30,-16(r1)
4564:   fb e1 ff f8 std r31,-8(r1)
4568:   f8 01 00 10 std r0,16(r1)
456c:   f8 21 ff 81 stdur1,-128(r1)
4570:   4b ff cd 45 bl  12b4 <.finish_task_switch>
4574:   4b ff c0 91 bl  604 <.balance_callback>
4578:   eb cd 01 88 ld  r30,392(r13)
457c:   eb fe 06 b0 ld  r31,1712(r30)
4580:   2f bf 00 00 cmpdi   cr7,r31,0
4584:   41 9e 00 2c beq cr7,45b0 <.schedule_tail+0x54>
4588:   7f c3 f3 78 mr  r3,r30
458c:   38 80 00 00 li  r4,0
4590:   38 a0 00 00 li  r5,0
4594:   48 00 00 01 bl  4594 <.schedule_tail+0x38>
4594: R_PPC64_REL24 .__task_pid_nr_ns
4598:   60 00 00 00 nop
459c:   e9 3e 0a b8 ld  r9,2744(r30)
45a0:   7f bf 48 40 cmpld   cr7,r31,r9
45a4:   41 9d 00 0c bgt cr7,45b0 <.schedule_tail+0x54>
45a8:   2b a9 00 03 cmpldi  cr7,r9,3
45ac:   41 9d 00 14 bgt cr7,45c0 <.schedule_tail+0x64>
45b0:   48 00 00 01 bl  45b0 <.schedule_tail+0x54>
45b0: R_PPC64_REL24 .calculate_sigpending
45b4:   60 00 00 00 nop
45b8:   38 21 00 80 addir1,r1,128
45bc:   48 00 00 00 b   45bc <.schedule_tail+0x60>
45bc: R_PPC64_REL24 _restgpr0_30
45c0:   39 20 00 00 li  r9,0
45c4:   90 7f 00 00 stw r3,0(r31)
45c8:   4b ff ff e8 b   45b0 <.schedule_tail+0x54>


Andreas.

-- 
Andreas Schwab, sch...@linux-m68k.org
GPG Key fingerprint = 7578 EB47 D4E5 4D69 2510  2552 DF73 E780 A9DA AEC1
"And now for something completely different."


Re: [PATCH 1/3] powerpc/uaccess: Switch __put_user_size_allowed() to __put_user_asm_goto()

2020-10-27 Thread Andreas Schwab
On Sep 04 2020, Christophe Leroy wrote:

> __put_user_asm_goto() provides more flexibility to GCC and avoids using
> a local variable to tell if the write succeeded or not.
> GCC can then avoid implementing a cmp in the fast path.

That breaks CLONE_CHILD_SETTID.  I'm getting an assertion failure in
__libc_fork (THREAD_GETMEM (self, tid) != ppid).

Andreas.

-- 
Andreas Schwab, sch...@linux-m68k.org
GPG Key fingerprint = 7578 EB47 D4E5 4D69 2510  2552 DF73 E780 A9DA AEC1
"And now for something completely different."


Re: [PATCH v2 1/1] i2c: ocores: fix polling mode workaround on FU540-C000 SoC

2020-10-09 Thread Andreas Schwab
On Okt 09 2020, Sagar Shrikant Kadam wrote:

> diff --git a/drivers/i2c/busses/i2c-ocores.c b/drivers/i2c/busses/i2c-ocores.c
> index f5fc75b..9b3d1ab 100644
> --- a/drivers/i2c/busses/i2c-ocores.c
> +++ b/drivers/i2c/busses/i2c-ocores.c
> @@ -686,17 +686,21 @@ static int ocores_i2c_probe(struct platform_device 
> *pdev)
>  
>   init_waitqueue_head(>wait);
>  
> + /*
> +  * Set OCORES_FLAG_BROKEN_IRQ to enable workaround for
> +  * FU540-C000 SoC in polling mode.
> +  * Since the SoC does have interrupt it's dt has the interrupt

Typo: its

Andreas.

-- 
Andreas Schwab, sch...@linux-m68k.org
GPG Key fingerprint = 7578 EB47 D4E5 4D69 2510  2552 DF73 E780 A9DA AEC1
"And now for something completely different."


Re: [PATCH V2 1/3] riscv: Fixup static_obj() fail

2020-10-05 Thread Andreas Schwab
On Okt 05 2020, Palmer Dabbelt wrote:

> On Mon, 05 Oct 2020 01:25:22 PDT (-0700), sch...@linux-m68k.org wrote:
>> On Sep 14 2020, Aurelien Jarno wrote:
>>
>>> How should we proceed to get that fixed in time for 5.9? For the older
>>> branches where it has been backported (so far 5.7 and 5.8), should we
>>> just get that commit reverted instead?
>>
>> Why is this still broken?
>
> Sorry, I hadn't seen this.  I'm not seeing a boot failure on 5.9-rc8 with just
> CONFIG_HARDENED_USERCPOY=y in addition to defconfig (on QEMU, though I doubt
> that's relevant here).

I don't see a boot failure either, but eventually you will get crashes
like this, and resources are not properly released:

[ 4560.936645] usercopy: Kernel memory overwrite attempt detected to kernel 
text (offset 241626, size 16)!
[ 4560.945324] [ cut here ]
[ 4560.949954] kernel BUG at mm/usercopy.c:99!
[ 4560.954030] Kernel BUG [#1]
[ 4560.956805] Modules linked in: nfsv3 nfs_acl rfkill mmc_block sf_pdma 
i2c_ocores virt_dma spi_sifive uio_pdrv_genirq uio loop drm 
drm_panel_orientation_quirks rpcsec_gss_krb5 auth_rpcgss nfsv4 dns_resolver nfs 
lockd grace fscache af_packet mscc macsec macb ptp pps_core phylink of_mdio 
fixed_phy libphy pwm_sifive mmc_spi crc_itu_t crc7 of_mmc_spi mmc_core 
spi_bitbang sunrpc sg dm_multipath dm_mod scsi_dh_rdac scsi_dh_emc scsi_dh_alua
[ 4560.995103] CPU: 2 PID: 23806 Comm: nis Not tainted 5.8.10-1-default #1 
openSUSE Tumbleweed (unreleased)
[ 4561.004563] epc: ffe00036140e ra : ffe00036140e sp : ffe004bc7d60
[ 4561.011679]  gp : ffe00127ee60 tp : ffe1b05d t0 : 
ffe001297ca0
[ 4561.018886]  t1 : ffe001297c30 t2 :  s0 : 
ffe004bc7d80
[ 4561.026093]  s1 : ffe3afda a0 : 005b a1 : 
ffe1f7d67588
[ 4561.033298]  a2 : ffe1f7d6c108 a3 :  a4 : 
ffe43e80
[ 4561.040506]  a5 : ffe1f7d6be80 a6 : 0144 a7 : 

[ 4561.047712]  s2 : 0010 s3 :  s4 : 
ffe3afea
[ 4561.054918]  s5 : ffe1f7e00e80 s6 : 002af4a2c2e0 s7 : 
f000
[ 4561.062124]  s8 : 003ff000 s9 : ffe19f985400 s10: 
0010
[ 4561.069329]  s11: ffe1f7e00e80 t3 : 00038fa8 t4 : 
00038fa8
[ 4561.076533]  t5 : 0001 t6 : ffe00128e062
[ 4561.081832] status: 00020120 badaddr:  cause: 
0003
[ 4561.089821] ---[ end trace a7c93e7595e9c2cc ]---
[ 4561.095589] BUG: Bad rss-counter state mm:0000c54f4c29 type:MM_ANONPAGES 
val:1

Andreas.

-- 
Andreas Schwab, sch...@linux-m68k.org
GPG Key fingerprint = 7578 EB47 D4E5 4D69 2510  2552 DF73 E780 A9DA AEC1
"And now for something completely different."


Re: [PATCH V2 1/3] riscv: Fixup static_obj() fail

2020-10-05 Thread Andreas Schwab
On Sep 14 2020, Aurelien Jarno wrote:

> How should we proceed to get that fixed in time for 5.9? For the older
> branches where it has been backported (so far 5.7 and 5.8), should we
> just get that commit reverted instead?

Why is this still broken?

Andreas.

-- 
Andreas Schwab, sch...@linux-m68k.org
GPG Key fingerprint = 7578 EB47 D4E5 4D69 2510  2552 DF73 E780 A9DA AEC1
"And now for something completely different."


Re: [PATCH V2 1/3] riscv: Fixup static_obj() fail

2020-09-24 Thread Andreas Schwab
On Sep 14 2020, Aurelien Jarno wrote:

> How should we proceed to get that fixed in time for 5.9? For the older
> branches where it has been backported (so far 5.7 and 5.8), should we
> just get that commit reverted instead?

Can this please be resolved ASAP?

Andreas.

-- 
Andreas Schwab, sch...@linux-m68k.org
GPG Key fingerprint = 7578 EB47 D4E5 4D69 2510  2552 DF73 E780 A9DA AEC1
"And now for something completely different."


Re: [PATCH v2] powerpc: fix EDEADLOCK redefinition error in uapi/asm/errno.h

2020-09-17 Thread Andreas Schwab
On Sep 17 2020, Arnd Bergmann wrote:

> The errno man page says they are supposed to be synonyms,
> and glibc defines it that way, while musl uses the numbers
> from the kernel.

glibc also uses whatever the kernel defines.

Andreas.

-- 
Andreas Schwab, sch...@linux-m68k.org
GPG Key fingerprint = 7578 EB47 D4E5 4D69 2510  2552 DF73 E780 A9DA AEC1
"And now for something completely different."


Re: [PATCH] powerpc/32s: Fix module loading failure when VMALLOC_END is over 0xf0000000

2020-08-21 Thread Andreas Schwab
On Aug 21 2020, Christophe Leroy wrote:

> In is_module_segment(), when VMALLOC_END is over 0xf000,
> ALIGN(VMALLOC_END, SZ_256M) has value 0.
>
> In that case, addr >= ALIGN(VMALLOC_END, SZ_256M) is always
> true then is_module_segment() always returns false.
>
> Use (ALIGN(VMALLOC_END, SZ_256M) - 1) which will have
> value 0x and will be suitable for the comparison.
>
> Reported-by: Andreas Schwab 
> Signed-off-by: Christophe Leroy 
> Fixes: c49643319715 ("powerpc/32s: Only leave NX unset on segments used for 
> modules")

Thanks, that fixes the crash.

Tested-by: Andreas Schwab 

Andreas.

-- 
Andreas Schwab, sch...@linux-m68k.org
GPG Key fingerprint = 7578 EB47 D4E5 4D69 2510  2552 DF73 E780 A9DA AEC1
"And now for something completely different."


Re: [PATCH v2 3/6] powerpc/32s: Only leave NX unset on segments used for modules

2020-08-20 Thread Andreas Schwab
On Jun 29 2020, Christophe Leroy wrote:

> Instead of leaving NX unset on all segments above the start
> of vmalloc space, only leave NX unset on segments used for
> modules.

I'm getting this crash:

kernel tried to execute exec-protected page (f294b000) - exploit attempt (uid: 
0)
BUG: Unable to handle kernel instruction fetch
Faulting instruction address: 0xf294b000
Oops: Kernel access of bad area, sig: 11 [#1]
BE PAGE_SIZE=4K MMU=Hash PowerMac
Modules linked in: pata_macio(+)
CPU: 0 PID: 87 Comm: udevd Not tainted 5.8.0-rc2-test #49
NIP:  f294b000 LR: 0005c60 CTR: f294b000
REGS: f18d9cc0 TRAP: 0400  Not tainted  (5.8.0-rc2-test)
MSR:  10009032   CR: 84222422  XER: 2000
GPR00: c0005c14 f18d9d78 ef30ca20  efe0 c00993d0 ef6da038 005e
GPR08: c09050b8 c08b  f18d9d78 44222422 10072070  0fefaca4
GPR16: 1006a00c f294d50b 0120 0124 c0096ea8 000e ef2776c0 ef2776e4
GPR24: f18fd6e8 0001 c086fe64 c086fe04  c08b f294b000 
NIP [f294b000] pata_macio_init+0x0/0xc0 [pata_macio]
LR [c0005c60] do_one_initcall+0x6c/0x160
Call Trace:
[f18d9d78] [c0005c14] do_one_initcall+0x20/0x160 (unreliable)
[f18d9dd8] [c009a22c] do_init_module+0x60/0x1c0
[f18d9df8] [c00993d8] load_module+0x16a8/0x1c14
[f18d9ea8] [c0099aa4] sys_finit_module+0x8c/0x94
[f18d9f38] [c0012174] ret_from_syscall+0x0/0x34
--- interrupt: c01 at 0xfdb4318
   LR = 0xfeee9c0
Instruction dump:
       
    <3d20c08b> 3d40c086 9421ffe0 8129106c
---[ end trace 85a98cc836109871 ]---

Andreas.

-- 
Andreas Schwab, sch...@linux-m68k.org
GPG Key fingerprint = 7578 EB47 D4E5 4D69 2510  2552 DF73 E780 A9DA AEC1
"And now for something completely different."


Re: [PATCH] net: stmmac: Fix signedness bug in stmmac_probe_config_dt()

2020-08-18 Thread Andreas Schwab
On Aug 18 2020, YueHaibing wrote:

> The "plat->phy_interface" variable is an enum and in this context GCC
> will treat it as an unsigned int so the error handling is never
> triggered.
>
> Fixes: b9f0b2f634c0 ("net: stmmac: platform: fix probe for ACPI devices")
> Signed-off-by: YueHaibing 
> ---
>  drivers/net/ethernet/stmicro/stmmac/stmmac_platform.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/drivers/net/ethernet/stmicro/stmmac/stmmac_platform.c 
> b/drivers/net/ethernet/stmicro/stmmac/stmmac_platform.c
> index f32317fa75c8..b5b558b02e7d 100644
> --- a/drivers/net/ethernet/stmicro/stmmac/stmmac_platform.c
> +++ b/drivers/net/ethernet/stmicro/stmmac/stmmac_platform.c
> @@ -413,7 +413,7 @@ stmmac_probe_config_dt(struct platform_device *pdev, 
> const char **mac)
>   }
>  
>   plat->phy_interface = device_get_phy_mode(>dev);
> - if (plat->phy_interface < 0)
> + if ((int)plat->phy_interface < 0)
>   return ERR_PTR(plat->phy_interface);

I don't think the conversion to long when passed to ERR_PTR will produce
a negative value either (if long is wider than unsigned int).

Andreas.

-- 
Andreas Schwab, sch...@linux-m68k.org
GPG Key fingerprint = 7578 EB47 D4E5 4D69 2510  2552 DF73 E780 A9DA AEC1
"And now for something completely different."


Re: get rid of the address_space override in setsockopt v2

2020-07-26 Thread Andreas Schwab
On Jul 26 2020, Christoph Hellwig wrote:

> From 6601732f7a54db5f04efba08f7e9224e5b757112 Mon Sep 17 00:00:00 2001
> From: Christoph Hellwig 
> Date: Sun, 26 Jul 2020 09:00:09 +0200
> Subject: mISDN: remove a debug printk in data_sock_setsockopt
>
> The %p won't work with the new sockptr_t type.  But in the times of
> ftrace, bpftrace and co these kinds of debug printks are pretty anyway,

I think there is a word missing after pretty.

Andreas.

-- 
Andreas Schwab, sch...@linux-m68k.org
GPG Key fingerprint = 7578 EB47 D4E5 4D69 2510  2552 DF73 E780 A9DA AEC1
"And now for something completely different."


Re: [PATCH 2/2] riscv: fix build warning of mm/pageattr

2020-07-16 Thread Andreas Schwab
On Jul 16 2020, Zong Li wrote:

> Add hearder for missing prototype. Also, static keyword should be at

s/hearder/header/

Andreas.

-- 
Andreas Schwab, sch...@linux-m68k.org
GPG Key fingerprint = 7578 EB47 D4E5 4D69 2510  2552 DF73 E780 A9DA AEC1
"And now for something completely different."


Re: printk of non NULL terminated strings ?

2020-07-09 Thread Andreas Schwab
On Jul 09 2020, Joakim Tjernlund wrote:

> Is there a format (or other function) that lets me
> print strings without an \0 terminator using an explicit length arg instead?

Use the precision.

Andreas.

-- 
Andreas Schwab, sch...@linux-m68k.org
GPG Key fingerprint = 7578 EB47 D4E5 4D69 2510  2552 DF73 E780 A9DA AEC1
"And now for something completely different."


[PATCH] riscv: use 16KB kernel stack on 64-bit

2020-07-06 Thread Andreas Schwab
With the current 8KB stack size there are frequent overflows in a 64-bit
configuration.

Signed-off-by: Andreas Schwab 
---
 arch/riscv/include/asm/thread_info.h | 4 
 1 file changed, 4 insertions(+)

diff --git a/arch/riscv/include/asm/thread_info.h 
b/arch/riscv/include/asm/thread_info.h
index 1dd12a0cbb2b..464a2bbc97ea 100644
--- a/arch/riscv/include/asm/thread_info.h
+++ b/arch/riscv/include/asm/thread_info.h
@@ -12,7 +12,11 @@
 #include 
 
 /* thread information allocation */
+#ifdef CONFIG_64BIT
+#define THREAD_SIZE_ORDER  (2)
+#else
 #define THREAD_SIZE_ORDER  (1)
+#endif
 #define THREAD_SIZE(PAGE_SIZE << THREAD_SIZE_ORDER)
 
 #ifndef __ASSEMBLY__
-- 
2.26.2


-- 
Andreas Schwab, SUSE Labs, sch...@suse.de
GPG Key fingerprint = 0196 BAD8 1CE9 1970 F4BE  1748 E4D4 88E3 0EEA B9D7
"And now for something completely different."


Re: [PATCH 0/3] Dynamic CPU frequency switching for the HiFive

2020-07-06 Thread Andreas Schwab
On Jul 03 2020, Yash Shah wrote:

> Yes, you are right. The userspace governor is the only one supported.

That doesn't make sense to me.  How is the userspace governor different
from any other governor?

Andreas.

-- 
Andreas Schwab, SUSE Labs, sch...@suse.de
GPG Key fingerprint = 0196 BAD8 1CE9 1970 F4BE  1748 E4D4 88E3 0EEA B9D7
"And now for something completely different."


Re: [PATCH 0/3] Dynamic CPU frequency switching for the HiFive

2020-07-01 Thread Andreas Schwab
On Jun 16 2020, Yash Shah wrote:

> The patch series adds the support for dynamic CPU frequency switching
> for FU540-C000 SoC on the HiFive Unleashed board. All the patches are
> based on Paul Walmsley's work.
>
> This series is based on Linux v5.7 and tested on HiFive unleashed board.

I'm using that patch with 5.7.5.

It appears to interfer with serial output when using the ondemand
governor.

I also see soft lockups when using the performance governor:

[  101.587527] rcu: INFO: rcu_sched self-detected stall on CPU
[  101.592322] rcu: 0-...!: (932 ticks this GP) 
idle=11a/1/0x4004 softirq=4301/4301 fqs=4
[  101.601432]  (t=6001 jiffies g=4017 q=859)
[  101.605514] rcu: rcu_sched kthread starved for 5984 jiffies! g4017 f0x0 
RCU_GP_WAIT_FQS(5) ->state=0x0 ->cpu=2
[  101.615494] rcu: RCU grace-period kthread stack dump:
[  101.620530] rcu_sched   R  running task010  2 0x
[  101.627560] Call Trace:
[  101.630004] [] __schedule+0x25c/0x616
[  101.635205] [] schedule+0x42/0xb2
[  101.640070] [] schedule_timeout+0x56/0xb8
[  101.645626] [] rcu_gp_fqs_loop+0x208/0x248
[  101.651266] [] rcu_gp_kthread+0xc2/0xcc
[  101.656651] [] kthread+0xda/0xec
[  101.661426] [] ret_from_exception+0x0/0xc
[  101.666977] Task dump for CPU 0:
[  101.670187] loop0   R  running task0   655  2 0x0008
[  101.677218] Call Trace:
[  101.679657] [] walk_stackframe+0x0/0xaa
[  101.685036] [] show_stack+0x2a/0x34
[  101.690074] [] sched_show_task.part.0+0xc2/0xd2
[  101.696154] [] sched_show_task+0x64/0x66
[  101.701618] [] dump_cpu_task+0x3e/0x48
[  101.706916] [] rcu_dump_cpu_stacks+0x94/0xce
[  101.712731] [] print_cpu_stall+0x116/0x18a
[  101.718375] [] check_cpu_stall+0xcc/0x1a2
[  101.723929] [] rcu_pending.constprop.0+0x36/0xaa
[  101.730094] [] rcu_sched_clock_irq+0xa6/0xea
[  101.735913] [] update_process_times+0x1e/0x42
[  101.741821] [] tick_sched_handle+0x26/0x52
[  101.747456] [] tick_sched_timer+0x6a/0xd0
[  101.753015] [] __run_hrtimer.constprop.0+0x50/0xe8
[  101.759353] [] __hrtimer_run_queues+0x48/0x6c
[  101.765254] [] hrtimer_interrupt+0xca/0x1d4
[  101.770985] [] riscv_timer_interrupt+0x32/0x3a
[  101.776976] [] do_IRQ+0xa4/0xb8
[  101.781663] [] ret_from_exception+0x0/0xc

Andreas.

-- 
Andreas Schwab, SUSE Labs, sch...@suse.de
GPG Key fingerprint = 0196 BAD8 1CE9 1970 F4BE  1748 E4D4 88E3 0EEA B9D7
"And now for something completely different."


Re: [PATCH] riscv: fix build warning of missing prototypes

2020-06-01 Thread Andreas Schwab
On Jun 01 2020, Zong Li wrote:

> Add the missing header in file, it was losed in original implementation.

s/losed/lost/

Andreas.

-- 
Andreas Schwab, sch...@linux-m68k.org
GPG Key fingerprint = 7578 EB47 D4E5 4D69 2510  2552 DF73 E780 A9DA AEC1
"And now for something completely different."


Re: [PATCH 1/4] exec: Change uselib(2) IS_SREG() failure to EACCES

2020-05-19 Thread Andreas Schwab
On Mai 19 2020, Eric W. Biederman wrote:

> I am wondering if there are source trees for libc4 or libc5 around
> anywhere that we can look at to see how usage of uselib evolved.

libc5 is available from archive.debian.org.

http://archive.debian.org/debian-archive/debian/pool/main/libc/libc/libc_5.4.46.orig.tar.gz

Andreas.

-- 
Andreas Schwab, sch...@linux-m68k.org
GPG Key fingerprint = 7578 EB47 D4E5 4D69 2510  2552 DF73 E780 A9DA AEC1
"And now for something completely different."


Re: [PATCH 1/4] exec: Change uselib(2) IS_SREG() failure to EACCES

2020-05-19 Thread Andreas Schwab
On Mai 18 2020, Eric W. Biederman wrote:

> If it was only libc4 and libc5 that used the uselib system call then it
> can probably be removed after enough time.

Only libc4 used it, libc5 was already ELF.

Andreas.

-- 
Andreas Schwab, sch...@linux-m68k.org
GPG Key fingerprint = 7578 EB47 D4E5 4D69 2510  2552 DF73 E780 A9DA AEC1
"And now for something completely different."


Re: [PATCH] ia64: enable HAVE_COPY_THREAD_TLS, switch to kernel_clone_args

2020-05-14 Thread Andreas Schwab
On Mai 14 2020, Christian Brauner wrote:

> pid = syscall(189 /* __NR_clone2 */, SIGCHLD, stack, STACK_SIZE, 
> NULL, NULL);

Syscall 189 doesn't exist on ia64, they start with 1024 (and __NR_clone2
is 1213).

Andreas.

-- 
Andreas Schwab, sch...@linux-m68k.org
GPG Key fingerprint = 7578 EB47 D4E5 4D69 2510  2552 DF73 E780 A9DA AEC1
"And now for something completely different."


Re: [PATCH] ia64: enable HAVE_COPY_THREAD_TLS, switch to kernel_clone_args

2020-05-14 Thread Andreas Schwab
On Mai 14 2020, Christian Brauner wrote:

>> static inline pid_t raw_clone(unsigned long flags) {
>> pid_t ret;
>> 
>> assert((flags & (CLONE_VM|CLONE_PARENT_SETTID|CLONE_CHILD_SETTID|
>>  CLONE_CHILD_CLEARTID|CLONE_SETTLS)) == 0);
>> #if defined(__s390x__) || defined(__s390__) || defined(__CRIS__)
>> /* On s390/s390x and cris the order of the first and second arguments
>>  * of the raw clone() system call is reversed. */
>> ret = (pid_t) syscall(__NR_clone, NULL, flags);
>> #elif defined(__sparc__)
>> {
>> /**
>>  * sparc always returns the other process id in %o0, and
>>  * a boolean flag whether this is the child or the parent in
>>  * %o1. Inline assembly is needed to get the flag returned
>>  * in %o1.
>>  */
>> int in_child, child_pid, error;
>> 
>> asm volatile("mov %3, %%g1\n\t"
>>  "mov %4, %%o0\n\t"
>>  "mov 0 , %%o1\n\t"
>> #if defined(__arch64__)
>>  "t 0x6d\n\t"
>> #else
>>  "t 0x10\n\t"
>> #endif
>>  "addx %%g0, 0, %2\n\t"
>>  "mov %%o1, %0\n\t"
>>  "mov %%o0, %1" :
>>  "=r"(in_child), "=r"(child_pid), "=r"(error) :
>>  "i"(__NR_clone), "r"(flags) :
>>  "%o1", "%o0", "%g1", "cc" );
>> 
>> if (error) {
>> errno = child_pid;
>> ret = -1;
>> } else
>> ret = in_child ? 0 : child_pid;
>> }
>> +#elif defined(__ia64__)
>> +/* On ia64 the stack and stack size are passed as separate arguments. */
>> +return (pid_t)syscall(__NR_clone, flags, NULL, 0);
>> +#else
>> +return (pid_t)syscall(__NR_clone, flags, NULL);
>> +#endif
>
> Scratch that. It's even worse. On ia64 it is _invalid_ to pass a NULL
> stack.

Only if you want CLONE_VM.  But this raw_clone does not allow CLONE_VM,
thus it is actually a true fork.

Andreas.

-- 
Andreas Schwab, sch...@linux-m68k.org
GPG Key fingerprint = 7578 EB47 D4E5 4D69 2510  2552 DF73 E780 A9DA AEC1
"And now for something completely different."


Re: [GIT PULL] RISC-V Fixes for 5.7-rc5

2020-05-12 Thread Andreas Schwab
On Mai 11 2020, Linus Torvalds wrote:

> Why is glibc doing it in the first place? Is it some historical thing
> that is simply irrelevant on RISC-V simply because RISC-V doesn't have
> that kind of history, perhaps?

It is completely generic.  Even new architectures become old over time
and accumulate cruft.  The idea is that if you configure glibc with
--enable-kernel=VERSION, it assumes that all syscalls from kernel
VERSION are guaranteed to exist, and drops the fallbacks for those
syscalls, or uses them in the first place (if no useful fallback
existed).  From time to time the absolute minimum supported kernel
version is increased (this happend the last time in 2017, when x86 and
x86_64 moved the mininum from 2.6.32 to 3.2, after all other
architectures did that step in 2016), which allows removing the fallback
code that becomes obsolete.

Andreas.

-- 
Andreas Schwab, SUSE Labs, sch...@suse.de
GPG Key fingerprint = 0196 BAD8 1CE9 1970 F4BE  1748 E4D4 88E3 0EEA B9D7
"And now for something completely different."


Re: [PATCH v2] selftests/ftrace: Use printf for backslash included command

2020-05-11 Thread Andreas Schwab
On Mai 11 2020, Masami Hiramatsu wrote:

> -(! echo "$command" >> "$3" ) 2> /dev/null
> +(! printf "%s" "$command" >> "$3" ) 2> /dev/null

printf %s does not print a newline, you need printf '%s\n' for that.

Andreas.

-- 
Andreas Schwab, sch...@linux-m68k.org
GPG Key fingerprint = 7578 EB47 D4E5 4D69 2510  2552 DF73 E780 A9DA AEC1
"And now for something completely different."


Re: [PATCH] selftests/ftrace: Use /bin/echo for backslash included command

2020-05-11 Thread Andreas Schwab
On Mai 11 2020, Masami Hiramatsu wrote:

> To fix this issue, we explicitly use /bin/echo -E (not interpret
> backslash escapes) if the command string can include backslash.

Please use printf instead.

Andreas.

-- 
Andreas Schwab, sch...@linux-m68k.org
GPG Key fingerprint = 7578 EB47 D4E5 4D69 2510  2552 DF73 E780 A9DA AEC1
"And now for something completely different."


Re: [GIT PULL] RISC-V Fixes for 5.7-rc5

2020-05-11 Thread Andreas Schwab
On Mai 09 2020, Linus Torvalds wrote:

> glibc depending on kernel version is WRONG. It's bogus. You can't do
> feature detection based on kernel version, it's fundamentally broken.
>
> So I really would prefer to see glibc fixed not to do that stupid
> thing, instead of adding pointless vdso notes to the kernel.

I'm not aware of any discussion or bug report on this issue.  Any
pointer?

Andreas.

-- 
Andreas Schwab, SUSE Labs, sch...@suse.de
GPG Key fingerprint = 0196 BAD8 1CE9 1970 F4BE  1748 E4D4 88E3 0EEA B9D7
"And now for something completely different."


Re: [PATCH 3/3] selftests/ftrace: Use /bin/echo instead of built-in echo

2020-05-07 Thread Andreas Schwab
On Mai 01 2020, Masami Hiramatsu wrote:

> Since the built-in echo has different behavior in POSIX shell
> (dash) and bash, we forcibly use /bin/echo -E (not interpret
> backslash escapes) by default.

How about using printf instead (at least where it matters)?

Andreas.

-- 
Andreas Schwab, sch...@linux-m68k.org
GPG Key fingerprint = 7578 EB47 D4E5 4D69 2510  2552 DF73 E780 A9DA AEC1
"And now for something completely different."


Re: [PATCH 1/2] riscv: defconfig: enable spi nor on Hifive Unleashed A00 board.

2020-05-06 Thread Andreas Schwab
On Mai 06 2020, Anup Patel wrote:

> We had build issues in past by selecting major driver subsystems
> in Kconfig.socs
>
> I suggest to select SPI_SIFIVE from Kconfig.socs

SPI_SIFIVE can be m, don't override that.

Andreas.

-- 
Andreas Schwab, sch...@linux-m68k.org
GPG Key fingerprint = 7578 EB47 D4E5 4D69 2510  2552 DF73 E780 A9DA AEC1
"And now for something completely different."


Re: [PATCH 7/7] sysvipc_find_ipc should increase position index

2020-05-05 Thread Andreas Schwab
I think this is causing this bug (seen on 5.6.8):

# ipcs -q

-- Message Queues 
keymsqid  owner  perms  used-bytes   messages

# ipcmk -Q
Message queue id: 0
# ipcs -q

-- Message Queues 
keymsqid  owner  perms  used-bytes   messages
0x82db8127 0  root   64400   

# ipcmk -Q
Message queue id: 1
# ipcs -q

-- Message Queues 
keymsqid  owner  perms  used-bytes   messages
0x82db8127 0  root   64400   
0x76d1fb2a 1  root   64400   

# ipcrm -q 0
# ipcs -q

-- Message Queues 
keymsqid  owner  perms  used-bytes   messages
0x76d1fb2a 1  root   64400   
0x76d1fb2a 1  root   64400   

# ipcmk -Q
Message queue id: 2
# ipcrm -q 2
# ipcs -q

-- Message Queues 
keymsqid  owner  perms  used-bytes   messages
0x76d1fb2a 1  root   64400   
0x76d1fb2a 1  root   64400   

# ipcmk -Q
Message queue id: 3
# ipcrm -q 1
# ipcs -q

-- Message Queues 
keymsqid  owner  perms  used-bytes   messages
0x7c982867 3  root   64400   
0x7c982867 3  root   64400   
0x7c982867 3  root   64400   
0x7c982867 3  root   64400   


As you can see, whenever an IPC item with a low id is deleted, the items
with higher ids are duplicated, as if filling a hole.

Andreas.

-- 
Andreas Schwab, SUSE Labs, sch...@suse.de
GPG Key fingerprint = 0196 BAD8 1CE9 1970 F4BE  1748 E4D4 88E3 0EEA B9D7
"And now for something completely different."


Re: [PATCH v2] riscv: force __cpu_up_ variables to put in data section

2020-05-04 Thread Andreas Schwab
On Mai 04 2020, Anup Patel wrote:

> Slightly improved text:
>
> This issue happens on random booting of multiple harts, which means
> it will manifest for BBL and OpenSBI v0.6 (or older version). In OpenSBI
> v0.7 (or higher version), we have HSM extension so all the secondary harts
> are brought-up by Linux kernel in an orderly fashion. This means we don't
> this change for OpenSBI v0.7 (or higher version).

  +need

Andreas.

-- 
Andreas Schwab, sch...@linux-m68k.org
GPG Key fingerprint = 7578 EB47 D4E5 4D69 2510  2552 DF73 E780 A9DA AEC1
"And now for something completely different."


Re: [PATCH] RISC-V: fix virtual address overlapped in FIXADDR_START and VMEMMAP_START

2019-10-16 Thread Andreas Schwab
On Okt 16 2019, greentime...@sifive.com wrote:

> From: Greentime Hu 
>
> This patch fixes the virtual address layout in pgtable.h.
> The virtual address of FIXADDR_START and VMEMMAP_START should not be 
> overlapped.
> These addresses will be existed at the same time in Linux kernel that they 
> can't
> be overlapped.

s/be existed/exist/
s/be overlapped/overlap/

Andreas.

-- 
Andreas Schwab, SUSE Labs, sch...@suse.de
GPG Key fingerprint = 0196 BAD8 1CE9 1970 F4BE  1748 E4D4 88E3 0EEA B9D7
"And now for something completely different."


Re: [PATCH v6 14/14] riscv: Make mmap allocation top-down by default

2019-10-15 Thread Andreas Schwab
On Okt 15 2019, Atish Patra  wrote:

> Nope. This is only reproducible in RISC-V Fedora Gnome desktop image on
> a HiFive Unleashed + Microsemi Expansion. Just to clarify, there is no
> issue with OpenEmbedded disk image related to memory layout. It was a
> userspace thing.

Does it also happen with any of the openSUSE images?

https://download.opensuse.org/ports/riscv/tumbleweed/images/

Andreas.

-- 
Andreas Schwab, SUSE Labs, sch...@suse.de
GPG Key fingerprint = 0196 BAD8 1CE9 1970 F4BE  1748 E4D4 88E3 0EEA B9D7
"And now for something completely different."


Re: [PATCH -next] ASoC: fsl_mqs: fix old-style function declaration

2019-10-11 Thread Andreas Schwab
On Okt 11 2019, YueHaibing  wrote:

> gcc warn about this:
>
> sound/soc/fsl/fsl_mqs.c:146:1: warning:
>  static is not at beginning of declaration [-Wold-style-declaration]

It's not a function, though.

Andreas.

-- 
Andreas Schwab, sch...@linux-m68k.org
GPG Key fingerprint = 7578 EB47 D4E5 4D69 2510  2552 DF73 E780 A9DA AEC1
"And now for something completely different."


Re: [PATCH] kheaders: substituting --sort in archive creation

2019-10-09 Thread Andreas Schwab
On Okt 09 2019, Dmitry Goldin  wrote:

> Andreas: Could you give this patch a try and see if this works for you?

Thanks, works for me.

Andreas.

-- 
Andreas Schwab, sch...@linux-m68k.org
GPG Key fingerprint = 7578 EB47 D4E5 4D69 2510  2552 DF73 E780 A9DA AEC1
"And now for something completely different."


Re: [PATCH v2] kheaders: making headers archive reproducible

2019-10-07 Thread Andreas Schwab
On Okt 07 2019, Greg KH  wrote:

> On Mon, Oct 07, 2019 at 01:49:47PM +0200, Andreas Schwab wrote:
>>   GEN kernel/kheaders_data.tar.xz
>> tar: unrecognized option '--sort=name'
>> Try `tar --help' or `tar --usage' for more information.
>> make[2]: *** [kernel/kheaders_data.tar.xz] Error 64
>> make[1]: *** [kernel] Error 2
>> make: *** [sub-make] Error 2
>> $ tar --version
>> tar (GNU tar) 1.26
>> Copyright (C) 2011 Free Software Foundation, Inc.
>
> Wow that's an old version of tar.  2011?  What happens if you use a more
> modern one?

That's the most modern I have available on that machine.

Andreas.

-- 
Andreas Schwab, sch...@linux-m68k.org
GPG Key fingerprint = 7578 EB47 D4E5 4D69 2510  2552 DF73 E780 A9DA AEC1
"And now for something completely different."


Re: [PATCH v2] kheaders: making headers archive reproducible

2019-10-07 Thread Andreas Schwab
  GEN kernel/kheaders_data.tar.xz
tar: unrecognized option '--sort=name'
Try `tar --help' or `tar --usage' for more information.
make[2]: *** [kernel/kheaders_data.tar.xz] Error 64
make[1]: *** [kernel] Error 2
make: *** [sub-make] Error 2
$ tar --version
tar (GNU tar) 1.26
Copyright (C) 2011 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>.
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.

Written by John Gilmore and Jay Fenlason.

-- 
Andreas Schwab, sch...@linux-m68k.org
GPG Key fingerprint = 7578 EB47 D4E5 4D69 2510  2552 DF73 E780 A9DA AEC1
"And now for something completely different."


Re: [PATCH] riscv: move flush_icache_range/user_range() after flush_icache_all()

2019-09-26 Thread Andreas Schwab
https://lore.kernel.org/linux-riscv/mvm7e9spggv@suse.de/

Andreas.

-- 
Andreas Schwab, SUSE Labs, sch...@suse.de
GPG Key fingerprint = 0196 BAD8 1CE9 1970 F4BE  1748 E4D4 88E3 0EEA B9D7
"And now for something completely different."


Re: [PATCH] serial/sifive: select SERIAL_EARLYCON

2019-09-17 Thread Andreas Schwab
On Sep 16 2019, Palmer Dabbelt  wrote:

> but we don't set it for the HiFive Unleashed.  I'd call that a bug,
> something like this
>
> diff --git a/arch/riscv/boot/dts/sifive/hifive-unleashed-a00.dts 
> b/arch/riscv/boot/dts/sifive/hifive-unleashed-a00.dts
> index 93d68cbd64fe..6d0ec76d93fe 100644
> --- a/arch/riscv/boot/dts/sifive/hifive-unleashed-a00.dts
> +++ b/arch/riscv/boot/dts/sifive/hifive-unleashed-a00.dts
> @@ -13,6 +13,7 @@
>compatible = "sifive,hifive-unleashed-a00", "sifive,fu540-c000";
>
>chosen {
> +   stdout-path = 
>};
>
>cpus {
>
> should fix it.  LMK if I've misunderstood something.

If that's how it's supposed to work, ok.  Other platforms add it in
u-boot.

Andreas.

-- 
Andreas Schwab, SUSE Labs, sch...@suse.de
GPG Key fingerprint = 0196 BAD8 1CE9 1970 F4BE  1748 E4D4 88E3 0EEA B9D7
"And now for something completely different."


Re: [PATCH v3 bpf-next 01/14] samples: bpf: makefile: fix HDR_PROBE "echo"

2019-09-16 Thread Andreas Schwab
On Sep 16 2019, Andrii Nakryiko  wrote:

> On Mon, Sep 16, 2019 at 3:59 AM Ivan Khoronzhuk
>  wrote:
>>
>> echo should be replaced with echo -e to handle '\n' correctly, but
>> instead, replace it with printf as some systems can't handle echo -e.
>>
>> Signed-off-by: Ivan Khoronzhuk 
>> ---
>>  samples/bpf/Makefile | 2 +-
>>  1 file changed, 1 insertion(+), 1 deletion(-)
>>
>> diff --git a/samples/bpf/Makefile b/samples/bpf/Makefile
>> index 1d9be26b4edd..f50ca852c2a8 100644
>> --- a/samples/bpf/Makefile
>> +++ b/samples/bpf/Makefile
>> @@ -201,7 +201,7 @@ endif
>>
>>  # Don't evaluate probes and warnings if we need to run make recursively
>>  ifneq ($(src),)
>> -HDR_PROBE := $(shell echo "\#include \n struct list_head { 
>> int a; }; int main() { return 0; }" | \
>> +HDR_PROBE := $(shell printf "\#include \n struct list_head { 
>> int a; }; int main() { return 0; }" | \
>
> printf change is fine, but I'm confused about \# at the beginning of
> the string.

>From the NEWS of make 4.3:

* WARNING: Backward-incompatibility!
  Number signs (#) appearing inside a macro reference or function invocation
  no longer introduce comments and should not be escaped with backslashes:
  thus a call such as:
foo := $(shell echo '#')
  is legal.  Previously the number sign needed to be escaped, for example:
foo := $(shell echo '\#')
  Now this latter will resolve to "\#".  If you want to write makefiles
  portable to both versions, assign the number sign to a variable:
H := \#
foo := $(shell echo '$H')
  This was claimed to be fixed in 3.81, but wasn't, for some reason.
  To detect this change search for 'nocomment' in the .FEATURES variable.

Andreas.

-- 
Andreas Schwab, sch...@linux-m68k.org
GPG Key fingerprint = 7578 EB47 D4E5 4D69 2510  2552 DF73 E780 A9DA AEC1
"And now for something completely different."


Re: [PATCH] serial/sifive: select SERIAL_EARLYCON

2019-09-16 Thread Andreas Schwab
On Sep 16 2019, Palmer Dabbelt  wrote:

> On Sun, 15 Sep 2019 23:42:53 PDT (-0700), Christoph Hellwig wrote:
>> On Fri, Sep 13, 2019 at 01:40:27PM -0700, Palmer Dabbelt wrote:
>>> OpenEmbedded passes "earlycon=sbi", which I can find in the doumentation.
>>> I can't find anything about just "earlycon".  I've sent a patch adding sbi
>>> to the list of earlycon arguments.
>>
>> earlycon without arguments is documented, although just for ARM64.
>> I can send a patch to update it to properly cover all DT platforms
>> in addition.
>
> Thanks.  I've kind of lost track of the thread, but assuming that does the
> "automatically pick an earlycon" stuff then that's probably what we should
> be using in the distros.

Except that it doesn't work.

Andreas.

-- 
Andreas Schwab, SUSE Labs, sch...@suse.de
GPG Key fingerprint = 0196 BAD8 1CE9 1970 F4BE  1748 E4D4 88E3 0EEA B9D7
"And now for something completely different."


Re: [PATCH] serial/sifive: select SERIAL_EARLYCON

2019-09-16 Thread Andreas Schwab
On Sep 16 2019, Paul Walmsley  wrote:

> On Tue, 10 Sep 2019, Andreas Schwab wrote:
>
>> On Sep 10 2019, Christoph Hellwig  wrote:
>> 
>> > On Tue, Sep 10, 2019 at 08:57:37AM +0200, Andreas Schwab wrote:
>> >> On Sep 10 2019, Christoph Hellwig  wrote:
>> >> 
>> >> > The sifive serial driver implements earlycon support,
>> >> 
>> >> It should probably be documented in admin-guide/kernel-parameters.txt.
>> >
>> > How so?  Wіth OF and a stdout path you just set earlycon on the
>> > command line without any arguments and it will be found.
>> 
>> Doesn't work for me.
>> 
>> [0.00] Malformed early option 'earlycon'
>
> Try:
>
> earlycon=sifive,0x1001

That's not what Christoph wants.

Andreas.

-- 
Andreas Schwab, SUSE Labs, sch...@suse.de
GPG Key fingerprint = 0196 BAD8 1CE9 1970 F4BE  1748 E4D4 88E3 0EEA B9D7
"And now for something completely different."


Re: [PATCH v2 2/2] riscv: Make __fstate_clean() work correctly.

2019-09-11 Thread Andreas Schwab
On Sep 11 2019, Geert Uytterhoeven  wrote:

> Hi Andreas,
>
> On Thu, Aug 15, 2019 at 12:37 AM Andreas Schwab  wrote:
>> On Aug 14 2019, Palmer Dabbelt  wrote:
>> > On Wed, 14 Aug 2019 13:32:50 PDT (-0700), Paul Walmsley wrote:
>> >> On Wed, 14 Aug 2019, Vincent Chen wrote:
>> >>> Make the __fstate_clean() function correctly set the
>> >>> state of sstatus.FS in pt_regs to SR_FS_CLEAN.
>> >>>
>> >>> Fixes: 7db91e5 ("RISC-V: Task implementation")
>> >>> Cc: linux-stable 
>> >>> Signed-off-by: Vincent Chen 
>> >>> Reviewed-by: Anup Patel 
>> >>> Reviewed-by: Christoph Hellwig 
>> >>
>> >> Thanks, I extended the "Fixes" commit ID to 12 digits, as is the usual
>> >> practice here, and have queued the following for v5.3-rc.
>> >
>> > For reference, something like "git config core.abbrev=12" (or whatever you
>> > write to get this in your .gitconfig)
>> >
>> >https://github.com/palmer-dabbelt/home/blob/master/.gitconfig.in#L23
>> >
>> > causes git to do the right thing.
>>
>> Actually, the right setting is core.abbrev=auto (or leaving it unset).
>> It lets git chose the appropriate length depending on the repository
>> contents.  For the linux repository it will chose 13 right now.
>
> Does that depend on the git version?
> For me (git version 2.17.1), it still uses 12 when using the auto setting.

No, 12 is the correct number.  I was miscounting.

Andreas.

-- 
Andreas Schwab, sch...@linux-m68k.org
GPG Key fingerprint = 7578 EB47 D4E5 4D69 2510  2552 DF73 E780 A9DA AEC1
"And now for something completely different."


Re: [PATCH] serial/sifive: select SERIAL_EARLYCON

2019-09-10 Thread Andreas Schwab
On Sep 10 2019, Christoph Hellwig  wrote:

> On Tue, Sep 10, 2019 at 10:18:15AM +0200, Andreas Schwab wrote:
>> > How so?  Wіth OF and a stdout path you just set earlycon on the
>> > command line without any arguments and it will be found.
>> 
>> Doesn't work for me.
>> 
>> [0.00] Malformed early option 'earlycon'
>
> That functionality is implemented by param_setup_earlycon and
> early_init_dt_scan_chosen_stdout.  Check why those aren't built into
> your kernel.

They are.

Andreas.

-- 
Andreas Schwab, SUSE Labs, sch...@suse.de
GPG Key fingerprint = 0196 BAD8 1CE9 1970 F4BE  1748 E4D4 88E3 0EEA B9D7
"And now for something completely different."


Re: [PATCH] serial/sifive: select SERIAL_EARLYCON

2019-09-10 Thread Andreas Schwab
On Sep 10 2019, Christoph Hellwig  wrote:

> On Tue, Sep 10, 2019 at 08:57:37AM +0200, Andreas Schwab wrote:
>> On Sep 10 2019, Christoph Hellwig  wrote:
>> 
>> > The sifive serial driver implements earlycon support,
>> 
>> It should probably be documented in admin-guide/kernel-parameters.txt.
>
> How so?  Wіth OF and a stdout path you just set earlycon on the
> command line without any arguments and it will be found.

Doesn't work for me.

[0.00] Malformed early option 'earlycon'

Andreas.

-- 
Andreas Schwab, SUSE Labs, sch...@suse.de
GPG Key fingerprint = 0196 BAD8 1CE9 1970 F4BE  1748 E4D4 88E3 0EEA B9D7
"And now for something completely different."


Re: [PATCH] serial/sifive: select SERIAL_EARLYCON

2019-09-10 Thread Andreas Schwab
On Sep 10 2019, Christoph Hellwig  wrote:

> The sifive serial driver implements earlycon support,

It should probably be documented in admin-guide/kernel-parameters.txt.

Andreas.

-- 
Andreas Schwab, SUSE Labs, sch...@suse.de
GPG Key fingerprint = 0196 BAD8 1CE9 1970 F4BE  1748 E4D4 88E3 0EEA B9D7
"And now for something completely different."


Re: [PATCH v7 18/21] RISC-V: KVM: Add SBI v0.1 support

2019-09-05 Thread Andreas Schwab
On Sep 04 2019, Anup Patel  wrote:

> From: Atish Patra 
>
> The KVM host kernel running in HS-mode needs to handle SBI calls coming
> from guest kernel running in VS-mode.
>
> This patch adds SBI v0.1 support in KVM RISC-V. All the SBI calls are
> implemented correctly except remote tlb flushes. For remote TLB flushes,
> we are doing full TLB flush and this will be optimized in future.

Note that this conflicts with
https://patchwork.kernel.org/patch/11107221/ which removes 
from .  You should probably include that header
explicitly in arch/riscv/kvm/vcpu_sbi.c.

Andreas.

-- 
Andreas Schwab, SUSE Labs, sch...@suse.de
GPG Key fingerprint = 0196 BAD8 1CE9 1970 F4BE  1748 E4D4 88E3 0EEA B9D7
"And now for something completely different."


Re: [PATCH 2/3] macb: Update compatibility string for SiFive FU540-C000

2019-08-20 Thread Andreas Schwab
On Aug 13 2019, Paul Walmsley  wrote:

> Dave, Nicolas,
>
> On Mon, 22 Jul 2019, Yash Shah wrote:
>
>> On Fri, Jul 19, 2019 at 5:36 PM  wrote:
>> >
>> > On 19/07/2019 at 13:10, Yash Shah wrote:
>> > > Update the compatibility string for SiFive FU540-C000 as per the new
>> > > string updated in the binding doc.
>> > > Reference: https://lkml.org/lkml/2019/7/17/200
>> >
>> > Maybe referring to lore.kernel.org is better:
>> > https://lore.kernel.org/netdev/caj2_jofevzqat0yprg4hem4jrrqkb72fkseqj4p8p5ka-+r...@mail.gmail.com/
>> 
>> Sure. Will keep that in mind for future reference.
>> 
>> >
>> > > Signed-off-by: Yash Shah 
>> >
>> > Acked-by: Nicolas Ferre 
>> 
>> Thanks.
>
> Am assuming you'll pick this up for the -net tree for v5.4-rc1 or earlier.
> If not, please let us know.

This is still missing in v5.4-rc5, which means that networking is broken.

Andreas.

-- 
Andreas Schwab, SUSE Labs, sch...@suse.de
GPG Key fingerprint = 0196 BAD8 1CE9 1970 F4BE  1748 E4D4 88E3 0EEA B9D7
"And now for something completely different."


Re: [v2 PATCH] RISC-V: Optimize tlb flush path.

2019-08-20 Thread Andreas Schwab
On Aug 20 2019, Atish Patra  wrote:

> +
> +   cpuid = get_cpu();
> + if (!cmask) {
> +   riscv_cpuid_to_hartid_mask(cpu_online_mask, );
> +   goto issue_sfence;
> +   }
> +
> +   
> +   if (cpumask_test_cpu(cpuid, cmask) && cpumask_weight(cmask) ==
> 1) {
> +   /* Save trap cost by issuing a local tlb flush here */
> +   if ((start == 0 && size == -1) || (size > PAGE_SIZE))
> +   local_flush_tlb_all();
> +   else if (size == PAGE_SIZE)
> +   local_flush_tlb_page(start);
> +   goto done;
> +   }
> +
> riscv_cpuid_to_hartid_mask(cmask, );
> +
> +issue_sfence:
> sbi_remote_sfence_vma(hmask.bits, start, size);
> +done:
> +   put_cpu();
>  }
>
> This is much simpler than what I had done in v2. I will address the if
> condition around size as well.

I still think that this function should be moved out of the header.

Andreas.

-- 
Andreas Schwab, sch...@linux-m68k.org
GPG Key fingerprint = 7578 EB47 D4E5 4D69 2510  2552 DF73 E780 A9DA AEC1
"And now for something completely different."


Re: [v2 PATCH] RISC-V: Optimize tlb flush path.

2019-08-20 Thread Andreas Schwab
On Aug 19 2019, Atish Patra  wrote:

> @@ -42,20 +43,44 @@ static inline void flush_tlb_range(struct vm_area_struct 
> *vma,
>  
>  #include 
>  
> -static inline void remote_sfence_vma(struct cpumask *cmask, unsigned long 
> start,
> -  unsigned long size)
> +static void __riscv_flush_tlb(struct cpumask *cmask, unsigned long start,
> +   unsigned long size)

cmask can be const.

>  {
>   struct cpumask hmask;
> + unsigned int hartid;
> + unsigned int cpuid;
>  
>   cpumask_clear();
> +
> + if (!cmask) {
> + riscv_cpuid_to_hartid_mask(cpu_online_mask, );
> + goto issue_sfence;
> + }

Wouldn't it make sense to fall through to doing a local flush here?

if (!cmask)
    cmask = cpu_online_mask;

Andreas.

-- 
Andreas Schwab, sch...@linux-m68k.org
GPG Key fingerprint = 7578 EB47 D4E5 4D69 2510  2552 DF73 E780 A9DA AEC1
"And now for something completely different."


Re: [v2 PATCH] RISC-V: Optimize tlb flush path.

2019-08-20 Thread Andreas Schwab
On Aug 19 2019, "h...@infradead.org"  wrote:

> This looks a little odd to m and assumes we never pass a size smaller
> than PAGE_SIZE.  Whule that is probably true, why not something like:
>
>   if (size < PAGE_SIZE && size != -1)

ITYM size <= PAGE_SIZE.  And since size is unsigned it cannot be == -1
at the same time.

>   local_flush_tlb_page(start);
>   else
>   local_flush_tlb_all();
>
> ?

Andreas.

-- 
Andreas Schwab, sch...@linux-m68k.org
GPG Key fingerprint = 7578 EB47 D4E5 4D69 2510  2552 DF73 E780 A9DA AEC1
"And now for something completely different."


Re: [PATCH v2 2/2] riscv: Make __fstate_clean() work correctly.

2019-08-14 Thread Andreas Schwab
On Aug 14 2019, Palmer Dabbelt  wrote:

> On Wed, 14 Aug 2019 13:32:50 PDT (-0700), Paul Walmsley wrote:
>> On Wed, 14 Aug 2019, Vincent Chen wrote:
>>
>>> Make the __fstate_clean() function correctly set the
>>> state of sstatus.FS in pt_regs to SR_FS_CLEAN.
>>>
>>> Fixes: 7db91e5 ("RISC-V: Task implementation")
>>> Cc: linux-stable 
>>> Signed-off-by: Vincent Chen 
>>> Reviewed-by: Anup Patel 
>>> Reviewed-by: Christoph Hellwig 
>>
>> Thanks, I extended the "Fixes" commit ID to 12 digits, as is the usual
>> practice here, and have queued the following for v5.3-rc.
>
> For reference, something like "git config core.abbrev=12" (or whatever you
> write to get this in your .gitconfig)
>
>https://github.com/palmer-dabbelt/home/blob/master/.gitconfig.in#L23
>
> causes git to do the right thing.

Actually, the right setting is core.abbrev=auto (or leaving it unset).
It lets git chose the appropriate length depending on the repository
contents.  For the linux repository it will chose 13 right now.

Andreas.

-- 
Andreas Schwab, sch...@linux-m68k.org
GPG Key fingerprint = 7578 EB47 D4E5 4D69 2510  2552 DF73 E780 A9DA AEC1
"And now for something completely different."


Re: [PATCH] RISC-V: Issue a local tlb flush if possible.

2019-08-10 Thread Andreas Schwab
On Aug 09 2019, Atish Patra  wrote:

> @@ -46,14 +47,38 @@ static inline void remote_sfence_vma(struct cpumask 
> *cmask, unsigned long start,
>unsigned long size)
>  {
>   struct cpumask hmask;
> + struct cpumask tmask;
> + int cpuid = smp_processor_id();
>  
>   cpumask_clear();
> - riscv_cpuid_to_hartid_mask(cmask, );
> - sbi_remote_sfence_vma(hmask.bits, start, size);
> + cpumask_clear();
> +
> + if (cmask)
> + cpumask_copy(, cmask);
> + else
> + cpumask_copy(, cpu_online_mask);
> +
> + if (cpumask_test_cpu(cpuid, )) {
> + /* Save trap cost by issuing a local tlb flush here */
> + if ((start == 0 && size == -1) || (size > PAGE_SIZE))
> + local_flush_tlb_all();
> + else if (size == PAGE_SIZE)
> + local_flush_tlb_page(start);
> + cpumask_clear_cpu(cpuid, );
> + } else if (cpumask_empty()) {
> + /* cpumask is empty. So just do a local flush */
> + local_flush_tlb_all();
> + return;
> + }
> +
> + if (!cpumask_empty()) {
> + riscv_cpuid_to_hartid_mask(, );
> + sbi_remote_sfence_vma(hmask.bits, start, size);
> + }
>  }

I think it's becoming too big to be inline.

Andreas.

-- 
Andreas Schwab, sch...@linux-m68k.org
GPG Key fingerprint = 7578 EB47 D4E5 4D69 2510  2552 DF73 E780 A9DA AEC1
"And now for something completely different."


Re: [RFC PATCH 00/16] KVM RISC-V Support

2019-07-30 Thread Andreas Schwab
On Jul 30 2019, Anup Patel  wrote:

> On Tue, Jul 30, 2019 at 12:23 PM Andreas Schwab  wrote:
>>
>> ERROR: "riscv_cs_get_mult_shift" [arch/riscv/kvm/kvm.ko] undefined!
>> ERROR: "riscv_isa" [arch/riscv/kvm/kvm.ko] undefined!
>> ERROR: "smp_send_reschedule" [arch/riscv/kvm/kvm.ko] undefined!
>> ERROR: "riscv_timebase" [arch/riscv/kvm/kvm.ko] undefined!
>
> Strange, we are not seeing these compile errors.

None of these symbols are exported.

> Anyway, please ensure that you apply Atish's KVM prep patches
> (https://lkml.org/lkml/2019/7/26/1271) on Linux-5.3-rcX before applying
> this series.

None of these patches contain EXPORT_SYMBOL declarations.

Andreas.

-- 
Andreas Schwab, SUSE Labs, sch...@suse.de
GPG Key fingerprint = 0196 BAD8 1CE9 1970 F4BE  1748 E4D4 88E3 0EEA B9D7
"And now for something completely different."


Re: [RFC PATCH 00/16] KVM RISC-V Support

2019-07-30 Thread Andreas Schwab
ERROR: "riscv_cs_get_mult_shift" [arch/riscv/kvm/kvm.ko] undefined!
ERROR: "riscv_isa" [arch/riscv/kvm/kvm.ko] undefined!
ERROR: "smp_send_reschedule" [arch/riscv/kvm/kvm.ko] undefined!
ERROR: "riscv_timebase" [arch/riscv/kvm/kvm.ko] undefined!

Andreas.

-- 
Andreas Schwab, SUSE Labs, sch...@suse.de
GPG Key fingerprint = 0196 BAD8 1CE9 1970 F4BE  1748 E4D4 88E3 0EEA B9D7
"And now for something completely different."


Re: [RFC PATCH 13/16] RISC-V: KVM: Add timer functionality

2019-07-30 Thread Andreas Schwab
On Jul 29 2019, Atish Patra  wrote:

> Strange. We never saw this error.

It is part of CONFIG_KERNEL_HEADER_TEST.  Everyone developing a driver
should enable it.

> #include 
>
> Can you try it at your end and confirm please ?

Confirmed.

Andreas.

-- 
Andreas Schwab, SUSE Labs, sch...@suse.de
GPG Key fingerprint = 0196 BAD8 1CE9 1970 F4BE  1748 E4D4 88E3 0EEA B9D7
"And now for something completely different."


Re: [RFC PATCH 13/16] RISC-V: KVM: Add timer functionality

2019-07-29 Thread Andreas Schwab
On Jul 29 2019, Anup Patel  wrote:

> From: Atish Patra 
>
> The RISC-V hypervisor specification doesn't have any virtual timer
> feature.
>
> Due to this, the guest VCPU timer will be programmed via SBI calls.
> The host will use a separate hrtimer event for each guest VCPU to
> provide timer functionality. We inject a virtual timer interrupt to
> the guest VCPU whenever the guest VCPU hrtimer event expires.
>
> The following features are not supported yet and will be added in
> future:
> 1. A time offset to adjust guest time from host time
> 2. A saved next event in guest vcpu for vm migration

I'm getting this error:

In file included from :
./include/clocksource/timer-riscv.h:12:30: error: unknown type name ‘u32’
   12 | void riscv_cs_get_mult_shift(u32 *mult, u32 *shift);
  |  ^~~
./include/clocksource/timer-riscv.h:12:41: error: unknown type name ‘u32’
   12 | void riscv_cs_get_mult_shift(u32 *mult, u32 *shift);
  | ^~~
make[1]: *** [scripts/Makefile.build:301: include/clocksource/timer-riscv.h.s] 
Error 1

Andreas.

-- 
Andreas Schwab, SUSE Labs, sch...@suse.de
GPG Key fingerprint = 0196 BAD8 1CE9 1970 F4BE  1748 E4D4 88E3 0EEA B9D7
"And now for something completely different."


Re: [PATCH 3/4] RISC-V: Support case insensitive ISA string parsing.

2019-07-29 Thread Andreas Schwab
On Jul 27 2019, Anup Patel  wrote:

> So, using strncasecmp() in-place of strncmp() and using tolower() for
> each character comparison is complex for you ?

Apparently too complex for you.

+   if (tolower(isa[0] != 's'))

Andreas.

-- 
Andreas Schwab, SUSE Labs, sch...@suse.de
GPG Key fingerprint = 0196 BAD8 1CE9 1970 F4BE  1748 E4D4 88E3 0EEA B9D7
"And now for something completely different."


[PATCH] net: phy: mscc: initialize stats array

2019-07-24 Thread Andreas Schwab
The memory allocated for the stats array may contain arbitrary data.

Signed-off-by: Andreas Schwab 
---
 drivers/net/phy/mscc.c | 16 
 1 file changed, 8 insertions(+), 8 deletions(-)

diff --git a/drivers/net/phy/mscc.c b/drivers/net/phy/mscc.c
index 28676af97b42..645d354ffb48 100644
--- a/drivers/net/phy/mscc.c
+++ b/drivers/net/phy/mscc.c
@@ -2226,8 +2226,8 @@ static int vsc8514_probe(struct phy_device *phydev)
vsc8531->supp_led_modes = VSC85XX_SUPP_LED_MODES;
vsc8531->hw_stats = vsc85xx_hw_stats;
vsc8531->nstats = ARRAY_SIZE(vsc85xx_hw_stats);
-   vsc8531->stats = devm_kmalloc_array(>mdio.dev, vsc8531->nstats,
-   sizeof(u64), GFP_KERNEL);
+   vsc8531->stats = devm_kcalloc(>mdio.dev, vsc8531->nstats,
+ sizeof(u64), GFP_KERNEL);
if (!vsc8531->stats)
return -ENOMEM;
 
@@ -2251,8 +2251,8 @@ static int vsc8574_probe(struct phy_device *phydev)
vsc8531->supp_led_modes = VSC8584_SUPP_LED_MODES;
vsc8531->hw_stats = vsc8584_hw_stats;
vsc8531->nstats = ARRAY_SIZE(vsc8584_hw_stats);
-   vsc8531->stats = devm_kmalloc_array(>mdio.dev, vsc8531->nstats,
-   sizeof(u64), GFP_KERNEL);
+   vsc8531->stats = devm_kcalloc(>mdio.dev, vsc8531->nstats,
+ sizeof(u64), GFP_KERNEL);
if (!vsc8531->stats)
return -ENOMEM;
 
@@ -2281,8 +2281,8 @@ static int vsc8584_probe(struct phy_device *phydev)
vsc8531->supp_led_modes = VSC8584_SUPP_LED_MODES;
vsc8531->hw_stats = vsc8584_hw_stats;
vsc8531->nstats = ARRAY_SIZE(vsc8584_hw_stats);
-   vsc8531->stats = devm_kmalloc_array(>mdio.dev, vsc8531->nstats,
-   sizeof(u64), GFP_KERNEL);
+   vsc8531->stats = devm_kcalloc(>mdio.dev, vsc8531->nstats,
+ sizeof(u64), GFP_KERNEL);
if (!vsc8531->stats)
return -ENOMEM;
 
@@ -2311,8 +2311,8 @@ static int vsc85xx_probe(struct phy_device *phydev)
vsc8531->supp_led_modes = VSC85XX_SUPP_LED_MODES;
vsc8531->hw_stats = vsc85xx_hw_stats;
vsc8531->nstats = ARRAY_SIZE(vsc85xx_hw_stats);
-   vsc8531->stats = devm_kmalloc_array(>mdio.dev, vsc8531->nstats,
-   sizeof(u64), GFP_KERNEL);
+   vsc8531->stats = devm_kcalloc(>mdio.dev, vsc8531->nstats,
+         sizeof(u64), GFP_KERNEL);
if (!vsc8531->stats)
return -ENOMEM;
 
-- 
2.22.0


-- 
Andreas Schwab, SUSE Labs, sch...@suse.de
GPG Key fingerprint = 0196 BAD8 1CE9 1970 F4BE  1748 E4D4 88E3 0EEA B9D7
"And now for something completely different."


Re: [PATCH RESEND 0/2] RISC-V: Handle the siginfo_t offset problem

2019-07-04 Thread Andreas Schwab
On Jul 03 2019, Alistair Francis  wrote:

> On Wed, Jul 3, 2019 at 12:08 AM Andreas Schwab  wrote:
>>
>> On Jul 02 2019, Alistair Francis  wrote:
>>
>> > In the RISC-V 32-bit glibc port [1] the siginfo_t struct in the kernel
>> > doesn't line up with the struct in glibc. In glibc world the _sifields
>> > union is 8 byte alligned (although I can't figure out why)
>>
>> Try ptype/o in gdb.
>
> That's a useful tip, I'll be sure to use that next time.

It was a serious note.  If the structs don't line up then there is a
mismatch in types that cannot be solved by adding spurious padding.  You
need to fix the types instead.

Andreas.

-- 
Andreas Schwab, SUSE Labs, sch...@suse.de
GPG Key fingerprint = 0196 BAD8 1CE9 1970 F4BE  1748 E4D4 88E3 0EEA B9D7
"And now for something completely different."


Re: [PATCH RESEND 0/2] RISC-V: Handle the siginfo_t offset problem

2019-07-03 Thread Andreas Schwab
On Jul 02 2019, Alistair Francis  wrote:

> In the RISC-V 32-bit glibc port [1] the siginfo_t struct in the kernel
> doesn't line up with the struct in glibc. In glibc world the _sifields
> union is 8 byte alligned (although I can't figure out why)

Try ptype/o in gdb.

Andreas.

-- 
Andreas Schwab, SUSE Labs, sch...@suse.de
GPG Key fingerprint = 0196 BAD8 1CE9 1970 F4BE  1748 E4D4 88E3 0EEA B9D7
"And now for something completely different."


Re: [RFC PATCH v2 02/12] powerpc/ptrace: drop unnecessary #ifdefs CONFIG_PPC64

2019-06-28 Thread Andreas Schwab
On Jun 28 2019, Christophe Leroy  wrote:

> Le 28/06/2019 à 18:36, Andreas Schwab a écrit :
>> On Jun 28 2019, Christophe Leroy  wrote:
>>
>>> diff --git a/arch/powerpc/include/uapi/asm/ptrace.h 
>>> b/arch/powerpc/include/uapi/asm/ptrace.h
>>> index f5f1ccc740fc..37d7befbb8dc 100644
>>> --- a/arch/powerpc/include/uapi/asm/ptrace.h
>>> +++ b/arch/powerpc/include/uapi/asm/ptrace.h
>>> @@ -43,12 +43,11 @@ struct pt_regs
>>> unsigned long link;
>>> unsigned long xer;
>>> unsigned long ccr;
>>> -#ifdef __powerpc64__
>>> -   unsigned long softe;/* Soft enabled/disabled */
>>> -#else
>>> -   unsigned long mq;   /* 601 only (not used at present) */
>>> +   union {
>>> +   unsigned long softe;/* Soft enabled/disabled */
>>> +   unsigned long mq;   /* 601 only (not used at present) */
>>> /* Used on APUS to hold IPL value. */
>>> -#endif
>>> +   };
>>
>> Anonymous unions are a C11 feature.
>>
>
> Is that a problem ?

Yes, this is a UAPI header.

Andreas.

-- 
Andreas Schwab, sch...@linux-m68k.org
GPG Key fingerprint = 7578 EB47 D4E5 4D69 2510  2552 DF73 E780 A9DA AEC1
"And now for something completely different."


Re: [RFC PATCH v2 02/12] powerpc/ptrace: drop unnecessary #ifdefs CONFIG_PPC64

2019-06-28 Thread Andreas Schwab
On Jun 28 2019, Christophe Leroy  wrote:

> diff --git a/arch/powerpc/include/uapi/asm/ptrace.h 
> b/arch/powerpc/include/uapi/asm/ptrace.h
> index f5f1ccc740fc..37d7befbb8dc 100644
> --- a/arch/powerpc/include/uapi/asm/ptrace.h
> +++ b/arch/powerpc/include/uapi/asm/ptrace.h
> @@ -43,12 +43,11 @@ struct pt_regs
>   unsigned long link;
>   unsigned long xer;
>   unsigned long ccr;
> -#ifdef __powerpc64__
> - unsigned long softe;/* Soft enabled/disabled */
> -#else
> - unsigned long mq;   /* 601 only (not used at present) */
> + union {
> + unsigned long softe;/* Soft enabled/disabled */
> + unsigned long mq;   /* 601 only (not used at present) */
>   /* Used on APUS to hold IPL value. */
> -#endif
> +     };

Anonymous unions are a C11 feature.

Andreas.

-- 
Andreas Schwab, sch...@linux-m68k.org
GPG Key fingerprint = 7578 EB47 D4E5 4D69 2510  2552 DF73 E780 A9DA AEC1
"And now for something completely different."


  1   2   3   4   5   6   7   8   9   10   >