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-09-13 Thread Christophe Leroy
Le 12/09/2023 à 19:39, Christophe Leroy a écrit : > > > Le 12/09/2023 à 17:59, Erhard Furtner a écrit : >> >> printk: bootconsole [udbg0] enabled >> Total memory = 2048MB; using 4096kB for hash table >> mapin_ram:125 >> mmu_mapin_ram:169 0 3000 140 200 >> __mmu_mapin_ram:146 0

Re: [PATCH v3 2/2] powerpc/fadump: make is_kdump_kernel() return false when fadump is active

2023-09-13 Thread Baoquan He
On 09/12/23 at 01:59pm, Hari Bathini wrote: > Currently, is_kdump_kernel() returns true in crash dump capture kernel > for both kdump and fadump crash dump capturing methods, as both these > methods set elfcorehdr_addr. Some restrictions enforced for crash dump > capture kernel, based on

Re: [PATCH v3 1/2] vmcore: remove dependency with is_kdump_kernel() for exporting vmcore

2023-09-13 Thread Baoquan He
On 09/12/23 at 01:59pm, Hari Bathini wrote: > Currently, is_kdump_kernel() returns true when elfcorehdr_addr is set. > While elfcorehdr_addr is set for kexec based kernel dump mechanism, > alternate dump capturing methods like fadump [1] also set it to export > the vmcore. Since, is_kdump_kernel()

Re: [PATCH v2] ASoC: imx-rpmsg: Set ignore_pmdown_time for dai_link

2023-09-13 Thread Shengjiu Wang
On Wed, Sep 13, 2023 at 6:27 PM Chancel Liu wrote: > > i.MX rpmsg sound cards work on codec slave mode. MCLK will be disabled > by CPU DAI driver in hw_free(). Some codec requires MCLK present at > power up/down sequence. So need to set ignore_pmdown_time to power down > codec immediately before

Re: [PATCH v7 3/3 RESEND] powerpc/pseries: PLPKS SED Opal keystore support

2023-09-13 Thread Michael Ellerman
Nathan Chancellor writes: > Hi Greg, > > On Fri, Sep 08, 2023 at 10:30:56AM -0500, gjo...@linux.vnet.ibm.com wrote: >> From: Greg Joyce >> >> Define operations for SED Opal to read/write keys >> from POWER LPAR Platform KeyStore(PLPKS). This allows >> non-volatile storage of SED Opal keys. >> >>

Re: [RFC PATCH v12 02/33] KVM: Use gfn instead of hva for mmu_notifier_retry

2023-09-13 Thread Binbin Wu
On 9/14/2023 9:55 AM, Sean Christopherson wrote: From: Chao Peng Currently in mmu_notifier invalidate path, hva range is recorded and then checked against by mmu_notifier_retry_hva() in the page fault handling path. However, for the to be introduced private memory, a page fault may not have

[PATCH v5 11/11] docs: powerpc: Document nested KVM on POWER

2023-09-13 Thread Jordan Niethe
From: Michael Neuling Document support for nested KVM on POWER using the existing API as well as the new PAPR API. This includes the new HCALL interface and how it used by KVM. Signed-off-by: Michael Neuling Signed-off-by: Jordan Niethe --- v2: - Separated into individual patch v3: - Fix

[PATCH v5 10/11] KVM: PPC: Add support for nestedv2 guests

2023-09-13 Thread Jordan Niethe
A series of hcalls have been added to the PAPR which allow a regular guest partition to create and manage guest partitions of its own. KVM already had an interface that allowed this on powernv platforms. This existing interface will now be called "nestedv1". The newly added PAPR interface will be

[PATCH v5 09/11] KVM: PPC: Book3s HV: Hold LPIDs in an unsigned long

2023-09-13 Thread Jordan Niethe
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 nestedv2 API returns a 64 bit "Guest ID" to be used be the L1 host for each L2 guest. This

[PATCH v5 08/11] KVM: PPC: Add helper library for Guest State Buffers

2023-09-13 Thread Jordan Niethe
The PAPR "Nestedv2" guest API introduces the concept of a Guest State Buffer for communication about L2 guests between L1 and L0 hosts. In the new API, the L0 manages the L2 on behalf of the L1. This means that if the L1 needs to change L2 state (e.g. GPRs, SPRs, partition table...), it must

[PATCH v5 07/11] KVM: PPC: Book3S HV: Introduce low level MSR accessor

2023-09-13 Thread Jordan Niethe
kvmppc_get_msr() and kvmppc_set_msr_fast() serve as accessors for the MSR. However because the MSR is kept in the shared regs they include a conditional check for kvmppc_shared_big_endian() and endian conversion. Within the Book3S HV specific code there are direct reads and writes of shregs::msr.

[PATCH v5 06/11] KVM: PPC: Book3S HV: Use accessors for VCPU registers

2023-09-13 Thread Jordan Niethe
Introduce accessor generator macros for Book3S HV VCPU registers. Use the accessor functions to replace direct accesses to this registers. This will be important later for Nested APIv2 support which requires additional functionality for accessing and modifying VCPU state. Signed-off-by: Jordan

[PATCH v5 05/11] KVM: PPC: Use accessors for VCORE registers

2023-09-13 Thread Jordan Niethe
Introduce accessor generator macros for VCORE registers. Use the accessor functions to replace direct accesses to this registers. This will be important later for Nested APIv2 support which requires additional functionality for accessing and modifying VCPU state. Signed-off-by: Jordan Niethe

[PATCH v5 04/11] KVM: PPC: Use accessors for VCPU registers

2023-09-13 Thread Jordan Niethe
Introduce accessor generator macros for VCPU registers. Use the accessor functions to replace direct accesses to this registers. This will be important later for Nested APIv2 support which requires additional functionality for accessing and modifying VCPU state. Signed-off-by: Jordan Niethe ---

[PATCH v5 03/11] KVM: PPC: Rename accessor generator macros

2023-09-13 Thread Jordan Niethe
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 convention. Reviewed-by: Nicholas Piggin Signed-off-by: Jordan Niethe --- v3: - New to series v4: -

[PATCH v5 02/11] KVM: PPC: Introduce FPR/VR accessor functions

2023-09-13 Thread Jordan Niethe
Introduce accessor functions for floating point and vector registers like the ones that exist for GPRs. Use these to replace the existing FPR and VR accessor macros. This will be important later for Nested APIv2 support which requires additional functionality for accessing and modifying VCPU

[PATCH v5 01/11] KVM: PPC: Always use the GPR accessors

2023-09-13 Thread Jordan Niethe
Always use the GPR accessor functions. This will be important later for Nested APIv2 support which requires additional functionality for accessing and modifying VCPU state. Signed-off-by: Jordan Niethe --- v4: - Split into unique patch --- arch/powerpc/kvm/book3s_64_vio.c | 4 ++--

[PATCH v5 00/11] KVM: PPC: Nested APIv2 guest support

2023-09-13 Thread Jordan Niethe
A nested-HV API for PAPR has been developed based on the KVM-specific nested-HV API that is upstream in Linux/KVM and QEMU. The PAPR API had to break compatibility to accommodate implementation in other hypervisors and partitioning firmware. The existing KVM-specific API will be known as the

Re: [PATCH] powerpc: Export kvm_guest static key, for bcachefs six locks

2023-09-13 Thread Michael Ellerman
Kent Overstreet writes: > bcachefs's six locks need kvm_guest, via > ower_on_cpu() -> vcpu_is_preempted() -> is_kvm_guest() > > Signed-off-by: Kent Overstreet > Cc: linuxppc-dev@lists.ozlabs.org > --- > arch/powerpc/kernel/firmware.c | 2 ++ > 1 file changed, 2 insertions(+) Acked-by:

[RFC PATCH v12 33/33] KVM: selftests: Test KVM exit behavior for private memory/access

2023-09-13 Thread Sean Christopherson
From: Ackerley Tng "Testing private access when memslot gets deleted" tests the behavior of KVM when a private memslot gets deleted while the VM is using the private memslot. When KVM looks up the deleted (slot = NULL) memslot, KVM should exit to userspace with KVM_EXIT_MEMORY_FAULT. In the

[RFC PATCH v12 32/33] KVM: selftests: Add basic selftest for guest_memfd()

2023-09-13 Thread Sean Christopherson
From: Chao Peng Add a selftest to verify the basic functionality of guest_memfd(): + file descriptor created with the guest_memfd() ioctl does not allow read/write/mmap operations + file size and block size as returned from fstat are as expected + fallocate on the fd checks that offset/length

[RFC PATCH v12 31/33] KVM: selftests: Expand set_memory_region_test to validate guest_memfd()

2023-09-13 Thread Sean Christopherson
From: Chao Peng Expand set_memory_region_test to exercise various positive and negative testcases for private memory. - Non-guest_memfd() file descriptor for private memory - guest_memfd() from different VM - Overlapping bindings - Unaligned bindings Signed-off-by: Chao Peng

[RFC PATCH v12 30/33] KVM: selftests: Add KVM_SET_USER_MEMORY_REGION2 helper

2023-09-13 Thread Sean Christopherson
From: Chao Peng Add helpers to invoke KVM_SET_USER_MEMORY_REGION2 directly so that tests can validate of features that are unique to "version 2" of "set user memory region", e.g. do negative testing on gmem_fd and gmem_offset. Provide a raw version as well as an assert-success version to reduce

[RFC PATCH v12 29/33] KVM: selftests: Add x86-only selftest for private memory conversions

2023-09-13 Thread Sean Christopherson
From: Vishal Annapurve Add a selftest to exercise implicit/explicit conversion functionality within KVM and verify: - Shared memory is visible to host userspace - Private memory is not visible to host userspace - Host userspace and guest can communicate over shared memory - Data in shared

[RFC PATCH v12 28/33] KVM: selftests: Add GUEST_SYNC[1-6] macros for synchronizing more data

2023-09-13 Thread Sean Christopherson
Add GUEST_SYNC[1-6]() so that tests can pass the maximum amount of information supported via ucall(), without needing to resort to shared memory. Signed-off-by: Sean Christopherson --- tools/testing/selftests/kvm/include/ucall_common.h | 11 +++ 1 file changed, 11 insertions(+) diff

[RFC PATCH v12 27/33] KVM: selftests: Introduce VM "shape" to allow tests to specify the VM type

2023-09-13 Thread Sean Christopherson
Add a "vm_shape" structure to encapsulate the selftests-defined "mode", along with the KVM-defined "type" for use when creating a new VM. "mode" tracks physical and virtual address properties, as well as the preferred backing memory type, while "type" corresponds to the VM type. Taking the VM

[RFC PATCH v12 26/33] KVM: selftests: Add helpers to do KVM_HC_MAP_GPA_RANGE hypercalls (x86)

2023-09-13 Thread Sean Christopherson
From: Vishal Annapurve Add helpers for x86 guests to invoke the KVM_HC_MAP_GPA_RANGE hypercall, which KVM will forward to userspace and thus can be used by tests to coordinate private<=>shared conversions between host userspace code and guest code. Signed-off-by: Vishal Annapurve [sean: drop

[RFC PATCH v12 25/33] KVM: selftests: Add helpers to convert guest memory b/w private and shared

2023-09-13 Thread Sean Christopherson
From: Vishal Annapurve Add helpers to convert memory between private and shared via KVM's memory attributes, as well as helpers to free/allocate guest_memfd memory via fallocate(). Userspace, i.e. tests, is NOT required to do fallocate() when converting memory, as the attributes are the single

[RFC PATCH v12 24/33] KVM: selftests: Add support for creating private memslots

2023-09-13 Thread Sean Christopherson
Add support for creating "private" memslots via KVM_CREATE_GUEST_MEMFD and KVM_SET_USER_MEMORY_REGION2. Make vm_userspace_mem_region_add() a wrapper to its effective replacement, vm_mem_add(), so that private memslots are fully opt-in, i.e. don't require update all tests that add memory regions.

[RFC PATCH v12 23/33] KVM: selftests: Convert lib's mem regions to KVM_SET_USER_MEMORY_REGION2

2023-09-13 Thread Sean Christopherson
Use KVM_SET_USER_MEMORY_REGION2 throughough KVM's selftests library so that support for guest private memory can be added without needing an entirely separate set of helpers. Signed-off-by: Sean Christopherson --- .../selftests/kvm/include/kvm_util_base.h | 2 +-

[RFC PATCH v12 22/33] KVM: selftests: Drop unused kvm_userspace_memory_region_find() helper

2023-09-13 Thread Sean Christopherson
Drop kvm_userspace_memory_region_find(), it's unused and a terrible API (probably why it's unused). If anything outside of kvm_util.c needs to get at the memslot, userspace_mem_region_find() can be exposed to give others full access to all memory region/slot information. Signed-off-by: Sean

[RFC PATCH v12 21/33] KVM: x86: Add support for "protected VMs" that can utilize private memory

2023-09-13 Thread Sean Christopherson
Signed-off-by: Sean Christopherson --- Documentation/virt/kvm/api.rst | 32 arch/x86/include/asm/kvm_host.h | 15 +-- arch/x86/include/uapi/asm/kvm.h | 3 +++ arch/x86/kvm/Kconfig| 12 arch/x86/kvm/mmu/mmu_internal.h | 1 +

[RFC PATCH v12 20/33] KVM: Allow arch code to track number of memslot address spaces per VM

2023-09-13 Thread Sean Christopherson
Let x86 track the number of address spaces on a per-VM basis so that KVM can disallow SMM memslots for confidential VMs. Confidentials VMs are fundamentally incompatible with emulating SMM, which as the name suggests requires being able to read and write guest memory and register state.

[RFC PATCH v12 19/33] KVM: Drop superfluous __KVM_VCPU_MULTIPLE_ADDRESS_SPACE macro

2023-09-13 Thread Sean Christopherson
Drop __KVM_VCPU_MULTIPLE_ADDRESS_SPACE and instead check the value of KVM_ADDRESS_SPACE_NUM. No functional change intended. Reviewed-by: Paolo Bonzini Signed-off-by: Sean Christopherson --- arch/x86/include/asm/kvm_host.h | 1 - include/linux/kvm_host.h| 2 +- 2 files changed, 1

[RFC PATCH v12 18/33] KVM: x86/mmu: Handle page fault for private memory

2023-09-13 Thread Sean Christopherson
From: Chao Peng A KVM_MEM_PRIVATE memslot can include both fd-based private memory and hva-based shared memory. Architecture code (like TDX code) can tell whether the on-going fault is private or not. This patch adds a 'is_private' field to kvm_page_fault to indicate this and architecture code

[RFC PATCH v12 17/33] KVM: x86: Disallow hugepages when memory attributes are mixed

2023-09-13 Thread Sean Christopherson
From: Chao Peng Disallow creating hugepages with mixed memory attributes, e.g. shared versus private, as mapping a hugepage in this case would allow the guest to access memory with the wrong attributes, e.g. overlaying private memory with a shared hugepage. Tracking whether or not attributes

[RFC PATCH v12 16/33] KVM: x86: "Reset" vcpu->run->exit_reason early in KVM_RUN

2023-09-13 Thread Sean Christopherson
Initialize run->exit_reason to KVM_EXIT_UNKNOWN early in KVM_RUN to reduce the probability of exiting to userspace with a stale run->exit_reason that *appears* to be valid. To support fd-based guest memory (guest memory without a corresponding userspace virtual address), KVM will exit to

[RFC PATCH v12 15/33] KVM: Add transparent hugepage support for dedicated guest memory

2023-09-13 Thread Sean Christopherson
TODO: writeme Signed-off-by: Sean Christopherson --- include/uapi/linux/kvm.h | 2 ++ virt/kvm/guest_mem.c | 54 2 files changed, 51 insertions(+), 5 deletions(-) diff --git a/include/uapi/linux/kvm.h b/include/uapi/linux/kvm.h index

[RFC PATCH v12 14/33] KVM: Add KVM_CREATE_GUEST_MEMFD ioctl() for guest-specific backing memory

2023-09-13 Thread Sean Christopherson
TODO Cc: Fuad Tabba Cc: Vishal Annapurve Cc: Ackerley Tng Cc: Jarkko Sakkinen Cc: Maciej Szmigiero Cc: Vlastimil Babka Cc: David Hildenbrand Cc: Quentin Perret Cc: Michael Roth Cc: Wang Cc: Liam Merwick Cc: Isaku Yamahata Co-developed-by: Kirill A. Shutemov Signed-off-by: Kirill A.

[RFC PATCH v12 13/33] security: Export security_inode_init_security_anon() for use by KVM

2023-09-13 Thread Sean Christopherson
TODO: Throw this away, assuming KVM drops its dedicated file system. Acked-by: Paul Moore Signed-off-by: Sean Christopherson --- security/security.c | 1 + 1 file changed, 1 insertion(+) diff --git a/security/security.c b/security/security.c index 23b129d482a7..0024156f867a 100644 ---

[RFC PATCH v12 12/33] mm: Add AS_UNMOVABLE to mark mapping as completely unmovable

2023-09-13 Thread Sean Christopherson
Add an "unmovable" flag for mappings that cannot be migrated under any circumstance. KVM will use the flag for its upcoming GUEST_MEMFD support, which will not support compaction/migration, at least not in the foreseeable future. Test AS_UNMOVABLE under folio lock as already done for the async

[RFC PATCH v12 11/33] KVM: Introduce per-page memory attributes

2023-09-13 Thread Sean Christopherson
From: Chao Peng In confidential computing usages, whether a page is private or shared is necessary information for KVM to perform operations like page fault handling, page zapping etc. There are other potential use cases for per-page memory attributes, e.g. to make memory read-only (or no-exec,

[RFC PATCH v12 10/33] KVM: Set the stage for handling only shared mappings in mmu_notifier events

2023-09-13 Thread Sean Christopherson
Add flags to "struct kvm_gfn_range" to let notifier events target only shared and only private mappings, and write up the existing mmu_notifier events to be shared-only (private memory is never associated with a userspace virtual address, i.e. can't be reached via mmu_notifiers). Add two flags so

[RFC PATCH v12 08/33] KVM: Add a dedicated mmu_notifier flag for reclaiming freed memory

2023-09-13 Thread Sean Christopherson
Handle AMD SEV's kvm_arch_guest_memory_reclaimed() hook by having __kvm_handle_hva_range() return whether or not an overlapping memslot was found, i.e. mmu_lock was acquired. Using the .on_unlock() hook works, but kvm_arch_guest_memory_reclaimed() needs to run after dropping mmu_lock, which makes

[RFC PATCH v12 07/33] KVM: Add KVM_EXIT_MEMORY_FAULT exit to report faults to userspace

2023-09-13 Thread Sean Christopherson
From: Chao Peng Add a new KVM exit type to allow userspace to handle memory faults that KVM cannot resolve, but that userspace *may* be able to handle (without terminating the guest). KVM will initially use KVM_EXIT_MEMORY_FAULT to report implicit conversions between private and shared memory.

[RFC PATCH v12 06/33] KVM: Introduce KVM_SET_USER_MEMORY_REGION2

2023-09-13 Thread Sean Christopherson
Introduce a "version 2" of KVM_SET_USER_MEMORY_REGION so that additional information can be supplied without setting userspace up to fail. The padding in the new kvm_userspace_memory_region2 structure will be used to pass a file descriptor in addition to the userspace_addr, i.e. allow userspace

[RFC PATCH v12 05/33] KVM: Convert KVM_ARCH_WANT_MMU_NOTIFIER to CONFIG_KVM_GENERIC_MMU_NOTIFIER

2023-09-13 Thread Sean Christopherson
Convert KVM_ARCH_WANT_MMU_NOTIFIER into a Kconfig and select it where appropriate to effectively maintain existing behavior. Using a proper Kconfig will simplify building more functionality on top of KVM's mmu_notifier infrastructure. Add a forward declaration of kvm_gfn_range to kvm_types.h so

[RFC PATCH v12 04/33] KVM: PPC: Return '1' unconditionally for KVM_CAP_SYNC_MMU

2023-09-13 Thread Sean Christopherson
Advertise that KVM's MMU is synchronized with the primary MMU for all flavors of PPC KVM support, i.e. advertise that the MMU is synchronized when CONFIG_KVM_BOOK3S_HV_POSSIBLE=y but the VM is not using hypervisor mode (a.k.a. PR VMs). PR VMs, via kvm_unmap_gfn_range_pr(), do the right thing for

[RFC PATCH v12 03/33] KVM: PPC: Drop dead code related to KVM_ARCH_WANT_MMU_NOTIFIER

2023-09-13 Thread Sean Christopherson
Assert that both KVM_ARCH_WANT_MMU_NOTIFIER and CONFIG_MMU_NOTIFIER are defined when KVM is enabled, and return '1' unconditionally for the CONFIG_KVM_BOOK3S_HV_POSSIBLE=n path. All flavors of PPC support for KVM select MMU_NOTIFIER, and KVM_ARCH_WANT_MMU_NOTIFIER is unconditionally defined by

[RFC PATCH v12 02/33] KVM: Use gfn instead of hva for mmu_notifier_retry

2023-09-13 Thread Sean Christopherson
From: Chao Peng Currently in mmu_notifier invalidate path, hva range is recorded and then checked against by mmu_notifier_retry_hva() in the page fault handling path. However, for the to be introduced private memory, a page fault may not have a hva associated, checking gfn(gpa) makes more sense.

[RFC PATCH v12 01/33] KVM: Tweak kvm_hva_range and hva_handler_t to allow reusing for gfn ranges

2023-09-13 Thread Sean Christopherson
Rework and rename "struct kvm_hva_range" into "kvm_mmu_notifier_range" so that the structure can be used to handle notifications that operate on gfn context, i.e. that aren't tied to a host virtual address. Practically speaking, this is a nop for 64-bit kernels as the only meaningful change is to

[RFC PATCH v12 00/33] KVM: guest_memfd() and per-page attributes

2023-09-13 Thread Sean Christopherson
This is hopefully the last RFC for implementing fd-based (instead of vma-based) memory for KVM guests. If you want the full background of why we are doing this, please go read the v10 cover letter. With luck, v13 will be a "normal" series that's ready for inclusion. Tagged RFC as there are

[PATCH] powerpc: Export kvm_guest static key, for bcachefs six locks

2023-09-13 Thread Kent Overstreet
bcachefs's six locks need kvm_guest, via ower_on_cpu() -> vcpu_is_preempted() -> is_kvm_guest() Signed-off-by: Kent Overstreet Cc: linuxppc-dev@lists.ozlabs.org --- arch/powerpc/kernel/firmware.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/arch/powerpc/kernel/firmware.c

Re: [PATCH 2/2] arch: Reserve map_shadow_stack() syscall number for all architectures

2023-09-13 Thread Edgecombe, Rick P
On Wed, 2023-09-13 at 12:18 -0700, Sohil Mehta wrote: > On 9/11/2023 2:10 PM, Edgecombe, Rick P wrote: > > On Mon, 2023-09-11 at 18:02 +, Sohil Mehta wrote: > > > diff --git a/arch/powerpc/kernel/syscalls/syscall.tbl > > > b/arch/powerpc/kernel/syscalls/syscall.tbl > > > index

Re: [PATCH 0/2] arch: Sync all syscall tables with 2 newly added system calls

2023-09-13 Thread Sohil Mehta
On 9/11/2023 11:02 AM, Sohil Mehta wrote: > Sohil Mehta (2): > tools headers UAPI: Sync fchmodat2() syscall table entries I now see a patch by Arnaldo that does something similar: https://lore.kernel.org/lkml/zp8be7axdbu%2fd...@kernel.org/ Also, it states that: "The

Re: [PATCH 2/2] arch: Reserve map_shadow_stack() syscall number for all architectures

2023-09-13 Thread Sohil Mehta
On 9/11/2023 2:10 PM, Edgecombe, Rick P wrote: > On Mon, 2023-09-11 at 18:02 +, Sohil Mehta wrote: >> diff --git a/arch/powerpc/kernel/syscalls/syscall.tbl >> b/arch/powerpc/kernel/syscalls/syscall.tbl >> index 20e50586e8a2..2767b8a42636 100644 >> --- a/arch/powerpc/kernel/syscalls/syscall.tbl

Re: [PATCH v14 00/15] phy: Add support for Lynx 10G SerDes

2023-09-13 Thread Vladimir Oltean
Hi Sean, On Thu, Aug 10, 2023 at 03:58:36PM -0400, Sean Anderson wrote: > I can look into doing this. It will be in my free time, so it will > likely be a bit before I can update this series. I was expecting you'd ask some clarification questions about the RCW override procedure that I've

Re: [PATCH v7 1/3 RESEND] block:sed-opal: SED Opal keystore

2023-09-13 Thread Nathan Chancellor
On Wed, Sep 13, 2023 at 01:49:39PM -0700, Nick Desaulniers wrote: > On Wed, Sep 13, 2023 at 9:56 AM Nathan Chancellor wrote: > > > > Hi Greg, > > > > On Fri, Sep 08, 2023 at 10:30:54AM -0500, gjo...@linux.vnet.ibm.com wrote: > > > From: Greg Joyce > > > > > > Add read and write functions that

Re: [PATCH v7 1/3 RESEND] block:sed-opal: SED Opal keystore

2023-09-13 Thread Nick Desaulniers
On Wed, Sep 13, 2023 at 9:56 AM Nathan Chancellor wrote: > > Hi Greg, > > On Fri, Sep 08, 2023 at 10:30:54AM -0500, gjo...@linux.vnet.ibm.com wrote: > > From: Greg Joyce > > > > Add read and write functions that allow SED Opal keys to stored > > in a permanent keystore. > > > > Signed-off-by:

Re: [PATCH v7 3/3 RESEND] powerpc/pseries: PLPKS SED Opal keystore support

2023-09-13 Thread Jens Axboe
On 9/13/23 12:59 PM, Nathan Chancellor wrote: > Hi Greg, > > On Fri, Sep 08, 2023 at 10:30:56AM -0500, gjo...@linux.vnet.ibm.com wrote: >> From: Greg Joyce >> >> Define operations for SED Opal to read/write keys >> from POWER LPAR Platform KeyStore(PLPKS). This allows >> non-volatile storage of

Re: [PATCH v7 3/3 RESEND] powerpc/pseries: PLPKS SED Opal keystore support

2023-09-13 Thread Nathan Chancellor
Hi Greg, On Fri, Sep 08, 2023 at 10:30:56AM -0500, gjo...@linux.vnet.ibm.com wrote: > From: Greg Joyce > > Define operations for SED Opal to read/write keys > from POWER LPAR Platform KeyStore(PLPKS). This allows > non-volatile storage of SED Opal keys. > > Signed-off-by: Greg Joyce >

Re: [PATCH v5 24/31] net: wan: Add framer framework support

2023-09-13 Thread Mark Brown
On Tue, Sep 12, 2023 at 12:14:36PM +0200, Herve Codina wrote: > A framer is a component in charge of an E1/T1 line interface. > Connected usually to a TDM bus, it converts TDM frames to/from E1/T1 > frames. It also provides information related to the E1/T1 line. > > The framer framework provides

Re: [PATCH v7 1/3 RESEND] block:sed-opal: SED Opal keystore

2023-09-13 Thread Nathan Chancellor
Hi Greg, On Fri, Sep 08, 2023 at 10:30:54AM -0500, gjo...@linux.vnet.ibm.com wrote: > From: Greg Joyce > > Add read and write functions that allow SED Opal keys to stored > in a permanent keystore. > > Signed-off-by: Greg Joyce > Reviewed-by: Jonathan Derrick > --- > block/Makefile

Re: [PATCH v5 08/31] dt-bindings: soc: fsl: cpm_qe: cpm1-scc-qmc: Add support for QMC HDLC

2023-09-13 Thread Conor Dooley
On Wed, Sep 13, 2023 at 03:56:16PM +0100, Conor Dooley wrote: > On Wed, Sep 13, 2023 at 04:52:50PM +0200, Herve Codina wrote: > > On Wed, 13 Sep 2023 15:42:45 +0100 > > Conor Dooley wrote: > > > > > On Wed, Sep 13, 2023 at 09:26:40AM +0200, Herve Codina wrote: > > > > Hi Conor, > > > > > > > >

Re: [PATCH v5 08/31] dt-bindings: soc: fsl: cpm_qe: cpm1-scc-qmc: Add support for QMC HDLC

2023-09-13 Thread Conor Dooley
On Wed, Sep 13, 2023 at 04:52:50PM +0200, Herve Codina wrote: > On Wed, 13 Sep 2023 15:42:45 +0100 > Conor Dooley wrote: > > > On Wed, Sep 13, 2023 at 09:26:40AM +0200, Herve Codina wrote: > > > Hi Conor, > > > > > > On Tue, 12 Sep 2023 18:21:58 +0100 > > > Conor Dooley wrote: > > > > > > >

Re: [PATCH v5 08/31] dt-bindings: soc: fsl: cpm_qe: cpm1-scc-qmc: Add support for QMC HDLC

2023-09-13 Thread Herve Codina
On Wed, 13 Sep 2023 15:42:45 +0100 Conor Dooley wrote: > On Wed, Sep 13, 2023 at 09:26:40AM +0200, Herve Codina wrote: > > Hi Conor, > > > > On Tue, 12 Sep 2023 18:21:58 +0100 > > Conor Dooley wrote: > > > > > On Tue, Sep 12, 2023 at 12:10:18PM +0200, Herve Codina wrote: > > > > The QMC

Re: [PATCH v5 08/31] dt-bindings: soc: fsl: cpm_qe: cpm1-scc-qmc: Add support for QMC HDLC

2023-09-13 Thread Conor Dooley
On Wed, Sep 13, 2023 at 09:26:40AM +0200, Herve Codina wrote: > Hi Conor, > > On Tue, 12 Sep 2023 18:21:58 +0100 > Conor Dooley wrote: > > > On Tue, Sep 12, 2023 at 12:10:18PM +0200, Herve Codina wrote: > > > The QMC (QUICC mutichannel controller) is a controller present in some > > >

Re: [PATCH v5 25/31] dt-bindings: net: Add the Lantiq PEF2256 E1/T1/J1 framer

2023-09-13 Thread Conor Dooley
On Tue, Sep 12, 2023 at 01:54:05PM -0500, Rob Herring wrote: > > > + lantiq,data-rate-bps: > > > +$ref: /schemas/types.yaml#/definitions/uint32 > > > +enum: [2048000, 4096000, 8192000, 16384000] > > > > -kBps is a standard suffix, would it be worth using that instead here? > > What you

[PATCH v8 08/24] iommu: Reorganize iommu_get_default_domain_type() to respect def_domain_type()

2023-09-13 Thread Jason Gunthorpe
Except for dart (which forces IOMMU_DOMAIN_DMA) every driver returns 0 or IDENTITY from ops->def_domain_type(). The drivers that return IDENTITY have some kind of good reason, typically that quirky hardware really can't support anything other than IDENTITY. Arrange things so that if the driver

[PATCH v8 24/24] iommu: Convert remaining simple drivers to domain_alloc_paging()

2023-09-13 Thread Jason Gunthorpe
These drivers don't support IOMMU_DOMAIN_DMA, so this commit effectively allows them to support that mode. The prior work to require default_domains makes this safe because every one of these drivers is either compilation incompatible with dma-iommu.c, or already establishing a default_domain. In

[PATCH v8 18/24] iommu/mtk_iommu: Add an IOMMU_IDENTITIY_DOMAIN

2023-09-13 Thread Jason Gunthorpe
This brings back the ops->detach_dev() code that commit 1b932ceddd19 ("iommu: Remove detach_dev callbacks") deleted and turns it into an IDENTITY domain. Reviewed-by: Lu Baolu Reviewed-by: Jerry Snitselaar Signed-off-by: Jason Gunthorpe --- drivers/iommu/mtk_iommu.c | 23

[PATCH v8 23/24] iommu: Convert simple drivers with DOMAIN_DMA to domain_alloc_paging()

2023-09-13 Thread Jason Gunthorpe
These drivers are all trivially converted since the function is only called if the domain type is going to be IOMMU_DOMAIN_UNMANAGED/DMA. Tested-by: Heiko Stuebner Tested-by: Steven Price Tested-by: Marek Szyprowski Tested-by: Nicolin Chen Reviewed-by: Lu Baolu Reviewed-by: Jerry Snitselaar

[PATCH v8 22/24] iommu: Add ops->domain_alloc_paging()

2023-09-13 Thread Jason Gunthorpe
This callback requests the driver to create only a __IOMMU_DOMAIN_PAGING domain, so it saves a few lines in a lot of drivers needlessly checking the type. More critically, this allows us to sweep out all the IOMMU_DOMAIN_UNMANAGED and IOMMU_DOMAIN_DMA checks from a lot of the drivers, simplifying

[PATCH v8 17/24] iommu/ipmmu: Add an IOMMU_IDENTITIY_DOMAIN

2023-09-13 Thread Jason Gunthorpe
This brings back the ops->detach_dev() code that commit 1b932ceddd19 ("iommu: Remove detach_dev callbacks") deleted and turns it into an IDENTITY domain. Also reverts commit 584d334b1393 ("iommu/ipmmu-vmsa: Remove ipmmu_utlb_disable()") Reviewed-by: Lu Baolu Reviewed-by: Jerry Snitselaar

[PATCH v8 10/24] iommu/exynos: Implement an IDENTITY domain

2023-09-13 Thread Jason Gunthorpe
What exynos calls exynos_iommu_detach_device is actually putting the iommu into identity mode. Move to the new core support for ARM_DMA_USE_IOMMU by defining ops->identity_domain. Tested-by: Marek Szyprowski Acked-by: Marek Szyprowski Reviewed-by: Jerry Snitselaar Signed-off-by: Jason

[PATCH v8 15/24] iommu: Remove ops->set_platform_dma_ops()

2023-09-13 Thread Jason Gunthorpe
All drivers are now using IDENTITY or PLATFORM domains for what this did, we can remove it now. It is no longer possible to attach to a NULL domain. Tested-by: Heiko Stuebner Tested-by: Niklas Schnelle Tested-by: Steven Price Tested-by: Marek Szyprowski Tested-by: Nicolin Chen Reviewed-by:

[PATCH v8 00/24] iommu: Make default_domain's mandatory

2023-09-13 Thread Jason Gunthorpe
It has been a long time coming, this series completes the default_domain transition and makes it so that the core IOMMU code will always have a non-NULL default_domain for every driver on every platform. set_platform_dma_ops() turned out to be a bad idea, and so completely remove it. This is

[PATCH v8 11/24] iommu/tegra-smmu: Implement an IDENTITY domain

2023-09-13 Thread Jason Gunthorpe
What tegra-smmu does during tegra_smmu_set_platform_dma() is actually putting the iommu into identity mode. Move to the new core support for ARM_DMA_USE_IOMMU by defining ops->identity_domain. Reviewed-by: Lu Baolu Reviewed-by: Jerry Snitselaar Signed-off-by: Jason Gunthorpe ---

[PATCH v8 09/24] iommu: Allow an IDENTITY domain as the default_domain in ARM32

2023-09-13 Thread Jason Gunthorpe
Even though dma-iommu.c and CONFIG_ARM_DMA_USE_IOMMU do approximately the same stuff, the way they relate to the IOMMU core is quiet different. dma-iommu.c expects the core code to setup an UNMANAGED domain (of type IOMMU_DOMAIN_DMA) and then configures itself to use that domain. This becomes the

[PATCH v8 12/24] iommu/tegra-smmu: Support DMA domains in tegra

2023-09-13 Thread Jason Gunthorpe
All ARM64 iommu drivers should support IOMMU_DOMAIN_DMA to enable dma-iommu.c. tegra is blocking dma-iommu usage, and also default_domain's, because it wants an identity translation. This is needed for some device quirk. The correct way to do this is to support IDENTITY domains and use

[PATCH v8 16/24] iommu/qcom_iommu: Add an IOMMU_IDENTITIY_DOMAIN

2023-09-13 Thread Jason Gunthorpe
This brings back the ops->detach_dev() code that commit 1b932ceddd19 ("iommu: Remove detach_dev callbacks") deleted and turns it into an IDENTITY domain. Reviewed-by: Lu Baolu Reviewed-by: Jerry Snitselaar Signed-off-by: Jason Gunthorpe --- drivers/iommu/arm/arm-smmu/qcom_iommu.c | 39

[PATCH v8 06/24] iommu/tegra-gart: Remove tegra-gart

2023-09-13 Thread Jason Gunthorpe
Thierry says this is not used anymore, and doesn't think it makes sense as an iommu driver. The HW it supports is about 10 years old now and newer HW uses different IOMMU drivers. As this is the only driver with a GART approach, and it doesn't really meet the driver expectations from the IOMMU

[PATCH v8 04/24] iommu: Add IOMMU_DOMAIN_PLATFORM for S390

2023-09-13 Thread Jason Gunthorpe
The PLATFORM domain will be set as the default domain and attached as normal during probe. The driver will ignore the initial attach from a NULL domain to the PLATFORM domain. After this, the PLATFORM domain's attach_dev will be called whenever we detach from an UNMANAGED domain (eg for VFIO).

[PATCH v8 14/24] iommu/msm: Implement an IDENTITY domain

2023-09-13 Thread Jason Gunthorpe
What msm does during msm_iommu_set_platform_dma() is actually putting the iommu into identity mode. Move to the new core support for ARM_DMA_USE_IOMMU by defining ops->identity_domain. This driver does not support IOMMU_DOMAIN_DMA, however it cannot be compiled on ARM64 either. Most likely it is

[PATCH v8 01/24] iommu: Add iommu_ops->identity_domain

2023-09-13 Thread Jason Gunthorpe
This allows a driver to set a global static to an IDENTITY domain and the core code will automatically use it whenever an IDENTITY domain is requested. By making it always available it means the IDENTITY can be used in error handling paths to force the iommu driver into a known state. Devices

[PATCH v8 19/24] iommu/sun50i: Add an IOMMU_IDENTITIY_DOMAIN

2023-09-13 Thread Jason Gunthorpe
Prior to commit 1b932ceddd19 ("iommu: Remove detach_dev callbacks") the sun50i_iommu_detach_device() function was being called by ops->detach_dev(). This is an IDENTITY domain so convert sun50i_iommu_detach_device() into sun50i_iommu_identity_attach() and a full IDENTITY domain and thus hook it

[PATCH v8 21/24] iommu: Add __iommu_group_domain_alloc()

2023-09-13 Thread Jason Gunthorpe
Allocate a domain from a group. Automatically obtains the iommu_ops to use from the device list of the group. Convert the internal callers to use it. Tested-by: Steven Price Tested-by: Marek Szyprowski Tested-by: Nicolin Chen Reviewed-by: Lu Baolu Reviewed-by: Jerry Snitselaar Signed-off-by:

[PATCH v8 13/24] iommu/omap: Implement an IDENTITY domain

2023-09-13 Thread Jason Gunthorpe
What omap does during omap_iommu_set_platform_dma() is actually putting the iommu into identity mode. Move to the new core support for ARM_DMA_USE_IOMMU by defining ops->identity_domain. This driver does not support IOMMU_DOMAIN_DMA, however it cannot be compiled on ARM64 either. Most likely it

[PATCH v8 20/24] iommu: Require a default_domain for all iommu drivers

2023-09-13 Thread Jason Gunthorpe
At this point every iommu driver will cause a default_domain to be selected, so we can finally remove this gap from the core code. The following table explains what each driver supports and what the resulting default_domain will be: ops->defaut_domain

[PATCH v8 02/24] iommu: Add IOMMU_DOMAIN_PLATFORM

2023-09-13 Thread Jason Gunthorpe
This is used when the iommu driver is taking control of the dma_ops, currently only on S390 and power spapr. It is designed to preserve the original ops->detach_dev() semantic that these S390 was built around. Provide an opaque domain type and a 'default_domain' ops value that allows the driver

[PATCH v8 07/24] iommu/mtk_iommu_v1: Implement an IDENTITY domain

2023-09-13 Thread Jason Gunthorpe
What mtk does during mtk_iommu_v1_set_platform_dma() is actually putting the iommu into identity mode. Make this available as a proper IDENTITY domain. The mtk_iommu_v1_def_domain_type() from commit 8bbe13f52cb7 ("iommu/mediatek-v1: Add def_domain_type") explains this was needed to allow

[PATCH v8 03/24] powerpc/iommu: Setup a default domain and remove set_platform_dma_ops

2023-09-13 Thread Jason Gunthorpe
POWER is using the set_platform_dma_ops() callback to hook up its private dma_ops, but this is buired under some indirection and is weirdly happening for a BLOCKED domain as well. For better documentation create a PLATFORM domain to manage the dma_ops, since that is what it is for, and make the

[PATCH v8 05/24] iommu/fsl_pamu: Implement a PLATFORM domain

2023-09-13 Thread Jason Gunthorpe
This driver is nonsensical. To not block migrating the core API away from NULL default_domains give it a hacky of a PLATFORM domain that keeps it working exactly as it always did. Leave some comments around to warn away any future people looking at this. Reviewed-by: Lu Baolu Reviewed-by: Jerry

[PATCH] powerpc: Fix build issue with LD_DEAD_CODE_DATA_ELIMINATION and FTRACE_MCOUNT_USE_PATCHABLE_FUNCTION_ENTRY

2023-09-13 Thread Naveen N Rao
We recently added support for -fpatchable-function-entry and it is enabled by default on ppc32 (ppc64 needs gcc v13.1.0). When building the kernel for ppc32 and also enabling CONFIG_LD_DEAD_CODE_DATA_ELIMINATION, we see the below build error with older gcc versions: powerpc-linux-gnu-ld:

Re: [PATCH] powerpc: add `cur_cpu_spec` symbol to vmcoreinfo

2023-09-13 Thread Sachin Sant
> On 11-Sep-2023, at 2:44 PM, Aditya Gupta wrote: > > Presently, while reading a vmcore, makedumpfile uses > `cur_cpu_spec.mmu_features` to decide whether the crashed system had > RADIX MMU or not. > > Currently, makedumpfile fails to get the `cur_cpu_spec` symbol (unless > a vmlinux is

Re: [PATCH v1 07/19] powerpc: Untangle fixmap.h and pgtable.h and mmu.h

2023-09-13 Thread kernel test robot
Hi Christophe, kernel test robot noticed the following build errors: [auto build test ERROR on linus/master] [also build test ERROR on v6.6-rc1 next-20230913] [If your patch is applied to the wrong git tree, kindly drop us a note. And when submitting patch, we suggest to use '--base

[PATCH v2] ASoC: imx-rpmsg: Set ignore_pmdown_time for dai_link

2023-09-13 Thread Chancel Liu
i.MX rpmsg sound cards work on codec slave mode. MCLK will be disabled by CPU DAI driver in hw_free(). Some codec requires MCLK present at power up/down sequence. So need to set ignore_pmdown_time to power down codec immediately before MCLK is turned off. Take WM8962 as an example, if MCLK is

[PATCH v2 3/8] arch/x86: Remove now superfluous sentinel elem from ctl_table arrays

2023-09-13 Thread Joel Granados via B4 Relay
From: Joel Granados This commit comes at the tail end of a greater effort to remove the empty elements at the end of the ctl_table arrays (sentinels) which will reduce the overall build time size of the kernel and run time memory bloat by ~64 bytes per sentinel (further information Link :

[PATCH v2 2/8] arm: Remove now superfluous sentinel elem from ctl_table arrays

2023-09-13 Thread Joel Granados via B4 Relay
From: Joel Granados This commit comes at the tail end of a greater effort to remove the empty elements at the end of the ctl_table arrays (sentinels) which will reduce the overall build time size of the kernel and run time memory bloat by ~64 bytes per sentinel (further information Link :

[PATCH v2 8/8] c-sky: Remove now superfluous sentinel element from ctl_talbe array

2023-09-13 Thread Joel Granados via B4 Relay
From: Joel Granados This commit comes at the tail end of a greater effort to remove the empty elements at the end of the ctl_table arrays (sentinels) which will reduce the overall build time size of the kernel and run time memory bloat by ~64 bytes per sentinel (further information Link :

  1   2   >