[powerpc:topic/ppc-kvm 5/6] arch/powerpc/kvm/book3s_hv_nestedv2.c:465:29: warning: variable 'amor' set but not used

2023-08-15 Thread kernel test robot
tree: https://git.kernel.org/pub/scm/linux/kernel/git/powerpc/linux.git topic/ppc-kvm head: c95bf4c16099f2ed29a7f6949559bc4187d30710 commit: 6be7fd9b644945c2e4f9f071b9f8caa57f4e5590 [5/6] KVM: PPC: Add support for nestedv2 guests config: powerpc-allmodconfig (https://download.01.org/0day-ci/

[PATCH] treewide: drop CONFIG_EMBEDDED

2023-08-15 Thread Randy Dunlap
There is only one Kconfig user of CONFIG_EMBEDDED and it can be switched to EXPERT or "if !ARCH_MULTIPLATFORM" (suggested by Arnd). Signed-off-by: Randy Dunlap Cc: Russell King Cc: linux-arm-ker...@lists.infradead.org Cc: Arnd Bergmann Cc: Jason A. Donenfeld Cc: wiregu...@lists.zx2c4.com Cc: l

[powerpc:topic/ppc-kvm 4/6] include/linux/kern_levels.h:5:25: warning: format '%d' expects argument of type 'int', but argument 2 has type 'long unsigned int'

2023-08-15 Thread kernel test robot
tree: https://git.kernel.org/pub/scm/linux/kernel/git/powerpc/linux.git topic/ppc-kvm head: c95bf4c16099f2ed29a7f6949559bc4187d30710 commit: adf03dd2204acf7eab000a02bdfe50099f2fa089 [4/6] KVM: PPC: Book3s HV: Hold LPIDs in an unsigned long config: powerpc-allmodconfig (https://download.01.or

Re: [PATCH v2] powerpc/ptrace: Split gpr32_set_common

2023-08-15 Thread Michael Ellerman
Christophe Leroy writes: > objtool report the following warning: > > arch/powerpc/kernel/ptrace/ptrace-view.o: warning: objtool: > gpr32_set_common+0x23c (.text+0x860): redundant UACCESS disable > > gpr32_set_common() conditionnaly opens and closes UACCESS based on > whether kbuf point is NU

[powerpc:topic/ppc-kvm 3/6] arch/powerpc/kvm/guest-state-buffer.c:505: warning: expecting prototype for kvmppc_gsm_init(). Prototype was for kvmppc_gsm_new() instead

2023-08-15 Thread kernel test robot
tree: https://git.kernel.org/pub/scm/linux/kernel/git/powerpc/linux.git topic/ppc-kvm head: c95bf4c16099f2ed29a7f6949559bc4187d30710 commit: 596bda338f11c9d2f860439733e5239100803d6c [3/6] KVM: PPC: Add helper library for Guest State Buffers config: powerpc-allmodconfig (https://download.01.o

Re: [PATCH v3 4/6] KVM: PPC: Book3s HV: Hold LPIDs in an unsigned long

2023-08-15 Thread Jordan Niethe
On 15/8/23 8:45 pm, Michael Ellerman wrote: "Nicholas Piggin" writes: On Mon Aug 7, 2023 at 11:45 AM AEST, Jordan Niethe wrote: The LPID register is 32 bits long. The host keeps the lpids for each guest in an unsigned word struct kvm_arch. Currently, LPIDs are already limited by mmu_lpid_bi

Re: [PATCH v3 2/6] KVM: PPC: Rename accessor generator macros

2023-08-15 Thread Jordan Niethe
On 14/8/23 6:27 pm, Nicholas Piggin wrote: On Mon Aug 7, 2023 at 11:45 AM AEST, Jordan Niethe wrote: More "wrapper" style accessor generating macros will be introduced for the nestedv2 guest support. Rename the existing macros with more descriptive names now so there is a consistent naming co

Re: [PATCH v3 4/6] KVM: PPC: Book3s HV: Hold LPIDs in an unsigned long

2023-08-15 Thread Jordan Niethe
On 14/8/23 6:15 pm, David Laight wrote: From: Jordan Niethe Sent: 07 August 2023 02:46 The LPID register is 32 bits long. The host keeps the lpids for each guest in an unsigned word struct kvm_arch. Currently, LPIDs are already limited by mmu_lpid_bits and KVM_MAX_NESTED_GUESTS_SHIFT. The n

Re: [PATCH v3 4/6] KVM: PPC: Book3s HV: Hold LPIDs in an unsigned long

2023-08-15 Thread Jordan Niethe
On 14/8/23 6:12 pm, Nicholas Piggin wrote: On Mon Aug 7, 2023 at 11:45 AM AEST, Jordan Niethe wrote: The LPID register is 32 bits long. The host keeps the lpids for each guest in an unsigned word struct kvm_arch. Currently, LPIDs are already limited by mmu_lpid_bits and KVM_MAX_NESTED_GUESTS_

Re: [PATCH v3 1/6] KVM: PPC: Use getters and setters for vcpu register state

2023-08-15 Thread Jordan Niethe
On 14/8/23 6:08 pm, Nicholas Piggin wrote: On Mon Aug 7, 2023 at 11:45 AM AEST, Jordan Niethe wrote: There are already some getter and setter functions used for accessing vcpu register state, e.g. kvmppc_get_pc(). There are also more complicated examples that are generated by macros like kvmp

[PATCH] powerpc/eeh: Use pci_dev_id() to simplify the code

2023-08-15 Thread Jialin Zhang
PCI core API pci_dev_id() can be used to get the BDF number for a pci device. We don't need to compose it mannually. Use pci_dev_id() to simplify the code a little bit. Signed-off-by: Jialin Zhang --- arch/powerpc/platforms/powernv/eeh-powernv.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletio

Re: [PATCH v4 6/6] integrity: PowerVM support for loading third party code signing keys

2023-08-15 Thread Mimi Zohar
On Tue, 2023-08-15 at 07:27 -0400, Nayna Jain wrote: > On secure boot enabled PowerVM LPAR, third party code signing keys are > needed during early boot to verify signed third party modules. These > third party keys are stored in moduledb object in the Platform > KeyStore (PKS). > > Load third par

Re: [RFC PATCH v11 12/29] KVM: Add KVM_CREATE_GUEST_MEMFD ioctl() for guest-specific backing memory

2023-08-15 Thread Sean Christopherson
On Tue, Aug 15, 2023, Ackerley Tng wrote: > Sean Christopherson writes: > > >> I feel that memslots form a natural way of managing usage of the gmem > >> file. When a memslot is created, it is using the file; hence we take a > >> refcount on the gmem file, and as memslots are removed, we drop > >

Re: KASAN debug kernel fails to boot at early stage when CONFIG_SMP=y is set (kernel 6.5-rc5, PowerMac G4 3,6)

2023-08-15 Thread Erhard Furtner
On Tue, 15 Aug 2023 17:25:13 + Christophe Leroy wrote: > I just sent a patch with additional pr_info() in order to help locate > the issue, please provide output with that patch. > > Thanks > Christophe Thanks for your efforts Christophe! With the patch applied I get this output + a blank

Re: [RFC PATCH v11 12/29] KVM: Add KVM_CREATE_GUEST_MEMFD ioctl() for guest-specific backing memory

2023-08-15 Thread Ackerley Tng
Sean Christopherson writes: > On Mon, Aug 07, 2023, Ackerley Tng wrote: >> I’d like to propose an alternative to the refcounting approach between >> the gmem file and associated kvm, where we think of KVM’s memslots as >> users of the gmem file. >> >> Instead of having the gmem file pin the VM (i

[PATCH v2] powerpc/32s: Cleanup the mess in __set_pte_at()

2023-08-15 Thread Christophe Leroy
__set_pte_at() handles 3 main cases with #ifdefs plus the 'percpu' subcase which leads to code duplication. Rewrite the function using IS_ENABLED() to minimise the total number of cases and remove duplicated code. Signed-off-by: Christophe Leroy --- v2: Reorganise comments, first case becomes th

Re: KASAN debug kernel fails to boot at early stage when CONFIG_SMP=y is set (kernel 6.5-rc5, PowerMac G4 3,6)

2023-08-15 Thread Christophe Leroy
Le 14/08/2023 à 19:27, Erhard Furtner a écrit : > On Mon, 14 Aug 2023 09:40:44 + > Christophe Leroy wrote: > >> Interesting. That means we get stuck somewhere around MMU_init() >> >> We know that MMU_init_hw() is called and runs at least until: >> >> pr_info("Total memory = %lldMB; us

[PATCH] Add pr_info() traces for investigation

2023-08-15 Thread Christophe Leroy
Signed-off-by: Christophe Leroy --- arch/powerpc/kernel/btext.c | 2 ++ arch/powerpc/mm/book3s32/kuap.c | 5 + arch/powerpc/mm/book3s32/mmu.c | 3 +++ arch/powerpc/mm/kasan/init_32.c | 3 +++ arch/powerpc/mm/pgtable_32.c| 4 5 files changed, 17 insertions(+) diff --git a/arch/p

Re: [BUG] Re: [PATCH v3 10/13] mm/khugepaged: collapse_pte_mapped_thp() with mmap_read_lock()

2023-08-15 Thread Hugh Dickins
On Tue, 15 Aug 2023, David Hildenbrand wrote: > On 15.08.23 08:34, Hugh Dickins wrote: > > On Mon, 14 Aug 2023, Jann Horn wrote: > >> > >> /* step 4: remove page table */ > >> + if (strcmp(current->comm, "DELAYME") == 0) { > >> + pr_warn("%s: BEGIN DELAY INJECTION\n", _

[PATCH v4 5/6] integrity: PowerVM machine keyring enablement

2023-08-15 Thread Nayna Jain
Update Kconfig to enable machine keyring and limit to CA certificates on PowerVM. Only key signing CA keys are allowed. Signed-off-by: Nayna Jain Reviewed-and-tested-by: Mimi Zohar Reviewed-by: Jarkko Sakkinen --- security/integrity/Kconfig | 4 +++- 1 file changed, 3 insertions(+), 1 deletion

[PATCH v4 1/6] integrity: PowerVM support for loading CA keys on machine keyring

2023-08-15 Thread Nayna Jain
Keys that derive their trust from an entity such as a security officer, administrator, system owner, or machine owner are said to have "imputed trust". CA keys with imputed trust can be loaded onto the machine keyring. The mechanism for loading these keys onto the machine keyring is platform depend

[PATCH v4 0/6] Enable loading local and third party keys on PowerVM guest

2023-08-15 Thread Nayna Jain
On a secure boot enabled PowerVM guest, local and third party code signing keys are needed to verify signed applications, configuration files, and kernel modules. Loading these keys onto either the .secondary_trusted_keys or .ima keyrings requires the certificates be signed by keys on the .builtin

[PATCH v4 4/6] integrity: check whether imputed trust is enabled

2023-08-15 Thread Nayna Jain
trust_moklist() is specific to UEFI enabled systems. Other platforms rely only on the Kconfig. Define a generic wrapper named imputed_trust_enabled(). Signed-off-by: Nayna Jain Reviewed-off-by: Mimi Zohar --- security/integrity/digsig.c| 2 +- security/integrity/integrity.

Re: [PATCH] powerpc: Make virt_to_pfn() a static inline

2023-08-15 Thread Michael Ellerman
Linus Walleij writes: > On Tue, Aug 15, 2023 at 9:30 AM Michael Ellerman wrote: >> Linus Walleij writes: > >> > - return ((unsigned long)__va(pmd_val(pmd) & ~PMD_MASKED_BITS)); >> > + return (const void *)((unsigned long)__va(pmd_val(pmd) & >> > ~PMD_MASKED_BITS)); >> >> This can also j

Re: [PATCH] powerpc/32s: Cleanup the mess in __set_pte_at()

2023-08-15 Thread Michael Ellerman
Christophe Leroy writes: > __set_pte_at() handles 3 main cases with #ifdefs plus the 'percpu' > subcase which leads to code duplication. > > Rewrite the function using IS_ENABLED() to minimise the total number > of cases and remove duplicated code. I think the code change is good, but the comment

[PATCH v4 6/6] integrity: PowerVM support for loading third party code signing keys

2023-08-15 Thread Nayna Jain
On secure boot enabled PowerVM LPAR, third party code signing keys are needed during early boot to verify signed third party modules. These third party keys are stored in moduledb object in the Platform KeyStore (PKS). Load third party code signing keys onto .secondary_trusted_keys keyring. Signe

[PATCH v4 3/6] integrity: remove global variable from machine_keyring.c

2023-08-15 Thread Nayna Jain
trust_mok variable is accessed within a single function locally. Change trust_mok from global to local static variable. Signed-off-by: Nayna Jain Reviewed-and-tested-by: Mimi Zohar Reviewed-by: Jarkko Sakkinen --- security/integrity/platform_certs/machine_keyring.c | 4 ++-- 1 file changed, 2

[PATCH v4 2/6] integrity: ignore keys failing CA restrictions on non-UEFI platform

2023-08-15 Thread Nayna Jain
On non-UEFI platforms, handle restrict_link_by_ca failures differently. Certificates which do not satisfy CA restrictions on non-UEFI platforms are ignored. Signed-off-by: Nayna Jain Reviewed-and-tested-by: Mimi Zohar Acked-by: Jarkko Sakkinen --- security/integrity/platform_certs/machine_key

[PATCH] powerpc: Move zalloc_maybe_bootmem() into pci-common.c

2023-08-15 Thread Christophe Leroy
zalloc_maybe_bootmem() is only used by PCI related functions. Move it into pci-common.c and remove the always built alloc.c Signed-off-by: Christophe Leroy --- arch/powerpc/include/asm/pci.h | 2 ++ arch/powerpc/include/asm/setup.h | 1 - arch/powerpc/kernel/pci-common.c | 16 ++

Re: [PATCH v2] powernv/opal-prd: Silence memcpy() run-time false positive warnings

2023-08-15 Thread Michael Ellerman
Joel Stanley writes: > On Fri, 7 Jul 2023 at 05:11, Mahesh Salgaonkar wrote: >> >> opal_prd_msg_notifier extracts the opal prd message size from the message >> header and uses it for allocating opal_prd_msg_queue_item that includes >> the correct message size to be copied. However, while running

Re: [PATCH v3 4/6] KVM: PPC: Book3s HV: Hold LPIDs in an unsigned long

2023-08-15 Thread Michael Ellerman
"Nicholas Piggin" writes: > On Mon Aug 7, 2023 at 11:45 AM AEST, Jordan Niethe wrote: >> The LPID register is 32 bits long. The host keeps the lpids for each >> guest in an unsigned word struct kvm_arch. Currently, LPIDs are already >> limited by mmu_lpid_bits and KVM_MAX_NESTED_GUESTS_SHIFT. >> >

Re: [linus:master] [locking] c8afaa1b0f: stress-ng.zero.ops_per_sec 6.3% improvement

2023-08-15 Thread Mateusz Guzik
On 8/15/23, Linus Torvalds wrote: > On Tue, 15 Aug 2023 at 07:12, kernel test robot > wrote: >> >> kernel test robot noticed a 6.3% improvement of stress-ng.zero.ops_per_sec >> on: > > WTF? That's ridiculous. Why would that even test new_inode() at all? > And why would it make any difference anyw

Re: [PATCH] powerpc: Make virt_to_pfn() a static inline

2023-08-15 Thread Linus Walleij
On Tue, Aug 15, 2023 at 9:30 AM Michael Ellerman wrote: > Linus Walleij writes: > > - return ((unsigned long)__va(pmd_val(pmd) & ~PMD_MASKED_BITS)); > > + return (const void *)((unsigned long)__va(pmd_val(pmd) & > > ~PMD_MASKED_BITS)); > > This can also just be: > > return __va(

Re: [linus:master] [locking] c8afaa1b0f: stress-ng.zero.ops_per_sec 6.3% improvement

2023-08-15 Thread Linus Torvalds
On Tue, 15 Aug 2023 at 07:12, kernel test robot wrote: > > kernel test robot noticed a 6.3% improvement of stress-ng.zero.ops_per_sec on: WTF? That's ridiculous. Why would that even test new_inode() at all? And why would it make any difference anyway to prefetch a new inode? The 'zero' test claim

Re: [PATCH] powerpc: Make virt_to_pfn() a static inline

2023-08-15 Thread Michael Ellerman
Linus Walleij writes: > Making virt_to_pfn() a static inline taking a strongly typed > (const void *) makes the contract of a passing a pointer of that > type to the function explicit and exposes any misuse of the > macro virt_to_pfn() acting polymorphic and accepting many types > such as (void *

Re: [PATCH] powerpc: Make virt_to_pfn() a static inline

2023-08-15 Thread Michael Ellerman
Christophe Leroy writes: > Le 14/08/2023 à 14:37, Michael Ellerman a écrit : >> Linus Walleij writes: >>> Making virt_to_pfn() a static inline taking a strongly typed >>> (const void *) makes the contract of a passing a pointer of that >>> type to the function explicit and exposes any misuse of t

[linus:master] [locking] c8afaa1b0f: stress-ng.zero.ops_per_sec 6.3% improvement

2023-08-15 Thread kernel test robot
e as below: --> The kernel config and materials to reproduce are available at: https://download.01.org/0day-ci/archive/20230815/202308151426.97be5bd8-oliver.s

Re: [BUG] Re: [PATCH v3 10/13] mm/khugepaged: collapse_pte_mapped_thp() with mmap_read_lock()

2023-08-15 Thread David Hildenbrand
On 15.08.23 08:34, Hugh Dickins wrote: On Mon, 14 Aug 2023, Jann Horn wrote: On Wed, Jul 12, 2023 at 6:42 AM Hugh Dickins wrote: Bring collapse_and_free_pmd() back into collapse_pte_mapped_thp(). It does need mmap_read_lock(), but it does not need mmap_write_lock(), nor vma_start_write() nor i