[PATCH v13 35/35] KVM: selftests: Test KVM exit behavior for private memory/access

2023-10-27 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 seco

[PATCH v13 34/35] KVM: selftests: Add basic selftest for guest_memfd()

2023-10-27 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

[PATCH v13 33/35] KVM: selftests: Expand set_memory_region_test to validate guest_memfd()

2023-10-27 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 Co-developed-b

[PATCH v13 32/35] KVM: selftests: Add KVM_SET_USER_MEMORY_REGION2 helper

2023-10-27 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

[PATCH v13 31/35] KVM: selftests: Add x86-only selftest for private memory conversions

2023-10-27 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 ba

[PATCH v13 30/35] KVM: selftests: Add GUEST_SYNC[1-6] macros for synchronizing more data

2023-10-27 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 --g

[PATCH v13 29/35] KVM: selftests: Introduce VM "shape" to allow tests to specify the VM type

2023-10-27 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 typ

[PATCH v13 28/35] KVM: selftests: Add helpers to do KVM_HC_MAP_GPA_RANGE hypercalls (x86)

2023-10-27 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 sh

[PATCH v13 27/35] KVM: selftests: Add helpers to convert guest memory b/w private and shared

2023-10-27 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 s

[PATCH v13 26/35] KVM: selftests: Add support for creating private memslots

2023-10-27 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.

[PATCH v13 25/35] KVM: selftests: Convert lib's mem regions to KVM_SET_USER_MEMORY_REGION2

2023-10-27 Thread Sean Christopherson
Use KVM_SET_USER_MEMORY_REGION2 throughout KVM's selftests library so that support for guest private memory can be added without needing an entirely separate set of helpers. Note, this obviously makes selftests backwards-incompatible with older KVM versions from this point forward. Signed-off-by:

[PATCH v13 24/35] KVM: selftests: Drop unused kvm_userspace_memory_region_find() helper

2023-10-27 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 Chris

[PATCH v13 23/35] KVM: x86: Add support for "protected VMs" that can utilize private memory

2023-10-27 Thread Sean Christopherson
Add a new x86 VM type, KVM_X86_SW_PROTECTED_VM, to serve as a development and testing vehicle for Confidential (CoCo) VMs, and potentially to even become a "real" product in the distant future, e.g. a la pKVM. The private memory support in KVM x86 is aimed at AMD's SEV-SNP and Intel's TDX, but tho

[PATCH v13 22/35] KVM: Allow arch code to track number of memslot address spaces per VM

2023-10-27 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. Disallowi

[PATCH v13 21/35] KVM: Drop superfluous __KVM_VCPU_MULTIPLE_ADDRESS_SPACE macro

2023-10-27 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 insert

[PATCH v13 20/35] KVM: x86/mmu: Handle page fault for private memory

2023-10-27 Thread Sean Christopherson
From: Chao Peng Add support for resolving page faults on guest private memory for VMs that differentiate between "shared" and "private" memory. For such VMs, KVM_MEM_PRIVATE memslots can include both fd-based private memory and hva-based shared memory, and KVM needs to map in the "correct" varia

[PATCH v13 19/35] KVM: x86: Disallow hugepages when memory attributes are mixed

2023-10-27 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 are

[PATCH v13 18/35] KVM: x86: "Reset" vcpu->run->exit_reason early in KVM_RUN

2023-10-27 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 userspace

[PATCH v13 17/35] KVM: Add transparent hugepage support for dedicated guest memory

2023-10-27 Thread Sean Christopherson
Extended guest_memfd to allow backing guest memory with transparent hugepages. Require userspace to opt-in via a flag even though there's no known/anticipated use case for forcing small pages as THP is optional, i.e. to avoid ending up in a situation where userspace is unaware that KVM can't provi

[PATCH v13 16/35] KVM: Add KVM_CREATE_GUEST_MEMFD ioctl() for guest-specific backing memory

2023-10-27 Thread Sean Christopherson
Introduce an ioctl(), KVM_CREATE_GUEST_MEMFD, to allow creating file-based memory that is tied to a specific KVM virtual machine and whose primary purpose is to serve guest memory. A guest-first memory subsystem allows for optimizations and enhancements that are kludgy or outright infeasible to im

[PATCH v13 15/35] fs: Export anon_inode_getfile_secure() for use by KVM

2023-10-27 Thread Sean Christopherson
Export anon_inode_getfile_secure() so that it can be used by KVM to create and manage file-based guest memory without need a fullblow filesystem. The "standard" anon_inode_getfd() doesn't work for KVM's use case as KVM needs a unique inode for each file, e.g. to be able to independently manage the

[PATCH v13 14/35] mm: Add AS_UNMOVABLE to mark mapping as completely unmovable

2023-10-27 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 co

[PATCH v13 13/35] KVM: Introduce per-page memory attributes

2023-10-27 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, o

[PATCH v13 12/35] KVM: Prepare for handling only shared mappings in mmu_notifier events

2023-10-27 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

[PATCH v13 11/35] KVM: Drop .on_unlock() mmu_notifier hook

2023-10-27 Thread Sean Christopherson
Drop the .on_unlock() mmu_notifer hook now that it's no longer used for notifying arch code that memory has been reclaimed. Adding .on_unlock() and invoking it *after* dropping mmu_lock was a terrible idea, as doing so resulted in .on_lock() and .on_unlock() having divergent and asymmetric behavio

[PATCH v13 10/35] KVM: Add a dedicated mmu_notifier flag for reclaiming freed memory

2023-10-27 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

[PATCH v13 09/35] KVM: Add KVM_EXIT_MEMORY_FAULT exit to report faults to userspace

2023-10-27 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.

[PATCH v13 08/35] KVM: Introduce KVM_SET_USER_MEMORY_REGION2

2023-10-27 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 to

[PATCH v13 07/35] KVM: Convert KVM_ARCH_WANT_MMU_NOTIFIER to CONFIG_KVM_GENERIC_MMU_NOTIFIER

2023-10-27 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 t

[PATCH v13 06/35] KVM: PPC: Return '1' unconditionally for KVM_CAP_SYNC_MMU

2023-10-27 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 m

[PATCH v13 05/35] KVM: PPC: Drop dead code related to KVM_ARCH_WANT_MMU_NOTIFIER

2023-10-27 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 arc

[PATCH v13 04/35] KVM: WARN if there are dangling MMU invalidations at VM destruction

2023-10-27 Thread Sean Christopherson
Add an assertion that there are no in-progress MMU invalidations when a VM is being destroyed, with the exception of the scenario where KVM unregisters its MMU notifier between an .invalidate_range_start() call and the corresponding .invalidate_range_end(). KVM can't detect unpaired calls from the

[PATCH v13 03/35] KVM: Use gfn instead of hva for mmu_notifier_retry

2023-10-27 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.

[PATCH v13 02/35] KVM: Assert that mmu_invalidate_in_progress *never* goes negative

2023-10-27 Thread Sean Christopherson
Move the assertion on the in-progress invalidation count from the primary MMU's notifier path to KVM's common notification path, i.e. assert that the count doesn't go negative even when the invalidation is coming from KVM itself. Opportunistically convert the assertion to a KVM_BUG_ON(), i.e. kill

[PATCH v13 00/35] KVM: guest_memfd() and per-page attributes

2023-10-27 Thread Sean Christopherson
Non-KVM people, please take a gander at two small-ish patches buried in the middle of this series: fs: Export anon_inode_getfile_secure() for use by KVM mm: Add AS_UNMOVABLE to mark mapping as completely unmovable Our plan/hope is to take this through the KVM tree for 6.8, reviews (and acks!)

[PATCH v13 01/35] KVM: Tweak kvm_hva_range and hva_handler_t to allow reusing for gfn ranges

2023-10-27 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. Rename the handler typedef too (arguably it should always have been gfn_handler_t). Practi

Re: [PATCH] ppc64: add mmu information to vmcoreinfo

2023-10-27 Thread Aditya Gupta
On Fri, Oct 27, 2023 at 08:59:56PM +1100, Michael Ellerman wrote: > On Mon, 23 Oct 2023 12:56:12 +0530, Aditya Gupta wrote: > > Since below commit, address mapping for vmemmap has changed for Radix > > MMU, where address mapping is stored in kernel page table itself, > > instead of earlier used 'vm

Re: [PATCH] ppc64: add mmu information to vmcoreinfo

2023-10-27 Thread Aditya Gupta
On Fri, Oct 27, 2023 at 08:59:56PM +1100, Michael Ellerman wrote: > On Mon, 23 Oct 2023 12:56:12 +0530, Aditya Gupta wrote: > > Since below commit, address mapping for vmemmap has changed for Radix > > MMU, where address mapping is stored in kernel page table itself, > > instead of earlier used 'vm

Re: [PATCH v3 0/4] PCI: layerscape: Add suspend/resume support for ls1043 and ls1021

2023-10-27 Thread Frank Li
On Tue, Oct 17, 2023 at 03:31:41PM -0400, Frank Li wrote: > Add suspend/resume support for ls1043 and ls1021. > Change log see each patch > > Frank Li (4): > PCI: layerscape: Add function pointer for exit_from_l2() > PCI: layerscape: Add suspend/resume for ls1021a > PCI: layerscape: Rename p

Re: [GIT PULL] Please pull powerpc/linux.git powerpc-6.6-6 tag

2023-10-27 Thread pr-tracker-bot
The pull request you sent on Fri, 27 Oct 2023 19:23:43 +1100: > https://git.kernel.org/pub/scm/linux/kernel/git/powerpc/linux.git > tags/powerpc-6.6-6 has been merged into torvalds/linux.git: https://git.kernel.org/torvalds/c/09a4a03c073bab5b375b71769f708d6932b370f7 Thank you! -- Deet-doot-do

Re: [RFC PATCH v8 00/13] Add audio support in v4l2 framework

2023-10-27 Thread Hans Verkuil
Hi Shengjiu, Is there a reason why this series is still marked RFC? Just wondering about that. Regards, Hans On 27/10/2023 12:35, Shengjiu Wang wrote: > Audio signal processing also has the requirement for memory to > memory similar as Video. > > This asrc memory to memory (memory ->a

[RFC PATCH v8 13/13] media: vim2m_audio: add virtual driver for audio memory to memory

2023-10-27 Thread Shengjiu Wang
Audio memory to memory virtual driver use video memory to memory virtual driver vim2m.c as example. The main difference is device type is VFL_TYPE_AUDIO and device cap type is V4L2_CAP_AUDIO_M2M. The device_run function is a dummy function, which is simply copy the data from input buffer to output

[RFC PATCH v8 12/13] media: imx-asrc: Add memory to memory driver

2023-10-27 Thread Shengjiu Wang
Implement the ASRC memory to memory function using the v4l2 framework, user can use this function with v4l2 ioctl interface. User send the output and capture buffer to driver and driver store the converted data to the capture buffer. This feature can be shared by ASRC and EASRC drivers Signed-of

[RFC PATCH v8 11/13] media: uapi: Add audio rate controls support

2023-10-27 Thread Shengjiu Wang
Add V4L2_CID_M2M_AUDIO_SOURCE_RATE and V4L2_CID_M2M_AUDIO_DEST_RATE new IDs for rate control. Add V4L2_CID_M2M_AUDIO_SOURCE_RATE_OFFSET and V4L2_CID_M2M_AUDIO_DEST_RATE_OFFSET for clock drift. Signed-off-by: Shengjiu Wang --- .../media/v4l/ext-ctrls-audio-m2m.rst | 20 ++

[RFC PATCH v8 10/13] media: uapi: Add V4L2_CTRL_TYPE_FIXED_POINT

2023-10-27 Thread Shengjiu Wang
Fixed point controls are used by the user to configure a fixed point value in 64bits, which Q31.32 format. Signed-off-by: Shengjiu Wang --- .../userspace-api/media/v4l/vidioc-g-ext-ctrls.rst | 13 +++-- .../userspace-api/media/v4l/vidioc-queryctrl.rst| 9 - .../userspace-ap

[RFC PATCH v8 09/13] media: uapi: Add V4L2_CTRL_CLASS_M2M_AUDIO

2023-10-27 Thread Shengjiu Wang
The Audio M2M class includes controls for audio memory-to-memory use cases. The controls can be used for audio codecs, audio preprocessing, audio postprocessing. Signed-off-by: Shengjiu Wang --- .../userspace-api/media/v4l/common.rst| 1 + .../media/v4l/ext-ctrls-audio-m2m.rst |

[RFC PATCH v8 08/13] media: uapi: Define audio sample format fourcc type

2023-10-27 Thread Shengjiu Wang
The audio sample format definition is from alsa, the header file is include/uapi/sound/asound.h, but don't include this header file directly, because in user space, there is another copy in alsa-lib. There will be conflict in userspace for include videodev2.h & asound.h and asoundlib.h Here still

[RFC PATCH v8 07/13] media: v4l2: Add audio capture and output support

2023-10-27 Thread Shengjiu Wang
Audio signal processing has the requirement for memory to memory similar as Video. This patch is to add this support in v4l2 framework, defined new buffer type V4L2_BUF_TYPE_AUDIO_CAPTURE and V4L2_BUF_TYPE_AUDIO_OUTPUT, defined new format v4l2_audio_format for audio case usage. The created audio

[RFC PATCH v8 06/13] media: uapi: Add V4L2_CAP_AUDIO_M2M capability flag

2023-10-27 Thread Shengjiu Wang
V4L2_CAP_AUDIO_M2M is similar to V4L2_CAP_VIDEO_M2M flag. It is used for audio memory to memory case. Signed-off-by: Shengjiu Wang --- Documentation/userspace-api/media/v4l/vidioc-querycap.rst| 3 +++ Documentation/userspace-api/media/videodev2.h.rst.exceptions | 1 + include/uapi/linux/vid

[RFC PATCH v8 05/13] ASoC: fsl_easrc: register m2m platform device

2023-10-27 Thread Shengjiu Wang
Register m2m platform device,that user can use M2M feature. Signed-off-by: Shengjiu Wang Acked-by: Mark Brown --- sound/soc/fsl/fsl_easrc.c | 19 +++ 1 file changed, 19 insertions(+) diff --git a/sound/soc/fsl/fsl_easrc.c b/sound/soc/fsl/fsl_easrc.c index 0b9f3df8efc2..07e7475d

[RFC PATCH v8 04/13] ASoC: fsl_asrc: register m2m platform device

2023-10-27 Thread Shengjiu Wang
Register m2m platform device, that user can use M2M feature. Defined platform data structure and platform driver name. Signed-off-by: Shengjiu Wang Acked-by: Mark Brown --- include/sound/fsl_asrc_common.h | 23 +++ sound/soc/fsl/fsl_asrc.c| 18 ++ 2

[RFC PATCH v8 03/13] ASoC: fsl_asrc: move fsl_asrc_common.h to include/sound

2023-10-27 Thread Shengjiu Wang
Move fsl_asrc_common.h to include/sound that it can be included from other drivers. Signed-off-by: Shengjiu Wang Acked-by: Mark Brown --- {sound/soc/fsl => include/sound}/fsl_asrc_common.h | 0 sound/soc/fsl/fsl_asrc.h | 2 +- sound/soc/fsl/fsl_asrc_dma.c

[RFC PATCH v8 02/13] ASoC: fsl_easrc: define functions for memory to memory usage

2023-10-27 Thread Shengjiu Wang
ASRC can be used on memory to memory case, define several functions for m2m usage and export them as function pointer. Signed-off-by: Shengjiu Wang Acked-by: Mark Brown --- sound/soc/fsl/fsl_easrc.c | 214 ++ sound/soc/fsl/fsl_easrc.h | 4 + 2 files changed

[RFC PATCH v8 00/13] Add audio support in v4l2 framework

2023-10-27 Thread Shengjiu Wang
Audio signal processing also has the requirement for memory to memory similar as Video. This asrc memory to memory (memory ->asrc->memory) case is a non real time use case. User fills the input buffer to the asrc module, after conversion, then asrc sends back the output buffer to user. So it is n

[RFC PATCH v8 01/13] ASoC: fsl_asrc: define functions for memory to memory usage

2023-10-27 Thread Shengjiu Wang
ASRC can be used on memory to memory case, define several functions for m2m usage. m2m_prepare: prepare for the start step m2m_start: the start step m2m_unprepare: unprepare for stop step, optional m2m_stop: stop step m2m_check_format: check format is supported or not m2m_calc_out_len: calculate o

Re: [PATCH v2] powerpc/mm: Avoid calling arch_enter/leave_lazy_mmu() in set_ptes

2023-10-27 Thread Matthew Wilcox
On Tue, Oct 24, 2023 at 08:06:04PM +0530, Aneesh Kumar K.V wrote: > ptep++; > - pte = __pte(pte_val(pte) + (1UL << PTE_RPN_SHIFT)); > addr += PAGE_SIZE; > + /* > + * increment the pfn. > + */ > + pte = pfn_pte

Re: [PATCH] cxl: make cxl_class constant

2023-10-27 Thread Michael Ellerman
Greg Kroah-Hartman writes: > On Wed, Oct 25, 2023 at 10:16:55AM +0200, Frederic Barrat wrote: >> On 24/10/2023 13:48, Greg Kroah-Hartman wrote: >> > Now that the driver core allows for struct class to be in read-only >> > memory, we should make all 'class' structures declared at build time >> > pl

Re: [PATCH] macintosh/macio-adb: add missing iounmap() on error in macio_init()

2023-10-27 Thread Michael Ellerman
On Thu, 05 Jan 2023 14:41:45 +0800, Yang Yingliang wrote: > Add missing iounmap(), if request_irq() fails. > > Applied to powerpc/next. [1/1] macintosh/macio-adb: add missing iounmap() on error in macio_init() https://git.kernel.org/powerpc/c/6db51ff905362e6c79593dbda08f61f24b25971c chee

Re: [PATCH v2] powerpc/pseries: fix potential memory leak in init_cpu_associativity()

2023-10-27 Thread Michael Ellerman
On Wed, 14 Dec 2022 15:46:23 +0800, Wang Yufen wrote: > If the vcpu_associativity alloc memory successfully but the > pcpu_associativity fails to alloc memory, the vcpu_associativity > memory leaks. > > Applied to powerpc/next. [1/1] powerpc/pseries: fix potential memory leak in init_cpu_associ

Re: [PATCH] powerpc/perf: Optimize find_alternatives_list() using binary search

2023-10-27 Thread Michael Ellerman
On Sat, 14 Oct 2023 01:57:14 +0800, Kuan-Wei Chiu wrote: > This patch improves the performance of event alternative lookup by > replacing the previous linear search with a more efficient binary > search. This change reduces the time complexity for the search process > from O(n) to O(log(n)). A pre-

Re: [PATCH v4] powerpc/paravirt: Improve vcpu_is_preempted

2023-10-27 Thread Michael Ellerman
On Thu, 19 Oct 2023 14:44:52 +0530, Srikar Dronamraju wrote: > PowerVM Hypervisor dispatches on a whole core basis. In a shared LPAR, a > CPU from a core that is CEDED or preempted may have a larger latency. In > such a scenario, its preferable to choose a different CPU to run. > > If one of the C

Re: [PATCH 0/7] Expect immutable pointer in virt_to_phys/isa_virt_to_bus prototypes

2023-10-27 Thread Michael Ellerman
On Sat, 15 Apr 2023 04:17:19 -0700, Stanislav Kinsburskii wrote: > This series is aimed to address compilation warnings when a constant pointer > is passed to virt_to_phys and isa_virt_to_bus functions: > > warning: passing argument 1 of ‘virt_to_phys’ discards ‘const’ qualifier > from pointer

Re: [PATCH] powerpc/tools: Pass -mabi=elfv2 to gcc-check-mprofile-kernel.sh

2023-10-27 Thread Michael Ellerman
On Tue, 30 May 2023 15:08:21 +0530, Naveen N Rao wrote: > Toolchains don't always default to the ELFv2 ABI. This is true with at > least the kernel.org toolchains. As such, pass -mabi=elfv2 explicitly to > ensure that we are testing against the correct compiler output. > > Applied to powerpc/nex

Re: [PATCH] powerpc: fsl_msi: Use device_get_match_data()

2023-10-27 Thread Michael Ellerman
On Fri, 06 Oct 2023 16:45:16 -0500, Rob Herring wrote: > Use preferred device_get_match_data() instead of of_match_device() to > get the driver match data. With this, adjust the includes to explicitly > include the correct headers. > > Applied to powerpc/next. [1/1] powerpc: fsl_msi: Use device

Re: (subset) [PATCH 0/6] powerpc/qspinlock: Fix yield latency bug and other

2023-10-27 Thread Michael Ellerman
On Mon, 16 Oct 2023 22:42:59 +1000, Nicholas Piggin wrote: > This fixes a long-standing latency bug in the powerpc qspinlock > implementation that quite a few people have reported and helped > out with debugging. > > The first patch is a minimal fix that avoids the problem. The > other patches are

Re: [PATCH] powerpc/perf: Fix disabling BHRB and instruction sampling

2023-10-27 Thread Michael Ellerman
On Thu, 19 Oct 2023 01:34:23 +1000, Nicholas Piggin wrote: > When the PMU is disabled, MMCRA is not updated to disable BHRB and > instruction sampling. This can lead to those features remaining enabled, > which can slow down a real or emulated CPU. > > Applied to powerpc/next. [1/1] powerpc/per

Re: [PATCH] powerpc/trace: Add support for HAVE_FUNCTION_ARG_ACCESS_API

2023-10-27 Thread Michael Ellerman
On Wed, 14 Jun 2023 14:29:26 +0530, Naveen N Rao wrote: > When creating a kprobe on function entry through tracefs, enable > arguments to be recorded to be specified using $argN syntax. > > Applied to powerpc/next. [1/1] powerpc/trace: Add support for HAVE_FUNCTION_ARG_ACCESS_API https://

Re: [RFC PATCH v1] powerpc: Add version to install filenames

2023-10-27 Thread Michael Ellerman
On Tue, 14 Mar 2023 11:44:42 -0500, Nick Child wrote: > Rather than replacing the versionless vmlinux and System.map files, > copy to files with the version info appended. > > Additionally, since executing the script is a last resort option, > inform the user about the missing `installkernel` comm

Re: [PATCH] powerpc: Hide empty pt_regs at base of the stack

2023-10-27 Thread Michael Ellerman
On Thu, 24 Aug 2023 16:42:10 +1000, Michael Ellerman wrote: > A thread started via eg. user_mode_thread() runs in the kernel to begin > with and then may later return to userspace. While it's running in the > kernel it has a pt_regs at the base of its kernel stack, but that > pt_regs is all zeroes.

Re: [PATCH] powerpc/32s: Implement local_flush_tlb_page_psize()

2023-10-27 Thread Michael Ellerman
On Mon, 23 Oct 2023 20:23:19 +1100, Michael Ellerman wrote: > There's a single call to local_flush_tlb_page_psize() in the code > patching code. That call is never executed on 32-bit Book3S, > because it's guarded by mm_patch_enabled() which is essentially a > radix_enabled() check, which is always

Re: [PATCH] arch: powerpc: net: bpf_jit_comp32.c: Fixed 'instead' typo

2023-10-27 Thread Michael Ellerman
On Fri, 13 Oct 2023 10:31:18 +0500, Muhammad Muzammil wrote: > Fixed 'instead' typo > > Applied to powerpc/next. [1/1] arch: powerpc: net: bpf_jit_comp32.c: Fixed 'instead' typo https://git.kernel.org/powerpc/c/4b47b0fa4b15e0de916e7dd93cd787fdab208ff2 cheers

Re: [PATCH v7 0/5] powerpc/bpf: use BPF prog pack allocator

2023-10-27 Thread Michael Ellerman
On Fri, 20 Oct 2023 19:43:53 +0530, Hari Bathini wrote: > Most BPF programs are small, but they consume a page each. For systems > with busy traffic and many BPF programs, this may also add significant > pressure on instruction TLB. High iTLB pressure usually slows down the > whole system causing v

Re: [PATCH v2] powerpc/vas: Limit open window failure messages in log bufffer

2023-10-27 Thread Michael Ellerman
On Thu, 19 Oct 2023 14:50:33 -0700, Haren Myneni wrote: > The VAS open window call prints error message and returns -EBUSY > after the migration suspend event initiated and until the resume > event completed on the destination system. It can cause the log > buffer filled with these error messages i

Re: [PATCH v2] powerpc/pseries/iommu: enable_ddw incorrectly returns direct mapping for SR-IOV device

2023-10-27 Thread Michael Ellerman
On Mon, 02 Oct 2023 22:08:02 -0500, Gaurav Batra wrote: > When a device is initialized, the driver invokes dma_supported() twice - > first for streaming mappings followed by coherent mappings. For an > SR-IOV device, default window is deleted and DDW created. With vPMEM > enabled, TCE mappings are

Re: [PATCH v1] powerpc/pseries: use kfree_sensitive() in plpks_gen_password()

2023-10-27 Thread Michael Ellerman
On Mon, 17 Jul 2023 17:26:48 +0800, Minjie Du wrote: > password might contain private information, so better use > kfree_sensitive to free it. > In plpks_gen_password() use kfree_sensitive(). > > Applied to powerpc/next. [1/1] powerpc/pseries: use kfree_sensitive() in plpks_gen_password()

Re: (subset) [PATCH v2 00/37] Implement execute-only protection on powerpc

2023-10-27 Thread Michael Ellerman
On Mon, 25 Sep 2023 20:31:14 +0200, Christophe Leroy wrote: > This series reworks _PAGE_FLAGS on all platforms in order > to implement execute-only protection on all powerpc. > > For all targets except 40x and 604 it will be a real execute-only > protection as the hardware and/or software allows a

Re: [PATCH] powerpc: Remove cpm_dp...() macros

2023-10-27 Thread Michael Ellerman
On Wed, 11 Oct 2023 08:27:03 +0200, Christophe Leroy wrote: > Since commit d3c511ac1d72 ("powerpc/cpm: Remove > !CONFIG_PPC_CPM_NEW_BINDING code") cpm_dp...() macros have no added > value anymore. > > Last user of those macros were fixed by commit 5e6cb39a256d ("net: > fs_enet: Use cpm_muram_xxx()

Re: [PATCH] powerpc/code-patching: Perform hwsync in __patch_instruction() in case of failure

2023-10-27 Thread Michael Ellerman
On Sat, 07 Oct 2023 12:46:19 +0200, Christophe Leroy wrote: > Commit c28c15b6d28a ("powerpc/code-patching: Use temporary mm for > Radix MMU") added a hwsync for when __patch_instruction() fails, > we results in a quite odd unbalanced logic. > > Instead of calling mb() when __patch_instruction() re

Re: [PATCH] powerpc/imc-pmu: Use the correct spinlock initializer.

2023-10-27 Thread Michael Ellerman
On Thu, 09 Mar 2023 14:48:31 +0100, Sebastian Andrzej Siewior wrote: > The macro __SPIN_LOCK_INITIALIZER() is implementation specific. Users > that desire to initialize a spinlock in a struct must use > __SPIN_LOCK_UNLOCKED(). > > Use __SPIN_LOCK_UNLOCKED() for the spinlock_t in imc_global_refc. >

Re: [PATCH] ppc64: add mmu information to vmcoreinfo

2023-10-27 Thread Michael Ellerman
On Mon, 23 Oct 2023 12:56:12 +0530, Aditya Gupta wrote: > Since below commit, address mapping for vmemmap has changed for Radix > MMU, where address mapping is stored in kernel page table itself, > instead of earlier used 'vmemmap_list'. > > commit 368a0590d954 ("powerpc/book3s64/vmemmap: swit

Re: (subset) [PATCH 00/12] Miscellaneous Sparse fixes

2023-10-27 Thread Michael Ellerman
On Wed, 11 Oct 2023 16:36:59 +1100, Benjamin Gray wrote: > There are many Sparse warnings in the kernel, including the powerpc > directory. This series provides fixes for some low-hanging fruit found > when trying to triage the warnings earlier this year. It addresses about > 100 warnings (many hav

Re: [PATCH v2] powerpc/mm: Avoid calling arch_enter/leave_lazy_mmu() in set_ptes

2023-10-27 Thread Michael Ellerman
On Tue, 24 Oct 2023 20:06:04 +0530, Aneesh Kumar K.V wrote: > With commit 9fee28baa601 ("powerpc: implement the new page table range > API") we added set_ptes to powerpc architecture. The implementation > included calling arch_enter/leave_lazy_mmu() calls. > > The patch removes the usage of arch_e

Re: [PATCH] powerpc/mm: Fix boot crash with FLATMEM

2023-10-27 Thread Michael Ellerman
On Mon, 23 Oct 2023 22:25:00 +1100, Michael Ellerman wrote: > Erhard reported that his G5 was crashing with v6.6-rc kernels: > > mpic: Setting up HT PICs workarounds for U3/U4 > BUG: Unable to handle kernel data access at 0xfeffbb62ffec65fe > Faulting instruction address: 0xc005dc40

[GIT PULL] Please pull powerpc/linux.git powerpc-6.6-6 tag

2023-10-27 Thread Michael Ellerman
-BEGIN PGP SIGNED MESSAGE- Hash: SHA256 Hi Linus, Please pull some final powerpc fixes for 6.6: The following changes since commit f9bc9bbe8afdf83412728f0b464979a72a3b9ec2: powerpc/qspinlock: Fix stale propagated yield_cpu (2023-10-18 21:07:21 +1100) are available in the git reposito

Re: [PATCH 10/10] [RFC] wifi: remove ipw2100/ipw2200 drivers

2023-10-27 Thread Greg KH
On Thu, Oct 26, 2023 at 12:41:27PM +0300, Kalle Valo wrote: > For example, I see lots of dead code under '#ifdef NOT_YET' and '#if 0', > removing those is a good a start. Also converting the ugly debug_level > procfs file to something more modern would be nice, maybe using just > dev_dbg() throught