Re: [PATCH v5 6/6] tpm/kexec: Duplicate TPM measurement log in of-tree for kexec

2022-07-06 Thread kernel test robot
Hi Stefan, Thank you for the patch! Yet something to improve: [auto build test ERROR on 03c765b0e3b4cb5063276b086c76f7a612856a9a] url: https://github.com/intel-lab-lkp/linux/commits/Stefan-Berger/tpm-Preserve-TPM-measurement-log-across-kexec-ppc64/20220706-232658 base

[PATCH] macintosh/windfarm_pid: Add header file macro definition

2022-07-06 Thread Li zeming
I think the header file could avoid redefinition errors. at compile time by adding macro definitions. Signed-off-by: Li zeming --- drivers/macintosh/windfarm_pid.h | 4 1 file changed, 4 insertions(+) diff --git a/drivers/macintosh/windfarm_pid.h b/drivers/macintosh/windfarm_pid.h index

[PATCH] macintosh/ams/ams: Add header file macro definition

2022-07-06 Thread Li zeming
Add header file macro definition. Signed-off-by: Li zeming --- drivers/macintosh/ams/ams.h | 4 1 file changed, 4 insertions(+) diff --git a/drivers/macintosh/ams/ams.h b/drivers/macintosh/ams/ams.h index 935bdd9cd9a6..5ec5547f151b 100644 --- a/drivers/macintosh/ams/ams.h +++

Re: [PATCH 31/36] cpuidle,acpi: Make noinstr clean

2022-07-06 Thread Rafael J. Wysocki
ieu.desnoy...@efficios.com>, Frederic Weisbecker , Len Brown , linux-xte...@linux-xtensa.org, Sascha Hauer , Vasily Gorbik , linux-arm-msm , linux-al...@vger.kernel.org, linux-m68k , Stafford Horne , Linux ARM , Chris Zankel , Stephen Boyd , dingu...@kernel.org, Daniel Bristot de Oliveira ,

Re: [PATCH 20/36] arch/idle: Change arch_cpu_idle() IRQ behaviour

2022-07-06 Thread Rafael J. Wysocki
ieu.desnoy...@efficios.com>, Frederic Weisbecker , Len Brown , linux-xte...@linux-xtensa.org, Sascha Hauer , Vasily Gorbik , linux-arm-msm , linux-al...@vger.kernel.org, linux-m68k , Stafford Horne , Linux ARM , Chris Zankel , Stephen Boyd , dingu...@kernel.org, Daniel Bristot de Oliveira ,

Re: [PATCH 18/36] cpuidle: Annotate poll_idle()

2022-07-06 Thread Rafael J. Wysocki
ieu.desnoy...@efficios.com>, Frederic Weisbecker , Len Brown , linux-xte...@linux-xtensa.org, Sascha Hauer , Vasily Gorbik , linux-arm-msm , linux-al...@vger.kernel.org, linux-m68k , Stafford Horne , Linux ARM , Chris Zankel , Stephen Boyd , dingu...@kernel.org, Daniel Bristot de Oliveira ,

Re: [PATCH 17/36] acpi_idle: Remove tracing

2022-07-06 Thread Rafael J. Wysocki
ieu.desnoy...@efficios.com>, Frederic Weisbecker , Len Brown , linux-xte...@linux-xtensa.org, Sascha Hauer , Vasily Gorbik , linux-arm-msm , linux-al...@vger.kernel.org, linux-m68k , Stafford Horne , Linux ARM , Chris Zankel , Stephen Boyd , dingu...@kernel.org, Daniel Bristot de Oliveira ,

Re: [PATCH 05/36] cpuidle: Move IRQ state validation

2022-07-06 Thread Rafael J. Wysocki
ieu.desnoy...@efficios.com>, Frederic Weisbecker , Len Brown , linux-xte...@linux-xtensa.org, Sascha Hauer , Vasily Gorbik , linux-arm-msm , linux-al...@vger.kernel.org, linux-m68k , Stafford Horne , Linux ARM , Chris Zankel , Stephen Boyd , dingu...@kernel.org, Daniel Bristot de Oliveira ,

Re: [PATCH 03/36] cpuidle/poll: Ensure IRQ state is invariant

2022-07-06 Thread Rafael J. Wysocki
ieu.desnoy...@efficios.com>, Frederic Weisbecker , Len Brown , linux-xte...@linux-xtensa.org, Sascha Hauer , Vasily Gorbik , linux-arm-msm , linux-al...@vger.kernel.org, linux-m68k , Stafford Horne , Linux ARM , Chris Zankel , Stephen Boyd , dingu...@kernel.org, Daniel Bristot de Oliveira ,

Re: [PATCH 19/36] objtool/idle: Validate __cpuidle code as noinstr

2022-07-06 Thread Geert Uytterhoeven
snps-...@lists.infradead.org, mgor...@suse.de, jacob.jun@linux.intel.com, Arnd Bergmann , Hans Ulli Kroll , Vineet Gupta , linux-...@vger.kernel.org, j...@joshtriplett.org, rost...@goodmis.org, r...@vger.kernel.org, b...@alien8.de, bc...@quicinc.com, tsbog...@alpha.franken.de,

Re: [PATCH] random: remove CONFIG_ARCH_RANDOM and "nordrand"

2022-07-06 Thread H. Peter Anvin
On July 6, 2022 5:23:31 AM PDT, Borislav Petkov wrote: >On Tue, Jul 05, 2022 at 04:11:45PM -0700, H. Peter Anvin wrote: >> What I'm wondering is if we shouldn't be simply instrument *every* >> invocation, and set the trust to zero if we ever trip it. > >I guess you can add some logic to

[PATCH AUTOSEL 4.9 3/5] cpufreq: pmac32-cpufreq: Fix refcount leak bug

2022-07-06 Thread Sasha Levin
From: Liang He [ Upstream commit ccd7567d4b6cf187fdfa55f003a9e461ee629e36 ] In pmac_cpufreq_init_MacRISC3(), we need to add corresponding of_node_put() for the three node pointers whose refcount have been incremented by of_find_node_by_name(). Signed-off-by: Liang He Signed-off-by: Viresh

[PATCH AUTOSEL 4.14 4/8] cpufreq: pmac32-cpufreq: Fix refcount leak bug

2022-07-06 Thread Sasha Levin
From: Liang He [ Upstream commit ccd7567d4b6cf187fdfa55f003a9e461ee629e36 ] In pmac_cpufreq_init_MacRISC3(), we need to add corresponding of_node_put() for the three node pointers whose refcount have been incremented by of_find_node_by_name(). Signed-off-by: Liang He Signed-off-by: Viresh

[PATCH AUTOSEL 4.19 4/8] cpufreq: pmac32-cpufreq: Fix refcount leak bug

2022-07-06 Thread Sasha Levin
From: Liang He [ Upstream commit ccd7567d4b6cf187fdfa55f003a9e461ee629e36 ] In pmac_cpufreq_init_MacRISC3(), we need to add corresponding of_node_put() for the three node pointers whose refcount have been incremented by of_find_node_by_name(). Signed-off-by: Liang He Signed-off-by: Viresh

[PATCH AUTOSEL 5.4 4/9] cpufreq: pmac32-cpufreq: Fix refcount leak bug

2022-07-06 Thread Sasha Levin
From: Liang He [ Upstream commit ccd7567d4b6cf187fdfa55f003a9e461ee629e36 ] In pmac_cpufreq_init_MacRISC3(), we need to add corresponding of_node_put() for the three node pointers whose refcount have been incremented by of_find_node_by_name(). Signed-off-by: Liang He Signed-off-by: Viresh

[PATCH AUTOSEL 5.10 05/11] cpufreq: pmac32-cpufreq: Fix refcount leak bug

2022-07-06 Thread Sasha Levin
From: Liang He [ Upstream commit ccd7567d4b6cf187fdfa55f003a9e461ee629e36 ] In pmac_cpufreq_init_MacRISC3(), we need to add corresponding of_node_put() for the three node pointers whose refcount have been incremented by of_find_node_by_name(). Signed-off-by: Liang He Signed-off-by: Viresh

[PATCH AUTOSEL 5.15 09/18] cpufreq: pmac32-cpufreq: Fix refcount leak bug

2022-07-06 Thread Sasha Levin
From: Liang He [ Upstream commit ccd7567d4b6cf187fdfa55f003a9e461ee629e36 ] In pmac_cpufreq_init_MacRISC3(), we need to add corresponding of_node_put() for the three node pointers whose refcount have been incremented by of_find_node_by_name(). Signed-off-by: Liang He Signed-off-by: Viresh

[PATCH AUTOSEL 5.15 02/18] powerpc/xive/spapr: correct bitmap allocation size

2022-07-06 Thread Sasha Levin
From: Nathan Lynch [ Upstream commit 19fc5bb93c6bbdce8292b4d7eed04e2fa118d2fe ] kasan detects access beyond the end of the xibm->bitmap allocation: BUG: KASAN: slab-out-of-bounds in _find_first_zero_bit+0x40/0x140 Read of size 8 at addr c0001d1d0118 by task swapper/0/1 CPU: 0 PID: 1 Comm:

[PATCH AUTOSEL 5.18 11/22] cpufreq: pmac32-cpufreq: Fix refcount leak bug

2022-07-06 Thread Sasha Levin
From: Liang He [ Upstream commit ccd7567d4b6cf187fdfa55f003a9e461ee629e36 ] In pmac_cpufreq_init_MacRISC3(), we need to add corresponding of_node_put() for the three node pointers whose refcount have been incremented by of_find_node_by_name(). Signed-off-by: Liang He Signed-off-by: Viresh

[PATCH AUTOSEL 5.18 02/22] powerpc/xive/spapr: correct bitmap allocation size

2022-07-06 Thread Sasha Levin
From: Nathan Lynch [ Upstream commit 19fc5bb93c6bbdce8292b4d7eed04e2fa118d2fe ] kasan detects access beyond the end of the xibm->bitmap allocation: BUG: KASAN: slab-out-of-bounds in _find_first_zero_bit+0x40/0x140 Read of size 8 at addr c0001d1d0118 by task swapper/0/1 CPU: 0 PID: 1 Comm:

[PATCH v5 5/6] of: kexec: Refactor IMA buffer related functions to make them reusable

2022-07-06 Thread Stefan Berger
Refactor IMA buffer related functions to make them reusable for carrying TPM logs across kexec. Signed-off-by: Stefan Berger Cc: Rob Herring Cc: Frank Rowand Cc: Mimi Zohar --- v5: - Rebased on Jonathan McDowell's commit "b69a2afd5afc x86/kexec: Carry forward IMA measurement log on

[PATCH v5 1/6] of: check previous kernel's ima-kexec-buffer against memory bounds

2022-07-06 Thread Stefan Berger
From: Vaibhav Jain Presently ima_get_kexec_buffer() doesn't check if the previous kernel's ima-kexec-buffer lies outside the addressable memory range. This can result in a kernel panic if the new kernel is booted with 'mem=X' arg and the ima-kexec-buffer was allocated beyond that range by the

[PATCH v5 6/6] tpm/kexec: Duplicate TPM measurement log in of-tree for kexec

2022-07-06 Thread Stefan Berger
The memory area of the TPM measurement log is currently not properly duplicated for carrying it across kexec when an Open Firmware Devicetree is used. Therefore, the contents of the log get corrupted. Fix this for the kexec_file_load() syscall by allocating a buffer and copying the contents of the

[PATCH v5 0/6] tpm: Preserve TPM measurement log across kexec (ppc64)

2022-07-06 Thread Stefan Berger
The of-tree subsystem does not currently preserve the IBM vTPM 1.2 and vTPM 2.0 measurement logs across a kexec on PowerVM and PowerKVM. This series fixes this for the kexec_file_load() syscall using the flattened device tree (fdt) to carry the TPM measurement log's buffer across kexec. Stefan

[PATCH v5 4/6] tpm: of: Make of-tree specific function commonly available

2022-07-06 Thread Stefan Berger
Simplify tpm_read_log_of() by moving reusable parts of the code into an inline function that makes it commonly available so it can be used also for kexec support. Call the new of_tpm_get_sml_parameters() function from the TPM Open Firmware driver. Signed-off-by: Stefan Berger Cc: Jarkko Sakkinen

[PATCH v5 3/6] x86/kexec: Carry forward IMA measurement log on kexec

2022-07-06 Thread Stefan Berger
From: Jonathan McDowell On kexec file load, the Integrity Measurement Architecture (IMA) subsystem may verify the IMA signature of the kernel and initramfs, and measure it. The command line parameters passed to the kernel in the kexec call may also be measured by IMA. A remote attestation

[PATCH v5 2/6] drivers: of: kexec ima: Support 32-bit platforms

2022-07-06 Thread Stefan Berger
From: Palmer Dabbelt RISC-V recently added kexec_file() support, which uses enables kexec IMA. We're the first 32-bit platform to support this, so we found a build bug. Acked-by: Rob Herring Signed-off-by: Palmer Dabbelt Reviewed-by: Mimi Zohar --- drivers/of/kexec.c | 4 ++-- 1 file

Re: [PATCH v4 4/5] of: kexec: Refactor IMA buffer related functions to make them reusable

2022-07-06 Thread Stefan Berger
On 7/6/22 10:00, Jonathan McDowell wrote: On Tue, Jul 05, 2022 at 06:46:54PM -0400, Mimi Zohar wrote: [Cc'ing Borislav Petkov , Jonathan McDowell ] Hi Stefan, On Thu, 2022-06-30 at 22:26 -0400, Stefan Berger wrote: Refactor IMA buffer related functions to make them reusable for carrying

Re: [PATCH] random: remove CONFIG_ARCH_RANDOM and "nordrand"

2022-07-06 Thread Theodore Ts'o
On Tue, Jul 05, 2022 at 09:01:21PM +0200, Jason A. Donenfeld wrote: > Later the thinking evolved. With a properly designed RNG, using RDRAND > values alone won't harm anything, even if the outputs are malicious. I personally think it's totally fine to remove nordrand. However, the reason why it

[PATCH v4] random: remove CONFIG_ARCH_RANDOM

2022-07-06 Thread Jason A. Donenfeld
When RDRAND was introduced, there was much discussion on whether it should be trusted and how the kernel should handle that. Initially, two mechanisms cropped up, CONFIG_ARCH_RANDOM, a compile time switch, and "nordrand", a boot-time switch. Later the thinking evolved. With a properly designed

Re: [PATCH v2] powerpc/mm: Use is_vmalloc_addr to validate addr

2022-07-06 Thread Christophe Leroy
Le 04/07/2022 à 09:55, Christophe Leroy a écrit : Le 04/07/2022 à 09:45, Aneesh Kumar K V a écrit : On 7/4/22 12:43 PM, Christophe Leroy wrote: Le 04/07/2022 à 08:39, Aneesh Kumar K.V a écrit : Instead of high_memory use is_vmalloc_addr to validate that the address is not in the

Re: [PATCH V6 21/26] m68k/mm: Enable ARCH_HAS_VM_GET_PAGE_PROT

2022-07-06 Thread Anshuman Khandual
On 7/6/22 15:33, Geert Uytterhoeven wrote: > Hi Anshuman, > > On Thu, Jun 30, 2022 at 7:19 AM Anshuman Khandual > wrote: >> This enables ARCH_HAS_VM_GET_PAGE_PROT on the platform and exports standard >> vm_get_page_prot() implementation via DECLARE_VM_GET_PAGE_PROT, which looks >> up a

[PATCH v3] random: remove CONFIG_ARCH_RANDOM

2022-07-06 Thread Jason A. Donenfeld
When RDRAND was introduced, there was much discussion on whether it should be trusted and how the kernel should handle that. Initially, two mechanisms cropped up, CONFIG_ARCH_RANDOM, a compile time switch, and "nordrand", a boot-time switch. Later the thinking evolved. With a properly designed

[PATCH 3/5] powerpc/pci: Hide pci_create_OF_bus_map() for non-chrp code

2022-07-06 Thread Pali Rohár
Function pci_create_OF_bus_map() is used only in chrp code. So hide it from all other platforms as it is unsed. Signed-off-by: Pali Rohár --- arch/powerpc/include/asm/pci-bridge.h | 2 ++ arch/powerpc/kernel/pci_32.c | 2 ++ 2 files changed, 4 insertions(+) diff --git

[PATCH 5/5] powerpc/pci: Add config option for using all 256 PCI buses

2022-07-06 Thread Pali Rohár
By default on PPC32 are PCI bus numbers unique across all PCI domains. So system could have only 256 PCI buses independently of available PCI domains. This is due to filling DT property pci-OF-bus-map which does not reflect multi-domain setup. On all powerpc platforms except chrp and powermac

[PATCH 2/5] powerpc/pci: Make pcibios_make_OF_bus_map() static

2022-07-06 Thread Pali Rohár
Function pcibios_make_OF_bus_map() is used only in pci_32.c file. So make it static and do not export out of pci_32.o unit. Signed-off-by: Pali Rohár --- arch/powerpc/kernel/pci_32.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/arch/powerpc/kernel/pci_32.c

[PATCH 4/5] powerpc/pci: Disable filling pci-OF-bus-map for non-chrp/powermac

2022-07-06 Thread Pali Rohár
Creating or filling pci-OF-bus-map property in the device-tree is deprecated since May 2006 [1] and was used only in old platforms like PowerMac. Currently kernel code handles it only for chrp and powermac code. So completely disable filling pci-OF-bus-map property for non-chrp and non-powermac

[PATCH 1/5] powerpc/pci: Hide pci_device_from_OF_node() for non-powermac code

2022-07-06 Thread Pali Rohár
Function pci_device_from_OF_node() is used only in powermac code. So hide it from all other platforms as it is unsed. Signed-off-by: Pali Rohár --- arch/powerpc/include/asm/pci-bridge.h | 2 ++ arch/powerpc/kernel/pci_32.c | 2 ++ arch/powerpc/kernel/pci_64.c | 2 ++ 3 files

[PATCH 0/5] powerpc/pci: Cleanup unused code and enable 256 PCI buses

2022-07-06 Thread Pali Rohár
This patch series cleanup unused code by eliminating it at compile time and then enable usage of all 256 PCI buses per every PCI domain as currently PCI bus numbers have to be unique across all PCI domains. So first bus number of each PCI domain would be zero and not the bus number of the previous

Re: [PATCH] powerpc/pci: Add config option for using OF 'reg' for PCI domain

2022-07-06 Thread Pali Rohár
On Friday 10 June 2022 17:33:32 Michael Ellerman wrote: > Pali Rohár writes: > > Since commit 63a72284b159 ("powerpc/pci: Assign fixed PHB number based on > > device-tree properties"), powerpc kernel always fallback to PCI domain > > assignment from OF / Device Tree 'reg' property of the PCI

[PATCH v2 2/2] powerpc/pci: Prefer PCI domain assignment via DT 'linux,pci-domain' and alias

2022-07-06 Thread Pali Rohár
Other Linux architectures use DT property 'linux,pci-domain' for specifying fixed PCI domain of PCI controller specified in Device-Tree. And lot of Freescale powerpc boards have defined numbered pci alias in Device-Tree for every PCIe controller which number specify preferred PCI domain. So

[PATCH v2 1/2] powerpc/pci: Add config option for using OF 'reg' for PCI domain

2022-07-06 Thread Pali Rohár
Since commit 63a72284b159 ("powerpc/pci: Assign fixed PHB number based on device-tree properties"), powerpc kernel always fallback to PCI domain assignment from OF / Device Tree 'reg' property of the PCI controller. In most cases 'reg' property is not zero and therefore there it cause that PCI

[PATCH] powerpc/fsl-pci: Fix Class Code of PCIe Root Port

2022-07-06 Thread Pali Rohár
By default old pre-3.0 Freescale PCIe controllers reports invalid PCI Class Code 0x0b20 for PCIe Root Port. It can be seen by lspci -b output on P2020 board which has this pre-3.0 controller: $ lspci -bvnn 00:00.0 Power PC [0b20]: Freescale Semiconductor Inc P2020E [1957:0070] (rev 21)

Re: [PATCH V6 26/26] mm/mmap: Drop ARCH_HAS_VM_GET_PAGE_PROT

2022-07-06 Thread Geert Uytterhoeven
On Thu, Jun 30, 2022 at 7:20 AM Anshuman Khandual wrote: > Now all the platforms enable ARCH_HAS_GET_PAGE_PROT. They define and export > own vm_get_page_prot() whether custom or standard DECLARE_VM_GET_PAGE_PROT. > Hence there is no need for default generic fallback for vm_get_page_prot(). > Just

Re: [PATCH V6 21/26] m68k/mm: Enable ARCH_HAS_VM_GET_PAGE_PROT

2022-07-06 Thread Geert Uytterhoeven
Hi Anshuman, On Thu, Jun 30, 2022 at 7:19 AM Anshuman Khandual wrote: > This enables ARCH_HAS_VM_GET_PAGE_PROT on the platform and exports standard > vm_get_page_prot() implementation via DECLARE_VM_GET_PAGE_PROT, which looks > up a private and static protection_map[] array. Subsequently all

Re: [PATCH 6/6] i2c: Make remove callback return void

2022-07-06 Thread Uwe Kleine-König
On Wed, Jul 06, 2022 at 12:13:15PM +0300, Vladimir Oltean wrote: > On Tue, Jun 28, 2022 at 04:03:12PM +0200, Uwe Kleine-König wrote: > > From: Uwe Kleine-König > > > > The value returned by an i2c driver's remove function is mostly ignored. > > (Only an error message is printed if the value is

Re: [PATCH 6/6] i2c: Make remove callback return void

2022-07-06 Thread Vladimir Oltean
On Tue, Jun 28, 2022 at 04:03:12PM +0200, Uwe Kleine-König wrote: > From: Uwe Kleine-König > > The value returned by an i2c driver's remove function is mostly ignored. > (Only an error message is printed if the value is non-zero that the > error is ignored.) > > So change the prototype of the

Re: [PATCH v2] random: remove CONFIG_ARCH_RANDOM

2022-07-06 Thread Heiko Carstens
On Wed, Jul 06, 2022 at 02:32:25AM +0200, Jason A. Donenfeld wrote: > When RDRAND was introduced, there was much discussion on whether it > should be trusted and how the kernel should handle that. Initially, two > mechanisms cropped up, CONFIG_ARCH_RANDOM, a compile time switch, and > "nordrand",

Re: [PATCH V6 00/26] mm/mmap: Drop __SXXX/__PXXX macros from across platforms

2022-07-06 Thread Anshuman Khandual
On 7/6/22 12:34, Arnd Bergmann wrote: > On Wed, Jul 6, 2022 at 8:33 AM Christophe Leroy > wrote: > >> As far as I can see in Kconfig, CONFIG_MMU is user selectable on the >> following architectures: >> - ARM >> - M68K >> - RISCV >> - SH >> >> And is disabled by default on XTENSA. > > Right,

Re: [PATCH V6 00/26] mm/mmap: Drop __SXXX/__PXXX macros from across platforms

2022-07-06 Thread Arnd Bergmann
On Wed, Jul 6, 2022 at 8:33 AM Christophe Leroy wrote: > As far as I can see in Kconfig, CONFIG_MMU is user selectable on the > following architectures: > - ARM > - M68K > - RISCV > - SH > > And is disabled by default on XTENSA. Right, the list is complete, though it's also default-enabled for

Re: [PATCH v2] random: remove CONFIG_ARCH_RANDOM

2022-07-06 Thread Greg Kroah-Hartman
On Wed, Jul 06, 2022 at 02:32:25AM +0200, Jason A. Donenfeld wrote: > When RDRAND was introduced, there was much discussion on whether it > should be trusted and how the kernel should handle that. Initially, two > mechanisms cropped up, CONFIG_ARCH_RANDOM, a compile time switch, and > "nordrand",

Re: [PATCH V6 00/26] mm/mmap: Drop __SXXX/__PXXX macros from across platforms

2022-07-06 Thread Christophe Leroy
Le 06/07/2022 à 07:57, Anshuman Khandual a écrit : > > > On 6/30/22 10:46, Anshuman Khandual wrote: >> __SXXX/__PXXX macros is an unnecessary abstraction layer in creating the >> generic protection_map[] array which is used for vm_get_page_prot(). This >> abstraction layer can be avoided, if