[PATCH kernel v2] KVM: PPC: Fix TCE handling for VFIO

2022-04-19 Thread Alexey Kardashevskiy
The LoPAPR spec defines a guest visible IOMMU with a variable page size. Currently QEMU advertises 4K, 64K, 2M, 16MB pages, a Linux VM picks the biggest (16MB). In the case of a passed though PCI device, there is a hardware IOMMU which does not support all pages sizes from the above - P8 cannot do

Re: [PATCH 3/3] KVM: Add helpers to wrap vcpu->srcu_idx and yell if it's abused

2022-04-19 Thread Maxim Levitsky
On Tue, 2022-04-19 at 15:45 +, Sean Christopherson wrote: > On Tue, Apr 19, 2022, Maxim Levitsky wrote: > > On Fri, 2022-04-15 at 00:43 +, Sean Christopherson wrote: > > > Add wrappers to acquire/release KVM's SRCU lock when stashing the index > > > in vcpu->src_idx, along with rudimentary

[PATCH] ASoC: fsl_asrc: using pm_runtime_resume_and_get to simplify the code

2022-04-19 Thread cgel . zte
From: Minghao Chi Using pm_runtime_resume_and_get() to replace pm_runtime_get_sync and pm_runtime_put_noidle. This change is just to simplify the code, no actual functional changes. Reported-by: Zeal Robot Signed-off-by: Minghao Chi --- sound/soc/fsl/fsl_asrc.c | 6 ++ 1 file changed, 2 i

Re: [PATCH v1 1/1] powerpc/83xx/mpc8349emitx: Get rid of of_node assignment

2022-04-19 Thread Linus Walleij
On Wed, Apr 6, 2022 at 3:02 PM Andy Shevchenko wrote: > On Mon, Mar 28, 2022 at 03:16:08PM +0200, Linus Walleij wrote: > > On Wed, Mar 23, 2022 at 6:43 PM Andy Shevchenko > > wrote: > > > > > Let GPIO library to assign of_node from the parent device. > > > This allows to move GPIO library and dri

Apply d799769188529abc6cbf035a10087a51f7832b6b to 5.17 and 5.15?

2022-04-19 Thread Nathan Chancellor
Hi Greg, Sasha, and Michael, Commit d79976918852 ("powerpc/64: Add UADDR64 relocation support") fixes a boot failure with CONFIG_RELOCATABLE=y kernels linked with recent versions of ld.lld [1]. Additionally, it resolves a separate boot failure that Paul Menzel reported [2] with ld.lld 13.0.0. Is t

Re: [PATCH 3/3] KVM: Add helpers to wrap vcpu->srcu_idx and yell if it's abused

2022-04-19 Thread Fabiano Rosas
Sean Christopherson writes: > Add wrappers to acquire/release KVM's SRCU lock when stashing the index > in vcpu->src_idx, along with rudimentary detection of illegal usage, > e.g. re-acquiring SRCU and thus overwriting vcpu->src_idx. Because the > SRCU index is (currently) either 0 or 1, illegal

Re: [PATCH RFC 2/8] arm64: stacktrace: Add arch_within_stack_frames

2022-04-19 Thread Mark Rutland
Hi, On Mon, Apr 18, 2022 at 09:22:11PM +0800, He Zhe wrote: > This function checks if the given address range crosses frame boundary. I don't think that's quite true, becuase arm64's procedure call standard (AAPCS64) doesn't give us enough information to determine this without additional metadata

Re: [PATCH RFC 1/8] stacktrace: Change callback prototype to pass more information

2022-04-19 Thread He Zhe
On 4/19/22 21:09, Mark Rutland wrote: > On Mon, Apr 18, 2022 at 09:22:10PM +0800, He Zhe wrote: >> Currently stack_trace_consume_fn can only have pc of each frame of the >> stack. Copying-beyond-the-frame-detection also needs fp of current and >> previous frame. Other detection algorithm in the

Re: [PATCH RFC 2/8] arm64: stacktrace: Add arch_within_stack_frames

2022-04-19 Thread He Zhe
On 4/19/22 05:59, Kees Cook wrote: > On Mon, Apr 18, 2022 at 09:22:11PM +0800, He Zhe wrote: >> This function checks if the given address range crosses frame boundary. >> It is based on the existing x86 algorithm, but implemented via stacktrace. >> This can be tested by USERCOPY_STACK_FRAME_FROM

Re: [PATCH v2 1/2] of: Create platform devices for OF framebuffers

2022-04-19 Thread Thomas Zimmermann
Hi Am 19.04.22 um 15:30 schrieb Rob Herring: ... -#ifndef CONFIG_PPC static const struct of_device_id reserved_mem_matches[] = { { .compatible = "qcom,rmtfs-mem" }, { .compatible = "qcom,cmd-db" }, @@ -520,33 +519,81 @@ static const struct of_device_id reserved_mem_matches[] =

Re: [PATCH v2 1/2] of: Create platform devices for OF framebuffers

2022-04-19 Thread Rob Herring
On Tue, Apr 19, 2022 at 12:04:04PM +0200, Thomas Zimmermann wrote: > Create a platform device for each OF-declared framebuffer and have > offb bind to these devices. Allows for real hot-unplugging and other > drivers besides offb. > > Originally, offb created framebuffer devices while initializing

Re: [PATCH RFC 1/8] stacktrace: Change callback prototype to pass more information

2022-04-19 Thread Mark Rutland
On Mon, Apr 18, 2022 at 09:22:10PM +0800, He Zhe wrote: > Currently stack_trace_consume_fn can only have pc of each frame of the > stack. Copying-beyond-the-frame-detection also needs fp of current and > previous frame. Other detection algorithm in the future may need more > information of the fram

Re: [PATCH v2 3/8] x86/pgtable: support __HAVE_ARCH_PTE_SWP_EXCLUSIVE

2022-04-19 Thread David Hildenbrand
On 29.03.22 18:43, David Hildenbrand wrote: > Let's use bit 3 to remember PG_anon_exclusive in swap ptes. > > Signed-off-by: David Hildenbrand > --- Looks like I ignored that 32bit uses a different (undocumented) swap layout and bit 3 falls into the swp type. We'll restrict this to x86-64 for no

[PATCH V3 2/2] powerpc/perf: Fix the power10 event alternatives array to have correct sort order

2022-04-19 Thread Athira Rajeev
When scheduling a group of events, there are constraint checks done to make sure all events can go in a group. Example, one of the criteria is that events in a group cannot use same PMC. But platform specific PMU supports alternative event for some of the event codes. During perf_event_open, if any

[PATCH V3 1/2] powerpc/perf: Fix the power9 event alternatives array to have correct sort order

2022-04-19 Thread Athira Rajeev
When scheduling a group of events, there are constraint checks done to make sure all events can go in a group. Example, one of the criteria is that events in a group cannot use same PMC. But platform specific PMU supports alternative event for some of the event codes. During perf_event_open, if any

Re: [PATCH] misc: ocxl: fix possible double free in ocxl_file_register_afu

2022-04-19 Thread Hangyu Hua
On 2022/4/19 17:09, Frederic Barrat wrote: On 18/04/2022 10:57, Hangyu Hua wrote: info_release() will be called in device_unregister() when info->dev's reference count is 0. So there is no need to call ocxl_afu_put() and kfree() again. Fix this by adding free_minor() and return to err_unregis

Re: [PATCH 3/3] KVM: Add helpers to wrap vcpu->srcu_idx and yell if it's abused

2022-04-19 Thread Maxim Levitsky
On Fri, 2022-04-15 at 00:43 +, Sean Christopherson wrote: > Add wrappers to acquire/release KVM's SRCU lock when stashing the index > in vcpu->src_idx, along with rudimentary detection of illegal usage, > e.g. re-acquiring SRCU and thus overwriting vcpu->src_idx. Because the > SRCU index is (c

Re: [PATCH 1/3] KVM: x86: Don't re-acquire SRCU lock in complete_emulated_io()

2022-04-19 Thread Maxim Levitsky
On Fri, 2022-04-15 at 00:43 +, Sean Christopherson wrote: > Don't re-acquire SRCU in complete_emulated_io() now that KVM acquires the > lock in kvm_arch_vcpu_ioctl_run(). More importantly, don't overwrite > vcpu->srcu_idx. If the index acquired by complete_emulated_io() differs > from the one

Re: [PATCH net-next v4 14/18] sfc: Remove usage of list iterator for list_add() after the loop body

2022-04-19 Thread Martin Habets
On Fri, Apr 15, 2022 at 02:29:43PM +0200, Jakob Koschel wrote: > In preparation to limit the scope of a list iterator to the list > traversal loop, use a dedicated pointer pointing to the location > where the element should be inserted [1]. > > Before, the code implicitly used the head when no ele

[PATCH v2 0/2] of: Register platform device for each framebuffer

2022-04-19 Thread Thomas Zimmermann
Move the detection of OF framebuffers from fbdev into of platform code and register a Linux platform device for each framebuffer. Allows for DRM-based OF drivers and real hot-unplugging of the framebuffer. This patchset has been tested with qemu's ppc64le emulation, which provides a framebuffer vi

[PATCH v2 2/2] fbdev: Warn in hot-unplug workaround for framebuffers without device

2022-04-19 Thread Thomas Zimmermann
A workaround makes fbdev hot-unplugging work for framebuffers without device. The only user for this feature was offb. As each OF framebuffer now has an associated platform device, the workaround hould no longer be triggered. Update it with a warning and rewrite the comment. Fbdev drivers that trig

[PATCH v2 1/2] of: Create platform devices for OF framebuffers

2022-04-19 Thread Thomas Zimmermann
Create a platform device for each OF-declared framebuffer and have offb bind to these devices. Allows for real hot-unplugging and other drivers besides offb. Originally, offb created framebuffer devices while initializing its module by parsing the OF device tree. No actual Linux device was set up.

Re: [PATCH] misc: ocxl: fix possible double free in ocxl_file_register_afu

2022-04-19 Thread Frederic Barrat
On 18/04/2022 10:57, Hangyu Hua wrote: info_release() will be called in device_unregister() when info->dev's reference count is 0. So there is no need to call ocxl_afu_put() and kfree() again. Fix this by adding free_minor() and return to err_unregister error path. Fixes: 75ca758adbaf ("ocxl

Re: [RFC v4 PATCH 4/5] powerpc/crash hp: add crash hotplug support for kexec_file_load

2022-04-19 Thread Sourabh Jain
On 14/04/22 22:02, Laurent Dufour wrote: On 11/04/2022, 10:43:56, Sourabh Jain wrote: Two major changes are done to enable the crash CPU hotplug handler. Firstly, updated the kexec load path to prepare kimage for hotplug changes, and secondly, implemented the crash hotplug handler. On the kex

Re: [RFC v4 PATCH 3/5] powrepc/crash hp: update kimage_arch struct

2022-04-19 Thread Sourabh Jain
On 14/04/22 22:05, Laurent Dufour wrote: On 11/04/2022, 10:43:55, Sourabh Jain wrote: Two new members fdt_index and fdt_index_valid are added in kimage_arch struct to track the FDT kexec segment. These new members of kimage_arch struct will help the crash hotplug handler to easily access the F

Re: [RFC v4 PATCH 2/5] powerpc/crash hp: introduce a new config option CRASH_HOTPLUG

2022-04-19 Thread Sourabh Jain
On 14/04/22 22:10, Laurent Dufour wrote: On 11/04/2022, 10:43:54, Sourabh Jain wrote: The option CRASH_HOTPLUG enables, in kernel update to kexec segments on hotplug events. All the updates needed on the capture kernel load path in the kernel for both kexec_load and kexec_file_load system wil

Re: [PATCH] macintosh: macio_asic: fix resource_size.cocci warnings

2022-04-19 Thread Uwe Kleine-König
On Thu, Apr 14, 2022 at 07:02:42AM -0700, Yihao Han wrote: > drivers/macintosh/macio_asic.c:219:26-29: WARNING: > Suspicious code. resource_size is maybe missing with res > drivers/macintosh/macio_asic.c:221:26-29: WARNING: > Suspicious code. resource_size is maybe missing with res For log message

Re: [PATCH 2/2] fbdev: Remove hot-unplug workaround for framebuffers without device

2022-04-19 Thread Javier Martinez Canillas
Hello Thomas, On 4/13/22 20:09, Thomas Zimmermann wrote: [snip] index bc6ed750e915..bdd00d381bbc 100644 --- a/drivers/video/fbdev/core/fbmem.c +++ b/drivers/video/fbdev/core/fbmem.c @@ -1579,14 +1579,7 @@ static void do_remove_conflicting_framebuffers(struct apertures_s

Re: [PATCH net-next v2] net: ethernet: Prepare cleanup of powerpc's asm/prom.h

2022-04-19 Thread Paolo Abeni
Hello, Sorry for the late reply. On Fri, 2022-04-15 at 10:39 +0200, Christophe Leroy wrote: > powerpc's asm/prom.h brings some headers that it doesn't > need itself. It's probably my fault, but I really can't parse the above. Could you please re-phrase? > > In order to clean it up in a further