[PATCH] powerpc: Perform a bounds check in arch_add_memory

2019-08-26 Thread Alastair D'Silva
From: Alastair D'Silva It is possible for firmware to allocate memory ranges outside the range of physical memory that we support (MAX_PHYSMEM_BITS). This patch adds a bounds check to ensure that any hotplugged memory is addressable. Signed-off-by: Alastair D'Silva --- arch/powerpc/mm/mem.c

Re: [PATCH kernel v2 4/4] powerpc/powernv/ioda: Remove obsolete iommu_table_ops::exchange callbacks

2019-08-26 Thread Michael Ellerman
Alexey Kardashevskiy writes: > As now we have xchg_no_kill/tce_kill, these are not used anymore so > remove them. > > Signed-off-by: Alexey Kardashevskiy > --- > arch/powerpc/include/asm/iommu.h | 10 - > arch/powerpc/kernel/iommu.c | 26 +--- >

[PATCH] ASoC: imx-audmix: register the card on a proper dev

2019-08-26 Thread Shengjiu Wang
This platform device is registered from "fsl_audmix", which is its parent device. If use pdev->dev.parent for the priv->card.dev, the value set by dev_set_drvdata in parent device will be covered by the value in child device. Fixes: b86ef5367761 ("ASoC: fsl: Add Audio Mixer machine driver")

[PATCH 4/4] powerpc/64: system call implement the bulk of the logic in C

2019-08-26 Thread Nicholas Piggin
System call entry and particularly exit code is beyond the limit of what is reasonable to implement in asm. This conversion moves all conditional branches out of the asm code, except a relatively simple test to see whether all GPRs should be restored at exit time. Null syscall test is about 5%

[PATCH 3/4] powerpc/64: system call remove non-volatile GPR save optimisation

2019-08-26 Thread Nicholas Piggin
powerpc has an optimisation where interrupts avoid saving the non-volatile (or callee saved) registers to the interrupt stack frame if they are not required. Two problems with this are that an interrupt does not always know whether it will need non-volatiles; and if it does need them, they can

[PATCH 2/4] powerpc/64s: remove support for kernel-mode syscalls

2019-08-26 Thread Nicholas Piggin
There is support for the kernel to execute the 'sc 0' instruction and make a system call to itself. This is a relic that is unused in the tree, therefore untested. It's also highly questionable for modules to be doing this. Signed-off-by: Nicholas Piggin --- arch/powerpc/kernel/entry_64.S

[PATCH 2/4] powerpc/64: remove support for kernel-mode syscalls

2019-08-26 Thread Nicholas Piggin
There is support for the kernel to execute the 'sc 0' instruction and make a system call to itself. This is a relic that is unused in the tree, therefore untested. It's also highly questionable for modules to be doing this. Signed-off-by: Nicholas Piggin --- arch/powerpc/kernel/entry_64.S

[PATCH 1/4] powerpc: convert to copy_thread_tls

2019-08-26 Thread Nicholas Piggin
Commit 3033f14ab78c3 ("clone: support passing tls argument via C rather than pt_regs magic") introduced the HAVE_COPY_THREAD_TLS option. Use it to avoid a subtle assumption about the argument ordering of clone type syscalls. Signed-off-by: Nicholas Piggin --- arch/powerpc/Kconfig | 1 +

[PATCH 0/4] powerpc/64: syscalls in C

2019-08-26 Thread Nicholas Piggin
This hasn't been highly stress tested or tested all cases (like 32-bit binaries, single stepping, etc.) but so far it's running stable doing normal kernel development and microbenchmarks. Thanks, Nick Nicholas Piggin (4): powerpc: convert to copy_thread_tls powerpc/64: remove support for

Re: [PATCH v3] powerpc/fadump: sysfs for fadump memory reservation

2019-08-26 Thread Michael Ellerman
Hari Bathini writes: > On 26/08/19 4:14 PM, Sourabh Jain wrote: >> On 8/26/19 3:46 PM, Sourabh Jain wrote: >>> On 8/26/19 3:29 PM, Hari Bathini wrote: On 10/08/19 11:29 PM, Sourabh Jain wrote: > Add a sys interface to allow querying the memory reserved by > fadump for saving the

Re: [PATCH] powerpc/time: use feature fixup in __USE_RTC() instead of cpu feature.

2019-08-26 Thread Michael Ellerman
Christophe Leroy writes: > Le 26/08/2019 à 13:41, Michael Ellerman a écrit : >> Christophe Leroy writes: >>> sched_clock(), used by printk(), calls __USE_RTC() to know >>> whether to use realtime clock or timebase. >>> >>> __USE_RTC() uses cpu_has_feature() which is initialised by >>>

Re: [PATCH] powerpc/time: use feature fixup in __USE_RTC() instead of cpu feature.

2019-08-26 Thread Michael Ellerman
Benjamin Herrenschmidt writes: > On Mon, 2019-08-26 at 21:41 +1000, Michael Ellerman wrote: >> Christophe Leroy writes: >> > sched_clock(), used by printk(), calls __USE_RTC() to know >> > whether to use realtime clock or timebase. >> > >> > __USE_RTC() uses cpu_has_feature() which is

Re: [PATCH v2] btrfs: fix allocation of bitmap pages.

2019-08-26 Thread Michael Ellerman
David Sterba writes: > On Mon, Aug 26, 2019 at 06:40:24PM +0300, Nikolay Borisov wrote: >> >> Link: https://bugzilla.kernel.org/show_bug.cgi?id=204371 >> >> Fixes: 69d2480456d1 ("btrfs: use copy_page for copying pages instead of >> >> memcpy") >> >> Cc: sta...@vger.kernel.org >> >>

Re: [PATCH v2] powerpc: Allow flush_(inval_)dcache_range to work across ranges >4GB

2019-08-26 Thread Michael Ellerman
"Alastair D'Silva" writes: > From: Alastair D'Silva > > The upstream commit: > 22e9c88d486a ("powerpc/64: reuse PPC32 static inline flush_dcache_range()") > has a similar effect, but since it is a rewrite of the assembler to C, is > too invasive for stable. This patch is a minimal fix to

Re: [PATCH v6 00/12] implement KASLR for powerpc/fsl_booke/32

2019-08-26 Thread Michael Ellerman
Jason Yan writes: > A polite ping :) > > What else should I do now? That's a good question. Scott, are you still maintaining FSL bits, and if so any comments? Or should I take this. cheers > On 2019/8/19 14:12, Jason Yan wrote: >> Hi Michael, >> >> Is there anything more I should do to get

Re: [PATCH v12 00/11] Appended signatures support for IMA appraisal

2019-08-26 Thread Thiago Jung Bauermann
Hello Jordan, Jordan Hand writes: > On 6/27/19 7:19 PM, Thiago Jung Bauermann wrote: >> On the OpenPOWER platform, secure boot and trusted boot are being >> implemented using IMA for taking measurements and verifying signatures. >> Since the kernel image on Power servers is an ELF binary,

Re: [PATCH v6 00/12] implement KASLR for powerpc/fsl_booke/32

2019-08-26 Thread Jason Yan
A polite ping :) What else should I do now? Thanks On 2019/8/19 14:12, Jason Yan wrote: Hi Michael, Is there anything more I should do to get this feature meeting the requirements of the mainline? Thanks, Jason On 2019/8/9 18:07, Jason Yan wrote: This series implements KASLR for

Re: [PATCH kernel v2 2/4] KVM: PPC: Invalidate multiple TCEs at once

2019-08-26 Thread Paul Mackerras
On Mon, Aug 26, 2019 at 04:17:03PM +1000, Alexey Kardashevskiy wrote: > Invalidating a TCE cache entry for each updated TCE is quite expensive. > This makes use of the new iommu_table_ops::xchg_no_kill()/tce_kill() > callbacks to bring down the time spent in mapping a huge guest DMA window; >

Re: [PATCH v12 00/11] Appended signatures support for IMA appraisal

2019-08-26 Thread Jordan Hand
On 6/27/19 7:19 PM, Thiago Jung Bauermann wrote: > On the OpenPOWER platform, secure boot and trusted boot are being > implemented using IMA for taking measurements and verifying signatures. > Since the kernel image on Power servers is an ELF binary, kernels are > signed using the

Re: [PATCH RESEND v11 7/8] open: openat2(2) syscall

2019-08-26 Thread sbaugh
Aleksa Sarai writes: > To this end, we introduce the openat2(2) syscall. It provides all of the > features of openat(2) through the @how->flags argument, but also > also provides a new @how->resolve argument which exposes RESOLVE_* flags > that map to our new LOOKUP_* flags. It also eliminates

Re: [PATCH v2] btrfs: fix allocation of bitmap pages.

2019-08-26 Thread Nikolay Borisov
On 26.08.19 г. 18:37 ч., David Sterba wrote: > On Wed, Aug 21, 2019 at 03:05:55PM +, Christophe Leroy wrote: >> Various notifications of type "BUG kmalloc-4096 () : Redzone >> overwritten" have been observed recently in various parts of >> the kernel. After some time, it has been made a

Re: [PATCH] powerpc: Avoid clang warnings around setjmp and longjmp

2019-08-26 Thread Nathan Chancellor
On Sun, Aug 11, 2019 at 07:32:15PM -0700, Nathan Chancellor wrote: > Commit aea447141c7e ("powerpc: Disable -Wbuiltin-requires-header when > setjmp is used") disabled -Wbuiltin-requires-header because of a warning > about the setjmp and longjmp declarations. > > r367387 in clang added another

Re: [PATCH 01/11] ftrace: move recordmcount tools to scripts/ftrace

2019-08-26 Thread Steven Rostedt
On Sun, 25 Aug 2019 21:23:20 +0800 Changbin Du wrote: > Move ftrace tools to its own directory. We will add another tool later. > > Cc: John F. Reiser > Signed-off-by: Changbin Du > --- > scripts/.gitignore | 1 - > scripts/Makefile | 2 +- >

Re: [PATCH 05/11] ftrace: create memcache for hash entries

2019-08-26 Thread Changbin Du
On Mon, Aug 26, 2019 at 09:44:37AM +0200, Peter Zijlstra wrote: > On Sun, Aug 25, 2019 at 09:23:24PM +0800, Changbin Du wrote: > > When CONFIG_FTRACE_FUNC_PROTOTYPE is enabled, thousands of > > ftrace_func_entry instances are created. So create a dedicated > > memcache to enhance performance. > >

Re: [PATCH 03/11] asm-generic: add generic dwarf definition

2019-08-26 Thread Changbin Du
Hi, Peter, On Mon, Aug 26, 2019 at 09:42:15AM +0200, Peter Zijlstra wrote: > On Sun, Aug 25, 2019 at 09:23:22PM +0800, Changbin Du wrote: > > Add generic DWARF constant definitions. We will use it later. > > > > Signed-off-by: Changbin Du > > --- > > include/asm-generic/dwarf.h | 199

Re: [PATCH] bpf: handle 32-bit zext during constant blinding

2019-08-26 Thread Daniel Borkmann
On 8/21/19 9:23 PM, Naveen N. Rao wrote: Since BPF constant blinding is performed after the verifier pass, the ALU32 instructions inserted for doubleword immediate loads don't have a corresponding zext instruction. This is causing a kernel oops on powerpc and can be reproduced by running

Re: [PATCH v2] powerpc: Allow flush_(inval_)dcache_range to work across ranges >4GB

2019-08-26 Thread Christophe Leroy
Le 26/08/2019 à 18:50, Greg Kroah-Hartman a écrit : On Wed, Aug 21, 2019 at 10:19:27AM +1000, Alastair D'Silva wrote: From: Alastair D'Silva The upstream commit: 22e9c88d486a ("powerpc/64: reuse PPC32 static inline flush_dcache_range()") has a similar effect, but since it is a rewrite of

Re: [PATCH v2] powerpc: Allow flush_(inval_)dcache_range to work across ranges >4GB

2019-08-26 Thread Greg Kroah-Hartman
On Wed, Aug 21, 2019 at 10:19:27AM +1000, Alastair D'Silva wrote: > From: Alastair D'Silva > > The upstream commit: > 22e9c88d486a ("powerpc/64: reuse PPC32 static inline flush_dcache_range()") > has a similar effect, but since it is a rewrite of the assembler to C, is > too invasive for stable.

Re: [PATCH v2] btrfs: fix allocation of bitmap pages.

2019-08-26 Thread David Sterba
On Mon, Aug 26, 2019 at 06:40:24PM +0300, Nikolay Borisov wrote: > >> Link: https://bugzilla.kernel.org/show_bug.cgi?id=204371 > >> Fixes: 69d2480456d1 ("btrfs: use copy_page for copying pages instead of > >> memcpy") > >> Cc: sta...@vger.kernel.org > >> Signed-off-by: Christophe Leroy > >> ---

Re: [PATCH v3 2/4] powerpc: expose secure variables to userspace via sysfs

2019-08-26 Thread Greg Kroah-Hartman
On Mon, Aug 26, 2019 at 11:46:11AM -0400, Nayna wrote: > > > On 08/26/2019 10:56 AM, Greg Kroah-Hartman wrote: > > On Mon, Aug 26, 2019 at 09:23:36AM -0400, Nayna Jain wrote: > > > +static struct kobj_attribute size_attr = __ATTR_RO(size); > > Wait, why not just normal ATTR_RO()? > > Oh!!

[PATCH 6/6] powerpc/32: don't use CPU_FTR_COHERENT_ICACHE

2019-08-26 Thread Christophe Leroy
Only 601 and E200 have CPU_FTR_COHERENT_ICACHE. Just use #ifdefs instead of feature fixup. Signed-off-by: Christophe Leroy --- arch/powerpc/kernel/misc_32.S | 21 - 1 file changed, 12 insertions(+), 9 deletions(-) diff --git a/arch/powerpc/kernel/misc_32.S

[PATCH 5/6] powerpc/32: drop CPU_FTR_UNIFIED_ID_CACHE

2019-08-26 Thread Christophe Leroy
Only 601 and e200 have unified I/D cache. Drop the feature and use CONFIG_PPC_BOOK3S_601 and CONFIG_E200. Signed-off-by: Christophe Leroy --- arch/powerpc/include/asm/cputable.h | 5 ++--- arch/powerpc/kernel/misc_32.S | 4 ++-- arch/powerpc/kernel/setup_32.c | 2 +- 3 files

[PATCH 4/6] powerpc/32s: use CONFIG_PPC_BOOK3S_601 instead of reading PVR

2019-08-26 Thread Christophe Leroy
Use CONFIG_PPC_BOOK3S_601 instead of reading PVR to know if it is a 601 or not. Signed-off-by: Christophe Leroy --- arch/powerpc/kernel/head_32.S | 49 +++ arch/powerpc/kernel/misc_32.S | 6 ++ 2 files changed, 24 insertions(+), 31 deletions(-) diff

[PATCH 3/6] powerpc/32s: drop CPU_FTR_USE_RTC feature

2019-08-26 Thread Christophe Leroy
CPU_FTR_USE_RTC feature only applies to powerpc601. Drop this feature and replace it with tests on CONFIG_PPC_BOOK3S_601. Signed-off-by: Christophe Leroy --- arch/powerpc/include/asm/cputable.h | 3 +-- arch/powerpc/include/asm/time.h | 6 +- arch/powerpc/kernel/vdso.c

[PATCH 2/6] powerpc/32s: get rid of CPU_FTR_601 feature

2019-08-26 Thread Christophe Leroy
Now that 601 is exclusive from other 6xx, CPU_FTR_601 and associated fixups are useless. Drop this feature and use #ifdefs instead. Signed-off-by: Christophe Leroy --- arch/powerpc/configs/pmac32_defconfig | 1 - arch/powerpc/include/asm/cputable.h | 14 --

[PATCH 1/6] powerpc/32s: add an option to exclusively select powerpc 601

2019-08-26 Thread Christophe Leroy
Powerpc 601 is rather old powerpc which as some important limitations compared to other book3s/32 powerpcs: - No Timebase. - Common BATs for instruction and data. - No execution protection in segment registers. - No RI bit in MSR - ... It is starting to be difficult and cumbersome to maintain

Re: [PATCH v3 2/4] powerpc: expose secure variables to userspace via sysfs

2019-08-26 Thread Nayna
On 08/26/2019 10:56 AM, Greg Kroah-Hartman wrote: On Mon, Aug 26, 2019 at 09:23:36AM -0400, Nayna Jain wrote: +static struct kobj_attribute size_attr = __ATTR_RO(size); Wait, why not just normal ATTR_RO()? Oh!! Sorry. I am not seeing this macro in sysfs.h. am I missing something ?

Re: [PATCH v2] btrfs: fix allocation of bitmap pages.

2019-08-26 Thread David Sterba
On Wed, Aug 21, 2019 at 03:05:55PM +, Christophe Leroy wrote: > Various notifications of type "BUG kmalloc-4096 () : Redzone > overwritten" have been observed recently in various parts of > the kernel. After some time, it has been made a relation with > the use of BTRFS filesystem. > > [

[PATCH] sysfs: add BIN_ATTR_WO() macro

2019-08-26 Thread Greg Kroah-Hartman
This variant was missing from sysfs.h, I guess no one noticed it before. Turns out the powerpc secure variable code can use it, so add it to the tree for it, and potentially others to take advantage of, instead of open-coding it. Reported-by: Nayna Jain Signed-off-by: Greg Kroah-Hartman ---

Re: [PATCH v3 2/4] powerpc: expose secure variables to userspace via sysfs

2019-08-26 Thread Greg Kroah-Hartman
On Mon, Aug 26, 2019 at 09:23:36AM -0400, Nayna Jain wrote: > +static struct kobj_attribute size_attr = __ATTR_RO(size); Wait, why not just normal ATTR_RO()? > +static struct bin_attribute data_attr = __BIN_ATTR_RO(data, > VARIABLE_MAX_SIZE); And BIN_ATTR_RO() here? Do those not work for you

Re: [PATCH v2 2/4] powerpc: expose secure variables to userspace via sysfs

2019-08-26 Thread Nayna
On 08/22/2019 01:18 AM, Oliver O'Halloran wrote: On Wed, 2019-08-21 at 11:08 -0400, Nayna Jain wrote: PowerNV secure variables, which store the keys used for OS kernel verification, are managed by the firmware. These secure variables need to be accessed by the userspace for addition/deletion

Re: [PATCH v2 2/4] powerpc: expose secure variables to userspace via sysfs

2019-08-26 Thread Nayna
On 08/21/2019 12:30 PM, Greg Kroah-Hartman wrote: On Wed, Aug 21, 2019 at 11:08:21AM -0400, Nayna Jain wrote: --- /dev/null +++ b/Documentation/ABI/testing/sysfs-secvar @@ -0,0 +1,27 @@ +What: /sys/firmware/secvar +Date: August 2019 +Contact: Nayna Jain +Description: +

Re: [PATCH v3 2/4] powerpc: expose secure variables to userspace via sysfs

2019-08-26 Thread Nayna
On 08/26/2019 10:01 AM, Greg Kroah-Hartman wrote: On Mon, Aug 26, 2019 at 09:23:36AM -0400, Nayna Jain wrote: +static struct bin_attribute update_attr = { + .attr = {.name = "update", .mode = 0200}, + .size = VARIABLE_MAX_SIZE, + .write = update_write, +}; Ah, do we need a

Re: [PATCH v3 2/4] powerpc: expose secure variables to userspace via sysfs

2019-08-26 Thread Greg Kroah-Hartman
On Mon, Aug 26, 2019 at 09:23:36AM -0400, Nayna Jain wrote: > +static struct bin_attribute update_attr = { > + .attr = {.name = "update", .mode = 0200}, > + .size = VARIABLE_MAX_SIZE, > + .write = update_write, > +}; Ah, do we need a __BIN_ATTR_WO() macro for you? That would make

Re: [PATCH] powerpc/time: use feature fixup in __USE_RTC() instead of cpu feature.

2019-08-26 Thread Christophe Leroy
Le 26/08/2019 à 15:25, Benjamin Herrenschmidt a écrit : On Mon, 2019-08-26 at 21:41 +1000, Michael Ellerman wrote: Christophe Leroy writes: sched_clock(), used by printk(), calls __USE_RTC() to know whether to use realtime clock or timebase. __USE_RTC() uses cpu_has_feature() which is

[PATCH 6/6] MIPS: document mixing "slightly different CCAs"

2019-08-26 Thread Christoph Hellwig
Based on an email from Paul Burton, quoting section 4.8 "Cacheability and Coherency Attributes and Access Types" of "MIPS Architecture Volume 1: Introduction to the MIPS32 Architecture" (MD00080, revision 6.01). Signed-off-by: Christoph Hellwig --- arch/mips/Kconfig | 7 +++ 1 file changed,

[PATCH 5/6] arm64: document the choice of page attributes for pgprot_dmacoherent

2019-08-26 Thread Christoph Hellwig
Based on an email from Will Deacon. Signed-off-by: Christoph Hellwig Acked-by: Will Deacon Acked-by: Mark Rutland --- arch/arm64/include/asm/pgtable.h | 8 1 file changed, 8 insertions(+) diff --git a/arch/arm64/include/asm/pgtable.h b/arch/arm64/include/asm/pgtable.h index

[PATCH 4/6] dma-mapping: make dma_atomic_pool_init self-contained

2019-08-26 Thread Christoph Hellwig
The memory allocated for the atomic pool needs to have the same mapping attributes that we use for remapping, so use pgprot_dmacoherent instead of open coding it. Also deduct a suitable zone to allocate the memory from based on the presence of the DMA zones. Signed-off-by: Christoph Hellwig ---

[PATCH 3/6] dma-mapping: remove arch_dma_mmap_pgprot

2019-08-26 Thread Christoph Hellwig
arch_dma_mmap_pgprot is used for two things: 1) to override the "normal" uncached page attributes for mapping memory coherent to devices that can't snoop the CPU caches 2) to provide the special DMA_ATTR_WRITE_COMBINE semantics on older arm systems and some mips platforms Replace one

[PATCH 2/6] arm-nommu: remove the unused pgprot_dmacoherent define

2019-08-26 Thread Christoph Hellwig
Signed-off-by: Christoph Hellwig --- arch/arm/include/asm/pgtable-nommu.h | 1 - 1 file changed, 1 deletion(-) diff --git a/arch/arm/include/asm/pgtable-nommu.h b/arch/arm/include/asm/pgtable-nommu.h index 0b1f6799a32e..d0de24f06724 100644 --- a/arch/arm/include/asm/pgtable-nommu.h +++

[PATCH 1/6] unicore32: remove the unused pgprot_dmacoherent define

2019-08-26 Thread Christoph Hellwig
Signed-off-by: Christoph Hellwig --- arch/unicore32/include/asm/pgtable.h | 2 -- 1 file changed, 2 deletions(-) diff --git a/arch/unicore32/include/asm/pgtable.h b/arch/unicore32/include/asm/pgtable.h index 9492aa304f03..126e961a8cb0 100644 --- a/arch/unicore32/include/asm/pgtable.h +++

cleanup the dma_pgprot handling v2

2019-08-26 Thread Christoph Hellwig
Hi all, this series replaces the arch_dma_mmap_pgprot hooks with the simpler pgprot_dmacoherent as used by the arm code already and cleans up various bits around that area. Changes since v1: - improve the new arm64 comment - keep the special DMA_ATTR_WRITE_COMBINE handling for mips and

Re: [PATCH] powerpc/time: use feature fixup in __USE_RTC() instead of cpu feature.

2019-08-26 Thread Benjamin Herrenschmidt
On Mon, 2019-08-26 at 21:41 +1000, Michael Ellerman wrote: > Christophe Leroy writes: > > sched_clock(), used by printk(), calls __USE_RTC() to know > > whether to use realtime clock or timebase. > > > > __USE_RTC() uses cpu_has_feature() which is initialised by > > machine_init(). Before

[PATCH v3 4/4] powerpc: load firmware trusted keys/hashes into kernel keyring

2019-08-26 Thread Nayna Jain
The keys used to verify the Host OS kernel are managed by firmware as secure variables. This patch loads the verification keys into the .platform keyring and revocation hashes into .blacklist keyring. This enables verification and loading of the kernels signed by the boot time keys which are

[PATCH v3 3/4] x86/efi: move common keyring handler functions to new file

2019-08-26 Thread Nayna Jain
The handlers to add the keys to the .platform keyring and blacklisted hashes to the .blacklist keyring is common for both the uefi and powerpc mechanisms of loading the keys/hashes from the firmware. This patch moves the common code from load_uefi.c to keyring_handler.c Signed-off-by: Nayna Jain

[PATCH v3 2/4] powerpc: expose secure variables to userspace via sysfs

2019-08-26 Thread Nayna Jain
PowerNV secure variables, which store the keys used for OS kernel verification, are managed by the firmware. These secure variables need to be accessed by the userspace for addition/deletion of the certificates. This patch adds the sysfs interface to expose secure variables for PowerNV

[PATCH v3 1/4] powerpc/powernv: Add OPAL API interface to access secure variable

2019-08-26 Thread Nayna Jain
The X.509 certificates trusted by the platform and required to secure boot the OS kernel are wrapped in secure variables, which are controlled by OPAL. This patch adds firmware/kernel interface to read and write OPAL secure variables based on the unique key. This support can be enabled using

[PATCH v3 0/4] powerpc: expose secure variables to the kernel and userspace

2019-08-26 Thread Nayna Jain
In order to verify the OS kernel on PowerNV systems, secure boot requires X.509 certificates trusted by the platform. These are stored in secure variables controlled by OPAL, called OPAL secure variables. In order to enable users to manage the keys, the secure variables need to be exposed to

Re: [RFC V2 0/1] mm/debug: Add tests for architecture exported page table helpers

2019-08-26 Thread Matthew Wilcox
On Mon, Aug 26, 2019 at 08:07:13AM +0530, Anshuman Khandual wrote: > On 08/09/2019 07:22 PM, Matthew Wilcox wrote: > > On Fri, Aug 09, 2019 at 04:05:07PM +0530, Anshuman Khandual wrote: > >> On 08/09/2019 03:46 PM, Matthew Wilcox wrote: > >>> On Fri, Aug 09, 2019 at 01:03:17PM +0530, Anshuman

Re: 5.2.7 kernel doesn't boot on G5

2019-08-26 Thread Mathieu Malaterre
Christian, On Fri, Aug 16, 2019 at 4:52 PM Christian Marillat wrote: > > On 16 août 2019 16:05, Andreas Schwab wrote: > > > On Aug 16 2019, Christian Marillat wrote: > > > >> On 15 août 2019 19:50, christophe leroy wrote: > >> > >> [...] > >> > >>> Can you test with latest stable version, ie

Re: [PATCH] KVM: PPC: Book3S: Enable XIVE native capability only if OPAL has required functions

2019-08-26 Thread Cédric Le Goater
On 26/08/2019 10:14, Paul Mackerras wrote: > There are some POWER9 machines where the OPAL firmware does not support > the OPAL_XIVE_GET_QUEUE_STATE and OPAL_XIVE_SET_QUEUE_STATE calls. > The impact of this is that a guest using XIVE natively will not be able > to be migrated successfully. On the

Re: [PATCH] powerpc/time: use feature fixup in __USE_RTC() instead of cpu feature.

2019-08-26 Thread Segher Boessenkool
On Mon, Aug 26, 2019 at 09:41:39PM +1000, Michael Ellerman wrote: > Given how many 601 users there are, maybe 1?, I think that would be a > simpler option and avoids complicating the code / binary for everyone > else. Or you could remove 601 support altogether? Segher

Re: [PATCH] powerpc/time: use feature fixup in __USE_RTC() instead of cpu feature.

2019-08-26 Thread Christophe Leroy
Le 26/08/2019 à 13:41, Michael Ellerman a écrit : Christophe Leroy writes: sched_clock(), used by printk(), calls __USE_RTC() to know whether to use realtime clock or timebase. __USE_RTC() uses cpu_has_feature() which is initialised by machine_init(). Before machine_init(), __USE_RTC()

[PATCH] PCI: hotplug: Remove surplus return from a void function

2019-08-26 Thread Krzysztof Wilczynski
Remove unnecessary empty return statement at the end of a void function in the following: - drivers/pci/hotplug/cpci_hotplug_core.c: cleanup_slots() - drivers/pci/hotplug/cpqphp_core.c: pci_print_IRQ_route() - drivers/pci/hotplug/cpqphp_ctrl.c: cpqhp_pushbutton_thread() -

Re: [PATCH] powerpc/time: use feature fixup in __USE_RTC() instead of cpu feature.

2019-08-26 Thread Michael Ellerman
Christophe Leroy writes: > sched_clock(), used by printk(), calls __USE_RTC() to know > whether to use realtime clock or timebase. > > __USE_RTC() uses cpu_has_feature() which is initialised by > machine_init(). Before machine_init(), __USE_RTC() returns true, > leading to a program check

Re: [PATCH v2 09/11] dma-direct: turn ARCH_ZONE_DMA_BITS into a variable

2019-08-26 Thread Michael Ellerman
Nicolas Saenz Julienne writes: > diff --git a/arch/powerpc/include/asm/page.h b/arch/powerpc/include/asm/page.h > index 0d52f57fca04..73668a21ae78 100644 > --- a/arch/powerpc/include/asm/page.h > +++ b/arch/powerpc/include/asm/page.h > @@ -319,13 +319,4 @@ struct vm_area_struct; > #endif /*

Re: [PATCH v3] powerpc/fadump: sysfs for fadump memory reservation

2019-08-26 Thread Hari Bathini
On 26/08/19 4:14 PM, Sourabh Jain wrote: > > > On 8/26/19 3:46 PM, Sourabh Jain wrote: >> >> >> On 8/26/19 3:29 PM, Hari Bathini wrote: >>> >>> >>> On 10/08/19 11:29 PM, Sourabh Jain wrote: Add a sys interface to allow querying the memory reserved by fadump for saving the crash

[PATCH] powerpc/prom: convert PROM_BUG() to standard trap

2019-08-26 Thread Christophe Leroy
Prior to commit 1bd98d7fbaf5 ("ppc64: Update BUG handling based on ppc32"), BUG() family was using BUG_ILLEGAL_INSTRUCTION which was an invalid instruction opcode to trap into program check exception. That commit converted them to using standard trap instructions, but prom/prom_init and their

Re: [PATCH v3] powerpc/fadump: sysfs for fadump memory reservation

2019-08-26 Thread Sourabh Jain
On 8/26/19 3:46 PM, Sourabh Jain wrote: > > > On 8/26/19 3:29 PM, Hari Bathini wrote: >> >> >> On 10/08/19 11:29 PM, Sourabh Jain wrote: >>> Add a sys interface to allow querying the memory reserved by >>> fadump for saving the crash dump. >>> >>> Add an ABI doc entry for new sysfs interface.

Re: [PATCH v3] powerpc/fadump: sysfs for fadump memory reservation

2019-08-26 Thread Sourabh Jain
On 8/26/19 3:29 PM, Hari Bathini wrote: > > > On 10/08/19 11:29 PM, Sourabh Jain wrote: >> Add a sys interface to allow querying the memory reserved by >> fadump for saving the crash dump. >> >> Add an ABI doc entry for new sysfs interface. >>- /sys/kernel/fadump_mem_reserved >> >>

Re: [powerpc]WARN : arch/powerpc/platforms/powernv/smp.c:160

2019-08-26 Thread Sachin Sant
> On 26-Aug-2019, at 2:39 PM, Gautham R Shenoy wrote: > >> c0055198] start_secondary+0x638/0x680 >> [ 40.285680] [c007f5527f90] [c000ac5c] >> start_secondary_prolog+0x10/0x14 >> [ 40.285680] Instruction dump: >> [ 40.285681] fb61ffd8 fb81ffe0 fba1ffe8 fbc1fff0

[PATCH v2 6/6] mm/memory_hotplug: Pass nid instead of zone to __remove_pages()

2019-08-26 Thread David Hildenbrand
The zone parameter is no longer in use. Replace it with the nid, which we can now use the nid to limit the number of zones we have to process (vie for_each_zone_nid()). The function signature of __remove_pages() now looks much more similar to the one of __add_pages(). Cc: Catalin Marinas Cc:

Re: [PATCH v3] powerpc/fadump: sysfs for fadump memory reservation

2019-08-26 Thread Hari Bathini
On 10/08/19 11:29 PM, Sourabh Jain wrote: > Add a sys interface to allow querying the memory reserved by > fadump for saving the crash dump. > > Add an ABI doc entry for new sysfs interface. >- /sys/kernel/fadump_mem_reserved > > Signed-off-by: Sourabh Jain > --- > Changelog: > v1 -> v2:

RE: [PATCH v2 08/10] PCI: layerscape: Add EP mode support for ls1088a and ls2088a

2019-08-26 Thread Xiaowei Bao
> -Original Message- > From: Andrew Murray > Sent: 2019年8月23日 22:28 > To: Xiaowei Bao > Cc: bhelg...@google.com; robh...@kernel.org; mark.rutl...@arm.com; > shawn...@kernel.org; Leo Li ; kis...@ti.com; > lorenzo.pieral...@arm.co; a...@arndb.de; gre...@linuxfoundation.org; M.h. > Lian ;

Re: [PATCH] KVM: PPC: Book3S: Enable XIVE native capability only if OPAL has required functions

2019-08-26 Thread David Gibson
On Mon, Aug 26, 2019 at 06:14:55PM +1000, Paul Mackerras wrote: > There are some POWER9 machines where the OPAL firmware does not support > the OPAL_XIVE_GET_QUEUE_STATE and OPAL_XIVE_SET_QUEUE_STATE calls. > The impact of this is that a guest using XIVE natively will not be able > to be migrated

Re: [powerpc]WARN : arch/powerpc/platforms/powernv/smp.c:160

2019-08-26 Thread Gautham R Shenoy
Hello Sachin, On Sat, Aug 24, 2019 at 09:34:41PM +0530, Sachin Sant wrote: > linux-next is currently broken on POWER8 non virtualized. Kernel > fails to reach login prompt with following kernel warning > repeatedly shown during boot. > > The problem dates back atleast till next-20190816. > >

[PATCH] KVM: PPC: Book3S: Enable XIVE native capability only if OPAL has required functions

2019-08-26 Thread Paul Mackerras
There are some POWER9 machines where the OPAL firmware does not support the OPAL_XIVE_GET_QUEUE_STATE and OPAL_XIVE_SET_QUEUE_STATE calls. The impact of this is that a guest using XIVE natively will not be able to be migrated successfully. On the source side, the get_attr operation on the KVM

Re: [PATCH 05/11] ftrace: create memcache for hash entries

2019-08-26 Thread Peter Zijlstra
On Sun, Aug 25, 2019 at 09:23:24PM +0800, Changbin Du wrote: > When CONFIG_FTRACE_FUNC_PROTOTYPE is enabled, thousands of > ftrace_func_entry instances are created. So create a dedicated > memcache to enhance performance. > > Signed-off-by: Changbin Du > --- > kernel/trace/ftrace.c | 17

Re: [PATCH 03/11] asm-generic: add generic dwarf definition

2019-08-26 Thread Peter Zijlstra
On Sun, Aug 25, 2019 at 09:23:22PM +0800, Changbin Du wrote: > Add generic DWARF constant definitions. We will use it later. > > Signed-off-by: Changbin Du > --- > include/asm-generic/dwarf.h | 199 > 1 file changed, 199 insertions(+) > create mode 100644

Re: [PATCH v2 09/11] dma-direct: turn ARCH_ZONE_DMA_BITS into a variable

2019-08-26 Thread Christoph Hellwig
Looks good, Reviewed-by: Christoph Hellwig

[PATCH] powerpc/time: use feature fixup in __USE_RTC() instead of cpu feature.

2019-08-26 Thread Christophe Leroy
sched_clock(), used by printk(), calls __USE_RTC() to know whether to use realtime clock or timebase. __USE_RTC() uses cpu_has_feature() which is initialised by machine_init(). Before machine_init(), __USE_RTC() returns true, leading to a program check exception on CPUs not having realtime clock.

Re: [PATCH] bpf: handle 32-bit zext during constant blinding

2019-08-26 Thread Naveen N. Rao
Jiong Wang wrote: Naveen N. Rao writes: Since BPF constant blinding is performed after the verifier pass, the ALU32 instructions inserted for doubleword immediate loads don't have a corresponding zext instruction. This is causing a kernel oops on powerpc and can be reproduced by running

[PATCH v4 1/2] powerpc/powernv: Enhance opal message read interface

2019-08-26 Thread Vasant Hegde
Use "opal-msg-size" device tree property to allocate memory for "opal_msg". Cc: Mahesh Salgaonkar Cc: Jeremy Kerr Signed-off-by: Vasant Hegde --- arch/powerpc/platforms/powernv/opal.c | 32 ++- 1 file changed, 22 insertions(+), 10 deletions(-) diff --git

[PATCH v4 2/2] powerpc/powernv: Add new opal message type

2019-08-26 Thread Vasant Hegde
We have OPAL_MSG_PRD message type to pass prd related messages from OPAL to `opal-prd`. It can handle messages upto 64 bytes. We have a requirement to send bigger than 64 bytes of data from OPAL to `opal-prd`. Lets add new message type (OPAL_MSG_PRD2) to pass bigger data. Cc: Jeremy Kerr

[PATCH kernel v2 4/4] powerpc/powernv/ioda: Remove obsolete iommu_table_ops::exchange callbacks

2019-08-26 Thread Alexey Kardashevskiy
As now we have xchg_no_kill/tce_kill, these are not used anymore so remove them. Signed-off-by: Alexey Kardashevskiy --- arch/powerpc/include/asm/iommu.h | 10 - arch/powerpc/kernel/iommu.c | 26 +--- arch/powerpc/platforms/powernv/pci-ioda.c | 50

[PATCH kernel v2 3/4] vfio/spapr_tce: Invalidate multiple TCEs at once

2019-08-26 Thread Alexey Kardashevskiy
Invalidating a TCE cache entry for each updated TCE is quite expensive. This makes use of the new iommu_table_ops::xchg_no_kill()/tce_kill() callbacks to bring down the time spent in mapping a huge guest DMA window. Signed-off-by: Alexey Kardashevskiy --- drivers/vfio/vfio_iommu_spapr_tce.c |

[PATCH kernel v2 2/4] KVM: PPC: Invalidate multiple TCEs at once

2019-08-26 Thread Alexey Kardashevskiy
Invalidating a TCE cache entry for each updated TCE is quite expensive. This makes use of the new iommu_table_ops::xchg_no_kill()/tce_kill() callbacks to bring down the time spent in mapping a huge guest DMA window; roughly 20s to 10s for each guest's 100GB of DMA space. Signed-off-by: Alexey

[PATCH kernel v2 0/4] powerpc/powernv/kvm: Invalidate multiple TCEs at once

2019-08-26 Thread Alexey Kardashevskiy
So far TCE cache updates (IOMMU translation cache on POWER8/9 PHB/NPU units) were barely noticeable; however with 100+GB guests we now see RCU stall warnings in guests because we spend too much time in the host system firmware which does actual TCE cache updates, hence this patchset. This is a

[PATCH kernel v2 1/4] powerpc/powernv/ioda: Split out TCE invalidation from TCE updates

2019-08-26 Thread Alexey Kardashevskiy
At the moment updates in a TCE table are made by iommu_table_ops::exchange which update one TCE and invalidates an entry in the PHB/NPU TCE cache via set of registers called "TCE Kill" (hence the naming). Writing a TCE is a simple xchg() but invalidating the TCE cache is a relatively expensive