LinuxPPC-Dev Archive on lore.kernel.org
 help / color / mirror / Atom feed
* Re: [PATCH v3 05/17] arm: Convert to GENERIC_CMDLINE
From: Christophe Leroy @ 2021-04-02 15:24 UTC (permalink / raw)
  To: Rob Herring
  Cc: open list:GENERIC INCLUDE/ASM HEADER FILES, devicetree,
	microblaze, Daniel Gimpelevich, linux-xtensa, SH-Linux,
	Will Deacon, X86 ML, linux-kernel@vger.kernel.org, nios2,
	open list:MIPS, Openrisc, linux-hexagon, sparclinux, linux-riscv,
	linuxppc-dev, linux-arm-kernel, Daniel Walker
In-Reply-To: <CAL_Jsq+LF-s5K4Jwd5jCHrU8271L5WCiGb0tR7aTUa8ddHF1YQ@mail.gmail.com>



Le 26/03/2021 à 16:47, Rob Herring a écrit :
> On Fri, Mar 26, 2021 at 7:44 AM Christophe Leroy
> <christophe.leroy@csgroup.eu> wrote:
>>
>> This converts the architecture to GENERIC_CMDLINE.
>>
>> Signed-off-by: Christophe Leroy <christophe.leroy@csgroup.eu>
>> ---
>>   arch/arm/Kconfig              | 38 +----------------------------------
>>   arch/arm/kernel/atags_parse.c | 15 +++++---------
>>   2 files changed, 6 insertions(+), 47 deletions(-)
>>
>> diff --git a/arch/arm/Kconfig b/arch/arm/Kconfig
>> index 5da96f5df48f..67bc75f2da81 100644
>> --- a/arch/arm/Kconfig
>> +++ b/arch/arm/Kconfig
>> @@ -50,6 +50,7 @@ config ARM
>>          select GENERIC_ARCH_TOPOLOGY if ARM_CPU_TOPOLOGY
>>          select GENERIC_ATOMIC64 if CPU_V7M || CPU_V6 || !CPU_32v6K || !AEABI
>>          select GENERIC_CLOCKEVENTS_BROADCAST if SMP
>> +       select GENERIC_CMDLINE if ATAGS
> 
> Don't we need this enabled for !ATAGS (i.e. DT boot)?
> 
> Can we always enable GENERIC_CMDLINE for OF_EARLY_FLATTREE?
> 

Yes missed it in v3 after your comment on v2. Done in v4.

^ permalink raw reply

* Re: [PATCH v5 41/48] KVM: PPC: Book3S HV: Remove unused nested HV tests in XICS emulation
From: kernel test robot @ 2021-04-02 15:28 UTC (permalink / raw)
  To: Nicholas Piggin, kvm-ppc
  Cc: linuxppc-dev, kbuild-all, Cédric Le Goater, Nicholas Piggin
In-Reply-To: <20210401150325.442125-42-npiggin@gmail.com>

[-- Attachment #1: Type: text/plain, Size: 13229 bytes --]

Hi Nicholas,

I love your patch! Perhaps something to improve:

[auto build test WARNING on powerpc/next]
[also build test WARNING on v5.12-rc5 next-20210401]
[If your patch is applied to the wrong git tree, kindly drop us a note.
And when submitting patch, we suggest to use '--base' as documented in
https://git-scm.com/docs/git-format-patch]

url:    https://github.com/0day-ci/linux/commits/Nicholas-Piggin/KVM-PPC-Book3S-C-ify-the-P9-entry-exit-code/20210401-232743
base:   https://git.kernel.org/pub/scm/linux/kernel/git/powerpc/linux.git next
config: powerpc64-randconfig-s032-20210402 (attached as .config)
compiler: powerpc64le-linux-gcc (GCC) 9.3.0
reproduce:
        wget https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O ~/bin/make.cross
        chmod +x ~/bin/make.cross
        # apt-get install sparse
        # sparse version: v0.6.3-279-g6d5d9b42-dirty
        # https://github.com/0day-ci/linux/commit/53519e6ae0f84e2742b886a08598648b424e6f08
        git remote add linux-review https://github.com/0day-ci/linux
        git fetch --no-tags linux-review Nicholas-Piggin/KVM-PPC-Book3S-C-ify-the-P9-entry-exit-code/20210401-232743
        git checkout 53519e6ae0f84e2742b886a08598648b424e6f08
        # save the attached .config to linux build tree
        COMPILER_INSTALL_PATH=$HOME/0day COMPILER=gcc-9.3.0 make.cross C=1 CF='-fdiagnostic-prefix -D__CHECK_ENDIAN__' ARCH=powerpc64 

If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <lkp@intel.com>


sparse warnings: (new ones prefixed by >>)
   arch/powerpc/kvm/book3s_hv_builtin.c:417:41: sparse: sparse: incorrect type in argument 1 (different base types) @@     expected unsigned int [usertype] *out_xirr @@     got restricted __be32 * @@
   arch/powerpc/kvm/book3s_hv_builtin.c:417:41: sparse:     expected unsigned int [usertype] *out_xirr
   arch/powerpc/kvm/book3s_hv_builtin.c:417:41: sparse:     got restricted __be32 *
>> arch/powerpc/kvm/book3s_hv_builtin.c:419:22: sparse: sparse: incorrect type in assignment (different base types) @@     expected restricted __be32 [addressable] [usertype] xirr @@     got unsigned int @@
   arch/powerpc/kvm/book3s_hv_builtin.c:419:22: sparse:     expected restricted __be32 [addressable] [usertype] xirr
   arch/powerpc/kvm/book3s_hv_builtin.c:419:22: sparse:     got unsigned int
>> arch/powerpc/kvm/book3s_hv_builtin.c:450:41: sparse: sparse: incorrect type in argument 1 (different base types) @@     expected unsigned int [usertype] val @@     got restricted __be32 [addressable] [usertype] xirr @@
   arch/powerpc/kvm/book3s_hv_builtin.c:450:41: sparse:     expected unsigned int [usertype] val
   arch/powerpc/kvm/book3s_hv_builtin.c:450:41: sparse:     got restricted __be32 [addressable] [usertype] xirr
   arch/powerpc/kvm/book3s_hv_builtin.c: note: in included file:
   arch/powerpc/include/asm/kvm_ppc.h:967:1: sparse: sparse: cast to restricted __be64
   arch/powerpc/include/asm/kvm_ppc.h:967:1: sparse: sparse: cast to restricted __be64
   arch/powerpc/include/asm/kvm_ppc.h:967:1: sparse: sparse: cast to restricted __be64
   arch/powerpc/include/asm/kvm_ppc.h:967:1: sparse: sparse: cast to restricted __be64
   arch/powerpc/include/asm/kvm_ppc.h:967:1: sparse: sparse: cast to restricted __be64
   arch/powerpc/include/asm/kvm_ppc.h:967:1: sparse: sparse: cast to restricted __be64
   arch/powerpc/include/asm/kvm_ppc.h:967:1: sparse: sparse: cast to restricted __be64
   arch/powerpc/include/asm/kvm_ppc.h:967:1: sparse: sparse: cast to restricted __be64
   arch/powerpc/include/asm/kvm_ppc.h:967:1: sparse: sparse: cast to restricted __be64
   arch/powerpc/include/asm/kvm_ppc.h:967:1: sparse: sparse: cast to restricted __be64
   arch/powerpc/include/asm/kvm_ppc.h:967:1: sparse: sparse: cast to restricted __le64
   arch/powerpc/include/asm/kvm_ppc.h:963:1: sparse: sparse: incorrect type in assignment (different base types) @@     expected unsigned long long [usertype] srr0 @@     got restricted __be64 [usertype] @@
   arch/powerpc/include/asm/kvm_ppc.h:963:1: sparse:     expected unsigned long long [usertype] srr0
   arch/powerpc/include/asm/kvm_ppc.h:963:1: sparse:     got restricted __be64 [usertype]
   arch/powerpc/include/asm/kvm_ppc.h:963:1: sparse: sparse: incorrect type in assignment (different base types) @@     expected unsigned long long [usertype] srr0 @@     got restricted __le64 [usertype] @@
   arch/powerpc/include/asm/kvm_ppc.h:963:1: sparse:     expected unsigned long long [usertype] srr0
   arch/powerpc/include/asm/kvm_ppc.h:963:1: sparse:     got restricted __le64 [usertype]
   arch/powerpc/include/asm/kvm_ppc.h:964:1: sparse: sparse: incorrect type in assignment (different base types) @@     expected unsigned long long [usertype] srr1 @@     got restricted __be64 [usertype] @@
   arch/powerpc/include/asm/kvm_ppc.h:964:1: sparse:     expected unsigned long long [usertype] srr1
   arch/powerpc/include/asm/kvm_ppc.h:964:1: sparse:     got restricted __be64 [usertype]
   arch/powerpc/include/asm/kvm_ppc.h:964:1: sparse: sparse: incorrect type in assignment (different base types) @@     expected unsigned long long [usertype] srr1 @@     got restricted __le64 [usertype] @@
   arch/powerpc/include/asm/kvm_ppc.h:964:1: sparse:     expected unsigned long long [usertype] srr1
   arch/powerpc/include/asm/kvm_ppc.h:964:1: sparse:     got restricted __le64 [usertype]

vim +419 arch/powerpc/kvm/book3s_hv_builtin.c

f725758b899f11 Paul Mackerras         2016-11-18  395  
f725758b899f11 Paul Mackerras         2016-11-18  396  static long kvmppc_read_one_intr(bool *again)
37f55d30df2eef Suresh Warrier         2016-08-19  397  {
d381d7caf812f7 Benjamin Herrenschmidt 2017-04-05  398  	void __iomem *xics_phys;
37f55d30df2eef Suresh Warrier         2016-08-19  399  	u32 h_xirr;
37f55d30df2eef Suresh Warrier         2016-08-19  400  	__be32 xirr;
37f55d30df2eef Suresh Warrier         2016-08-19  401  	u32 xisr;
37f55d30df2eef Suresh Warrier         2016-08-19  402  	u8 host_ipi;
f725758b899f11 Paul Mackerras         2016-11-18  403  	int64_t rc;
37f55d30df2eef Suresh Warrier         2016-08-19  404  
5af50993850a48 Benjamin Herrenschmidt 2017-04-05  405  	if (xive_enabled())
5af50993850a48 Benjamin Herrenschmidt 2017-04-05  406  		return 1;
5af50993850a48 Benjamin Herrenschmidt 2017-04-05  407  
37f55d30df2eef Suresh Warrier         2016-08-19  408  	/* see if a host IPI is pending */
37f55d30df2eef Suresh Warrier         2016-08-19  409  	host_ipi = local_paca->kvm_hstate.host_ipi;
37f55d30df2eef Suresh Warrier         2016-08-19  410  	if (host_ipi)
37f55d30df2eef Suresh Warrier         2016-08-19  411  		return 1;
37f55d30df2eef Suresh Warrier         2016-08-19  412  
37f55d30df2eef Suresh Warrier         2016-08-19  413  	/* Now read the interrupt from the ICP */
37f55d30df2eef Suresh Warrier         2016-08-19  414  	xics_phys = local_paca->kvm_hstate.xics_phys;
53af3ba2e8195f Paul Mackerras         2017-01-30  415  	rc = 0;
ab9bad0ead9ab1 Benjamin Herrenschmidt 2017-02-07  416  	if (!xics_phys)
53af3ba2e8195f Paul Mackerras         2017-01-30  417  		rc = opal_int_get_xirr(&xirr, false);
53af3ba2e8195f Paul Mackerras         2017-01-30  418  	else
d381d7caf812f7 Benjamin Herrenschmidt 2017-04-05 @419  		xirr = __raw_rm_readl(xics_phys + XICS_XIRR);
f725758b899f11 Paul Mackerras         2016-11-18  420  	if (rc < 0)
37f55d30df2eef Suresh Warrier         2016-08-19  421  		return 1;
37f55d30df2eef Suresh Warrier         2016-08-19  422  
37f55d30df2eef Suresh Warrier         2016-08-19  423  	/*
37f55d30df2eef Suresh Warrier         2016-08-19  424  	 * Save XIRR for later. Since we get control in reverse endian
37f55d30df2eef Suresh Warrier         2016-08-19  425  	 * on LE systems, save it byte reversed and fetch it back in
37f55d30df2eef Suresh Warrier         2016-08-19  426  	 * host endian. Note that xirr is the value read from the
37f55d30df2eef Suresh Warrier         2016-08-19  427  	 * XIRR register, while h_xirr is the host endian version.
37f55d30df2eef Suresh Warrier         2016-08-19  428  	 */
37f55d30df2eef Suresh Warrier         2016-08-19  429  	h_xirr = be32_to_cpu(xirr);
37f55d30df2eef Suresh Warrier         2016-08-19  430  	local_paca->kvm_hstate.saved_xirr = h_xirr;
37f55d30df2eef Suresh Warrier         2016-08-19  431  	xisr = h_xirr & 0xffffff;
37f55d30df2eef Suresh Warrier         2016-08-19  432  	/*
37f55d30df2eef Suresh Warrier         2016-08-19  433  	 * Ensure that the store/load complete to guarantee all side
37f55d30df2eef Suresh Warrier         2016-08-19  434  	 * effects of loading from XIRR has completed
37f55d30df2eef Suresh Warrier         2016-08-19  435  	 */
37f55d30df2eef Suresh Warrier         2016-08-19  436  	smp_mb();
37f55d30df2eef Suresh Warrier         2016-08-19  437  
37f55d30df2eef Suresh Warrier         2016-08-19  438  	/* if nothing pending in the ICP */
37f55d30df2eef Suresh Warrier         2016-08-19  439  	if (!xisr)
37f55d30df2eef Suresh Warrier         2016-08-19  440  		return 0;
37f55d30df2eef Suresh Warrier         2016-08-19  441  
37f55d30df2eef Suresh Warrier         2016-08-19  442  	/* We found something in the ICP...
37f55d30df2eef Suresh Warrier         2016-08-19  443  	 *
37f55d30df2eef Suresh Warrier         2016-08-19  444  	 * If it is an IPI, clear the MFRR and EOI it.
37f55d30df2eef Suresh Warrier         2016-08-19  445  	 */
37f55d30df2eef Suresh Warrier         2016-08-19  446  	if (xisr == XICS_IPI) {
53af3ba2e8195f Paul Mackerras         2017-01-30  447  		rc = 0;
53519e6ae0f84e Nicholas Piggin        2021-04-02  448  		if (xics_phys) {
d381d7caf812f7 Benjamin Herrenschmidt 2017-04-05  449  			__raw_rm_writeb(0xff, xics_phys + XICS_MFRR);
d381d7caf812f7 Benjamin Herrenschmidt 2017-04-05 @450  			__raw_rm_writel(xirr, xics_phys + XICS_XIRR);
f725758b899f11 Paul Mackerras         2016-11-18  451  		} else {
ab9bad0ead9ab1 Benjamin Herrenschmidt 2017-02-07  452  			opal_int_set_mfrr(hard_smp_processor_id(), 0xff);
ab9bad0ead9ab1 Benjamin Herrenschmidt 2017-02-07  453  			rc = opal_int_eoi(h_xirr);
53af3ba2e8195f Paul Mackerras         2017-01-30  454  		}
f725758b899f11 Paul Mackerras         2016-11-18  455  		/* If rc > 0, there is another interrupt pending */
f725758b899f11 Paul Mackerras         2016-11-18  456  		*again = rc > 0;
f725758b899f11 Paul Mackerras         2016-11-18  457  
37f55d30df2eef Suresh Warrier         2016-08-19  458  		/*
37f55d30df2eef Suresh Warrier         2016-08-19  459  		 * Need to ensure side effects of above stores
37f55d30df2eef Suresh Warrier         2016-08-19  460  		 * complete before proceeding.
37f55d30df2eef Suresh Warrier         2016-08-19  461  		 */
37f55d30df2eef Suresh Warrier         2016-08-19  462  		smp_mb();
37f55d30df2eef Suresh Warrier         2016-08-19  463  
37f55d30df2eef Suresh Warrier         2016-08-19  464  		/*
37f55d30df2eef Suresh Warrier         2016-08-19  465  		 * We need to re-check host IPI now in case it got set in the
37f55d30df2eef Suresh Warrier         2016-08-19  466  		 * meantime. If it's clear, we bounce the interrupt to the
37f55d30df2eef Suresh Warrier         2016-08-19  467  		 * guest
37f55d30df2eef Suresh Warrier         2016-08-19  468  		 */
37f55d30df2eef Suresh Warrier         2016-08-19  469  		host_ipi = local_paca->kvm_hstate.host_ipi;
37f55d30df2eef Suresh Warrier         2016-08-19  470  		if (unlikely(host_ipi != 0)) {
37f55d30df2eef Suresh Warrier         2016-08-19  471  			/* We raced with the host,
37f55d30df2eef Suresh Warrier         2016-08-19  472  			 * we need to resend that IPI, bummer
37f55d30df2eef Suresh Warrier         2016-08-19  473  			 */
53519e6ae0f84e Nicholas Piggin        2021-04-02  474  			if (xics_phys)
d381d7caf812f7 Benjamin Herrenschmidt 2017-04-05  475  				__raw_rm_writeb(IPI_PRIORITY,
d381d7caf812f7 Benjamin Herrenschmidt 2017-04-05  476  						xics_phys + XICS_MFRR);
f725758b899f11 Paul Mackerras         2016-11-18  477  			else
ab9bad0ead9ab1 Benjamin Herrenschmidt 2017-02-07  478  				opal_int_set_mfrr(hard_smp_processor_id(),
f725758b899f11 Paul Mackerras         2016-11-18  479  						  IPI_PRIORITY);
37f55d30df2eef Suresh Warrier         2016-08-19  480  			/* Let side effects complete */
37f55d30df2eef Suresh Warrier         2016-08-19  481  			smp_mb();
37f55d30df2eef Suresh Warrier         2016-08-19  482  			return 1;
37f55d30df2eef Suresh Warrier         2016-08-19  483  		}
37f55d30df2eef Suresh Warrier         2016-08-19  484  
37f55d30df2eef Suresh Warrier         2016-08-19  485  		/* OK, it's an IPI for us */
37f55d30df2eef Suresh Warrier         2016-08-19  486  		local_paca->kvm_hstate.saved_xirr = 0;
37f55d30df2eef Suresh Warrier         2016-08-19  487  		return -1;
37f55d30df2eef Suresh Warrier         2016-08-19  488  	}
37f55d30df2eef Suresh Warrier         2016-08-19  489  
f725758b899f11 Paul Mackerras         2016-11-18  490  	return kvmppc_check_passthru(xisr, xirr, again);
37f55d30df2eef Suresh Warrier         2016-08-19  491  }
5af50993850a48 Benjamin Herrenschmidt 2017-04-05  492  

---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org

[-- Attachment #2: .config.gz --]
[-- Type: application/gzip, Size: 42686 bytes --]

^ permalink raw reply

* Re: [PATCH v3 01/17] cmdline: Add generic function to build command line.
From: Christophe Leroy @ 2021-04-02 15:33 UTC (permalink / raw)
  To: Daniel Walker
  Cc: linux-arch, robh, microblaze, daniel, devicetree, linux-sh, will,
	linux-xtensa, x86, linux-kernel, nios2, linux-mips, openrisc,
	linux-hexagon, sparclinux, linux-riscv, linuxppc-dev,
	Andrew Morton, linux-arm-kernel
In-Reply-To: <20210330172714.GR109100@zorba>



Le 30/03/2021 à 19:27, Daniel Walker a écrit :
> On Fri, Mar 26, 2021 at 01:44:48PM +0000, Christophe Leroy wrote:
>> This code provides architectures with a way to build command line
>> based on what is built in the kernel and what is handed over by the
>> bootloader, based on selected compile-time options.
>>
>> Signed-off-by: Christophe Leroy <christophe.leroy@csgroup.eu>
>> ---
>> v3:
>> - Addressed comments from Will
>> - Added capability to have src == dst
>> ---
>>   include/linux/cmdline.h | 57 +++++++++++++++++++++++++++++++++++++++++
>>   1 file changed, 57 insertions(+)
>>   create mode 100644 include/linux/cmdline.h
>>
>> diff --git a/include/linux/cmdline.h b/include/linux/cmdline.h
>> new file mode 100644
>> index 000000000000..dea87edd41be
>> --- /dev/null
>> +++ b/include/linux/cmdline.h
>> @@ -0,0 +1,57 @@
>> +/* SPDX-License-Identifier: GPL-2.0 */
>> +#ifndef _LINUX_CMDLINE_H
>> +#define _LINUX_CMDLINE_H
>> +
>> +#include <linux/string.h>
>> +
>> +/* Allow architectures to override strlcat, powerpc can't use strings so early */
>> +#ifndef cmdline_strlcat
>> +#define cmdline_strlcat strlcat
>> +#endif
>> +
>> +/*
>> + * This function will append or prepend a builtin command line to the command
>> + * line provided by the bootloader. Kconfig options can be used to alter
>> + * the behavior of this builtin command line.
>> + * @dst: The destination of the final appended/prepended string.
>> + * @src: The starting string or NULL if there isn't one.
>> + * @len: the length of dest buffer.
>> + */
> 
> Append or prepend ? Cisco requires both at the same time. This is why my
> implementation provides both. I can't use this with both at once.
> 

I think it can be added as a second step if dimmed necessary. The feeling I have from all the 
discussion is that it's not what people from the community are looking for at the moment.

Anyway, once all architectures are moved to generic handling, I believe it is then easier to split 
CONFIG_CMDLINE in two configuration items in order to provide both appending and prepending at the 
same time.

I see some concerns about risk of double changes, but I have focussed in changing as little as 
possible the existing configuration items, in order to minimise that.

^ permalink raw reply

* Re: [PATCH v3 09/17] nios2: Convert to GENERIC_CMDLINE
From: Christophe Leroy @ 2021-04-02 15:33 UTC (permalink / raw)
  To: Tan, Ley Foon, will@kernel.org, danielwa@cisco.com,
	robh@kernel.org, daniel@gimpelevich.san-francisco.ca.us
  Cc: linux-arch@vger.kernel.org, devicetree@vger.kernel.org,
	microblaze, linux-xtensa@linux-xtensa.org,
	linux-sh@vger.kernel.org, linux-hexagon@vger.kernel.org,
	x86@kernel.org, linux-kernel@vger.kernel.org,
	linux-mips@vger.kernel.org, openrisc@lists.librecores.org,
	sparclinux@vger.kernel.org, linux-riscv@lists.infradead.org,
	linuxppc-dev@lists.ozlabs.org,
	linux-arm-kernel@lists.infradead.org
In-Reply-To: <BY5PR11MB38934E74AF74D40379E46AB9CC7E9@BY5PR11MB3893.namprd11.prod.outlook.com>



Le 29/03/2021 à 03:35, Tan, Ley Foon a écrit :
> 
> 
>> -----Original Message-----
>> From: Christophe Leroy <christophe.leroy@csgroup.eu>
>> Sent: Friday, March 26, 2021 9:45 PM
>> To: will@kernel.org; danielwa@cisco.com; robh@kernel.org;
>> daniel@gimpelevich.san-francisco.ca.us
>> Cc: linux-arch@vger.kernel.org; devicetree@vger.kernel.org; linuxppc-
>> dev@lists.ozlabs.org; linux-kernel@vger.kernel.org; linuxppc-
>> dev@lists.ozlabs.org; linux-arm-kernel@lists.infradead.org; microblaze
>> <monstr@monstr.eu>; linux-mips@vger.kernel.org; Tan, Ley Foon
>> <ley.foon.tan@intel.com>; openrisc@lists.librecores.org; linux-
>> hexagon@vger.kernel.org; linux-riscv@lists.infradead.org; x86@kernel.org;
>> linux-xtensa@linux-xtensa.org; linux-sh@vger.kernel.org;
>> sparclinux@vger.kernel.org
>> Subject: [PATCH v3 09/17] nios2: Convert to GENERIC_CMDLINE
>>
>> This converts the architecture to GENERIC_CMDLINE.
>>
>> Signed-off-by: Christophe Leroy <christophe.leroy@csgroup.eu>
>> ---
>>   arch/nios2/Kconfig        | 24 +-----------------------
>>   arch/nios2/kernel/setup.c | 13 ++++---------
>>   2 files changed, 5 insertions(+), 32 deletions(-)
>>
>> diff --git a/arch/nios2/Kconfig b/arch/nios2/Kconfig index
>> c24955c81c92..f66c97b15813 100644
>> --- a/arch/nios2/Kconfig
>> +++ b/arch/nios2/Kconfig
>> @@ -90,31 +90,9 @@ config NIOS2_ALIGNMENT_TRAP
>>
>>   comment "Boot options"
>>
>> -config CMDLINE_BOOL
>> -	bool "Default bootloader kernel arguments"
>> -	default y
>> -
>> -config CMDLINE
>> -	string "Default kernel command string"
>> -	default ""
>> -	depends on CMDLINE_BOOL
>> -	help
>> -	  On some platforms, there is currently no way for the boot loader to
>> -	  pass arguments to the kernel. For these platforms, you can supply
>> -	  some command-line options at build time by entering them here.  In
>> -	  other cases you can specify kernel args so that you don't have
>> -	  to set them up in board prom initialization routines.
>> -
>> -config CMDLINE_FORCE
>> -	bool "Force default kernel command string"
>> -	depends on CMDLINE_BOOL
>> -	help
>> -	  Set this to have arguments from the default kernel command string
>> -	  override those passed by the boot loader.
>> -
>>   config NIOS2_CMDLINE_IGNORE_DTB
>>   	bool "Ignore kernel command string from DTB"
>> -	depends on CMDLINE_BOOL
>> +	depends on CMDLINE != ""
>>   	depends on !CMDLINE_FORCE
>>   	default y
>>   	help
> 
> Missing " select GENERIC_CMDLINE" ?

Added in v4

Thanks
Christophe

^ permalink raw reply

* Re: [PATCH v3 12/17] sh: Convert to GENERIC_CMDLINE
From: Christophe Leroy @ 2021-04-02 15:36 UTC (permalink / raw)
  To: will, danielwa, robh, daniel
  Cc: linux-arch, devicetree, microblaze, linux-sh, linux-hexagon,
	linux-xtensa, x86, linux-kernel, nios2, linux-mips, openrisc,
	sparclinux, linux-riscv, linuxppc-dev, linux-arm-kernel
In-Reply-To: <6b76649009943f2893fdfded22becd41db2fe1f7.1616765870.git.christophe.leroy@csgroup.eu>



Le 26/03/2021 à 14:44, Christophe Leroy a écrit :
> This converts the architecture to GENERIC_CMDLINE.
> 
> Signed-off-by: Christophe Leroy <christophe.leroy@csgroup.eu>
> ---

> diff --git a/arch/sh/Kconfig b/arch/sh/Kconfig
> index e798e55915c2..fab84f62448c 100644
> --- a/arch/sh/Kconfig
> +++ b/arch/sh/Kconfig
> @@ -16,6 +16,7 @@ config SUPERH
>   	select CPU_NO_EFFICIENT_FFS
>   	select DMA_DECLARE_COHERENT
>   	select GENERIC_ATOMIC64
> +	select GENERIC_CMDLINE
>   	select GENERIC_CMOS_UPDATE if SH_SH03 || SH_DREAMCAST
>   	select GENERIC_IDLE_POLL_SETUP
>   	select GENERIC_IRQ_SHOW
> @@ -742,35 +743,6 @@ config ROMIMAGE_MMCIF
>   	  first part of the romImage which in turn loads the rest the kernel
>   	  image to RAM using the MMCIF hardware block.
>   
> -choice
> -	prompt "Kernel command line"
> -	optional
> -	default CMDLINE_OVERWRITE
> -	help
> -	  Setting this option allows the kernel command line arguments
> -	  to be set.
> -
> -config CMDLINE_OVERWRITE
> -	bool "Overwrite bootloader kernel arguments"
> -	help
> -	  Given string will overwrite any arguments passed in by
> -	  a bootloader.
> -
> -config CMDLINE_EXTEND
> -	bool "Extend bootloader kernel arguments"
> -	help
> -	  Given string will be concatenated with arguments passed in
> -	  by a bootloader.
> -
> -endchoice
> -
> -config CMDLINE
> -	string "Kernel command line arguments string"
> -	depends on CMDLINE_OVERWRITE || CMDLINE_EXTEND
> -	default "console=ttySC1,115200"
> -
> -endmenu
> -

That "endmenu" shall not be removed.

Fixed in v4,

Thanks to Rob L. for the report.
Christophe

>   menu "Bus options"
>   
>   config SUPERHYWAY

^ permalink raw reply

* Re: [PATCH v5 41/48] KVM: PPC: Book3S HV: Remove unused nested HV tests in XICS emulation
From: Cédric Le Goater @ 2021-04-02 16:32 UTC (permalink / raw)
  To: Nicholas Piggin, kvm-ppc; +Cc: linuxppc-dev
In-Reply-To: <20210401150325.442125-42-npiggin@gmail.com>

On 4/1/21 5:03 PM, Nicholas Piggin wrote:
> Commit f3c18e9342a44 ("KVM: PPC: Book3S HV: Use XICS hypercalls when
> running as a nested hypervisor") added nested HV tests in XICS
> hypercalls, but not all are required.
> 
> * icp_eoi is only called by kvmppc_deliver_irq_passthru which is only
>   called by kvmppc_check_passthru which is only caled by
>   kvmppc_read_one_intr.
> 
> * kvmppc_read_one_intr is only called by kvmppc_read_intr which is only
>   called by the L0 HV rmhandlers code.
> 
> * kvmhv_rm_send_ipi is called by:
>   - kvmhv_interrupt_vcore which is only called by kvmhv_commence_exit
>     which is only called by the L0 HV rmhandlers code.
>   - icp_send_hcore_msg which is only called by icp_rm_set_vcpu_irq.
>   - icp_rm_set_vcpu_irq which is only called by icp_rm_try_update
>   - icp_rm_set_vcpu_irq is not nested HV safe because it writes to
>     LPCR directly without a kvmhv_on_pseries test. Nested handlers
>     should not in general be using the rm handlers.
> 
> The important test seems to be in kvmppc_ipi_thread, which sends the
> virt-mode H_IPI handler kick to use smp_call_function rather than
> msgsnd.
> 
> Cc: Cédric Le Goater <clg@kaod.org>
> Signed-off-by: Nicholas Piggin <npiggin@gmail.com>
> ---
>  arch/powerpc/kvm/book3s_hv_builtin.c | 44 +++++-----------------------
>  arch/powerpc/kvm/book3s_hv_rm_xics.c | 15 ----------
>  2 files changed, 8 insertions(+), 51 deletions(-)

So, now, the L1 is not limited to XICS anymore and we can use the XIVE 
native interrupt mode with an L2 using XICS in KVM or XIVE in QEMU.
Is that correct ?   

It seems you removed all the XICS hcalls under kvmhv_on_pseries().

C.

 
> diff --git a/arch/powerpc/kvm/book3s_hv_builtin.c b/arch/powerpc/kvm/book3s_hv_builtin.c
> index 8d669a0e15f8..259492bb4153 100644
> --- a/arch/powerpc/kvm/book3s_hv_builtin.c
> +++ b/arch/powerpc/kvm/book3s_hv_builtin.c
> @@ -199,15 +199,6 @@ void kvmhv_rm_send_ipi(int cpu)
>  	void __iomem *xics_phys;
>  	unsigned long msg = PPC_DBELL_TYPE(PPC_DBELL_SERVER);
>  
> -	/* For a nested hypervisor, use the XICS via hcall */
> -	if (kvmhv_on_pseries()) {
> -		unsigned long retbuf[PLPAR_HCALL_BUFSIZE];
> -
> -		plpar_hcall_raw(H_IPI, retbuf, get_hard_smp_processor_id(cpu),
> -				IPI_PRIORITY);
> -		return;
> -	}
> -
>  	/* On POWER9 we can use msgsnd for any destination cpu. */
>  	if (cpu_has_feature(CPU_FTR_ARCH_300)) {
>  		msg |= get_hard_smp_processor_id(cpu);
> @@ -420,19 +411,12 @@ static long kvmppc_read_one_intr(bool *again)
>  		return 1;
>  
>  	/* Now read the interrupt from the ICP */
> -	if (kvmhv_on_pseries()) {
> -		unsigned long retbuf[PLPAR_HCALL_BUFSIZE];
> -
> -		rc = plpar_hcall_raw(H_XIRR, retbuf, 0xFF);
> -		xirr = cpu_to_be32(retbuf[0]);
> -	} else {
> -		xics_phys = local_paca->kvm_hstate.xics_phys;
> -		rc = 0;
> -		if (!xics_phys)
> -			rc = opal_int_get_xirr(&xirr, false);
> -		else
> -			xirr = __raw_rm_readl(xics_phys + XICS_XIRR);
> -	}
> +	xics_phys = local_paca->kvm_hstate.xics_phys;
> +	rc = 0;
> +	if (!xics_phys)
> +		rc = opal_int_get_xirr(&xirr, false);
> +	else
> +		xirr = __raw_rm_readl(xics_phys + XICS_XIRR);
>  	if (rc < 0)
>  		return 1;
>  
> @@ -461,13 +445,7 @@ static long kvmppc_read_one_intr(bool *again)
>  	 */
>  	if (xisr == XICS_IPI) {
>  		rc = 0;
> -		if (kvmhv_on_pseries()) {
> -			unsigned long retbuf[PLPAR_HCALL_BUFSIZE];
> -
> -			plpar_hcall_raw(H_IPI, retbuf,
> -					hard_smp_processor_id(), 0xff);
> -			plpar_hcall_raw(H_EOI, retbuf, h_xirr);
> -		} else if (xics_phys) {
> +		if (xics_phys) {
>  			__raw_rm_writeb(0xff, xics_phys + XICS_MFRR);
>  			__raw_rm_writel(xirr, xics_phys + XICS_XIRR);
>  		} else {
> @@ -493,13 +471,7 @@ static long kvmppc_read_one_intr(bool *again)
>  			/* We raced with the host,
>  			 * we need to resend that IPI, bummer
>  			 */
> -			if (kvmhv_on_pseries()) {
> -				unsigned long retbuf[PLPAR_HCALL_BUFSIZE];
> -
> -				plpar_hcall_raw(H_IPI, retbuf,
> -						hard_smp_processor_id(),
> -						IPI_PRIORITY);
> -			} else if (xics_phys)
> +			if (xics_phys)
>  				__raw_rm_writeb(IPI_PRIORITY,
>  						xics_phys + XICS_MFRR);
>  			else
> diff --git a/arch/powerpc/kvm/book3s_hv_rm_xics.c b/arch/powerpc/kvm/book3s_hv_rm_xics.c
> index c2c9c733f359..0a11ec88a0ae 100644
> --- a/arch/powerpc/kvm/book3s_hv_rm_xics.c
> +++ b/arch/powerpc/kvm/book3s_hv_rm_xics.c
> @@ -141,13 +141,6 @@ static void icp_rm_set_vcpu_irq(struct kvm_vcpu *vcpu,
>  		return;
>  	}
>  
> -	if (xive_enabled() && kvmhv_on_pseries()) {
> -		/* No XICS access or hypercalls available, too hard */
> -		this_icp->rm_action |= XICS_RM_KICK_VCPU;
> -		this_icp->rm_kick_target = vcpu;
> -		return;
> -	}
> -
>  	/*
>  	 * Check if the core is loaded,
>  	 * if not, find an available host core to post to wake the VCPU,
> @@ -771,14 +764,6 @@ static void icp_eoi(struct irq_chip *c, u32 hwirq, __be32 xirr, bool *again)
>  	void __iomem *xics_phys;
>  	int64_t rc;
>  
> -	if (kvmhv_on_pseries()) {
> -		unsigned long retbuf[PLPAR_HCALL_BUFSIZE];
> -
> -		iosync();
> -		plpar_hcall_raw(H_EOI, retbuf, hwirq);
> -		return;
> -	}
> -
>  	rc = pnv_opal_pci_msi_eoi(c, hwirq);
>  
>  	if (rc)
> 


^ permalink raw reply

* Re: [PATCH v2] pseries: prevent free CPU ids to be reused on another node
From: Nathan Lynch @ 2021-04-02 16:44 UTC (permalink / raw)
  To: Laurent Dufour
  Cc: Srikar Dronamraju, cheloha, linux-kernel, paulus, linuxppc-dev
In-Reply-To: <d06106d3-76e6-f5da-e3b4-db13c6bfee96@linux.ibm.com>

Laurent Dufour <ldufour@linux.ibm.com> writes:
> Le 02/04/2021 à 15:34, Nathan Lynch a écrit :
>> Laurent Dufour <ldufour@linux.ibm.com> writes:
>>> When a CPU is hot added, the CPU ids are taken from the available mask from
>>> the lower possible set. If that set of values was previously used for CPU
>>> attached to a different node, this seems to application like if these CPUs
>>> have migrated from a node to another one which is not expected in real
>>> life.
>> 
>> This seems like a problem that could affect other architectures or
>> platforms? I guess as long as arch code is responsible for placing new
>> CPUs in cpu_present_mask, that code will have the responsibility of
>> ensuring CPU IDs' NUMA assignments remain stable.
>
> Actually, x86 is already handling this issue in the arch code specific
> code, see 8f54969dc8d6 ("x86/acpi: Introduce persistent storage for
> cpuid <-> apicid mapping"). I didn't check for other architectures but
> as CPU id allocation is in the arch part, I believe this is up to each
> arch to deal with this issue.
>
> Making the CPU id allocation common to all arch is outside the scope
> of this patch.

Well... we'd better avoid a situation where architectures impose
different policies in this area. (I guess we're already in this
situation, which is the problem.) A more maintainable way to achieve
that would be to put the higher-level policy in arch-independent code,
as much as possible.

I don't insist, though.


>> I don't know, should we not fail the request instead of doing the
>> ABI-breaking thing the code in this change is trying to prevent? I
>> don't think a warning in the kernel log is going to help any
>> application that would be affected by this.
>
> That's a really good question. One should argue that the most
> important is to satisfy the CPU add operation, assuming that only few
> are interested in the CPU numbering, while others would prefer the CPU
> adding to fail (which may prevent adding CPUs on another nodes if the
> whole operation is aborted as soon as a CPU add is failing).
>
> I was conservative here, but if failing the operation is the best
> option, then this will make that code simpler, removing the backward
> jump.
>
> Who is deciding?

I favor failing the request. Apart from the implications for user space,
it's not clear to me that allowing the cpu-node relationship to change
once initialized is benign in terms of internal kernel assumptions
(e.g. sched domains, workqueues?). And as you say, it would make for
more straightforward code.

^ permalink raw reply

* Re: [PATCH 1/8] CMDLINE: add generic builtin command line
From: Christophe Leroy @ 2021-04-02 17:28 UTC (permalink / raw)
  To: Daniel Walker, Will Deacon, ob Herring, Daniel Gimpelevich,
	Andrew Morton, x86, linux-mips, linuxppc-dev
  Cc: Ruslan Bilovol, linux-kernel, xe-linux-external
In-Reply-To: <41021d66db2ab427c14255d2a24bb4517c8b58fd.1617126961.git.danielwa@cisco.com>



Le 30/03/2021 à 19:56, Daniel Walker a écrit :
> This code allows architectures to use a generic builtin command line.
> The state of the builtin command line options across architecture is
> diverse. MIPS and X86 once has similar systems, then mips added some
> options to allow extending the command line. Powerpc did something
> simiar in adding the ability to extend. Even with mips and powerpc
> enhancement the needs of Cisco are not met on these platforms.

Can you explain in the commit what is the need ? Nobody mind "who" needs it I think, but "what" is 
needed would be valuable to know.

> 
> The code in this commit unifies the code into a generic
> header file under the CONFIG_GENERIC_CMDLINE option. When this
> option is enabled the architecture can call the cmdline_add_builtin()
> to add the builtin command line.
> 
> This unified implementation offers the same functionality needed by
> Cisco on all platform which use it.

Cisco cisco cisco ... Can we avoid mentionning companies like this ? I can't see patches mentioning 
google or IBM or other companies to that extend.

> 
> Cc: xe-linux-external@cisco.com
> Signed-off-by: Ruslan Bilovol <rbilovol@cisco.com>
> Signed-off-by: Daniel Walker <danielwa@cisco.com>
> ---
>   include/linux/cmdline.h | 98 +++++++++++++++++++++++++++++++++++++++++
>   init/Kconfig            | 72 ++++++++++++++++++++++++++++++
>   2 files changed, 170 insertions(+)
>   create mode 100644 include/linux/cmdline.h
> 
> diff --git a/include/linux/cmdline.h b/include/linux/cmdline.h
> new file mode 100644
> index 000000000000..439c4585feba
> --- /dev/null
> +++ b/include/linux/cmdline.h
> @@ -0,0 +1,98 @@
> +/* SPDX-License-Identifier: GPL-2.0 */
> +#ifndef _LINUX_CMDLINE_H
> +#define _LINUX_CMDLINE_H
> +
> +/*
> + *
> + * Copyright (C) 2006,2021. Cisco Systems, Inc.
> + *
> + * Generic Append/Prepend cmdline support.
> + */
> +
> +#if defined(CONFIG_GENERIC_CMDLINE) && defined(CONFIG_CMDLINE_BOOL)
> +
> +#ifndef CONFIG_CMDLINE_OVERRIDE
> +#define GENERIC_CMDLINE_NEED_STRLCAT

Does it matter ?

Only powerpc needs that really. And prom_strlcat() is there anyway, so why not just use it when 
needed and rely on GCC to optimise it out when possible ?


> +#define CMDLINE_PREPEND CONFIG_CMDLINE_PREPEND
> +#define CMDLINE_APPEND CONFIG_CMDLINE_APPEND

What are those defines used for ?

> +
> +/*
> + * This function will append or prepend a builtin command line to the command
> + * line provided by the bootloader. Kconfig options can be used to alter
> + * the behavior of this builtin command line.
> + * @dest: The destination of the final appended/prepended string
> + * @src: The starting string or NULL if there isn't one.
> + * @tmp: temporary space used for prepending
> + * @length: the maximum length of the strings above.
> + * @cmdline_strlcpy: point to a compatible strlcpy
> + * @cmdline_strlcat: point to a compatible strlcat
> + */
> +static inline void
> +__cmdline_add_builtin(char *dest, const char *src, char *tmp, unsigned long length,
> +		size_t (*cmdline_strlcpy)(char *dest, const char *src, size_t size),
> +		size_t (*cmdline_strlcat)(char *dest, const char *src, size_t count))

I still can see the advantage of passing strlcpy and strlcat as functions to the function.

Can we instead use macros defined by default that can be overriden by powerpc ?

Something like

#ifndef cmdline_strlcat
#define cmdline_strlcat strlcat
#define cmdline_strlcpy strlcpy
#endif

> +{
> +	if (src != dest && src != NULL) {
> +		cmdline_strlcpy(dest, " ", length);
> +		cmdline_strlcat(dest, src, length);
> +	}
> +
> +	if (sizeof(CONFIG_CMDLINE_APPEND) > 1)
> +		cmdline_strlcat(dest, " " CONFIG_CMDLINE_APPEND, length);
> +
> +	if (sizeof(CONFIG_CMDLINE_PREPEND) > 1) {
> +		cmdline_strlcpy(tmp, CONFIG_CMDLINE_PREPEND " ", length);
> +		cmdline_strlcat(tmp, dest, length);
> +		cmdline_strlcpy(dest, tmp, length);
> +	}
> +}
> +
> +#define cmdline_add_builtin_custom(dest, src, length, label, cmdline_strlcpy, cmdline_strlcat)			\
> +{														\
> +	if (sizeof(CONFIG_CMDLINE_PREPEND) > 1) {								\
> +		static label char cmdline_tmp_space[length];							\
> +		__cmdline_add_builtin(dest, src, cmdline_tmp_space, length, cmdline_strlcpy, cmdline_strlcat);	\
> +	} else if (sizeof(CONFIG_CMDLINE_APPEND) > 1) {								\
> +		__cmdline_add_builtin(dest, src, NULL, length, cmdline_strlcpy, cmdline_strlcat);		\
> +	}													\
> +}

I still don't like passing section names to a macro that way, just for powerpc.
That tmp space is only needed when source and destination are identical, and it is easy to ensure 
powerpc doesn't need that. For others, just use __initdata section.

Also the variable length is not really necessary, only COMMAND_LINE_SIZE is used everywhere.

> +#define cmdline_add_builtin(dest, src, length)	\
> +	cmdline_add_builtin_custom(dest, src, length, __initdata, strlcpy, strlcat)
> +
> +#else /* CONFIG_CMDLINE_OVERRIDE */
> +
> +#define CMDLINE_PREPEND CONFIG_CMDLINE_PREPEND
> +#define CMDLINE_APPEND CONFIG_CMDLINE_APPEND
> +
> +static inline void
> +__cmdline_add_builtin_custom(char *dest, const char *src, unsigned long length,
> +		size_t (*cmdline_strlcpy)(char *dest, const char *src, size_t size))
> +{
> +	cmdline_strlcpy(dest, CONFIG_CMDLINE_PREPEND " " CONFIG_CMDLINE_APPEND, length);
> +}
> +#define cmdline_add_builtin_custom(dest, src, length, label, cmdline_strlcpy, cmdline_strlcat)	\
> +	__cmdline_add_builtin_custom(dest, src, length, cmdline_strlcpy)
> +#define cmdline_add_builtin(dest, src, length)	\
> +	__cmdline_add_builtin_custom(dest, src, length, strlcpy)
> +#endif /* !CONFIG_CMDLINE_OVERRIDE */
> +
> +#else /* !CONFIG_GENERIC_CMDLINE || !CONFIG_CMDLINE_BOOL */
> +
> +#define CMDLINE_PREPEND ""
> +#define CMDLINE_APPEND ""
> +
> +static inline void
> +__cmdline_add_builtin_custom(char *dest, const char *src, unsigned long length,
> +		size_t (*cmdline_strlcpy)(char *dest, const char *src, size_t size))
> +{
> +	if (src != NULL)
> +		cmdline_strlcpy(dest, src, length);
> +}
> +#define cmdline_add_builtin_custom(dest, src, length, label, cmdline_strlcpy, cmdline_strlcat)	\
> +	__cmdline_add_builtin_custom(dest, src, length, cmdline_strlcpy)
> +#define cmdline_add_builtin(dest, src, length)	\
> +	__cmdline_add_builtin_custom(dest, src, length, strlcpy)	\
> +
> +#endif /* CONFIG_GENERIC_CMDLINE */

There are too many alternatives, they could be easily refactored to a single instance reducing the 
number of #ifdefs.

> +
> +#endif /* _LINUX_CMDLINE_H */
> diff --git a/init/Kconfig b/init/Kconfig
> index 5f5c776ef192..84f06f62550a 100644
> --- a/init/Kconfig
> +++ b/init/Kconfig
> @@ -2034,6 +2034,78 @@ config PROFILING
>   config TRACEPOINTS
>   	bool
>   
> +config GENERIC_CMDLINE
> +	bool
> +
> +config GENERIC_CMDLINE_OF
> +	bool

Oh ? A new one ? What do we need something special for OF ?

> +
> +
> +if GENERIC_CMDLINE
> +
> +config CMDLINE_BOOL
> +	bool "Built-in kernel command line"
> +	help
> +	  Allow for specifying boot arguments to the kernel at
> +	  build time.  On some systems (e.g. embedded ones), it is
> +	  necessary or convenient to provide some or all of the
> +	  kernel boot arguments with the kernel itself (that is,
> +	  to not rely on the boot loader to provide them.)
> +
> +	  To compile command line arguments into the kernel,
> +	  set this option to 'Y', then fill in the
> +	  the boot arguments in CONFIG_CMDLINE.
> +
> +	  Systems with fully functional boot loaders (i.e. non-embedded)
> +	  should leave this option set to 'N'.
> +
> +config CMDLINE_APPEND
> +	string "Built-in kernel command string append"
> +	depends on CMDLINE_BOOL
> +	default ""

By doing the following instead of using depends

	string "Built-in kernel command string append" if CMDLINE_BOOL
	default ""

you could have CMDLINE_APPEND defined all the time and avoid related #ifdefs.

> +	help
> +	  Enter arguments here that should be compiled into the kernel
> +	  image and used at boot time.  If the boot loader provides a
> +	  command line at boot time, this string is appended to it to
> +	  form the full kernel command line, when the system boots.
> +
> +	  However, you can use the CONFIG_CMDLINE_OVERRIDE option to
> +	  change this behavior.
> +
> +	  In most cases, the command line (whether built-in or provided
> +	  by the boot loader) should specify the device for the root
> +	  file system.
> +
> +config CMDLINE_PREPEND
> +	string "Built-in kernel command string prepend"
> +	depends on CMDLINE_BOOL
> +	default ""

Same


> +	help
> +	  Enter arguments here that should be compiled into the kernel
> +	  image and used at boot time.  If the boot loader provides a
> +	  command line at boot time, this string is prepended to it to
> +	  form the full kernel command line, when the system boots.
> +
> +	  However, you can use the CONFIG_CMDLINE_OVERRIDE option to
> +	  change this behavior.
> +
> +	  In most cases, the command line (whether built-in or provided
> +	  by the boot loader) should specify the device for the root
> +	  file system.
> +
> +config CMDLINE_OVERRIDE

Most platforms use CMDLINE_FORCE. Why change the majority to minority ?

> +	bool "Built-in command line overrides boot loader arguments"
> +	depends on CMDLINE_BOOL
> +	help
> +	  Set this option to 'Y' to have the kernel ignore the boot loader
> +	  command line, and use ONLY the built-in command line. In this case
> +	  append and prepend strings are concatenated to form the full
> +	  command line.
> +
> +	  This is used to work around broken boot loaders.  This should
> +	  be set to 'N' under normal conditions.
> +endif
> +

Looks like we are still missing the one used at least by powerpc today: CMDLINE_DEFAULT_BOOTLOADER, 
which uses bootloader arguments if provided, builtin arguments otherwise.

>   endmenu		# General setup
>   
>   source "arch/Kconfig"
> 

^ permalink raw reply

* Re: [PATCH 2/8] CMDLINE: drivers: of: ifdef out cmdline section
From: Christophe Leroy @ 2021-04-02 17:32 UTC (permalink / raw)
  To: Daniel Walker, Will Deacon, ob Herring, Daniel Gimpelevich,
	Andrew Morton, x86, linux-mips, linuxppc-dev, Rob Herring,
	Frank Rowand
  Cc: devicetree, Ruslan Ruslichenko, linux-kernel, xe-linux-external
In-Reply-To: <0c4b839f023f87c451c8aa3c4f7a8d92729c2f02.1617126961.git.danielwa@cisco.com>



Le 30/03/2021 à 19:56, Daniel Walker a écrit :
> It looks like there's some seepage of cmdline stuff into
> the generic device tree code. This conflicts with the
> generic cmdline implementation so I remove it in the case
> when that's enabled.
> 
> Cc: xe-linux-external@cisco.com
> Signed-off-by: Ruslan Ruslichenko <rruslich@cisco.com>
> Signed-off-by: Daniel Walker <danielwa@cisco.com>
> ---
>   drivers/of/fdt.c | 14 ++++++++++++++
>   1 file changed, 14 insertions(+)
> 
> diff --git a/drivers/of/fdt.c b/drivers/of/fdt.c
> index dcc1dd96911a..d8805cd9717a 100644
> --- a/drivers/of/fdt.c
> +++ b/drivers/of/fdt.c
> @@ -25,6 +25,7 @@
>   #include <linux/serial_core.h>
>   #include <linux/sysfs.h>
>   #include <linux/random.h>
> +#include <linux/cmdline.h>
>   
>   #include <asm/setup.h>  /* for COMMAND_LINE_SIZE */
>   #include <asm/page.h>
> @@ -1050,6 +1051,18 @@ int __init early_init_dt_scan_chosen(unsigned long node, const char *uname,
>   
>   	/* Retrieve command line */
>   	p = of_get_flat_dt_prop(node, "bootargs", &l);
> +
> +#if defined(CONFIG_GENERIC_CMDLINE) && defined(CONFIG_GENERIC_CMDLINE_OF)
> +	/*
> +	 * The builtin command line will be added here, or it can override
> +	 * with the DT bootargs.
> +	 */
> +	cmdline_add_builtin(data,
> +			    (l > 0 ? p : NULL), /* This is sanity checking */
> +			    COMMAND_LINE_SIZE);
> +#elif defined(CONFIG_GENERIC_CMDLINE)
> +	strlcpy(data, p, COMMAND_LINE_SIZE);
> +#else

Ugly.

Linux codying style recommend to limit the use of #ifdefs to headers as much as possible.

Why do we need so many alternatives ? Allthough they are temporary, can we order the changes in 
another way to reduce that ?

>   	if (p != NULL && l > 0)
>   		strlcpy(data, p, min(l, COMMAND_LINE_SIZE));
>   
> @@ -1070,6 +1083,7 @@ int __init early_init_dt_scan_chosen(unsigned long node, const char *uname,
>   		strlcpy(data, CONFIG_CMDLINE, COMMAND_LINE_SIZE);
>   #endif
>   #endif /* CONFIG_CMDLINE */
> +#endif /* CONFIG_GENERIC_CMDLINE */
>   
>   	pr_debug("Command line is: %s\n", (char *)data);
>   
> 

^ permalink raw reply

* Re: [PATCH 3/8] powerpc: convert strcpy to strlcpy in prom_init
From: Christophe Leroy @ 2021-04-02 17:32 UTC (permalink / raw)
  To: Daniel Walker, Will Deacon, ob Herring, Daniel Gimpelevich,
	Andrew Morton, x86, linux-mips, linuxppc-dev
  Cc: linux-kernel, Paul Mackerras, xe-linux-external
In-Reply-To: <0c80a08ad4cf788c75043c1615c05bad893f4fde.1617126961.git.danielwa@cisco.com>



Le 30/03/2021 à 19:56, Daniel Walker a écrit :
> There's only two users of strcpy and one is the command
> line handling. The generic command line handling uses strlcpy
> and it makes sense to convert this one other user to strlcpy to
> keep prom_init size consistent.
> 
> Cc: xe-linux-external@cisco.com
> Signed-off-by: Daniel Walker <danielwa@cisco.com>

Reviewed-by: Christophe Leroy <christophe.leroy@csgroup.eu>

> ---
>   arch/powerpc/kernel/prom_init.c | 25 +++++++++++++++----------
>   1 file changed, 15 insertions(+), 10 deletions(-)
> 
> diff --git a/arch/powerpc/kernel/prom_init.c b/arch/powerpc/kernel/prom_init.c
> index ccf77b985c8f..2c2f33155317 100644
> --- a/arch/powerpc/kernel/prom_init.c
> +++ b/arch/powerpc/kernel/prom_init.c
> @@ -242,15 +242,6 @@ static int __init prom_strcmp(const char *cs, const char *ct)
>   	return 0;
>   }
>   
> -static char __init *prom_strcpy(char *dest, const char *src)
> -{
> -	char *tmp = dest;
> -
> -	while ((*dest++ = *src++) != '\0')
> -		/* nothing */;
> -	return tmp;
> -}
> -
>   static int __init prom_strncmp(const char *cs, const char *ct, size_t count)
>   {
>   	unsigned char c1, c2;
> @@ -276,6 +267,20 @@ static size_t __init prom_strlen(const char *s)
>   	return sc - s;
>   }
>   
> +static size_t __init prom_strlcpy(char *dest, const char *src, size_t size)
> +{
> +	size_t ret = prom_strlen(src);
> +
> +	if (size) {
> +		size_t len = (ret >= size) ? size - 1 : ret;
> +
> +		memcpy(dest, src, len);
> +		dest[len] = '\0';
> +	}
> +	return ret;
> +}
> +
> +
>   static int __init prom_memcmp(const void *cs, const void *ct, size_t count)
>   {
>   	const unsigned char *su1, *su2;
> @@ -2702,7 +2707,7 @@ static void __init flatten_device_tree(void)
>   
>   	/* Add "phandle" in there, we'll need it */
>   	namep = make_room(&mem_start, &mem_end, 16, 1);
> -	prom_strcpy(namep, "phandle");
> +	prom_strlcpy(namep, "phandle", 8);
>   	mem_start = (unsigned long)namep + prom_strlen(namep) + 1;
>   
>   	/* Build string array */
> 

^ permalink raw reply

* Re: [PATCH 4/8] CMDLINE: powerpc: convert to generic builtin command line
From: Christophe Leroy @ 2021-04-02 17:34 UTC (permalink / raw)
  To: Daniel Walker, Will Deacon, ob Herring, Daniel Gimpelevich,
	Andrew Morton, x86, linux-mips, linuxppc-dev, Michael Ellerman,
	Benjamin Herrenschmidt, Paul Mackerras
  Cc: Ruslan Ruslichenko, Ruslan Bilovol, linux-kernel,
	xe-linux-external
In-Reply-To: <e51a16e369f6a7dfae948c6de76061f3a061a375.1617126961.git.danielwa@cisco.com>



Le 30/03/2021 à 19:56, Daniel Walker a écrit :
> This updates the powerpc code to use the CONFIG_GENERIC_CMDLINE
> option.
> 
> This includes a scripted mass convert of the config files to use
> the new generic cmdline. There is a bit of a trim effect here.
> It would seems that some of the config haven't been trimmed in
> a while.

Sorry, this patch is not acceptable as is, the default for powerpc is CMDLINE_FROM_BOOTLOADER, ie 
builtin-cmdline is taken if and only if none is provided by the bootloader.

As far as I understand, that disappear with this patch.

> 
> The bash script used to convert is as follows,
> 
> if [[ -z "$1" || -z "$2" ]]; then
>          echo "Two arguments are needed."
>          exit 1
> fi
> mkdir $1
> cp $2 $1/.config
> sed -i 's/CONFIG_CMDLINE=/CONFIG_CMDLINE_BOOL=y\nCONFIG_CMDLINE_PREPEND=/g' $1/.config
> make ARCH=$1 O=$1 olddefconfig
> make ARCH=$1 O=$1 savedefconfig
> cp $1/defconfig $2
> rm -Rf $1
> 
> Cc: xe-linux-external@cisco.com
> Signed-off-by: Ruslan Ruslichenko <rruslich@cisco.com>
> Signed-off-by: Ruslan Bilovol <rbilovol@cisco.com>
> Signed-off-by: Daniel Walker <danielwa@cisco.com>
> ---
>   arch/powerpc/Kconfig                          | 38 +------------------
>   arch/powerpc/configs/44x/fsp2_defconfig       | 32 ++++++++--------
>   arch/powerpc/configs/44x/iss476-smp_defconfig | 24 ++++++------
>   arch/powerpc/configs/44x/warp_defconfig       | 17 ++++-----
>   arch/powerpc/configs/holly_defconfig          | 13 ++++---
>   arch/powerpc/configs/mvme5100_defconfig       | 23 +++++------
>   arch/powerpc/configs/skiroot_defconfig        | 12 +++---
>   arch/powerpc/configs/storcenter_defconfig     | 18 ++++-----
>   arch/powerpc/kernel/prom_init.c               | 10 +++--
>   9 files changed, 74 insertions(+), 113 deletions(-)
> 
> diff --git a/arch/powerpc/Kconfig b/arch/powerpc/Kconfig
> index 386ae12d8523..3a19e5b74177 100644
> --- a/arch/powerpc/Kconfig
> +++ b/arch/powerpc/Kconfig
> @@ -167,6 +167,8 @@ config PPC
>   	select EDAC_SUPPORT
>   	select GENERIC_ATOMIC64			if PPC32
>   	select GENERIC_CLOCKEVENTS_BROADCAST	if SMP
> +	select GENERIC_CMDLINE
> +	select GENERIC_CMDLINE_OF
>   	select GENERIC_CMOS_UPDATE
>   	select GENERIC_CPU_AUTOPROBE
>   	select GENERIC_CPU_VULNERABILITIES	if PPC_BARRIER_NOSPEC
> @@ -886,42 +888,6 @@ config PPC_DENORMALISATION
>   	  Add support for handling denormalisation of single precision
>   	  values.  Useful for bare metal only.  If unsure say Y here.
>   
> -config CMDLINE
> -	string "Initial kernel command string"
> -	default ""
> -	help
> -	  On some platforms, there is currently no way for the boot loader to
> -	  pass arguments to the kernel. For these platforms, you can supply
> -	  some command-line options at build time by entering them here.  In
> -	  most cases you will need to specify the root device here.
> -
> -choice
> -	prompt "Kernel command line type" if CMDLINE != ""
> -	default CMDLINE_FROM_BOOTLOADER
> -
> -config CMDLINE_FROM_BOOTLOADER
> -	bool "Use bootloader kernel arguments if available"
> -	help
> -	  Uses the command-line options passed by the boot loader. If
> -	  the boot loader doesn't provide any, the default kernel command
> -	  string provided in CMDLINE will be used.
> -
> -config CMDLINE_EXTEND
> -	bool "Extend bootloader kernel arguments"
> -	help
> -	  The command-line arguments provided by the boot loader will be
> -	  appended to the default kernel command string.
> -
> -config CMDLINE_FORCE
> -	bool "Always use the default kernel command string"
> -	help
> -	  Always use the default kernel command string, even if the boot
> -	  loader passes other arguments to the kernel.
> -	  This is useful if you cannot or don't want to change the
> -	  command-line options your boot loader passes to the kernel.
> -
> -endchoice
> -
>   config EXTRA_TARGETS
>   	string "Additional default image types"
>   	help
> diff --git a/arch/powerpc/configs/44x/fsp2_defconfig b/arch/powerpc/configs/44x/fsp2_defconfig
> index 8da316e61a08..4993db054589 100644
> --- a/arch/powerpc/configs/44x/fsp2_defconfig
> +++ b/arch/powerpc/configs/44x/fsp2_defconfig
> @@ -1,8 +1,6 @@
> -CONFIG_44x=y
>   # CONFIG_SWAP is not set
>   CONFIG_SYSVIPC=y
>   # CONFIG_CROSS_MEMORY_ATTACH is not set
> -# CONFIG_FHANDLE is not set
>   CONFIG_NO_HZ=y
>   CONFIG_HIGH_RES_TIMERS=y
>   CONFIG_IKCONFIG=y
> @@ -13,23 +11,25 @@ CONFIG_BLK_DEV_INITRD=y
>   # CONFIG_RD_XZ is not set
>   # CONFIG_RD_LZO is not set
>   # CONFIG_RD_LZ4 is not set
> +# CONFIG_FHANDLE is not set
>   CONFIG_KALLSYMS_ALL=y
>   CONFIG_BPF_SYSCALL=y
>   CONFIG_EMBEDDED=y
>   CONFIG_PROFILING=y
> -CONFIG_MODULES=y
> -CONFIG_MODULE_UNLOAD=y
> -# CONFIG_BLK_DEV_BSG is not set
> +CONFIG_CMDLINE_BOOL=y
> +CONFIG_CMDLINE_PREPEND="ip=on rw"
> +CONFIG_44x=y
>   CONFIG_PPC_47x=y
>   # CONFIG_EBONY is not set
>   CONFIG_FSP2=y
>   CONFIG_476FPE_ERR46=y
> -CONFIG_SWIOTLB=y
>   CONFIG_KEXEC=y
>   CONFIG_CRASH_DUMP=y
> -CONFIG_CMDLINE="ip=on rw"
>   # CONFIG_SUSPEND is not set
> -# CONFIG_PCI is not set
> +CONFIG_OPROFILE=y
> +CONFIG_MODULES=y
> +CONFIG_MODULE_UNLOAD=y
> +# CONFIG_BLK_DEV_BSG is not set
>   CONFIG_NET=y
>   CONFIG_PACKET=y
>   CONFIG_UNIX=y
> @@ -46,14 +46,12 @@ CONFIG_MTD=y
>   CONFIG_MTD_BLOCK=y
>   CONFIG_MTD_JEDECPROBE=y
>   CONFIG_MTD_CFI_AMDSTD=y
> -CONFIG_MTD_PHYSMAP_OF=y
>   CONFIG_BLK_DEV_RAM=y
>   CONFIG_BLK_DEV_RAM_SIZE=35000
>   # CONFIG_SCSI_PROC_FS is not set
>   CONFIG_BLK_DEV_SD=y
>   # CONFIG_SCSI_LOWLEVEL is not set
>   CONFIG_ATA=y
> -# CONFIG_SATA_PMP is not set
>   # CONFIG_ATA_SFF is not set
>   CONFIG_NETDEVICES=y
>   CONFIG_BONDING=m
> @@ -62,7 +60,6 @@ CONFIG_IBM_EMAC=m
>   # CONFIG_SERIO is not set
>   # CONFIG_VT is not set
>   # CONFIG_LEGACY_PTYS is not set
> -# CONFIG_DEVMEM is not set
>   CONFIG_SERIAL_8250=y
>   CONFIG_SERIAL_8250_CONSOLE=y
>   CONFIG_SERIAL_8250_NR_UARTS=32
> @@ -71,6 +68,7 @@ CONFIG_SERIAL_8250_EXTENDED=y
>   CONFIG_SERIAL_8250_SHARE_IRQ=y
>   CONFIG_SERIAL_OF_PLATFORM=y
>   # CONFIG_HW_RANDOM is not set
> +# CONFIG_DEVMEM is not set
>   CONFIG_I2C=y
>   CONFIG_I2C_IBM_IIC=y
>   CONFIG_PTP_1588_CLOCK=y
> @@ -106,6 +104,12 @@ CONFIG_NFS_V3_ACL=y
>   CONFIG_NFS_V4=y
>   CONFIG_ROOT_NFS=y
>   CONFIG_NLS_DEFAULT="n"
> +CONFIG_CRYPTO_CBC=y
> +CONFIG_CRYPTO_ECB=y
> +CONFIG_CRYPTO_PCBC=y
> +CONFIG_CRYPTO_MD5=y
> +CONFIG_CRYPTO_DES=y
> +# CONFIG_CRYPTO_HW is not set
>   CONFIG_XZ_DEC=y
>   CONFIG_PRINTK_TIME=y
>   CONFIG_MESSAGE_LOGLEVEL_DEFAULT=3
> @@ -113,9 +117,3 @@ CONFIG_DYNAMIC_DEBUG=y
>   CONFIG_DEBUG_INFO=y
>   CONFIG_MAGIC_SYSRQ=y
>   CONFIG_DETECT_HUNG_TASK=y
> -CONFIG_CRYPTO_CBC=y
> -CONFIG_CRYPTO_ECB=y
> -CONFIG_CRYPTO_PCBC=y
> -CONFIG_CRYPTO_MD5=y
> -CONFIG_CRYPTO_DES=y
> -# CONFIG_CRYPTO_HW is not set
> diff --git a/arch/powerpc/configs/44x/iss476-smp_defconfig b/arch/powerpc/configs/44x/iss476-smp_defconfig
> index c11e777b2f3d..b8d97061517a 100644
> --- a/arch/powerpc/configs/44x/iss476-smp_defconfig
> +++ b/arch/powerpc/configs/44x/iss476-smp_defconfig
> @@ -1,5 +1,3 @@
> -CONFIG_44x=y
> -CONFIG_SMP=y
>   CONFIG_SYSVIPC=y
>   CONFIG_POSIX_MQUEUE=y
>   CONFIG_LOG_BUF_SHIFT=14
> @@ -7,19 +5,22 @@ CONFIG_BLK_DEV_INITRD=y
>   CONFIG_EXPERT=y
>   CONFIG_KALLSYMS_ALL=y
>   CONFIG_PROFILING=y
> -CONFIG_MODULES=y
> -CONFIG_MODULE_UNLOAD=y
> -# CONFIG_BLK_DEV_BSG is not set
> +CONFIG_CMDLINE_BOOL=y
> +CONFIG_CMDLINE_PREPEND="root=/dev/issblk0"
> +CONFIG_44x=y
> +CONFIG_SMP=y
>   CONFIG_PPC_47x=y
>   # CONFIG_EBONY is not set
>   CONFIG_ISS4xx=y
>   CONFIG_HZ_100=y
>   CONFIG_MATH_EMULATION=y
>   CONFIG_IRQ_ALL_CPUS=y
> -CONFIG_CMDLINE="root=/dev/issblk0"
> -# CONFIG_PCI is not set
>   CONFIG_ADVANCED_OPTIONS=y
>   CONFIG_DYNAMIC_MEMSTART=y
> +CONFIG_OPROFILE=y
> +CONFIG_MODULES=y
> +CONFIG_MODULE_UNLOAD=y
> +# CONFIG_BLK_DEV_BSG is not set
>   CONFIG_NET=y
>   CONFIG_PACKET=y
>   CONFIG_UNIX=y
> @@ -33,7 +34,6 @@ CONFIG_MTD=y
>   CONFIG_MTD_BLOCK=y
>   CONFIG_MTD_JEDECPROBE=y
>   CONFIG_MTD_CFI_AMDSTD=y
> -CONFIG_MTD_PHYSMAP_OF=y
>   CONFIG_BLK_DEV_RAM=y
>   CONFIG_BLK_DEV_RAM_SIZE=35000
>   # CONFIG_INPUT is not set
> @@ -56,13 +56,13 @@ CONFIG_PROC_KCORE=y
>   CONFIG_TMPFS=y
>   CONFIG_CRAMFS=y
>   # CONFIG_NETWORK_FILESYSTEMS is not set
> -CONFIG_DEBUG_INFO=y
> -CONFIG_MAGIC_SYSRQ=y
> -CONFIG_DETECT_HUNG_TASK=y
> -CONFIG_PPC_EARLY_DEBUG=y
>   CONFIG_CRYPTO_CBC=y
>   CONFIG_CRYPTO_ECB=y
>   CONFIG_CRYPTO_PCBC=y
>   CONFIG_CRYPTO_MD5=y
>   CONFIG_CRYPTO_DES=y
>   # CONFIG_CRYPTO_HW is not set
> +CONFIG_DEBUG_INFO=y
> +CONFIG_MAGIC_SYSRQ=y
> +CONFIG_DETECT_HUNG_TASK=y
> +CONFIG_PPC_EARLY_DEBUG=y
> diff --git a/arch/powerpc/configs/44x/warp_defconfig b/arch/powerpc/configs/44x/warp_defconfig
> index 47252c2d7669..d2e4bbe1492c 100644
> --- a/arch/powerpc/configs/44x/warp_defconfig
> +++ b/arch/powerpc/configs/44x/warp_defconfig
> @@ -1,4 +1,3 @@
> -CONFIG_44x=y
>   CONFIG_LOCALVERSION="-pika"
>   # CONFIG_LOCALVERSION_AUTO is not set
>   CONFIG_SYSVIPC=y
> @@ -7,15 +6,16 @@ CONFIG_IKCONFIG_PROC=y
>   CONFIG_LOG_BUF_SHIFT=14
>   CONFIG_BLK_DEV_INITRD=y
>   CONFIG_EXPERT=y
> -CONFIG_MODULES=y
> -CONFIG_MODULE_UNLOAD=y
> -# CONFIG_BLK_DEV_BSG is not set
> +CONFIG_CMDLINE_BOOL=y
> +CONFIG_CMDLINE_PREPEND="ip=on"
> +CONFIG_44x=y
>   # CONFIG_EBONY is not set
>   CONFIG_WARP=y
>   CONFIG_PPC4xx_GPIO=y
>   CONFIG_HZ_1000=y
> -CONFIG_CMDLINE="ip=on"
> -# CONFIG_PCI is not set
> +CONFIG_MODULES=y
> +CONFIG_MODULE_UNLOAD=y
> +# CONFIG_BLK_DEV_BSG is not set
>   CONFIG_NET=y
>   CONFIG_PACKET=y
>   CONFIG_UNIX=y
> @@ -31,7 +31,6 @@ CONFIG_MTD_CMDLINE_PARTS=y
>   CONFIG_MTD_BLOCK=y
>   CONFIG_MTD_CFI=y
>   CONFIG_MTD_CFI_AMDSTD=y
> -CONFIG_MTD_PHYSMAP_OF=y
>   CONFIG_MTD_RAW_NAND=y
>   CONFIG_MTD_NAND_NDFC=y
>   CONFIG_MTD_UBI=y
> @@ -88,9 +87,9 @@ CONFIG_NLS_UTF8=y
>   CONFIG_CRC_CCITT=y
>   CONFIG_CRC_T10DIF=y
>   CONFIG_PRINTK_TIME=y
> +# CONFIG_DEBUG_BUGVERBOSE is not set
>   CONFIG_DEBUG_INFO=y
> -CONFIG_DEBUG_FS=y
>   CONFIG_MAGIC_SYSRQ=y
> +CONFIG_DEBUG_FS=y
>   CONFIG_DETECT_HUNG_TASK=y
>   # CONFIG_SCHED_DEBUG is not set
> -# CONFIG_DEBUG_BUGVERBOSE is not set
> diff --git a/arch/powerpc/configs/holly_defconfig b/arch/powerpc/configs/holly_defconfig
> index 271daff47d1d..98c0644e80b4 100644
> --- a/arch/powerpc/configs/holly_defconfig
> +++ b/arch/powerpc/configs/holly_defconfig
> @@ -4,17 +4,18 @@ CONFIG_HIGH_RES_TIMERS=y
>   CONFIG_LOG_BUF_SHIFT=14
>   CONFIG_BLK_DEV_INITRD=y
>   CONFIG_EXPERT=y
> -CONFIG_MODULES=y
> -# CONFIG_BLK_DEV_BSG is not set
> -CONFIG_PARTITION_ADVANCED=y
> +CONFIG_CMDLINE_BOOL=y
> +CONFIG_CMDLINE_PREPEND="console=ttyS0,115200"
>   # CONFIG_PPC_CHRP is not set
>   # CONFIG_PPC_PMAC is not set
>   CONFIG_EMBEDDED6xx=y
>   CONFIG_PPC_HOLLY=y
>   CONFIG_GEN_RTC=y
> -CONFIG_BINFMT_MISC=y
> -CONFIG_CMDLINE="console=ttyS0,115200"
>   # CONFIG_SECCOMP is not set
> +CONFIG_MODULES=y
> +# CONFIG_BLK_DEV_BSG is not set
> +CONFIG_PARTITION_ADVANCED=y
> +CONFIG_BINFMT_MISC=y
>   CONFIG_NET=y
>   CONFIG_PACKET=y
>   CONFIG_UNIX=y
> @@ -53,8 +54,8 @@ CONFIG_PROC_KCORE=y
>   CONFIG_TMPFS=y
>   CONFIG_NFS_FS=y
>   CONFIG_ROOT_NFS=y
> +# CONFIG_DEBUG_BUGVERBOSE is not set
>   CONFIG_MAGIC_SYSRQ=y
>   # CONFIG_SCHED_DEBUG is not set
> -# CONFIG_DEBUG_BUGVERBOSE is not set
>   CONFIG_XMON=y
>   CONFIG_XMON_DEFAULT=y
> diff --git a/arch/powerpc/configs/mvme5100_defconfig b/arch/powerpc/configs/mvme5100_defconfig
> index 1fed6be95d53..884a3e0defde 100644
> --- a/arch/powerpc/configs/mvme5100_defconfig
> +++ b/arch/powerpc/configs/mvme5100_defconfig
> @@ -11,16 +11,17 @@ CONFIG_LOG_BUF_SHIFT=14
>   # CONFIG_NET_NS is not set
>   CONFIG_CC_OPTIMIZE_FOR_SIZE=y
>   # CONFIG_COMPAT_BRK is not set
> -CONFIG_MODULES=y
> -CONFIG_MODULE_UNLOAD=y
> -# CONFIG_BLK_DEV_BSG is not set
> +CONFIG_CMDLINE_BOOL=y
> +CONFIG_CMDLINE_PREPEND="console=ttyS0,9600 ip=dhcp root=/dev/nfs"
>   # CONFIG_PPC_CHRP is not set
>   # CONFIG_PPC_PMAC is not set
>   CONFIG_EMBEDDED6xx=y
>   CONFIG_MVME5100=y
>   CONFIG_KVM_GUEST=y
>   CONFIG_HZ_100=y
> -CONFIG_CMDLINE="console=ttyS0,9600 ip=dhcp root=/dev/nfs"
> +CONFIG_MODULES=y
> +CONFIG_MODULE_UNLOAD=y
> +# CONFIG_BLK_DEV_BSG is not set
>   # CONFIG_CORE_DUMP_DEFAULT_ELF_HEADERS is not set
>   # CONFIG_COMPACTION is not set
>   CONFIG_NET=y
> @@ -108,13 +109,6 @@ CONFIG_NLS_CODEPAGE_437=m
>   CONFIG_NLS_CODEPAGE_932=m
>   CONFIG_NLS_ISO8859_1=m
>   CONFIG_NLS_UTF8=m
> -CONFIG_CRC_CCITT=m
> -CONFIG_CRC_T10DIF=y
> -CONFIG_XZ_DEC=y
> -CONFIG_MAGIC_SYSRQ=y
> -CONFIG_DEBUG_KERNEL=y
> -CONFIG_DETECT_HUNG_TASK=y
> -CONFIG_DEFAULT_HUNG_TASK_TIMEOUT=20
>   CONFIG_CRYPTO_CBC=y
>   CONFIG_CRYPTO_PCBC=m
>   CONFIG_CRYPTO_MD5=y
> @@ -125,3 +119,10 @@ CONFIG_CRYPTO_DES=y
>   CONFIG_CRYPTO_SERPENT=m
>   CONFIG_CRYPTO_TWOFISH=m
>   CONFIG_CRYPTO_DEFLATE=m
> +CONFIG_CRC_CCITT=m
> +CONFIG_CRC_T10DIF=y
> +CONFIG_XZ_DEC=y
> +CONFIG_MAGIC_SYSRQ=y
> +CONFIG_DEBUG_KERNEL=y
> +CONFIG_DETECT_HUNG_TASK=y
> +CONFIG_DEFAULT_HUNG_TASK_TIMEOUT=20
> diff --git a/arch/powerpc/configs/skiroot_defconfig b/arch/powerpc/configs/skiroot_defconfig
> index b806a5d3a695..5e11995508d7 100644
> --- a/arch/powerpc/configs/skiroot_defconfig
> +++ b/arch/powerpc/configs/skiroot_defconfig
> @@ -26,6 +26,8 @@ CONFIG_PERF_EVENTS=y
>   # CONFIG_SLAB_MERGE_DEFAULT is not set
>   CONFIG_SLAB_FREELIST_RANDOM=y
>   CONFIG_SLAB_FREELIST_HARDENED=y
> +CONFIG_CMDLINE_BOOL=y
> +CONFIG_CMDLINE_PREPEND="console=tty0 console=hvc0 ipr.fast_reboot=1 quiet"
>   CONFIG_PPC64=y
>   CONFIG_ALTIVEC=y
>   CONFIG_VSX=y
> @@ -42,14 +44,11 @@ CONFIG_KEXEC=y
>   CONFIG_KEXEC_FILE=y
>   CONFIG_PRESERVE_FA_DUMP=y
>   CONFIG_IRQ_ALL_CPUS=y
> -CONFIG_NUMA=y
>   CONFIG_PPC_64K_PAGES=y
>   CONFIG_SCHED_SMT=y
> -CONFIG_CMDLINE="console=tty0 console=hvc0 ipr.fast_reboot=1 quiet"
> -# CONFIG_SECCOMP is not set
>   # CONFIG_PPC_MEM_KEYS is not set
>   CONFIG_JUMP_LABEL=y
> -CONFIG_STRICT_KERNEL_RWX=y
> +# CONFIG_SECCOMP is not set
>   CONFIG_MODULES=y
>   CONFIG_MODULE_UNLOAD=y
>   CONFIG_MODULE_SIG_FORCE=y
> @@ -80,7 +79,6 @@ CONFIG_BLK_DEV_NVME=m
>   CONFIG_NVME_MULTIPATH=y
>   CONFIG_EEPROM_AT24=m
>   # CONFIG_CXL is not set
> -# CONFIG_OCXL is not set
>   CONFIG_BLK_DEV_SD=m
>   CONFIG_BLK_DEV_SR=m
>   CONFIG_CHR_DEV_SG=m
> @@ -199,7 +197,6 @@ CONFIG_PHYLIB=y
>   CONFIG_INPUT_EVDEV=y
>   CONFIG_INPUT_MISC=y
>   # CONFIG_SERIO_SERPORT is not set
> -# CONFIG_DEVMEM is not set
>   CONFIG_SERIAL_8250=y
>   CONFIG_SERIAL_8250_CONSOLE=y
>   CONFIG_IPMI_HANDLER=y
> @@ -207,9 +204,10 @@ CONFIG_IPMI_DEVICE_INTERFACE=y
>   CONFIG_IPMI_POWERNV=y
>   CONFIG_IPMI_WATCHDOG=y
>   CONFIG_HW_RANDOM=y
> +# CONFIG_DEVMEM is not set
> +# CONFIG_DEVPORT is not set
>   CONFIG_TCG_TPM=y
>   CONFIG_TCG_TIS_I2C_NUVOTON=y
> -# CONFIG_DEVPORT is not set
>   CONFIG_I2C=y
>   # CONFIG_I2C_COMPAT is not set
>   CONFIG_I2C_CHARDEV=y
> diff --git a/arch/powerpc/configs/storcenter_defconfig b/arch/powerpc/configs/storcenter_defconfig
> index 47dcfaddc1ac..17a17b8ae160 100644
> --- a/arch/powerpc/configs/storcenter_defconfig
> +++ b/arch/powerpc/configs/storcenter_defconfig
> @@ -2,18 +2,19 @@ CONFIG_SYSVIPC=y
>   CONFIG_LOG_BUF_SHIFT=14
>   CONFIG_EXPERT=y
>   # CONFIG_KALLSYMS is not set
> -CONFIG_MODULES=y
> -CONFIG_MODULE_UNLOAD=y
> -# CONFIG_BLK_DEV_BSG is not set
> -CONFIG_PARTITION_ADVANCED=y
> +CONFIG_CMDLINE_BOOL=y
> +CONFIG_CMDLINE_PREPEND="console=ttyS0,115200"
>   # CONFIG_PPC_CHRP is not set
>   # CONFIG_PPC_PMAC is not set
>   CONFIG_EMBEDDED6xx=y
>   CONFIG_STORCENTER=y
>   CONFIG_HZ_100=y
> -CONFIG_BINFMT_MISC=y
> -CONFIG_CMDLINE="console=ttyS0,115200"
>   # CONFIG_SECCOMP is not set
> +CONFIG_MODULES=y
> +CONFIG_MODULE_UNLOAD=y
> +# CONFIG_BLK_DEV_BSG is not set
> +CONFIG_PARTITION_ADVANCED=y
> +CONFIG_BINFMT_MISC=y
>   CONFIG_NET=y
>   CONFIG_PACKET=m
>   CONFIG_UNIX=y
> @@ -35,7 +36,6 @@ CONFIG_BLK_DEV_SD=y
>   CONFIG_BLK_DEV_SR=y
>   CONFIG_SCSI_SPI_ATTRS=y
>   CONFIG_ATA=y
> -CONFIG_PATA_VIA=y
>   CONFIG_MD=y
>   CONFIG_BLK_DEV_MD=y
>   CONFIG_MD_LINEAR=y
> @@ -44,16 +44,13 @@ CONFIG_MD_RAID1=y
>   CONFIG_MD_RAID456=y
>   CONFIG_NETDEVICES=y
>   CONFIG_DUMMY=m
> -CONFIG_R8169=y
>   # CONFIG_INPUT is not set
>   # CONFIG_SERIO is not set
>   # CONFIG_VT is not set
>   CONFIG_SERIAL_8250=y
>   CONFIG_SERIAL_8250_CONSOLE=y
> -# CONFIG_SERIAL_8250_PCI is not set
>   CONFIG_SERIAL_8250_NR_UARTS=2
>   CONFIG_SERIAL_8250_RUNTIME_UARTS=2
> -CONFIG_NVRAM=y
>   CONFIG_I2C=y
>   CONFIG_I2C_CHARDEV=y
>   CONFIG_I2C_MPC=y
> @@ -76,4 +73,3 @@ CONFIG_NLS_CODEPAGE_437=y
>   CONFIG_NLS_ISO8859_1=y
>   CONFIG_NLS_UTF8=y
>   CONFIG_CRC_T10DIF=y
> -# CONFIG_ENABLE_MUST_CHECK is not set
> diff --git a/arch/powerpc/kernel/prom_init.c b/arch/powerpc/kernel/prom_init.c
> index 2c2f33155317..27fece82ff93 100644
> --- a/arch/powerpc/kernel/prom_init.c
> +++ b/arch/powerpc/kernel/prom_init.c
> @@ -27,6 +27,7 @@
>   #include <linux/initrd.h>
>   #include <linux/bitops.h>
>   #include <linux/pgtable.h>
> +#include <linux/cmdline.h>
>   #include <asm/prom.h>
>   #include <asm/rtas.h>
>   #include <asm/page.h>
> @@ -309,6 +310,7 @@ static char __init *prom_strstr(const char *s1, const char *s2)
>   	return NULL;
>   }
>   
> +#ifdef GENERIC_CMDLINE_NEED_STRLCAT
>   static size_t __init prom_strlcat(char *dest, const char *src, size_t count)
>   {
>   	size_t dsize = prom_strlen(dest);
> @@ -328,6 +330,7 @@ static size_t __init prom_strlcat(char *dest, const char *src, size_t count)
>   	return res;
>   
>   }
> +#endif
>   
>   #ifdef CONFIG_PPC_PSERIES
>   static int __init prom_strtobool(const char *s, bool *res)
> @@ -780,12 +783,11 @@ static void __init early_cmdline_parse(void)
>   	prom_cmd_line[0] = 0;
>   	p = prom_cmd_line;
>   
> -	if (!IS_ENABLED(CONFIG_CMDLINE_FORCE) && (long)prom.chosen > 0)
> +	if ((long)prom.chosen > 0)
>   		l = prom_getprop(prom.chosen, "bootargs", p, COMMAND_LINE_SIZE-1);
>   
> -	if (IS_ENABLED(CONFIG_CMDLINE_EXTEND) || l <= 0 || p[0] == '\0')
> -		prom_strlcat(prom_cmd_line, " " CONFIG_CMDLINE,
> -			     sizeof(prom_cmd_line));
> +	cmdline_add_builtin_custom(prom_cmd_line, (l > 0 ? p : NULL), sizeof(prom_cmd_line),
> +					__prombss, prom_strlcpy, prom_strlcat);
>   
>   	prom_printf("command line: %s\n", prom_cmd_line);
>   
> 

^ permalink raw reply

* Re: [PATCH 6/8] drivers: firmware: efi: libstub: enable generic commandline
From: Christophe Leroy @ 2021-04-02 17:36 UTC (permalink / raw)
  To: Daniel Walker, Will Deacon, ob Herring, Daniel Gimpelevich,
	Andrew Morton, x86, linux-mips, linuxppc-dev
  Cc: linux-kernel, linux-efi, Ard Biesheuvel, xe-linux-external
In-Reply-To: <e5d98d566c38d6f8516b8d9d1fd603ec1f131037.1617126961.git.danielwa@cisco.com>



Le 30/03/2021 à 19:57, Daniel Walker a écrit :
> This adds code to handle the generic command line changes.
> The efi code appears that it doesn't benefit as much from this design
> as it could.
> 
> For example, if you had a prepend command line with "nokaslr" then
> you might be helpful to re-enable it in the boot loader or dts,
> but there appears to be no way to re-enable kaslr or some of the
> other options.
> 
> Cc: xe-linux-external@cisco.com
> Signed-off-by: Daniel Walker <danielwa@cisco.com>
> ---
>   .../firmware/efi/libstub/efi-stub-helper.c    | 35 +++++++++++++++++++
>   drivers/firmware/efi/libstub/efi-stub.c       |  7 ++++
>   drivers/firmware/efi/libstub/efistub.h        |  1 +
>   drivers/firmware/efi/libstub/x86-stub.c       | 13 +++++--
>   4 files changed, 54 insertions(+), 2 deletions(-)
> 
> diff --git a/drivers/firmware/efi/libstub/efi-stub-helper.c b/drivers/firmware/efi/libstub/efi-stub-helper.c
> index aa8da0a49829..c155837cedc9 100644
> --- a/drivers/firmware/efi/libstub/efi-stub-helper.c
> +++ b/drivers/firmware/efi/libstub/efi-stub-helper.c
> @@ -13,6 +13,7 @@
>   #include <linux/efi.h>
>   #include <linux/kernel.h>
>   #include <linux/printk.h> /* For CONSOLE_LOGLEVEL_* */
> +#include <linux/cmdline.h>
>   #include <asm/efi.h>
>   #include <asm/setup.h>
>   
> @@ -172,6 +173,40 @@ int efi_printk(const char *fmt, ...)
>   	return printed;
>   }
>   
> +/**
> + * efi_handle_cmdline() - handle adding in building parts of the command line
> + * @cmdline:	kernel command line
> + *
> + * Add in the generic parts of the commandline and start the parsing of the
> + * command line.
> + *
> + * Return:	status code
> + */
> +efi_status_t efi_handle_cmdline(char const *cmdline)
> +{
> +	efi_status_t status;
> +
> +	status = efi_parse_options(CMDLINE_PREPEND);
> +	if (status != EFI_SUCCESS) {
> +		efi_err("Failed to parse options\n");
> +		return status;
> +	}
> +
> +	status = efi_parse_options(IS_ENABLED(CONFIG_CMDLINE_OVERRIDE) ? "" : cmdline);
> +	if (status != EFI_SUCCESS) {
> +		efi_err("Failed to parse options\n");
> +		return status;
> +	}
> +
> +	status = efi_parse_options(CMDLINE_APPEND);
> +	if (status != EFI_SUCCESS) {
> +		efi_err("Failed to parse options\n");
> +		return status;
> +	}
> +
> +	return EFI_SUCCESS;
> +}

I think we can refactor to first build the final command line, then call efi_parse_options() only 
once after that.

The big advantage of GENERIC_CMDLINE should be to not address anymore CONFIG_CMDLINE_XXX options at 
all outside of linux/cmdline.h

> +
>   /**
>    * efi_parse_options() - Parse EFI command line options
>    * @cmdline:	kernel command line
> diff --git a/drivers/firmware/efi/libstub/efi-stub.c b/drivers/firmware/efi/libstub/efi-stub.c
> index 26e69788f27a..760480248adf 100644
> --- a/drivers/firmware/efi/libstub/efi-stub.c
> +++ b/drivers/firmware/efi/libstub/efi-stub.c
> @@ -172,6 +172,12 @@ efi_status_t __efiapi efi_pe_entry(efi_handle_t handle,
>   		goto fail;
>   	}
>   
> +#ifdef CONFIG_GENERIC_CMDLINE
> +	status = efi_handle_cmdline(cmdline_ptr);
> +	if (status != EFI_SUCCESS) {
> +		goto fail_free_cmdline;
> +	}
> +#else

Why an alternative ?

>   	if (IS_ENABLED(CONFIG_CMDLINE_EXTEND) ||
>   	    IS_ENABLED(CONFIG_CMDLINE_FORCE) ||
>   	    cmdline_size == 0) {
> @@ -189,6 +195,7 @@ efi_status_t __efiapi efi_pe_entry(efi_handle_t handle,
>   			goto fail_free_cmdline;
>   		}
>   	}
> +#endif
>   
>   	efi_info("Booting Linux Kernel...\n");
>   
> diff --git a/drivers/firmware/efi/libstub/efistub.h b/drivers/firmware/efi/libstub/efistub.h
> index cde0a2ef507d..07c7f9fdfffc 100644
> --- a/drivers/firmware/efi/libstub/efistub.h
> +++ b/drivers/firmware/efi/libstub/efistub.h
> @@ -800,6 +800,7 @@ efi_status_t efi_relocate_kernel(unsigned long *image_addr,
>   				 unsigned long alignment,
>   				 unsigned long min_addr);
>   
> +efi_status_t efi_handle_cmdline(char const *cmdline);
>   efi_status_t efi_parse_options(char const *cmdline);
>   
>   void efi_parse_option_graphics(char *option);
> diff --git a/drivers/firmware/efi/libstub/x86-stub.c b/drivers/firmware/efi/libstub/x86-stub.c
> index f14c4ff5839f..30ad8fb7122d 100644
> --- a/drivers/firmware/efi/libstub/x86-stub.c
> +++ b/drivers/firmware/efi/libstub/x86-stub.c
> @@ -673,6 +673,8 @@ unsigned long efi_main(efi_handle_t handle,
>   	unsigned long bzimage_addr = (unsigned long)startup_32;
>   	unsigned long buffer_start, buffer_end;
>   	struct setup_header *hdr = &boot_params->hdr;
> +	unsigned long cmdline_paddr = ((u64)hdr->cmd_line_ptr |
> +				       ((u64)boot_params->ext_cmd_line_ptr << 32));
>   	efi_status_t status;
>   
>   	efi_system_table = sys_table_arg;
> @@ -735,6 +737,14 @@ unsigned long efi_main(efi_handle_t handle,
>   		image_offset = 0;
>   	}
>   
> +#ifdef CONFIG_GENERIC_CMDLINE
> +	status = efi_handle_cmdline((char *)cmdline_paddr);
> +	if (status != EFI_SUCCESS) {
> +		efi_err("Failed to parse options\n");
> +		goto fail;
> +	}
> +#else /* CONFIG_GENERIC_CMDLINE */
> +
>   #ifdef CONFIG_CMDLINE_BOOL
>   	status = efi_parse_options(CONFIG_CMDLINE);
>   	if (status != EFI_SUCCESS) {
> @@ -743,8 +753,6 @@ unsigned long efi_main(efi_handle_t handle,
>   	}
>   #endif
>   	if (!IS_ENABLED(CONFIG_CMDLINE_OVERRIDE)) {
> -		unsigned long cmdline_paddr = ((u64)hdr->cmd_line_ptr |
> -					       ((u64)boot_params->ext_cmd_line_ptr << 32));
>   		status = efi_parse_options((char *)cmdline_paddr);
>   		if (status != EFI_SUCCESS) {
>   			efi_err("Failed to parse options\n");
> @@ -752,6 +760,7 @@ unsigned long efi_main(efi_handle_t handle,
>   		}
>   	}
>   
> +#endif
>   	/*
>   	 * At this point, an initrd may already have been loaded by the
>   	 * bootloader and passed via bootparams. We permit an initrd loaded
> 

^ permalink raw reply

* Re: [PATCH v5 31/48] KVM: PPC: Book3S HV P9: inline kvmhv_load_hv_regs_and_go into __kvmhv_vcpu_entry_p9
From: kernel test robot @ 2021-04-02 20:58 UTC (permalink / raw)
  To: Nicholas Piggin, kvm-ppc
  Cc: linuxppc-dev, kbuild-all, Nicholas Piggin, Fabiano Rosas
In-Reply-To: <20210401150325.442125-32-npiggin@gmail.com>

[-- Attachment #1: Type: text/plain, Size: 18530 bytes --]

Hi Nicholas,

I love your patch! Yet something to improve:

[auto build test ERROR on powerpc/next]
[also build test ERROR on v5.12-rc5 next-20210401]
[If your patch is applied to the wrong git tree, kindly drop us a note.
And when submitting patch, we suggest to use '--base' as documented in
https://git-scm.com/docs/git-format-patch]

url:    https://github.com/0day-ci/linux/commits/Nicholas-Piggin/KVM-PPC-Book3S-C-ify-the-P9-entry-exit-code/20210401-232743
base:   https://git.kernel.org/pub/scm/linux/kernel/git/powerpc/linux.git next
config: powerpc64-randconfig-r033-20210402 (attached as .config)
compiler: powerpc64-linux-gcc (GCC) 9.3.0
reproduce (this is a W=1 build):
        wget https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O ~/bin/make.cross
        chmod +x ~/bin/make.cross
        # https://github.com/0day-ci/linux/commit/f2a35edda3ab6cba30fbfc362e163d5bc1e086d0
        git remote add linux-review https://github.com/0day-ci/linux
        git fetch --no-tags linux-review Nicholas-Piggin/KVM-PPC-Book3S-C-ify-the-P9-entry-exit-code/20210401-232743
        git checkout f2a35edda3ab6cba30fbfc362e163d5bc1e086d0
        # save the attached .config to linux build tree
        COMPILER_INSTALL_PATH=$HOME/0day COMPILER=gcc-9.3.0 make.cross ARCH=powerpc64 

If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <lkp@intel.com>

All errors (new ones prefixed by >>):

   arch/powerpc/kvm/book3s_hv_interrupt.c: In function 'switch_mmu_to_guest_radix':
   arch/powerpc/kvm/book3s_hv_interrupt.c:61:46: error: 'struct kvm_vcpu_arch' has no member named 'nested'
      61 |  struct kvm_nested_guest *nested = vcpu->arch.nested;
         |                                              ^
   arch/powerpc/kvm/book3s_hv_interrupt.c:80:2: error: implicit declaration of function 'kvmppc_check_need_tlb_flush' [-Werror=implicit-function-declaration]
      80 |  kvmppc_check_need_tlb_flush(kvm, vc->pcpu, nested);
         |  ^~~~~~~~~~~~~~~~~~~~~~~~~~~
   In file included from arch/powerpc/include/asm/processor.h:11,
                    from arch/powerpc/include/asm/thread_info.h:40,
                    from include/linux/thread_info.h:58,
                    from include/asm-generic/preempt.h:5,
                    from ./arch/powerpc/include/generated/asm/preempt.h:1,
                    from include/linux/preempt.h:78,
                    from include/linux/percpu.h:6,
                    from include/linux/context_tracking_state.h:5,
                    from include/linux/hardirq.h:5,
                    from include/linux/kvm_host.h:7,
                    from arch/powerpc/kvm/book3s_hv_interrupt.c:3:
   arch/powerpc/kvm/book3s_hv_interrupt.c: In function 'switch_mmu_to_host_radix':
   arch/powerpc/kvm/book3s_hv_interrupt.c:88:28: error: 'struct kvm_arch' has no member named 'host_lpid'
      88 |  mtspr(SPRN_LPID, kvm->arch.host_lpid);
         |                            ^
   arch/powerpc/include/asm/reg.h:1393:33: note: in definition of macro 'mtspr'
    1393 |          : "r" ((unsigned long)(v)) \
         |                                 ^
   arch/powerpc/kvm/book3s_hv_interrupt.c:90:28: error: 'struct kvm_arch' has no member named 'host_lpcr'
      90 |  mtspr(SPRN_LPCR, kvm->arch.host_lpcr);
         |                            ^
   arch/powerpc/include/asm/reg.h:1393:33: note: in definition of macro 'mtspr'
    1393 |          : "r" ((unsigned long)(v)) \
         |                                 ^
   arch/powerpc/kvm/book3s_hv_interrupt.c: At top level:
   arch/powerpc/kvm/book3s_hv_interrupt.c:128:5: error: no previous prototype for 'kvmhv_vcpu_entry_p9' [-Werror=missing-prototypes]
     128 | int kvmhv_vcpu_entry_p9(struct kvm_vcpu *vcpu, u64 time_limit, unsigned long lpcr)
         |     ^~~~~~~~~~~~~~~~~~~
   arch/powerpc/kvm/book3s_hv_interrupt.c: In function 'kvmhv_vcpu_entry_p9':
>> arch/powerpc/kvm/book3s_hv_interrupt.c:170:25: error: 'struct kvmppc_host_state' has no member named 'host_purr'; did you mean 'host_r1'?
     170 |  local_paca->kvm_hstate.host_purr = mfspr(SPRN_PURR);
         |                         ^~~~~~~~~
         |                         host_r1
>> arch/powerpc/kvm/book3s_hv_interrupt.c:171:25: error: 'struct kvmppc_host_state' has no member named 'host_spurr'; did you mean 'host_r1'?
     171 |  local_paca->kvm_hstate.host_spurr = mfspr(SPRN_SPURR);
         |                         ^~~~~~~~~~
         |                         host_r1
   In file included from arch/powerpc/include/asm/processor.h:11,
                    from arch/powerpc/include/asm/thread_info.h:40,
                    from include/linux/thread_info.h:58,
                    from include/asm-generic/preempt.h:5,
                    from ./arch/powerpc/include/generated/asm/preempt.h:1,
                    from include/linux/preempt.h:78,
                    from include/linux/percpu.h:6,
                    from include/linux/context_tracking_state.h:5,
                    from include/linux/hardirq.h:5,
                    from include/linux/kvm_host.h:7,
                    from arch/powerpc/kvm/book3s_hv_interrupt.c:3:
>> arch/powerpc/kvm/book3s_hv_interrupt.c:187:31: error: 'struct kvmppc_host_state' has no member named 'fake_suspend'
     187 |        (local_paca->kvm_hstate.fake_suspend << PSSCR_FAKE_SUSPEND_LG));
         |                               ^
   arch/powerpc/include/asm/reg.h:1393:33: note: in definition of macro 'mtspr'
    1393 |          : "r" ((unsigned long)(v)) \
         |                                 ^
   arch/powerpc/kvm/book3s_hv_interrupt.c:191:31: error: 'struct kvm_vcpu_arch' has no member named 'shregs'; did you mean 'regs'?
     191 |  mtspr(SPRN_SPRG0, vcpu->arch.shregs.sprg0);
         |                               ^~~~~~
   arch/powerpc/include/asm/reg.h:1393:33: note: in definition of macro 'mtspr'
    1393 |          : "r" ((unsigned long)(v)) \
         |                                 ^
   arch/powerpc/kvm/book3s_hv_interrupt.c:192:31: error: 'struct kvm_vcpu_arch' has no member named 'shregs'; did you mean 'regs'?
     192 |  mtspr(SPRN_SPRG1, vcpu->arch.shregs.sprg1);
         |                               ^~~~~~
   arch/powerpc/include/asm/reg.h:1393:33: note: in definition of macro 'mtspr'
    1393 |          : "r" ((unsigned long)(v)) \
         |                                 ^
   arch/powerpc/kvm/book3s_hv_interrupt.c:193:31: error: 'struct kvm_vcpu_arch' has no member named 'shregs'; did you mean 'regs'?
     193 |  mtspr(SPRN_SPRG2, vcpu->arch.shregs.sprg2);
         |                               ^~~~~~
   arch/powerpc/include/asm/reg.h:1393:33: note: in definition of macro 'mtspr'
    1393 |          : "r" ((unsigned long)(v)) \
         |                                 ^
   arch/powerpc/kvm/book3s_hv_interrupt.c:194:31: error: 'struct kvm_vcpu_arch' has no member named 'shregs'; did you mean 'regs'?
     194 |  mtspr(SPRN_SPRG3, vcpu->arch.shregs.sprg3);
         |                               ^~~~~~
   arch/powerpc/include/asm/reg.h:1393:33: note: in definition of macro 'mtspr'
    1393 |          : "r" ((unsigned long)(v)) \
         |                                 ^
   arch/powerpc/kvm/book3s_hv_interrupt.c:206:30: error: 'struct kvm_vcpu_arch' has no member named 'shregs'; did you mean 'regs'?
     206 |  mtspr(SPRN_SRR0, vcpu->arch.shregs.srr0);
         |                              ^~~~~~
   arch/powerpc/include/asm/reg.h:1393:33: note: in definition of macro 'mtspr'
    1393 |          : "r" ((unsigned long)(v)) \
         |                                 ^
   arch/powerpc/kvm/book3s_hv_interrupt.c:207:30: error: 'struct kvm_vcpu_arch' has no member named 'shregs'; did you mean 'regs'?
     207 |  mtspr(SPRN_SRR1, vcpu->arch.shregs.srr1);
         |                              ^~~~~~
   arch/powerpc/include/asm/reg.h:1393:33: note: in definition of macro 'mtspr'
    1393 |          : "r" ((unsigned long)(v)) \
         |                                 ^
   In file included from arch/powerpc/include/asm/bug.h:109,
                    from include/linux/bug.h:5,
                    from include/linux/mmdebug.h:5,
                    from include/linux/percpu.h:5,
                    from include/linux/context_tracking_state.h:5,
                    from include/linux/hardirq.h:5,
                    from include/linux/kvm_host.h:7,
                    from arch/powerpc/kvm/book3s_hv_interrupt.c:3:
   arch/powerpc/kvm/book3s_hv_interrupt.c:213:26: error: 'struct kvm_vcpu_arch' has no member named 'shregs'; did you mean 'regs'?
     213 |  WARN_ON_ONCE(vcpu->arch.shregs.msr & MSR_HV);
         |                          ^~~~~~
   include/asm-generic/bug.h:102:25: note: in definition of macro 'WARN_ON_ONCE'
     102 |  int __ret_warn_on = !!(condition);   \
         |                         ^~~~~~~~~
   arch/powerpc/kvm/book3s_hv_interrupt.c:214:28: error: 'struct kvm_vcpu_arch' has no member named 'shregs'; did you mean 'regs'?
     214 |  WARN_ON_ONCE(!(vcpu->arch.shregs.msr & MSR_ME));
         |                            ^~~~~~
   include/asm-generic/bug.h:102:25: note: in definition of macro 'WARN_ON_ONCE'
     102 |  int __ret_warn_on = !!(condition);   \
         |                         ^~~~~~~~~
   In file included from arch/powerpc/include/asm/processor.h:11,
                    from arch/powerpc/include/asm/thread_info.h:40,
                    from include/linux/thread_info.h:58,
                    from include/asm-generic/preempt.h:5,
                    from ./arch/powerpc/include/generated/asm/preempt.h:1,
                    from include/linux/preempt.h:78,
                    from include/linux/percpu.h:6,
                    from include/linux/context_tracking_state.h:5,
                    from include/linux/hardirq.h:5,
                    from include/linux/kvm_host.h:7,
                    from arch/powerpc/kvm/book3s_hv_interrupt.c:3:
   arch/powerpc/kvm/book3s_hv_interrupt.c:217:32: error: 'struct kvm_vcpu_arch' has no member named 'shregs'; did you mean 'regs'?
     217 |  mtspr(SPRN_HSRR1, (vcpu->arch.shregs.msr & ~MSR_HV) | MSR_ME);
         |                                ^~~~~~
   arch/powerpc/include/asm/reg.h:1393:33: note: in definition of macro 'mtspr'
    1393 |          : "r" ((unsigned long)(v)) \
         |                                 ^
   arch/powerpc/kvm/book3s_hv_interrupt.c:244:13: error: 'struct kvm_vcpu_arch' has no member named 'shregs'; did you mean 'regs'?
     244 |  vcpu->arch.shregs.srr0 = mfspr(SPRN_SRR0);
         |             ^~~~~~
         |             regs
   arch/powerpc/kvm/book3s_hv_interrupt.c:245:13: error: 'struct kvm_vcpu_arch' has no member named 'shregs'; did you mean 'regs'?
     245 |  vcpu->arch.shregs.srr1 = mfspr(SPRN_SRR1);
         |             ^~~~~~
         |             regs
   arch/powerpc/kvm/book3s_hv_interrupt.c:246:13: error: 'struct kvm_vcpu_arch' has no member named 'shregs'; did you mean 'regs'?
     246 |  vcpu->arch.shregs.dar = mfspr(SPRN_DAR);
         |             ^~~~~~
         |             regs
   arch/powerpc/kvm/book3s_hv_interrupt.c:247:13: error: 'struct kvm_vcpu_arch' has no member named 'shregs'; did you mean 'regs'?
     247 |  vcpu->arch.shregs.dsisr = mfspr(SPRN_DSISR);
         |             ^~~~~~
         |             regs
   arch/powerpc/kvm/book3s_hv_interrupt.c:281:13: error: 'struct kvm_vcpu_arch' has no member named 'emul_inst'
     281 |   vcpu->arch.emul_inst = mfspr(SPRN_HEIR);
         |             ^
   In file included from arch/powerpc/include/asm/processor.h:11,
                    from arch/powerpc/include/asm/thread_info.h:40,
                    from include/linux/thread_info.h:58,


vim +170 arch/powerpc/kvm/book3s_hv_interrupt.c

   127	
   128	int kvmhv_vcpu_entry_p9(struct kvm_vcpu *vcpu, u64 time_limit, unsigned long lpcr)
   129	{
   130		struct kvm *kvm = vcpu->kvm;
   131		struct kvmppc_vcore *vc = vcpu->arch.vcore;
   132		s64 hdec;
   133		u64 tb, purr, spurr;
   134		u64 *exsave;
   135		unsigned long msr = mfmsr();
   136		int trap;
   137		unsigned long host_hfscr = mfspr(SPRN_HFSCR);
   138		unsigned long host_ciabr = mfspr(SPRN_CIABR);
   139		unsigned long host_dawr0 = mfspr(SPRN_DAWR0);
   140		unsigned long host_dawrx0 = mfspr(SPRN_DAWRX0);
   141		unsigned long host_psscr = mfspr(SPRN_PSSCR);
   142		unsigned long host_pidr = mfspr(SPRN_PID);
   143		unsigned long host_dawr1 = 0;
   144		unsigned long host_dawrx1 = 0;
   145	
   146		if (cpu_has_feature(CPU_FTR_DAWR1)) {
   147			host_dawr1 = mfspr(SPRN_DAWR1);
   148			host_dawrx1 = mfspr(SPRN_DAWRX1);
   149		}
   150	
   151		tb = mftb();
   152		hdec = time_limit - tb;
   153		if (hdec < 0)
   154			return BOOK3S_INTERRUPT_HV_DECREMENTER;
   155	
   156		if (vc->tb_offset) {
   157			u64 new_tb = tb + vc->tb_offset;
   158			mtspr(SPRN_TBU40, new_tb);
   159			tb = mftb();
   160			if ((tb & 0xffffff) < (new_tb & 0xffffff))
   161				mtspr(SPRN_TBU40, new_tb + 0x1000000);
   162			vc->tb_offset_applied = vc->tb_offset;
   163		}
   164	
   165		if (vc->pcr)
   166			mtspr(SPRN_PCR, vc->pcr | PCR_MASK);
   167		mtspr(SPRN_DPDES, vc->dpdes);
   168		mtspr(SPRN_VTB, vc->vtb);
   169	
 > 170		local_paca->kvm_hstate.host_purr = mfspr(SPRN_PURR);
 > 171		local_paca->kvm_hstate.host_spurr = mfspr(SPRN_SPURR);
   172		mtspr(SPRN_PURR, vcpu->arch.purr);
   173		mtspr(SPRN_SPURR, vcpu->arch.spurr);
   174	
   175		if (dawr_enabled()) {
   176			mtspr(SPRN_DAWR0, vcpu->arch.dawr0);
   177			mtspr(SPRN_DAWRX0, vcpu->arch.dawrx0);
   178			if (cpu_has_feature(CPU_FTR_DAWR1)) {
   179				mtspr(SPRN_DAWR1, vcpu->arch.dawr1);
   180				mtspr(SPRN_DAWRX1, vcpu->arch.dawrx1);
   181			}
   182		}
   183		mtspr(SPRN_CIABR, vcpu->arch.ciabr);
   184		mtspr(SPRN_IC, vcpu->arch.ic);
   185	
   186		mtspr(SPRN_PSSCR, vcpu->arch.psscr | PSSCR_EC |
 > 187		      (local_paca->kvm_hstate.fake_suspend << PSSCR_FAKE_SUSPEND_LG));
   188	
   189		mtspr(SPRN_HFSCR, vcpu->arch.hfscr);
   190	
   191		mtspr(SPRN_SPRG0, vcpu->arch.shregs.sprg0);
   192		mtspr(SPRN_SPRG1, vcpu->arch.shregs.sprg1);
   193		mtspr(SPRN_SPRG2, vcpu->arch.shregs.sprg2);
   194		mtspr(SPRN_SPRG3, vcpu->arch.shregs.sprg3);
   195	
   196		mtspr(SPRN_AMOR, ~0UL);
   197	
   198		switch_mmu_to_guest_radix(kvm, vcpu, lpcr);
   199	
   200		/*
   201		 * P9 suppresses the HDEC exception when LPCR[HDICE] = 0,
   202		 * so set guest LPCR (with HDICE) before writing HDEC.
   203		 */
   204		mtspr(SPRN_HDEC, hdec);
   205	
   206		mtspr(SPRN_SRR0, vcpu->arch.shregs.srr0);
   207		mtspr(SPRN_SRR1, vcpu->arch.shregs.srr1);
   208	
   209		start_timing(vcpu, &vcpu->arch.rm_entry);
   210	
   211		vcpu->arch.ceded = 0;
   212	
   213		WARN_ON_ONCE(vcpu->arch.shregs.msr & MSR_HV);
   214		WARN_ON_ONCE(!(vcpu->arch.shregs.msr & MSR_ME));
   215	
   216		mtspr(SPRN_HSRR0, vcpu->arch.regs.nip);
   217		mtspr(SPRN_HSRR1, (vcpu->arch.shregs.msr & ~MSR_HV) | MSR_ME);
   218	
   219		/*
   220		 * On POWER9 DD2.1 and below, sometimes on a Hypervisor Data Storage
   221		 * Interrupt (HDSI) the HDSISR is not be updated at all.
   222		 *
   223		 * To work around this we put a canary value into the HDSISR before
   224		 * returning to a guest and then check for this canary when we take a
   225		 * HDSI. If we find the canary on a HDSI, we know the hardware didn't
   226		 * update the HDSISR. In this case we return to the guest to retake the
   227		 * HDSI which should correctly update the HDSISR the second time HDSI
   228		 * entry.
   229		 *
   230		 * Just do this on all p9 processors for now.
   231		 */
   232		mtspr(SPRN_HDSISR, HDSISR_CANARY);
   233	
   234		accumulate_time(vcpu, &vcpu->arch.guest_time);
   235	
   236		local_paca->kvm_hstate.in_guest = KVM_GUEST_MODE_GUEST_HV_FAST;
   237		kvmppc_p9_enter_guest(vcpu);
   238		// Radix host and guest means host never runs with guest MMU state
   239		local_paca->kvm_hstate.in_guest = KVM_GUEST_MODE_NONE;
   240	
   241		accumulate_time(vcpu, &vcpu->arch.rm_intr);
   242	
   243		/* Get these from r11/12 and paca exsave */
   244		vcpu->arch.shregs.srr0 = mfspr(SPRN_SRR0);
   245		vcpu->arch.shregs.srr1 = mfspr(SPRN_SRR1);
   246		vcpu->arch.shregs.dar = mfspr(SPRN_DAR);
   247		vcpu->arch.shregs.dsisr = mfspr(SPRN_DSISR);
   248	
   249		/* 0x2 bit for HSRR is only used by PR and P7/8 HV paths, clear it */
   250		trap = local_paca->kvm_hstate.scratch0 & ~0x2;
   251		if (likely(trap > BOOK3S_INTERRUPT_MACHINE_CHECK)) {
   252			exsave = local_paca->exgen;
   253		} else if (trap == BOOK3S_INTERRUPT_SYSTEM_RESET) {
   254			exsave = local_paca->exnmi;
   255		} else { /* trap == 0x200 */
   256			exsave = local_paca->exmc;
   257		}
   258	
   259		vcpu->arch.regs.gpr[1] = local_paca->kvm_hstate.scratch1;
   260		vcpu->arch.regs.gpr[3] = local_paca->kvm_hstate.scratch2;
   261		vcpu->arch.regs.gpr[9] = exsave[EX_R9/sizeof(u64)];
   262		vcpu->arch.regs.gpr[10] = exsave[EX_R10/sizeof(u64)];
   263		vcpu->arch.regs.gpr[11] = exsave[EX_R11/sizeof(u64)];
   264		vcpu->arch.regs.gpr[12] = exsave[EX_R12/sizeof(u64)];
   265		vcpu->arch.regs.gpr[13] = exsave[EX_R13/sizeof(u64)];
   266		vcpu->arch.ppr = exsave[EX_PPR/sizeof(u64)];
   267		vcpu->arch.cfar = exsave[EX_CFAR/sizeof(u64)];
   268		vcpu->arch.regs.ctr = exsave[EX_CTR/sizeof(u64)];
   269	
   270		vcpu->arch.last_inst = KVM_INST_FETCH_FAILED;
   271	
   272		if (unlikely(trap == BOOK3S_INTERRUPT_MACHINE_CHECK)) {
   273			vcpu->arch.fault_dar = exsave[EX_DAR/sizeof(u64)];
   274			vcpu->arch.fault_dsisr = exsave[EX_DSISR/sizeof(u64)];
   275			kvmppc_realmode_machine_check(vcpu);
   276	
   277		} else if (unlikely(trap == BOOK3S_INTERRUPT_HMI)) {
   278			kvmppc_realmode_hmi_handler();
   279	
   280		} else if (trap == BOOK3S_INTERRUPT_H_EMUL_ASSIST) {
   281			vcpu->arch.emul_inst = mfspr(SPRN_HEIR);
   282	
   283		} else if (trap == BOOK3S_INTERRUPT_H_DATA_STORAGE) {
   284			vcpu->arch.fault_dar = exsave[EX_DAR/sizeof(u64)];
   285			vcpu->arch.fault_dsisr = exsave[EX_DSISR/sizeof(u64)];
   286			vcpu->arch.fault_gpa = mfspr(SPRN_ASDR);
   287	
   288		} else if (trap == BOOK3S_INTERRUPT_H_INST_STORAGE) {
   289			vcpu->arch.fault_gpa = mfspr(SPRN_ASDR);
   290	
   291		} else if (trap == BOOK3S_INTERRUPT_H_FAC_UNAVAIL) {
   292			vcpu->arch.hfscr = mfspr(SPRN_HFSCR);
   293	

---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org

[-- Attachment #2: .config.gz --]
[-- Type: application/gzip, Size: 27150 bytes --]

^ permalink raw reply

* Re: [PATCH 04/14] powerpc/64s: avoid reloading (H)SRR registers if they are still valid
From: Michael Ellerman @ 2021-04-02 22:39 UTC (permalink / raw)
  To: Nicholas Piggin, linuxppc-dev; +Cc: Nicholas Piggin
In-Reply-To: <20210315220402.260594-5-npiggin@gmail.com>

Nicholas Piggin <npiggin@gmail.com> writes:
> When an interrupt is taken, the SRR registers are set to return to
> where it left off. Unless they are modified in the meantime, or the
> return address or MSR are modified, there is no need to reload these
> registers when returning from interrupt.
>
> Introduce per-CPU flags that track the validity of SRR and HSRR
> registers, clear them when returning from interrupt, using the registers
> for something else (e.g., OPAL calls), or adjusting return address or MSR.
>
> This improves the performance of interrupt returns.
>
> XXX: may not need to invalidate both hsrr and srr all the time
>
> Signed-off-by: Nicholas Piggin <npiggin@gmail.com>
> ---

I needed something like below to get 32-bit building.

cheers


diff --git a/arch/powerpc/include/asm/ptrace.h b/arch/powerpc/include/asm/ptrace.h
index 6d6237e0cbd7..7f9bbd19db10 100644
--- a/arch/powerpc/include/asm/ptrace.h
+++ b/arch/powerpc/include/asm/ptrace.h
@@ -153,15 +153,21 @@ static inline void regs_set_return_value(struct pt_regs *regs, unsigned long rc)
 	regs->gpr[3] = rc;
 }
 
-static inline void regs_set_return_ip(struct pt_regs *regs, unsigned long ip)
+static inline void invalidate_srrs(void)
 {
-	regs->nip = ip;
 #ifdef CONFIG_PPC_BOOK3S_64
+	// XXX: We may not need to invalidate both hsrr and srr all the time
 	local_paca->hsrr_valid = 0;
 	local_paca->srr_valid = 0;
 #endif
 }
 
+static inline void regs_set_return_ip(struct pt_regs *regs, unsigned long ip)
+{
+	regs->nip = ip;
+	invalidate_srrs();
+}
+
 static inline void regs_add_return_ip(struct pt_regs *regs, long offset)
 {
 	regs_set_return_ip(regs, regs->nip + offset);
diff --git a/arch/powerpc/kernel/process.c b/arch/powerpc/kernel/process.c
index 200b4805f999..82623b57e2d6 100644
--- a/arch/powerpc/kernel/process.c
+++ b/arch/powerpc/kernel/process.c
@@ -98,8 +98,7 @@ static void check_if_tm_restore_required(struct task_struct *tsk)
 	    !test_thread_flag(TIF_RESTORE_TM)) {
 		tsk->thread.ckpt_regs.msr = tsk->thread.regs->msr;
 		set_thread_flag(TIF_RESTORE_TM);
-		local_paca->hsrr_valid = 0;
-		local_paca->srr_valid = 0;
+		invalidate_srrs();
 	}
 }
 
@@ -164,8 +163,7 @@ static void __giveup_fpu(struct task_struct *tsk)
 	if (cpu_has_feature(CPU_FTR_VSX))
 		msr &= ~MSR_VSX;
 	tsk->thread.regs->msr = msr;
-	local_paca->hsrr_valid = 0;
-	local_paca->srr_valid = 0;
+	invalidate_srrs();
 }
 
 void giveup_fpu(struct task_struct *tsk)
@@ -249,8 +247,7 @@ static void __giveup_altivec(struct task_struct *tsk)
 	if (cpu_has_feature(CPU_FTR_VSX))
 		msr &= ~MSR_VSX;
 	tsk->thread.regs->msr = msr;
-	local_paca->hsrr_valid = 0;
-	local_paca->srr_valid = 0;
+	invalidate_srrs();
 }
 
 void giveup_altivec(struct task_struct *tsk)
@@ -566,8 +563,7 @@ void notrace restore_math(struct pt_regs *regs)
 		msr_check_and_clear(new_msr);
 
 		regs->msr |= new_msr | fpexc_mode;
-		local_paca->hsrr_valid = 0;
-		local_paca->srr_valid = 0;
+		invalidate_srrs();
 	}
 }
 #endif /* CONFIG_PPC_BOOK3S_64 */
@@ -1293,8 +1289,7 @@ struct task_struct *__switch_to(struct task_struct *prev,
 			atomic_read(&current->mm->context.vas_windows)))
 			asm volatile(PPC_CP_ABORT);
 	}
-	local_paca->hsrr_valid = 0;
-	local_paca->srr_valid = 0;
+	invalidate_srrs();
 #endif /* CONFIG_PPC_BOOK3S_64 */
 
 	return last;
@@ -1884,8 +1879,7 @@ void start_thread(struct pt_regs *regs, unsigned long start, unsigned long sp)
 	current->thread.load_tm = 0;
 #endif /* CONFIG_PPC_TRANSACTIONAL_MEM */
 
-	local_paca->hsrr_valid = 0;
-	local_paca->srr_valid = 0;
+	invalidate_srrs();
 }
 EXPORT_SYMBOL(start_thread);
 
@@ -1936,8 +1930,7 @@ int set_fpexc_mode(struct task_struct *tsk, unsigned int val)
 	if (regs != NULL && (regs->msr & MSR_FP) != 0) {
 		regs->msr = (regs->msr & ~(MSR_FE0|MSR_FE1))
 			| tsk->thread.fpexc_mode;
-		local_paca->hsrr_valid = 0;
-		local_paca->srr_valid = 0;
+		invalidate_srrs();
 	}
 	return 0;
 }
@@ -1990,8 +1983,7 @@ int set_endian(struct task_struct *tsk, unsigned int val)
 	else
 		return -EINVAL;
 
-	local_paca->hsrr_valid = 0;
-	local_paca->srr_valid = 0;
+	invalidate_srrs();
 
 	return 0;
 }
diff --git a/arch/powerpc/kernel/syscalls.c b/arch/powerpc/kernel/syscalls.c
index 4cb38afa28a8..9d1d6070a516 100644
--- a/arch/powerpc/kernel/syscalls.c
+++ b/arch/powerpc/kernel/syscalls.c
@@ -115,8 +115,8 @@ SYSCALL_DEFINE0(switch_endian)
 	struct thread_info *ti;
 
 	current->thread.regs->msr ^= MSR_LE;
-	local_paca->hsrr_valid = 0;
-	local_paca->srr_valid = 0;
+
+	invalidate_srrs();
 
 	/*
 	 * Set TIF_RESTOREALL so that r3 isn't clobbered on return to
diff --git a/arch/powerpc/lib/sstep.c b/arch/powerpc/lib/sstep.c
index 96505d4bba1c..2b94bf21d6ae 100644
--- a/arch/powerpc/lib/sstep.c
+++ b/arch/powerpc/lib/sstep.c
@@ -3480,8 +3480,7 @@ int emulate_step(struct pt_regs *regs, struct ppc_inst instr)
 	unsigned long val;
 	unsigned long ea;
 
-	local_paca->hsrr_valid = 0;
-	local_paca->srr_valid = 0;
+	invalidate_srrs();
 
 	r = analyse_instr(&op, regs, instr);
 	if (r < 0)

^ permalink raw reply related

* [PATCH] powerpc/dts: fix not include DTC_FLAGS
From: Youlin Song @ 2021-04-03  2:04 UTC (permalink / raw)
  To: robh+dt, mpe, benh, paulus
  Cc: devicetree, linuxppc-dev, linux-kernel, Youlin Song

I wanted to build the fsl dts in my machine and found that
the dtb have not extra space,so uboot will cause about
FDT_ERR_NOSPACE issue.

Signed-off-by: Youlin Song <syl.loop@gmail.com>
---
 arch/powerpc/boot/dts/Makefile | 1 +
 1 file changed, 1 insertion(+)

diff --git a/arch/powerpc/boot/dts/Makefile b/arch/powerpc/boot/dts/Makefile
index fb335d05aae8..c21165c0cd76 100644
--- a/arch/powerpc/boot/dts/Makefile
+++ b/arch/powerpc/boot/dts/Makefile
@@ -2,5 +2,6 @@
 
 subdir-y += fsl
 
+DTC_FLAGS   ?= -p 1024
 dtstree		:= $(srctree)/$(src)
 dtb-$(CONFIG_OF_ALL_DTBS) := $(patsubst $(dtstree)/%.dts,%.dtb, $(wildcard $(dtstree)/*.dts))
-- 
2.25.1


^ permalink raw reply related

* Re: [PATCH 04/14] powerpc/64s: avoid reloading (H)SRR registers if they are still valid
From: Michael Ellerman @ 2021-04-03  2:28 UTC (permalink / raw)
  To: Nicholas Piggin, linuxppc-dev; +Cc: Nicholas Piggin
In-Reply-To: <20210315220402.260594-5-npiggin@gmail.com>

Nicholas Piggin <npiggin@gmail.com> writes:
> diff --git a/arch/powerpc/kernel/entry_64.S b/arch/powerpc/kernel/entry_64.S
> index ccf913cedd29..b466b3e1bb3f 100644
> --- a/arch/powerpc/kernel/entry_64.S
> +++ b/arch/powerpc/kernel/entry_64.S
> @@ -64,6 +64,30 @@ exception_marker:
>  	.section	".text"
>  	.align 7
>  
> +.macro DEBUG_SRR_VALID srr
> +#ifdef CONFIG_PPC_RFI_SRR_DEBUG
> +	.ifc \srr,srr
> +	mfspr	r11,SPRN_SRR0
> +	ld	r12,_NIP(r1)
> +100:	tdne	r11,r12
> +	EMIT_BUG_ENTRY 100b,__FILE__,__LINE__,(BUGFLAG_WARNING | BUGFLAG_ONCE)

This always points at *this* line, not the caller. Works better with the
patch below.

cheers


diff --git a/arch/powerpc/kernel/entry_64.S b/arch/powerpc/kernel/entry_64.S
index b466b3e1bb3f..ada76b1279f9 100644
--- a/arch/powerpc/kernel/entry_64.S
+++ b/arch/powerpc/kernel/entry_64.S
@@ -64,26 +64,26 @@
 	.section	".text"
 	.align 7
 
-.macro DEBUG_SRR_VALID srr
+.macro DEBUG_SRR_VALID srr line
 #ifdef CONFIG_PPC_RFI_SRR_DEBUG
 	.ifc \srr,srr
 	mfspr	r11,SPRN_SRR0
 	ld	r12,_NIP(r1)
 100:	tdne	r11,r12
-	EMIT_BUG_ENTRY 100b,__FILE__,__LINE__,(BUGFLAG_WARNING | BUGFLAG_ONCE)
+	EMIT_BUG_ENTRY 100b,__FILE__,\line,(BUGFLAG_WARNING | BUGFLAG_ONCE)
 	mfspr	r11,SPRN_SRR1
 	ld	r12,_MSR(r1)
 100:	tdne	r11,r12
-	EMIT_BUG_ENTRY 100b,__FILE__,__LINE__,(BUGFLAG_WARNING | BUGFLAG_ONCE)
+	EMIT_BUG_ENTRY 100b,__FILE__,\line,(BUGFLAG_WARNING | BUGFLAG_ONCE)
 	.else
 	mfspr	r11,SPRN_HSRR0
 	ld	r12,_NIP(r1)
 100:	tdne	r11,r12
-	EMIT_BUG_ENTRY 100b,__FILE__,__LINE__,(BUGFLAG_WARNING | BUGFLAG_ONCE)
+	EMIT_BUG_ENTRY 100b,__FILE__,\line,(BUGFLAG_WARNING | BUGFLAG_ONCE)
 	mfspr	r11,SPRN_HSRR1
 	ld	r12,_MSR(r1)
 100:	tdne	r11,r12
-	EMIT_BUG_ENTRY 100b,__FILE__,__LINE__,(BUGFLAG_WARNING | BUGFLAG_ONCE)
+	EMIT_BUG_ENTRY 100b,__FILE__,\line,(BUGFLAG_WARNING | BUGFLAG_ONCE)
 	.endif
 #endif
 .endm
@@ -358,7 +358,7 @@ END_BTB_FLUSH_SECTION
 	mtspr	SPRN_SRR0,r4
 	mtspr	SPRN_SRR1,r5
 1:
-	DEBUG_SRR_VALID srr
+	DEBUG_SRR_VALID srr __LINE__
 
 BEGIN_FTR_SECTION
 	stdcx.	r0,0,r1			/* to clear the reservation */
@@ -753,7 +753,7 @@ END_FTR_SECTION_IFSET(CPU_FTR_HAS_PPR)
 	stb	r4,PACAHSRR_VALID(r13)
 #endif
 	.endif
-	DEBUG_SRR_VALID \srr
+	DEBUG_SRR_VALID \srr __LINE__
 
 BEGIN_FTR_SECTION
 	stdcx.	r0,0,r1		/* to clear the reservation */
@@ -825,7 +825,7 @@ ALT_FTR_SECTION_END_IFCLR(CPU_FTR_STCX_CHECKS_ADDRESS)
 	stb	r4,PACAHSRR_VALID(r13)
 #endif
 	.endif
-	DEBUG_SRR_VALID \srr
+	DEBUG_SRR_VALID \srr __LINE__
 
 BEGIN_FTR_SECTION
 	stdcx.	r0,0,r1		/* to clear the reservation */

^ permalink raw reply related

* [GIT PULL] Please pull powerpc/linux.git powerpc-5.12-5 tag
From: Michael Ellerman @ 2021-04-03 11:48 UTC (permalink / raw)
  To: Linus Torvalds; +Cc: nathanl, aneesh.kumar, linuxppc-dev, linux-kernel

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA256

Hi Linus,

Please pull some more powerpc fixes for 5.12:

The following changes since commit cc7a0bb058b85ea03db87169c60c7cfdd5d34678:

  PCI: rpadlpar: Fix potential drc_name corruption in store functions (2021-03-17 13:48:07 +1100)

are available in the git repository at:

  https://git.kernel.org/pub/scm/linux/kernel/git/powerpc/linux.git tags/powerpc-5.12-5

for you to fetch changes up to 53f1d31708f6240e4615b0927df31f182e389e2f:

  powerpc/mm/book3s64: Use the correct storage key value when calling H_PROTECT (2021-03-26 22:19:39 +1100)

- ------------------------------------------------------------------
powerpc fixes for 5.12 #5

Fix a bug on pseries where spurious wakeups from H_PROD would prevent partition migration
from succeeding.

Fix oopses seen in pcpu_alloc(), caused by parallel faults of the percpu mapping causing
us to corrupt the protection key used for the mapping, and cause a fatal key fault.

Thanks to Aneesh Kumar K.V, Murilo Opsfelder Araujo, Nathan Lynch.

- ------------------------------------------------------------------
Aneesh Kumar K.V (1):
      powerpc/mm/book3s64: Use the correct storage key value when calling H_PROTECT

Nathan Lynch (2):
      powerpc/pseries/mobility: use struct for shared state
      powerpc/pseries/mobility: handle premature return from H_JOIN


 arch/powerpc/platforms/pseries/lpar.c     |  3 +-
 arch/powerpc/platforms/pseries/mobility.c | 48 ++++++++++++++++++--
 2 files changed, 46 insertions(+), 5 deletions(-)
-----BEGIN PGP SIGNATURE-----

iQIzBAEBCAAdFiEEJFGtCPCthwEv2Y/bUevqPMjhpYAFAmBoVTsACgkQUevqPMjh
pYDlFxAAkkiy2RiHbaAlWHpVekXVQN1/oRISHQ+9jRco3BQUAEq8wHJNrlArnab6
N7C/ig2SiugagpLelRsXeXWyM54U3syIQnX3NRg82PgUBxU/LGJmIcyWCgDIf9x0
/xbMrWcRMuzY1x916rX7MPuSVc8LcyVu9nByBrbFWNE6IqUrJ0ngrBNNsEyWbEf/
NBHYqUzpurXYv/OHEPOQu9GIOWej5SR8oOKGn3/aJ66cg3WoC7iC56seBjSIrcLe
zwhUenwRYM6YQ6boX0OBKs/NaPSeT9qy4JyZOe0Sqeo0Yvhj4VJs9W0napIYQde5
y6ieoyHk33xPawUWiTEtkLmvH2nZPVRXCfGOQmh5B4mvuS/rrv6hTeFkdLFZ74yJ
Fuan/ljnXSPTkT+xRITrOO/irZyTaRXJ4j0Ck3LrtluUFib9psf+OqtoIiqqy11w
u+E8T1GChRZTuy2iMZy1jiyvmKwa/S5v67YUU2xUXNYeRI8j3g3cPo/W9Skn3TS2
LiO5+/6Ws1ABn7TohGV2R7sTPu5AnJP7jyHVJuDbtf/Z79U1SMiNAOb8jA/8WNbW
0NtLSQsy1PHonsqUIJgJntmstA46Xnsr1ruA2wR7GEuaaBrjSynw9cG55KlA4Lug
16kaOFPBnJhvkgjTDI7Xl7+ktr4yuR5EriDI0wJMqbhxn+IJ5VM=
=9cfb
-----END PGP SIGNATURE-----

^ permalink raw reply

* Re: [PATCH] powerpc/ptrace: Don't return error when getting/setting FP regs without CONFIG_PPC_FPU_REGS
From: Michael Ellerman @ 2021-04-03 11:51 UTC (permalink / raw)
  To: Christophe Leroy, Benjamin Herrenschmidt, Paul Mackerras,
	Michael Ellerman
  Cc: linuxppc-dev, linux-kernel
In-Reply-To: <9121a44a2d50ba1af18d8aa5ada06c9a3bea8afd.1617200085.git.christophe.leroy@csgroup.eu>

On Wed, 31 Mar 2021 14:14:58 +0000 (UTC), Christophe Leroy wrote:
> An #ifdef CONFIG_PPC_FPU_REGS is missing in arch_ptrace() leading
> to the following Oops because [REGSET_FPR] entry is not initialised in
> native_regsets[].
> 
> [   41.917608] BUG: Unable to handle kernel instruction fetch
> [   41.922849] Faulting instruction address: 0xff8fd228
> [   41.927760] Oops: Kernel access of bad area, sig: 11 [#1]
> [   41.933089] BE PAGE_SIZE=4K PREEMPT CMPC885
> [   41.940753] Modules linked in:
> [   41.943768] CPU: 0 PID: 366 Comm: gdb Not tainted 5.12.0-rc5-s3k-dev-01666-g7aac86a0f057-dirty #4835
> [   41.952800] NIP:  ff8fd228 LR: c004d9e0 CTR: ff8fd228
> [   41.957790] REGS: caae9df0 TRAP: 0400   Not tainted  (5.12.0-rc5-s3k-dev-01666-g7aac86a0f057-dirty)
> [   41.966741] MSR:  40009032 <EE,ME,IR,DR,RI>  CR: 82004248  XER: 20000000
> [   41.973540]
> [   41.973540] GPR00: c004d9b4 caae9eb0 c1b64f60 c1b64520 c0713cd4 caae9eb8 c1bacdfc 00000004
> [   41.973540] GPR08: 00000200 ff8fd228 c1bac700 00001032 28004242 1061aaf4 00000001 106d64a0
> [   41.973540] GPR16: 00000000 00000000 7fa0a774 10610000 7fa0aef9 00000000 10610000 7fa0a538
> [   41.973540] GPR24: 7fa0a580 7fa0a570 c1bacc00 c1b64520 c1bacc00 caae9ee8 00000108 c0713cd4
> [   42.009685] NIP [ff8fd228] 0xff8fd228
> [   42.013300] LR [c004d9e0] __regset_get+0x100/0x124
> [   42.018036] Call Trace:
> [   42.020443] [caae9eb0] [c004d9b4] __regset_get+0xd4/0x124 (unreliable)
> [   42.026899] [caae9ee0] [c004da94] copy_regset_to_user+0x5c/0xb0
> [   42.032751] [caae9f10] [c002f640] sys_ptrace+0xe4/0x588
> [   42.037915] [caae9f30] [c0011010] ret_from_syscall+0x0/0x28
> [   42.043422] --- interrupt: c00 at 0xfd1f8e4
> [   42.047553] NIP:  0fd1f8e4 LR: 1004a688 CTR: 00000000
> [   42.052544] REGS: caae9f40 TRAP: 0c00   Not tainted  (5.12.0-rc5-s3k-dev-01666-g7aac86a0f057-dirty)
> [   42.061494] MSR:  0000d032 <EE,PR,ME,IR,DR,RI>  CR: 48004442  XER: 00000000
> [   42.068551]
> [   42.068551] GPR00: 0000001a 7fa0a040 77dad7e0 0000000e 00000170 00000000 7fa0a078 00000004
> [   42.068551] GPR08: 00000000 108deb88 108dda40 106d6010 44004442 1061aaf4 00000001 106d64a0
> [   42.068551] GPR16: 00000000 00000000 7fa0a774 10610000 7fa0aef9 00000000 10610000 7fa0a538
> [   42.068551] GPR24: 7fa0a580 7fa0a570 1078fe00 1078fd70 1078fd70 00000170 0fdd3244 0000000d
> [   42.104696] NIP [0fd1f8e4] 0xfd1f8e4
> [   42.108225] LR [1004a688] 0x1004a688
> [   42.111753] --- interrupt: c00
> [   42.114768] Instruction dump:
> [   42.117698] XXXXXXXX XXXXXXXX XXXXXXXX XXXXXXXX XXXXXXXX XXXXXXXX XXXXXXXX XXXXXXXX
> [   42.125443] XXXXXXXX XXXXXXXX XXXXXXXX XXXXXXXX XXXXXXXX XXXXXXXX XXXXXXXX XXXXXXXX
> [   42.133195] ---[ end trace d35616f22ab2100c ]---
> 
> [...]

Applied to powerpc/fixes.

[1/1] powerpc/ptrace: Don't return error when getting/setting FP regs without CONFIG_PPC_FPU_REGS
      https://git.kernel.org/powerpc/c/3618250c8399cb36f4a0fbc48610a178307e1c64

cheers

^ permalink raw reply

* Re: [PATCH] powerpc/vdso: Make sure vdso_wrapper.o is rebuilt everytime vdso.so is rebuilt
From: Michael Ellerman @ 2021-04-03 11:51 UTC (permalink / raw)
  To: Paul Mackerras, Michael Ellerman, Benjamin Herrenschmidt,
	masahiroy, Christophe Leroy
  Cc: linuxppc-dev, linux-kernel
In-Reply-To: <8bb015bc98c51d8ced581415b7e3d157e18da7c9.1617181918.git.christophe.leroy@csgroup.eu>

On Wed, 31 Mar 2021 09:12:19 +0000 (UTC), Christophe Leroy wrote:
> Commit bce74491c300 ("powerpc/vdso: fix unnecessary rebuilds of
> vgettimeofday.o") moved vdso32_wrapper.o and vdso64_wrapper.o out
> of arch/powerpc/kernel/vdso[32/64]/ and removed the dependencies in
> the Makefile. This leads to the wrappers not being re-build hence the
> kernel embedding the old vdso library.
> 
> Add back missing dependencies to ensure vdso32_wrapper.o and vdso64_wrapper.o
> are rebuilt when vdso32.so.dbg and vdso64.so.dbg are changed.

Applied to powerpc/fixes.

[1/1] powerpc/vdso: Make sure vdso_wrapper.o is rebuilt everytime vdso.so is rebuilt
      https://git.kernel.org/powerpc/c/791f9e36599d94af5a76d3f74d04e16326761aae

cheers

^ permalink raw reply

* Re: [PATCH v2] powerpc/signal32: Fix Oops on sigreturn with unmapped VDSO
From: Michael Ellerman @ 2021-04-03 11:51 UTC (permalink / raw)
  To: Christophe Leroy, Benjamin Herrenschmidt, Paul Mackerras,
	Michael Ellerman
  Cc: linuxppc-dev, linux-kernel
In-Reply-To: <bde9154e5351a5ac7bca3d59cdb5a5e8edacbb79.1617199569.git.christophe.leroy@csgroup.eu>

On Wed, 31 Mar 2021 14:07:04 +0000 (UTC), Christophe Leroy wrote:
> PPC32 encounters a KUAP fault when trying to handle a signal with
> VDSO unmapped.
> 
> 	Kernel attempted to read user page (7fc07ec0) - exploit attempt? (uid: 0)
> 	BUG: Unable to handle kernel data access on read at 0x7fc07ec0
> 	Faulting instruction address: 0xc00111d4
> 	Oops: Kernel access of bad area, sig: 11 [#1]
> 	BE PAGE_SIZE=16K PREEMPT CMPC885
> 	CPU: 0 PID: 353 Comm: sigreturn_vdso Not tainted 5.12.0-rc4-s3k-dev-01553-gb30c310ea220 #4814
> 	NIP:  c00111d4 LR: c0005a28 CTR: 00000000
> 	REGS: cadb3dd0 TRAP: 0300   Not tainted  (5.12.0-rc4-s3k-dev-01553-gb30c310ea220)
> 	MSR:  00009032 <EE,ME,IR,DR,RI>  CR: 48000884  XER: 20000000
> 	DAR: 7fc07ec0 DSISR: 88000000
> 	GPR00: c0007788 cadb3e90 c28d4a40 7fc07ec0 7fc07ed0 000004e0 7fc07ce0 00000000
> 	GPR08: 00000001 00000001 7fc07ec0 00000000 28000282 1001b828 100a0920 00000000
> 	GPR16: 100cac0c 100b0000 105c43a4 105c5685 100d0000 100d0000 100d0000 100b2e9e
> 	GPR24: ffffffff 105c43c8 00000000 7fc07ec8 cadb3f40 cadb3ec8 c28d4a40 00000000
> 	NIP [c00111d4] flush_icache_range+0x90/0xb4
> 	LR [c0005a28] handle_signal32+0x1bc/0x1c4
> 	Call Trace:
> 	[cadb3e90] [100d0000] 0x100d0000 (unreliable)
> 	[cadb3ec0] [c0007788] do_notify_resume+0x260/0x314
> 	[cadb3f20] [c000c764] syscall_exit_prepare+0x120/0x184
> 	[cadb3f30] [c00100b4] ret_from_syscall+0xc/0x28
> 	--- interrupt: c00 at 0xfe807f8
> 	NIP:  0fe807f8 LR: 10001060 CTR: c0139378
> 	REGS: cadb3f40 TRAP: 0c00   Not tainted  (5.12.0-rc4-s3k-dev-01553-gb30c310ea220)
> 	MSR:  0000d032 <EE,PR,ME,IR,DR,RI>  CR: 28000482  XER: 20000000
> 
> [...]

Applied to powerpc/fixes.

[1/1] powerpc/signal32: Fix Oops on sigreturn with unmapped VDSO
      https://git.kernel.org/powerpc/c/acca57217c688c5bbbd5140974533d81e8757cc9

cheers

^ permalink raw reply

* Re: [PATCH 08/10] powerpc/signal32: Convert restore_[tm]_user_regs() to user access block
From: Christophe Leroy @ 2021-04-03 17:32 UTC (permalink / raw)
  To: Benjamin Herrenschmidt, Paul Mackerras, Michael Ellerman, cmr
  Cc: linuxppc-dev, linux-kernel
In-Reply-To: <181adf15a6f644efcd1aeafb355f3578ff1b6bc5.1616151715.git.christophe.leroy@csgroup.eu>



Le 19/03/2021 à 12:06, Christophe Leroy a écrit :
> Convert restore_user_regs() and restore_tm_user_regs()
> to use user_access_read_begin/end blocks.
> 
> Signed-off-by: Christophe Leroy <christophe.leroy@csgroup.eu>
> ---
>   arch/powerpc/include/asm/ptrace.h |   2 +-
>   arch/powerpc/kernel/signal_32.c   | 141 +++++++++++++++---------------
>   2 files changed, 72 insertions(+), 71 deletions(-)
> 
> diff --git a/arch/powerpc/kernel/signal_32.c b/arch/powerpc/kernel/signal_32.c
> index 088c83853026..0b1a6f53e553 100644
> --- a/arch/powerpc/kernel/signal_32.c
> +++ b/arch/powerpc/kernel/signal_32.c
> @@ -567,19 +569,22 @@ static long restore_user_regs(struct pt_regs *regs,
>   	regs->msr &= ~MSR_SPE;
>   	if (msr & MSR_SPE) {
>   		/* restore spe registers from the stack */
> -		if (__copy_from_user(current->thread.evr, &sr->mc_vregs,
> -				     ELF_NEVRREG * sizeof(u32)))
> -			return 1;
> +		unsafe_copy_from_user(current->thread.evr, &sr->mc_vregs,
> +				      ELF_NEVRREG * sizeof(u32));

Missing the , failed); here at the end of the line.

Michael can you add it ?

Thanks
Christophe

^ permalink raw reply

* Re: [GIT PULL] Please pull powerpc/linux.git powerpc-5.12-5 tag
From: pr-tracker-bot @ 2021-04-03 18:18 UTC (permalink / raw)
  To: Michael Ellerman
  Cc: nathanl, aneesh.kumar, Linus Torvalds, linuxppc-dev, linux-kernel
In-Reply-To: <871rbr1te5.fsf@mpe.ellerman.id.au>

The pull request you sent on Sat, 03 Apr 2021 22:48:02 +1100:

> https://git.kernel.org/pub/scm/linux/kernel/git/powerpc/linux.git tags/powerpc-5.12-5

has been merged into torvalds/linux.git:
https://git.kernel.org/torvalds/c/9c2ef23e4dae122d2b18e834d90f8bd4dda48fe6

Thank you!

-- 
Deet-doot-dot, I am a bot.
https://korg.docs.kernel.org/prtracker.html

^ permalink raw reply

* [powerpc:next-test] BUILD REGRESSION 556baad64ee9f87db99de05be3b53edbd7beeaa1
From: kernel test robot @ 2021-04-04  0:06 UTC (permalink / raw)
  To: Michael Ellerman; +Cc: linuxppc-dev

tree/branch: https://git.kernel.org/pub/scm/linux/kernel/git/powerpc/linux.git next-test
branch HEAD: 556baad64ee9f87db99de05be3b53edbd7beeaa1  selftests/powerpc: Suggest memtrace instead of /dev/mem for ci memory

Error/Warning in current branch:

arch/powerpc/kernel/signal_32.c:572:3: error: 'unsafe_copy_from_user' undeclared (first use in this function); did you mean 'raw_copy_from_user'?
arch/powerpc/kernel/signal_32.c:573:36: error: macro "unsafe_copy_from_user" requires 4 arguments, but only 3 given
arch/powerpc/platforms/powernv/memtrace.c:49:5: error: no previous prototype for 'memtrace_mmap' [-Werror=missing-prototypes]

Error/Warning ids grouped by kconfigs:

gcc_recent_errors
|-- powerpc-mpc8540_ads_defconfig
|   |-- arch-powerpc-kernel-signal_32.c:error:macro-unsafe_copy_from_user-requires-arguments-but-only-given
|   `-- arch-powerpc-kernel-signal_32.c:error:unsafe_copy_from_user-undeclared-(first-use-in-this-function)
`-- powerpc-powernv_defconfig
    `-- arch-powerpc-platforms-powernv-memtrace.c:error:no-previous-prototype-for-memtrace_mmap

elapsed time: 721m

configs tested: 119
configs skipped: 2

gcc tested configs:
arm                                 defconfig
arm64                            allyesconfig
arm64                               defconfig
arm                              allyesconfig
arm                              allmodconfig
x86_64                           allyesconfig
riscv                            allmodconfig
i386                             allyesconfig
riscv                            allyesconfig
powerpc                     powernv_defconfig
mips                      malta_kvm_defconfig
m68k                        mvme16x_defconfig
powerpc                      ppc40x_defconfig
mips                         tb0226_defconfig
powerpc                 mpc8540_ads_defconfig
mips                         bigsur_defconfig
sh                             sh03_defconfig
powerpc                      katmai_defconfig
arm                         assabet_defconfig
arc                          axs103_defconfig
ia64                             allmodconfig
m68k                         amcore_defconfig
m68k                       bvme6000_defconfig
arm                       spear13xx_defconfig
powerpc                     ppa8548_defconfig
powerpc                          g5_defconfig
arm                        mini2440_defconfig
sh                            migor_defconfig
arm                     eseries_pxa_defconfig
m68k                            q40_defconfig
um                           x86_64_defconfig
powerpc                      acadia_defconfig
sh                 kfr2r09-romimage_defconfig
sh                          sdk7780_defconfig
powerpc                     ep8248e_defconfig
powerpc                      ppc64e_defconfig
arm                         lpc32xx_defconfig
m68k                        m5272c3_defconfig
h8300                            alldefconfig
nds32                            alldefconfig
arm                       netwinder_defconfig
mips                         mpc30x_defconfig
powerpc                 mpc836x_mds_defconfig
xtensa                  nommu_kc705_defconfig
powerpc                      tqm8xx_defconfig
arm                             rpc_defconfig
sparc64                             defconfig
powerpc                 mpc834x_mds_defconfig
powerpc                      ep88xc_defconfig
parisc                generic-32bit_defconfig
sh                           sh2007_defconfig
ia64                                defconfig
ia64                             allyesconfig
m68k                             allmodconfig
m68k                                defconfig
m68k                             allyesconfig
nios2                               defconfig
arc                              allyesconfig
nds32                             allnoconfig
nds32                               defconfig
nios2                            allyesconfig
csky                                defconfig
alpha                               defconfig
alpha                            allyesconfig
xtensa                           allyesconfig
h8300                            allyesconfig
arc                                 defconfig
sh                               allmodconfig
parisc                              defconfig
s390                             allyesconfig
s390                             allmodconfig
parisc                           allyesconfig
s390                                defconfig
sparc                            allyesconfig
sparc                               defconfig
i386                                defconfig
mips                             allyesconfig
mips                             allmodconfig
powerpc                          allyesconfig
powerpc                          allmodconfig
powerpc                           allnoconfig
i386                 randconfig-a006-20210403
i386                 randconfig-a003-20210403
i386                 randconfig-a001-20210403
i386                 randconfig-a004-20210403
i386                 randconfig-a002-20210403
i386                 randconfig-a005-20210403
x86_64               randconfig-a014-20210403
x86_64               randconfig-a015-20210403
x86_64               randconfig-a011-20210403
x86_64               randconfig-a013-20210403
x86_64               randconfig-a012-20210403
x86_64               randconfig-a016-20210403
i386                 randconfig-a014-20210403
i386                 randconfig-a011-20210403
i386                 randconfig-a016-20210403
i386                 randconfig-a012-20210403
i386                 randconfig-a013-20210403
i386                 randconfig-a015-20210403
riscv                    nommu_k210_defconfig
riscv                    nommu_virt_defconfig
riscv                             allnoconfig
riscv                               defconfig
riscv                          rv32_defconfig
um                               allmodconfig
um                                allnoconfig
um                               allyesconfig
um                                  defconfig
x86_64                    rhel-8.3-kselftests
x86_64                              defconfig
x86_64                               rhel-8.3
x86_64                      rhel-8.3-kbuiltin
x86_64                                  kexec

clang tested configs:
x86_64               randconfig-a004-20210403
x86_64               randconfig-a005-20210403
x86_64               randconfig-a003-20210403
x86_64               randconfig-a001-20210403
x86_64               randconfig-a002-20210403
x86_64               randconfig-a006-20210403

---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org

^ permalink raw reply

* [powerpc:fixes-test] BUILD SUCCESS 791f9e36599d94af5a76d3f74d04e16326761aae
From: kernel test robot @ 2021-04-04  0:06 UTC (permalink / raw)
  To: Michael Ellerman; +Cc: linuxppc-dev

tree/branch: https://git.kernel.org/pub/scm/linux/kernel/git/powerpc/linux.git fixes-test
branch HEAD: 791f9e36599d94af5a76d3f74d04e16326761aae  powerpc/vdso: Make sure vdso_wrapper.o is rebuilt everytime vdso.so is rebuilt

elapsed time: 723m

configs tested: 176
configs skipped: 2

The following configs have been built successfully.
More configs may be tested in the coming days.

gcc tested configs:
arm                                 defconfig
arm64                            allyesconfig
arm64                               defconfig
arm                              allyesconfig
arm                              allmodconfig
riscv                            allmodconfig
x86_64                           allyesconfig
i386                             allyesconfig
riscv                            allyesconfig
powerpc                     powernv_defconfig
mips                      malta_kvm_defconfig
m68k                        mvme16x_defconfig
powerpc                      ppc40x_defconfig
mips                         tb0226_defconfig
powerpc                 mpc8540_ads_defconfig
mips                         bigsur_defconfig
sh                             sh03_defconfig
powerpc                      katmai_defconfig
arm                         assabet_defconfig
arc                          axs103_defconfig
ia64                             allmodconfig
m68k                         amcore_defconfig
m68k                       bvme6000_defconfig
arm                       spear13xx_defconfig
powerpc                     ppa8548_defconfig
sh                          polaris_defconfig
sh                         ap325rxa_defconfig
sh                          urquell_defconfig
mips                        bcm47xx_defconfig
arm                            mps2_defconfig
powerpc                          g5_defconfig
arm                        mini2440_defconfig
sh                            migor_defconfig
arm                     eseries_pxa_defconfig
m68k                            q40_defconfig
um                           x86_64_defconfig
powerpc                      acadia_defconfig
sh                 kfr2r09-romimage_defconfig
sh                          sdk7780_defconfig
powerpc                     ep8248e_defconfig
powerpc                   bluestone_defconfig
sh                          rsk7269_defconfig
sh                           se7751_defconfig
mips                        omega2p_defconfig
arm                        mvebu_v7_defconfig
um                            kunit_defconfig
powerpc                      ppc64e_defconfig
arm                         lpc32xx_defconfig
m68k                        m5272c3_defconfig
h8300                            alldefconfig
powerpc                      chrp32_defconfig
arc                 nsimosci_hs_smp_defconfig
powerpc                     taishan_defconfig
mips                             allmodconfig
arm                          ep93xx_defconfig
nds32                            alldefconfig
arm                       netwinder_defconfig
mips                         mpc30x_defconfig
powerpc                 mpc836x_mds_defconfig
xtensa                  nommu_kc705_defconfig
sh                           se7712_defconfig
powerpc                     tqm8555_defconfig
arm                         mv78xx0_defconfig
xtensa                          iss_defconfig
arm                          pxa910_defconfig
sh                           se7705_defconfig
mips                     decstation_defconfig
arm                        multi_v5_defconfig
arm                         nhk8815_defconfig
powerpc                      tqm8xx_defconfig
arm                             rpc_defconfig
sparc64                             defconfig
powerpc                 mpc834x_mds_defconfig
powerpc                      ep88xc_defconfig
parisc                generic-32bit_defconfig
sh                           sh2007_defconfig
arm                         hackkit_defconfig
arm                          moxart_defconfig
arm                           stm32_defconfig
sh                            hp6xx_defconfig
mips                           ip22_defconfig
sh                   sh7724_generic_defconfig
arm                      jornada720_defconfig
arc                        nsim_700_defconfig
arc                           tb10x_defconfig
ia64                                defconfig
ia64                             allyesconfig
m68k                             allmodconfig
m68k                                defconfig
m68k                             allyesconfig
nios2                               defconfig
arc                              allyesconfig
nds32                             allnoconfig
nds32                               defconfig
nios2                            allyesconfig
csky                                defconfig
alpha                               defconfig
alpha                            allyesconfig
xtensa                           allyesconfig
h8300                            allyesconfig
arc                                 defconfig
sh                               allmodconfig
parisc                              defconfig
s390                             allyesconfig
s390                             allmodconfig
parisc                           allyesconfig
s390                                defconfig
sparc                            allyesconfig
sparc                               defconfig
i386                                defconfig
mips                             allyesconfig
powerpc                          allyesconfig
powerpc                          allmodconfig
powerpc                           allnoconfig
i386                 randconfig-a006-20210404
i386                 randconfig-a003-20210404
i386                 randconfig-a001-20210404
i386                 randconfig-a004-20210404
i386                 randconfig-a005-20210404
i386                 randconfig-a002-20210404
i386                 randconfig-a006-20210403
i386                 randconfig-a003-20210403
i386                 randconfig-a001-20210403
i386                 randconfig-a004-20210403
i386                 randconfig-a002-20210403
i386                 randconfig-a005-20210403
x86_64               randconfig-a014-20210403
x86_64               randconfig-a015-20210403
x86_64               randconfig-a011-20210403
x86_64               randconfig-a013-20210403
x86_64               randconfig-a012-20210403
x86_64               randconfig-a016-20210403
i386                 randconfig-a014-20210403
i386                 randconfig-a011-20210403
i386                 randconfig-a016-20210403
i386                 randconfig-a012-20210403
i386                 randconfig-a013-20210403
i386                 randconfig-a015-20210403
i386                 randconfig-a014-20210404
i386                 randconfig-a016-20210404
i386                 randconfig-a011-20210404
i386                 randconfig-a012-20210404
i386                 randconfig-a015-20210404
i386                 randconfig-a013-20210404
x86_64               randconfig-a004-20210404
x86_64               randconfig-a003-20210404
x86_64               randconfig-a005-20210404
x86_64               randconfig-a001-20210404
x86_64               randconfig-a002-20210404
x86_64               randconfig-a006-20210404
riscv                    nommu_k210_defconfig
riscv                    nommu_virt_defconfig
riscv                             allnoconfig
riscv                               defconfig
riscv                          rv32_defconfig
um                               allmodconfig
um                                allnoconfig
um                               allyesconfig
um                                  defconfig
x86_64                    rhel-8.3-kselftests
x86_64                              defconfig
x86_64                               rhel-8.3
x86_64                      rhel-8.3-kbuiltin
x86_64                                  kexec

clang tested configs:
x86_64               randconfig-a004-20210403
x86_64               randconfig-a005-20210403
x86_64               randconfig-a003-20210403
x86_64               randconfig-a001-20210403
x86_64               randconfig-a002-20210403
x86_64               randconfig-a006-20210403
x86_64               randconfig-a014-20210404
x86_64               randconfig-a015-20210404
x86_64               randconfig-a013-20210404
x86_64               randconfig-a011-20210404
x86_64               randconfig-a012-20210404
x86_64               randconfig-a016-20210404

---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org

^ permalink raw reply

* [powerpc:merge] BUILD SUCCESS 571b0d1ccf5cd3dc1b9866a908769ee23f7d127e
From: kernel test robot @ 2021-04-04  0:06 UTC (permalink / raw)
  To: Michael Ellerman; +Cc: linuxppc-dev

tree/branch: https://git.kernel.org/pub/scm/linux/kernel/git/powerpc/linux.git merge
branch HEAD: 571b0d1ccf5cd3dc1b9866a908769ee23f7d127e  Automatic merge of 'fixes' into merge (2021-04-03 20:47)

elapsed time: 721m

configs tested: 103
configs skipped: 2

The following configs have been built successfully.
More configs may be tested in the coming days.

gcc tested configs:
arm                                 defconfig
arm64                            allyesconfig
arm64                               defconfig
arm                              allyesconfig
arm                              allmodconfig
x86_64                           allyesconfig
riscv                            allmodconfig
i386                             allyesconfig
riscv                            allyesconfig
sh                             sh03_defconfig
powerpc                          g5_defconfig
powerpc                      katmai_defconfig
arm                        mini2440_defconfig
sh                            migor_defconfig
s390                       zfcpdump_defconfig
ia64                          tiger_defconfig
powerpc                  storcenter_defconfig
arm                         s5pv210_defconfig
arm                          ep93xx_defconfig
sh                          sdk7780_defconfig
powerpc                      ppc64e_defconfig
arm                         lpc32xx_defconfig
m68k                        m5272c3_defconfig
h8300                            alldefconfig
nds32                            alldefconfig
arm                       netwinder_defconfig
mips                         mpc30x_defconfig
powerpc                 mpc836x_mds_defconfig
xtensa                  nommu_kc705_defconfig
powerpc                      tqm8xx_defconfig
sh                 kfr2r09-romimage_defconfig
arm                             rpc_defconfig
sparc64                             defconfig
powerpc                 mpc834x_mds_defconfig
ia64                             allmodconfig
ia64                                defconfig
ia64                             allyesconfig
m68k                             allmodconfig
m68k                                defconfig
m68k                             allyesconfig
nios2                               defconfig
arc                              allyesconfig
nds32                             allnoconfig
nds32                               defconfig
nios2                            allyesconfig
csky                                defconfig
alpha                               defconfig
alpha                            allyesconfig
xtensa                           allyesconfig
h8300                            allyesconfig
arc                                 defconfig
sh                               allmodconfig
parisc                              defconfig
s390                             allyesconfig
s390                             allmodconfig
parisc                           allyesconfig
s390                                defconfig
sparc                            allyesconfig
sparc                               defconfig
i386                                defconfig
mips                             allyesconfig
mips                             allmodconfig
powerpc                          allyesconfig
powerpc                          allmodconfig
powerpc                           allnoconfig
i386                 randconfig-a006-20210403
i386                 randconfig-a003-20210403
i386                 randconfig-a001-20210403
i386                 randconfig-a004-20210403
i386                 randconfig-a002-20210403
i386                 randconfig-a005-20210403
x86_64               randconfig-a014-20210403
x86_64               randconfig-a015-20210403
x86_64               randconfig-a011-20210403
x86_64               randconfig-a013-20210403
x86_64               randconfig-a012-20210403
x86_64               randconfig-a016-20210403
i386                 randconfig-a014-20210403
i386                 randconfig-a011-20210403
i386                 randconfig-a016-20210403
i386                 randconfig-a012-20210403
i386                 randconfig-a013-20210403
i386                 randconfig-a015-20210403
riscv                    nommu_k210_defconfig
riscv                    nommu_virt_defconfig
riscv                             allnoconfig
riscv                               defconfig
riscv                          rv32_defconfig
um                               allmodconfig
um                                allnoconfig
um                               allyesconfig
um                                  defconfig
x86_64                    rhel-8.3-kselftests
x86_64                              defconfig
x86_64                               rhel-8.3
x86_64                      rhel-8.3-kbuiltin
x86_64                                  kexec

clang tested configs:
x86_64               randconfig-a003-20210403
x86_64               randconfig-a001-20210403
x86_64               randconfig-a002-20210403
x86_64               randconfig-a004-20210403
x86_64               randconfig-a005-20210403
x86_64               randconfig-a006-20210403

---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org

^ permalink raw reply


This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox