Re: [PATCH RFC v1 01/12] mm/memory_hotplug: Don't allow to online/offline memory blocks with holes

2019-10-23 Thread Anshuman Khandual
On 10/22/2019 10:42 PM, David Hildenbrand wrote: > Our onlining/offlining code is unnecessarily complicated. Only memory > blocks added during boot can have holes. Hotplugged memory never has > holes. That memory is already online. Why hot plugged memory at runtime cannot have holes (e.g a semi

[PATCH v9 8/8] powerpc/ima: update ima arch policy to check for blacklist

2019-10-23 Thread Nayna Jain
This patch updates the arch-specific policies for PowerNV system to make sure that the binary hash is not blacklisted. Signed-off-by: Nayna Jain Reviewed-by: Mimi Zohar --- arch/powerpc/kernel/ima_arch.c | 8 1 file changed, 4 insertions(+), 4 deletions(-) diff --git

[PATCH v9 7/8] ima: check against blacklisted hashes for files with modsig

2019-10-23 Thread Nayna Jain
Asymmetric private keys are used to sign multiple files. The kernel currently support checking against blacklisted keys. However, if the public key is blacklisted, any file signed by the blacklisted key will automatically fail signature verification. We might not want to blacklist all the files

[PATCH v9 6/8] certs: add wrapper function to check blacklisted binary hash

2019-10-23 Thread Nayna Jain
The -EKEYREJECTED error returned by existing is_hash_blacklisted() is misleading when called for checking against blacklisted hash of a binary. This patch adds a wrapper function is_binary_blacklisted() to return -EPERM error if binary is blacklisted. Signed-off-by: Nayna Jain Reviewed-by: Mimi

[PATCH v9 5/8] ima: make process_buffer_measurement() generic

2019-10-23 Thread Nayna Jain
process_buffer_measurement() is limited to measuring the kexec boot command line. This patch makes process_buffer_measurement() more generic, allowing it to measure other types of buffer data (e.g. blacklisted binary hashes or key hashes). process_buffer_measurement() may be called directly from

[PATCH v9 4/8] powerpc/ima: define trusted boot policy

2019-10-23 Thread Nayna Jain
This patch defines an arch-specific trusted boot only policy and a combined secure and trusted boot policy. Signed-off-by: Nayna Jain --- arch/powerpc/kernel/ima_arch.c | 33 - 1 file changed, 32 insertions(+), 1 deletion(-) diff --git

[PATCH v9 3/8] powerpc: detect the trusted boot state of the system

2019-10-23 Thread Nayna Jain
While secure boot permits only properly verified signed kernels to be booted, trusted boot calculates the file hash of the kernel image and stores the measurement prior to boot, that can be subsequently compared against good known values via attestation services. This patch reads the trusted boot

[PATCH v9 2/8] powerpc/ima: add support to initialize ima policy rules

2019-10-23 Thread Nayna Jain
PowerNV system use a Linux-based bootloader, which relies on the IMA subsystem to enforce different secure boot modes. Since the verification policy may differ based on the secure boot mode of the system, the policies must be defined at runtime. This patch implements arch-specific support to

[PATCH v9 1/8] powerpc: detect the secure boot mode of the system

2019-10-23 Thread Nayna Jain
This patch defines a function to detect the secure boot state of a PowerNV system. The PPC_SECURE_BOOT config represents the base enablement of secure boot for powerpc. Signed-off-by: Nayna Jain --- arch/powerpc/Kconfig | 10 arch/powerpc/include/asm/secure_boot.h |

[PATCH v9 0/8] powerpc: Enabling IMA arch specific secure boot policies

2019-10-23 Thread Nayna Jain
This patchset extends the previous version[1] by adding support for checking against a blacklist of binary hashes. The IMA subsystem supports custom, built-in, arch-specific policies to define the files to be measured and appraised. These policies are honored based on priority, where

Re: [PATCH v7 3/3] soc: fsl: add RCPM driver

2019-10-23 Thread kbuild test robot
Hi Ran, Thank you for the patch! Perhaps something to improve: [auto build test WARNING on linus/master] [cannot apply to v5.4-rc4 next-20191023] [if your patch is applied to the wrong git tree, please drop us a note to help improve the system. BTW, we also suggest to use '--base' option

RE: [PATCH v9 3/3] soc: fsl: add RCPM driver

2019-10-23 Thread Ran Wang
Hi Leo, On Thursday, October 24, 2019 06:48, Li Yang wrote: > > On Wed, Oct 23, 2019 at 3:24 AM Ran Wang wrote: > > > > The NXP's QorIQ Processors based on ARM Core have RCPM module > > Actually not just ARM based QorIQ processors are having RCPM, PowerPC based > QorIQ SoCs also have RCPM.

Re: [PATCH] powerpc/boot: Fix the initrd being overwritten under qemu

2019-10-23 Thread Alexey Kardashevskiy
On 24/10/2019 12:31, Alexey Kardashevskiy wrote: > > > On 23/10/2019 22:21, Segher Boessenkool wrote: >> On Wed, Oct 23, 2019 at 12:36:35PM +1100, Oliver O'Halloran wrote: >>> When booting under OF the zImage expects the initrd address and size to be >>> passed to it using registers r3 and

Re: [PATCH] powerpc/boot: Fix the initrd being overwritten under qemu

2019-10-23 Thread Alexey Kardashevskiy
On 23/10/2019 22:21, Segher Boessenkool wrote: > On Wed, Oct 23, 2019 at 12:36:35PM +1100, Oliver O'Halloran wrote: >> When booting under OF the zImage expects the initrd address and size to be >> passed to it using registers r3 and r4. SLOF (guest firmware used by QEMU) >> currently doesn't do

[PATCH] powerpc/tools: Don't quote $objdump in scripts

2019-10-23 Thread Michael Ellerman
Some of our scripts are passed $objdump and then call it as "$objdump". This doesn't work if it contains spaces because we're using ccache, for example you get errors such as: ./arch/powerpc/tools/relocs_check.sh: line 48: ccache ppc64le-objdump: No such file or directory

Re: [PATCH v9 3/3] soc: fsl: add RCPM driver

2019-10-23 Thread Li Yang
On Wed, Oct 23, 2019 at 3:24 AM Ran Wang wrote: > > The NXP's QorIQ Processors based on ARM Core have RCPM module Actually not just ARM based QorIQ processors are having RCPM, PowerPC based QorIQ SoCs also have RCPM. Does this driver also work with the PowerPC SoCs? Please clarify in the

Re: [PATCH RFC v1 00/12] mm: Don't mark hotplugged pages PG_reserved (including ZONE_DEVICE)

2019-10-23 Thread David Hildenbrand
On 23.10.19 21:39, Dan Williams wrote: > On Wed, Oct 23, 2019 at 10:28 AM David Hildenbrand wrote: >> I dislike this for three reasons a) It does not protect against any races, really, it does not improve things. b) We do have the exact same problem with

Re: [PATCH RFC v1 00/12] mm: Don't mark hotplugged pages PG_reserved (including ZONE_DEVICE)

2019-10-23 Thread Dan Williams
On Wed, Oct 23, 2019 at 10:28 AM David Hildenbrand wrote: > > >> I dislike this for three reasons > >> > >> a) It does not protect against any races, really, it does not improve > >> things. > >> b) We do have the exact same problem with pfn_to_online_page(). As long as > >> we > >>don't

Re: [PATCH RFC v1 00/12] mm: Don't mark hotplugged pages PG_reserved (including ZONE_DEVICE)

2019-10-23 Thread David Hildenbrand
>> I dislike this for three reasons >> >> a) It does not protect against any races, really, it does not improve things. >> b) We do have the exact same problem with pfn_to_online_page(). As long as we >>don't hold the memory hotplug lock, memory can get offlined and remove >> any time. Racy.

Re: [PATCH RFC v1 00/12] mm: Don't mark hotplugged pages PG_reserved (including ZONE_DEVICE)

2019-10-23 Thread Dan Williams
On Wed, Oct 23, 2019 at 12:26 AM David Hildenbrand wrote: > > On 22.10.19 23:54, Dan Williams wrote: > > Hi David, > > > > Thanks for tackling this! > > Thanks for having a look :) > > [...] > > > >> I am probably a little bit too careful (but I don't want to break things). > >> In most places

Re: [PATCH RFC v1 02/12] mm/usercopy.c: Prepare check_page_span() for PG_reserved changes

2019-10-23 Thread David Hildenbrand
On 23.10.19 18:25, Kees Cook wrote: > On Wed, Oct 23, 2019 at 10:20:14AM +0200, David Hildenbrand wrote: >> On 22.10.19 19:12, David Hildenbrand wrote: >>> Right now, ZONE_DEVICE memory is always set PG_reserved. We want to >>> change that. >>> >>> Let's make sure that the logic in the function

Re: [PATCH RFC v1 02/12] mm/usercopy.c: Prepare check_page_span() for PG_reserved changes

2019-10-23 Thread Kees Cook
On Wed, Oct 23, 2019 at 10:20:14AM +0200, David Hildenbrand wrote: > On 22.10.19 19:12, David Hildenbrand wrote: > > Right now, ZONE_DEVICE memory is always set PG_reserved. We want to > > change that. > > > > Let's make sure that the logic in the function won't change. Once we no > > longer set

RE: [PATCH v9 1/3] PM: wakeup: Add routine to help fetch wakeup source object.

2019-10-23 Thread Leo Li
> -Original Message- > From: Ran Wang > Sent: Wednesday, October 23, 2019 4:53 AM > To: Rafael J. Wysocki > Cc: Rafael J . Wysocki ; Rob Herring > ; Leo Li ; Mark Rutland > ; Pavel Machek ; Anson Huang > ; Biwen Li ; Len Brown > ; Greg Kroah-Hartman > ; linuxppc-dev

Re: [PATCH] ASoC: fsl_asrc: refine the setting of internal clock divider

2019-10-23 Thread Nicolin Chen
On Wed, Oct 23, 2019 at 06:25:20AM +, S.j. Wang wrote: > > On Thu, Oct 17, 2019 at 02:21:08PM +0800, Shengjiu Wang wrote: > > > For P2P output, the output divider should align with the output sample > > > > I think we should avoid "P2P" (or "M2M") keyword in the mainline code as > > we know

Re: [PATCH] ASoC: fsl_esai: Add spin lock to protect reset and stop

2019-10-23 Thread Nicolin Chen
On Wed, Oct 23, 2019 at 03:29:49PM +0800, Shengjiu Wang wrote: > xrun may happen at the end of stream, the > trigger->fsl_esai_trigger_stop maybe called in the middle of > fsl_esai_hw_reset, this may cause esai in wrong state > after stop, and there may be endless xrun interrupt. What about

[PATCH] powerpc/fadump: Remove duplicate message.

2019-10-23 Thread Michal Suchanek
There is duplicate message about lack of support by firmware in fadump_reserve_mem and setup_fadump. Due to different capitalization it is clear that the one in setup_fadump is shown on boot. Remove the duplicate that is not shown. Signed-off-by: Michal Suchanek --- arch/powerpc/kernel/fadump.c

Re: Onboard SD card doesn't work anymore after the 'mmc-v5.4-2' updates

2019-10-23 Thread Russell King - ARM Linux admin
On Wed, Oct 23, 2019 at 08:52:33AM -0500, Rob Herring wrote: > > I think this should have been done the other way around and default to > > coherent since most traditional OF platforms are coherent, and you > > can't just require those DTs to change. > > You can blame me. This was really only

Re: Onboard SD card doesn't work anymore after the 'mmc-v5.4-2' updates

2019-10-23 Thread Russell King - ARM Linux admin
On Wed, Oct 23, 2019 at 08:52:33AM -0500, Rob Herring wrote: > On Wed, Oct 23, 2019 at 1:41 AM Benjamin Herrenschmidt > wrote: > > > > On Wed, 2019-10-23 at 16:42 +1100, Michael Ellerman wrote: > > > > > > Right, it seems of_dma_is_coherent() has baked in the assumption that > > > devices are

Re: Onboard SD card doesn't work anymore after the 'mmc-v5.4-2' updates

2019-10-23 Thread Christian Zigotzky
Hello, The patch below works. I compiled the RC4 of kernel 5.4 with this patch today and the onboard SD card works without any problems. Thanks! Christian > On 23. Oct 2019, at 07:42, Michael Ellerman wrote: > > Russell King - ARM Linux admin writes: >>> On Tue, Oct 15, 2019 at 03:12:49PM

Re: Onboard SD card doesn't work anymore after the 'mmc-v5.4-2' updates

2019-10-23 Thread Rob Herring
On Wed, Oct 23, 2019 at 1:41 AM Benjamin Herrenschmidt wrote: > > On Wed, 2019-10-23 at 16:42 +1100, Michael Ellerman wrote: > > > > Right, it seems of_dma_is_coherent() has baked in the assumption that > > devices are non-coherent unless explicitly marked as coherent. > > > > Which is wrong on

[RESEND][PATCH] powerpc/pseries: Use correct event modifier in rtas_parse_epow_errlog()

2019-10-23 Thread YueHaibing
rtas_parse_epow_errlog() should pass 'modifier' to handle_system_shutdown, because event modifier only use bottom 4 bits. Reviewed-by: Tyrel Datwyler Signed-off-by: YueHaibing --- arch/powerpc/platforms/pseries/ras.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git

[PATCH -next] powerpc/spufs: remove set but not used variable 'ctx'

2019-10-23 Thread YueHaibing
arch/powerpc/platforms/cell/spufs/inode.c:201:22: warning: variable ctx set but not used [-Wunused-but-set-variable] It is not used since commit 67cba9fd6456 ("move spu_forget() into spufs_rmdir()") Signed-off-by: YueHaibing --- arch/powerpc/platforms/cell/spufs/inode.c | 2 -- 1 file

[PATCH] powerpc/85xx: remove mostly pointless mpc85xx_qe_init()

2019-10-23 Thread Rasmus Villemoes
Since commit 302c059f2e7b (QE: use subsys_initcall to init qe), mpc85xx_qe_init() has done nothing apart from possibly emitting a pr_err(). As part of reducing the amount of QE-related code in arch/powerpc/ (and eventually support QE on other architectures), remove this low-hanging fruit.

Re: [PATCH] powerpc/boot: Fix the initrd being overwritten under qemu

2019-10-23 Thread Oliver O'Halloran
On Wed, Oct 23, 2019 at 10:21 PM Segher Boessenkool wrote: > > On Wed, Oct 23, 2019 at 12:36:35PM +1100, Oliver O'Halloran wrote: > > When booting under OF the zImage expects the initrd address and size to be > > passed to it using registers r3 and r4. SLOF (guest firmware used by QEMU) > >

Re: [PATCH] powerpc/boot: Fix the initrd being overwritten under qemu

2019-10-23 Thread Segher Boessenkool
On Wed, Oct 23, 2019 at 12:36:35PM +1100, Oliver O'Halloran wrote: > When booting under OF the zImage expects the initrd address and size to be > passed to it using registers r3 and r4. SLOF (guest firmware used by QEMU) > currently doesn't do this so the zImage is not aware of the initrd >

Re: [PATCH RFC v1 02/12] mm/usercopy.c: Prepare check_page_span() for PG_reserved changes

2019-10-23 Thread David Hildenbrand
On 22.10.19 19:12, David Hildenbrand wrote: Right now, ZONE_DEVICE memory is always set PG_reserved. We want to change that. Let's make sure that the logic in the function won't change. Once we no longer set these pages to reserved, we can rework this function to perform separate checks for

Re: [PATCH RFC v1 06/12] staging/gasket: Prepare gasket_release_page() for PG_reserved changes

2019-10-23 Thread David Hildenbrand
On 22.10.19 19:12, David Hildenbrand wrote: Right now, ZONE_DEVICE memory is always set PG_reserved. We want to change that. The pages are obtained via get_user_pages_fast(). I assume, these could be ZONE_DEVICE pages. Let's just exclude them as well explicitly. Cc: Rob Springer Cc: Todd

Re: [PATCH RFC v1 00/12] mm: Don't mark hotplugged pages PG_reserved (including ZONE_DEVICE)

2019-10-23 Thread David Hildenbrand
On 22.10.19 23:54, Dan Williams wrote: > Hi David, > > Thanks for tackling this! Thanks for having a look :) [...] >> I am probably a little bit too careful (but I don't want to break things). >> In most places (besides KVM and vfio that are nuts), the >> pfn_to_online_page() check could most

RE: [PATCH v9 1/3] PM: wakeup: Add routine to help fetch wakeup source object.

2019-10-23 Thread Ran Wang
Hi Rafael, On Wednesday, October 23, 2019 17:07, Rafael J. Wysocki wrote: > > On Wed, Oct 23, 2019 at 10:24 AM Ran Wang wrote: > > > > Some user might want to go through all registered wakeup sources and > > doing things accordingly. For example, SoC PM driver might need to do > > HW

RE: [PATCH v9 3/3] soc: fsl: add RCPM driver

2019-10-23 Thread Ran Wang
Hi Rafael, On Wednesday, October 23, 2019 17:12, Rafael J. Wysocki wrote: > > On Wed, Oct 23, 2019 at 10:24 AM Ran Wang wrote: > > > > The NXP's QorIQ Processors based on ARM Core have RCPM module (Run > > Control and Power Management), which performs system level tasks > > associated with

Re: [PATCH v9 1/3] PM: wakeup: Add routine to help fetch wakeup source object.

2019-10-23 Thread Rafael J. Wysocki
On Wed, Oct 23, 2019 at 10:24 AM Ran Wang wrote: > > Some user might want to go through all registered wakeup sources > and doing things accordingly. For example, SoC PM driver might need to > do HW programming to prevent powering down specific IP which wakeup > source depending on. So add this

Re: [PATCH v9 3/3] soc: fsl: add RCPM driver

2019-10-23 Thread Rafael J. Wysocki
On Wed, Oct 23, 2019 at 10:24 AM Ran Wang wrote: > > The NXP's QorIQ Processors based on ARM Core have RCPM module > (Run Control and Power Management), which performs system level > tasks associated with power management such as wakeup source control. > > This driver depends on PM wakeup source

[PATCH v9 2/3] Documentation: dt: binding: fsl: Add 'little-endian' and update Chassis define

2019-10-23 Thread Ran Wang
By default, QorIQ SoC's RCPM register block is Big Endian. But there are some exceptions, such as LS1088A and LS2088A, are Little Endian. So add this optional property to help identify them. Actually LS2021A and other Layerscapes won't totally follow Chassis 2.1, so separate them from powerpc

[PATCH v9 1/3] PM: wakeup: Add routine to help fetch wakeup source object.

2019-10-23 Thread Ran Wang
Some user might want to go through all registered wakeup sources and doing things accordingly. For example, SoC PM driver might need to do HW programming to prevent powering down specific IP which wakeup source depending on. So add this API to help walk through all registered wakeup source objects

[PATCH v9 3/3] soc: fsl: add RCPM driver

2019-10-23 Thread Ran Wang
The NXP's QorIQ Processors based on ARM Core have RCPM module (Run Control and Power Management), which performs system level tasks associated with power management such as wakeup source control. This driver depends on PM wakeup source framework which help to collect wake information.

[PATCH] ASoC: fsl_esai: Add spin lock to protect reset and stop

2019-10-23 Thread Shengjiu Wang
xrun may happen at the end of stream, the trigger->fsl_esai_trigger_stop maybe called in the middle of fsl_esai_hw_reset, this may cause esai in wrong state after stop, and there may be endless xrun interrupt. So Add spin lock to lock these two function. Fixes: 7ccafa2b3879 ("ASoC: fsl_esai:

Re: [PATCH 3/7] soc: fsl: qe: avoid ppc-specific io accessors

2019-10-23 Thread Rasmus Villemoes
On 22/10/2019 17.01, Christophe Leroy wrote: > > > On 10/18/2019 12:52 PM, Rasmus Villemoes wrote: >> In preparation for allowing to build QE support for architectures >> other than PPC, replace the ppc-specific io accessors. Done via >> > > This patch is not transparent in terms of

Re: [PATCH] powerpc/boot: Fix the initrd being overwritten under qemu

2019-10-23 Thread Alexey Kardashevskiy
On 23/10/2019 12:36, Oliver O'Halloran wrote: > When booting under OF the zImage expects the initrd address and size to be > passed to it using registers r3 and r4. SLOF (guest firmware used by QEMU) > currently doesn't do this so the zImage is not aware of the initrd > location. This can

Re: Onboard SD card doesn't work anymore after the 'mmc-v5.4-2' updates

2019-10-23 Thread Benjamin Herrenschmidt
On Wed, 2019-10-23 at 16:42 +1100, Michael Ellerman wrote: > > Right, it seems of_dma_is_coherent() has baked in the assumption that > devices are non-coherent unless explicitly marked as coherent. > > Which is wrong on all or at least most existing powerpc systems > according to Ben. This is

Re: [PATCH] ASoC: fsl_asrc: refine the setting of internal clock divider

2019-10-23 Thread S.j. Wang
Hi > > On Thu, Oct 17, 2019 at 02:21:08PM +0800, Shengjiu Wang wrote: > > For P2P output, the output divider should align with the output sample > > I think we should avoid "P2P" (or "M2M") keyword in the mainline code as > we know M2M will never get merged while somebody working with the >