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

2023-09-15 Thread Xiaoyao Li
On 9/14/2023 9:55 AM, Sean Christopherson wrote: 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 addi

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

2023-09-15 Thread Yan Zhao
On Wed, Sep 13, 2023 at 06:55:09PM -0700, Sean Christopherson wrote: > 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 cas

Re: [PATCH] powerpc/82xx: Select FSL_SOC

2023-09-15 Thread Michael Ellerman
Christophe Leroy writes: > Le 15/09/2023 à 02:43, Michael Ellerman a écrit : >> Christophe Leroy writes: >>> It used to be impossible to select CONFIG_CPM2 without selecting >>> CONFIG_FSL_SOC at the same time because CONFIG_CPM2 was dependent >>> on CONFIG_8260 and CONFIG_8260 was selecting CONF

Re: [PATCH] ASoC: imx-audmix: Fix return error with devm_clk_get()

2023-09-15 Thread Daniel Baluta
On Fri, Sep 15, 2023 at 9:38 AM Shengjiu Wang wrote: > > The devm_clk_get() can return -EPROBE_DEFER error, > modify the error code to be -EINVAL is not correct, which > cause the -EPROBE_DEFER error is not correctly handled. > > This patch is to fix the return error code. > > Fixes: b86ef5367761

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

2023-09-15 Thread Michael Ellerman
Sohil Mehta writes: > commit c35559f94ebc ("x86/shstk: Introduce map_shadow_stack syscall") > recently added support for map_shadow_stack() but it is limited to x86 > only for now. There is a possibility that other architectures (namely, > arm64 and RISC-V), that are implementing equivalent suppor

Re: [PATCH tty v1 00/74] serial: wrappers for uart port lock

2023-09-15 Thread Ilpo Järvinen
On Thu, 14 Sep 2023, John Ogness wrote: > When a serial port is used for kernel console output, then all > modifications to the UART registers which are done from other contexts, > e.g. getty, termios, are interference points for the kernel console. > > So far this has been ignored and the printk

Re: [PATCH v2] crypto: vmx: Improved AES/XTS performance of 6-way unrolling for ppc.

2023-09-15 Thread Herbert Xu
On Wed, Aug 30, 2023 at 09:49:11AM -0400, Danny Tsen wrote: > Improve AES/XTS performance of 6-way unrolling for PowerPC up > to 17% with tcrypt. This is done by using one instruction, > vpermxor, to replace xor and vsldoi. > > The same changes were applied to OpenSSL code and a pull request was

Re: [PATCH v2] crypto: vmx: Improved AES/XTS performance of 6-way unrolling for ppc.

2023-09-15 Thread Danny Tsen
Thanks Herbert. -Danny On 9/15/23 5:41 AM, Herbert Xu wrote: On Wed, Aug 30, 2023 at 09:49:11AM -0400, Danny Tsen wrote: Improve AES/XTS performance of 6-way unrolling for PowerPC up to 17% with tcrypt. This is done by using one instruction, vpermxor, to replace xor and vsldoi. The same chan

Re: [PATCH tty v1 00/74] serial: wrappers for uart port lock

2023-09-15 Thread Thomas Gleixner
On Thu, Sep 14 2023 at 20:01, Maciej W. Rozycki wrote: > On Thu, 14 Sep 2023, John Ogness wrote: > >> Patches 2-74 switch all uart port locking call sites to use the new >> wrappers. These patches were automatically generated using coccinelle. > > Hmm, no need to do this for drivers/tty/serial/zs

Re: [PATCH v2] crypto: vmx: Improved AES/XTS performance of 6-way unrolling for ppc.

2023-09-15 Thread Michael Ellerman
Danny Tsen writes: > Improve AES/XTS performance of 6-way unrolling for PowerPC up > to 17% with tcrypt. This is done by using one instruction, > vpermxor, to replace xor and vsldoi. > > The same changes were applied to OpenSSL code and a pull request was > submitted. https://github.com/openssl/

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

2023-09-15 Thread Sean Christopherson
On Fri, Sep 15, 2023, Yan Zhao wrote: > On Wed, Sep 13, 2023 at 06:55:16PM -0700, Sean Christopherson wrote: > > > +static void kvm_mmu_prepare_memory_fault_exit(struct kvm_vcpu *vcpu, > > + struct kvm_page_fault *fault) > > +{ > > + kvm_prepare_memory

[powerpc:topic/ppc-kvm] BUILD SUCCESS 476652297f94a2e5e5ef29e734b0da37ade94110

2023-09-15 Thread kernel test robot
allnoconfig gcc arc allyesconfig gcc arc defconfig gcc arc randconfig-001-20230915 gcc arm allmodconfig gcc arm

Re: [PATCH v2] crypto: vmx: Improved AES/XTS performance of 6-way unrolling for ppc.

2023-09-15 Thread Danny Tsen
Still waiting for the CCLA to send to Openssl. Thanks. -Danny On 9/15/23 8:29 AM, Michael Ellerman wrote: Danny Tsen writes: Improve AES/XTS performance of 6-way unrolling for PowerPC up to 17% with tcrypt. This is done by using one instruction, vpermxor, to replace xor and vsldoi. The sam

Re: [PATCH 1/3] core/device: Add function to return child node using name at substring "@"

2023-09-15 Thread Reza Arbab
Hi Athira, On Thu, Sep 14, 2023 at 10:02:04PM +0530, Athira Rajeev wrote: +struct dt_node *dt_find_by_name_before_addr(struct dt_node *root, const char *name) +{ + struct dt_node *child, *match; + char *child_node = NULL; + + list_for_each(&root->children, child, list) { +

Re: [PATCH tty v1 72/74] serial: ucc_uart: Use port lock wrappers

2023-09-15 Thread Timur Tabi
On Thu, Sep 14, 2023 at 1:39 PM John Ogness wrote: > Converted with coccinelle. No functional change. > > Signed-off-by: Thomas Gleixner > --- > drivers/tty/serial/ucc_uart.c | 4 ++-- Acked-by: Timur Tabi

Re: [PATCH] ASoC: imx-audmix: Fix return error with devm_clk_get()

2023-09-15 Thread Mark Brown
On Fri, 15 Sep 2023 14:02:11 +0800, Shengjiu Wang wrote: > The devm_clk_get() can return -EPROBE_DEFER error, > modify the error code to be -EINVAL is not correct, which > cause the -EPROBE_DEFER error is not correctly handled. > > This patch is to fix the return error code. > > > [...] Applied

Re: [PATCH 1/3] core/device: Add function to return child node using name at substring "@"

2023-09-15 Thread Athira Rajeev
> On 15-Sep-2023, at 8:00 PM, Reza Arbab wrote: > > Hi Athira, > > On Thu, Sep 14, 2023 at 10:02:04PM +0530, Athira Rajeev wrote: >> +struct dt_node *dt_find_by_name_before_addr(struct dt_node *root, const >> char *name) >> +{ >> + struct dt_node *child, *match; >> + char *child_node = NULL

[PATCH 1/3] PCI: layerscape: add function pointer for exit_from_l2()

2023-09-15 Thread Frank Li
Difference layerscape chip have not difference exit_from_l2() method. Using function pointer for ls1028. It prepare for other layerscape suspend/resume support. Signed-off-by: Frank Li --- drivers/pci/controller/dwc/pci-layerscape.c | 7 +-- 1 file changed, 5 insertions(+), 2 deletions(-) d

[PATCH 2/3] PCI: layerscape: add suspend/resume for ls1021a

2023-09-15 Thread Frank Li
ls1021a add suspend/resume support. Signed-off-by: Frank Li --- drivers/pci/controller/dwc/pci-layerscape.c | 88 - 1 file changed, 87 insertions(+), 1 deletion(-) diff --git a/drivers/pci/controller/dwc/pci-layerscape.c b/drivers/pci/controller/dwc/pci-layerscape.c index 2

[PATCH 3/3] PCI: layerscape: add suspend/resume for ls1043a

2023-09-15 Thread Frank Li
ls1043a add suspend/resume support. Signed-off-by: Frank Li --- drivers/pci/controller/dwc/pci-layerscape.c | 91 - 1 file changed, 90 insertions(+), 1 deletion(-) diff --git a/drivers/pci/controller/dwc/pci-layerscape.c b/drivers/pci/controller/dwc/pci-layerscape.c index b

[PATCH][next] net: spider_net: Use size_add() in call to struct_size()

2023-09-15 Thread Gustavo A. R. Silva
If, for any reason, the open-coded arithmetic causes a wraparound, the protection that `struct_size()` adds against potential integer overflows is defeated. Fix this by hardening call to `struct_size()` with `size_add()`. Fixes: 3f1071ec39f7 ("net: spider_net: Use struct_size() helper") Signed-off

Re: [PATCH][next] net: spider_net: Use size_add() in call to struct_size()

2023-09-15 Thread Kees Cook
On Fri, Sep 15, 2023 at 01:25:36PM -0600, Gustavo A. R. Silva wrote: > If, for any reason, the open-coded arithmetic causes a wraparound, > the protection that `struct_size()` adds against potential integer > overflows is defeated. Fix this by hardening call to `struct_size()` > with `size_add()`.

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

2023-09-15 Thread Sean Christopherson
On Fri, Sep 15, 2023, Xiaoyao Li wrote: > On 9/14/2023 9:54 AM, Sean Christopherson wrote: > > 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 virtua

Re: [PATCH][next] net: spider_net: Use size_add() in call to struct_size()

2023-09-15 Thread Geoff Levand
On 9/15/23 14:25, Gustavo A. R. Silva wrote: > If, for any reason, the open-coded arithmetic causes a wraparound, > the protection that `struct_size()` adds against potential integer > overflows is defeated. Fix this by hardening call to `struct_size()` > with `size_add()`. > > Fixes: 3f1071ec39f7

[PATCH 00/26] KVM: vfio: Hide KVM internals from others

2023-09-15 Thread Sean Christopherson
This is a borderline RFC series to hide KVM's internals from the rest of the kernel, where "internals" means data structures, enums, #defines, APIs, etc. that are intended to be KVM-only, but are exposed everywhere due to kvm_host.h (and other headers) living in the global include paths. The motiv

[PATCH 01/26] vfio: Wrap KVM helpers with CONFIG_KVM instead of CONFIG_HAVE_KVM

2023-09-15 Thread Sean Christopherson
Wrap the helpers for getting references to KVM instances with a check on CONFIG_KVM being enabled, not on CONFIG_HAVE_KVM being defined. PPC does NOT select HAVE_KVM, despite obviously supporting KVM, and guarding code to get references to KVM based on whether or not the architecture supports KVM

[PATCH 02/26] vfio: Move KVM get/put helpers to colocate it with other KVM related code

2023-09-15 Thread Sean Christopherson
Move the definitions of vfio_device_get_kvm_safe() and vfio_device_put_kvm() down in vfio_main.c to colocate them with other KVM-specific functions, e.g. to allow wrapping them all with a single CONFIG_KVM check. Signed-off-by: Sean Christopherson --- drivers/vfio/vfio_main.c | 104 +

[PATCH 03/26] virt: Declare and define vfio_file_set_kvm() iff CONFIG_KVM is enabled

2023-09-15 Thread Sean Christopherson
Hide vfio_file_set_kvm() and its unique helpers if KVM is not enabled, nothing else in the kernel (or out of the kernel) should be using a KVM specific helper. Signed-off-by: Sean Christopherson --- drivers/vfio/vfio_main.c | 2 +- include/linux/vfio.h | 2 ++ 2 files changed, 3 insertions(+

[PATCH 04/26] vfio: Add struct to hold KVM assets and dedup group vs. iommufd code

2023-09-15 Thread Sean Christopherson
Add a struct to hold the KVM assets need to manage and pass along KVM references to VFIO devices. Providing a common struct deduplicates the group vs. iommufd code, and will make it easier to rework the attachment logic so that VFIO doesn't have to do a symbol lookup to retrieve the get/put helper

[PATCH 05/26] vfio: KVM: Pass get/put helpers from KVM to VFIO, don't do circular lookup

2023-09-15 Thread Sean Christopherson
Explicitly pass KVM's get/put helpers to VFIO when attaching a VM to VFIO instead of having VFIO do a symbol lookup back into KVM. Having both KVM and VFIO do symbol lookups increases the overall complexity and places an unnecessary dependency on KVM (from VFIO) without adding any value. Signed-o

[PATCH 06/26] KVM: Drop CONFIG_KVM_VFIO and just look at KVM+VFIO

2023-09-15 Thread Sean Christopherson
Drop KVM's KVM_VFIO Kconfig, and instead compile in VFIO support if and only if VFIO itself is enabled. Similar to the recent change to have VFIO stop looking at HAVE_KVM, compiling in support for talking to VFIO just because the architecture supports VFIO is nonsensical. This fixes a bug where R

[PATCH 07/26] x86/idt: Wrap KVM logic with CONFIG_KVM instead of CONFIG_HAVE_KVM

2023-09-15 Thread Sean Christopherson
Wrap all of the IDT-related code that deals with KVM in CONFIG_KVM instead of CONFIG_HAVE_KVM. x86 always "has" KVM, i.e. checking CONFIG_HAVE_KVM is pointless. Alternatively, the #ifdefs could simply be deleted, but the only potential value is in printing the number of posted interrupts that end

[PATCH 08/26] KVM: x86: Stop selecting and depending on HAVE_KVM

2023-09-15 Thread Sean Christopherson
Now that nothing in x86 or architecture agnostic code consumes HAVE_KVM, stop selecting it in x86. This is one of several steps towards deleting HAVE_KVM from the common KVM Kconfig. Signed-off-by: Sean Christopherson --- arch/x86/Kconfig | 1 - arch/x86/kvm/Kconfig | 2 -- 2 files changed,

[PATCH 09/26] KVM: arm64: Stop selecting and depending on HAVE_KVM

2023-09-15 Thread Sean Christopherson
Now that nothing in arm64 or architecture agnostic code consumes HAVE_KVM, stop selecting it in arm64. This is one of several steps towards deleting HAVE_KVM from the common KVM Kconfig. Signed-off-by: Sean Christopherson --- arch/arm64/Kconfig | 1 - arch/arm64/kvm/Kconfig | 1 - 2 files c

[PATCH 10/26] KVM: s390: Stop selecting and depending on HAVE_KVM

2023-09-15 Thread Sean Christopherson
Now that nothing in s390 or architecture agnostic code consumes HAVE_KVM, stop selecting it in s390. This is one of several steps towards deleting HAVE_KVM from the common KVM Kconfig. Signed-off-by: Sean Christopherson --- arch/s390/Kconfig | 1 - arch/s390/kvm/Kconfig | 1 - 2 files chang

[PATCH 11/26] KVM: MIPS: Make HAVE_KVM a MIPS-only Kconfig

2023-09-15 Thread Sean Christopherson
Now that MIPS is the sole remaining user of HAVE_KVM, make HAVE_KVM a MIPS-only Kconfig. Because most architectures unconditionally support virtualization, advertising to the kernel at-large that an arch has KVM just led to a bunch of useless and misguided #ifdefs. Signed-off-by: Sean Christopher

[PATCH 12/26] KVM: arm64: Move arm_{psci,hypercalls}.h to an internal KVM path

2023-09-15 Thread Sean Christopherson
From: Anish Ghulati Move arm_hypercalls.h and arm_psci.h into arch/arm64/kvm now that KVM no longer supports 32-bit ARM, i.e. now that there's no reason to make the hypercall and PSCI APIs "public". Signed-off-by: Anish Ghulati [sean: squash into one patch, write changelog] Signed-off-by: Sean

[PATCH 13/26] KVM: arm64: Include KVM headers to get forward declarations

2023-09-15 Thread Sean Christopherson
Include include/uapi/linux/kvm.h and include/linux/kvm_types.h in ARM's public arm_arch_timer.h and arm_pmu.h headers to get forward declarations of things like "struct kvm_vcpu" and "struct kvm_device_attr", which are referenced but never declared (neither file includes *any* KVM headers). The mi

[PATCH 14/26] KVM: arm64: Move ARM specific headers in include/kvm to arch directory

2023-09-15 Thread Sean Christopherson
Move kvm/arm_{arch_timer,pmu,vgic}.h to arch/arm64/include/asm and drop the "arm" prefix from all file names. Now that KVM no longer supports 32-bit ARM, there is no reason to expose ARM specific headers to other architectures beyond arm64. Signed-off-by: Sean Christopherson --- .../arm64/inclu

[PATCH 15/26] KVM: Move include/kvm/iodev.h to include/linux as kvm_iodev.h

2023-09-15 Thread Sean Christopherson
Move iodev.h, the last remaining holdout in include/kvm, to the standard include/linux directory as kvm_iodev.h and delete include/kvm. Signed-off-by: Sean Christopherson --- MAINTAINERS| 1 - arch/arm64/include/asm/kvm_vgic.h | 2 +- arch/arm64/kvm/vgic/

[PATCH 16/26] KVM: MIPS: Stop adding virt/kvm to the arch include path

2023-09-15 Thread Sean Christopherson
Don't add virt/kvm to KVM MIPS' include path, the headers in virt/kvm are intended to be used only by other code in virt/kvm, i.e. are "private" to the core KVM code. It's not clear that MIPS *ever* included a header from virt/kvm, i.e. odds are good the "-Ivirt/kvm" was copied from a different ar

[PATCH 17/26] KVM: PPC: Stop adding virt/kvm to the arch include path

2023-09-15 Thread Sean Christopherson
Don't add virt/kvm to KVM PPC's include path, the headers in virt/kvm are intended to be used only by other code in virt/kvm, i.e. are "private" to the core KVM code. It's not clear that PPC *ever* included a header from virt/kvm, i.e. odds are good the "-Ivirt/kvm" was copied from a different arc

[PATCH 18/26] KVM: s390: Stop adding virt/kvm to the arch include path

2023-09-15 Thread Sean Christopherson
Don't add virt/kvm to KVM s390's include path, the headers in virt/kvm are intended to be used only by other code in virt/kvm, i.e. are "private" to the core KVM code. It's not clear that s390 *ever* included a header from virt/kvm, i.e. odds are good the "-Ivirt/kvm" was copied from a x86's Makef

[PATCH 19/26] KVM: Standardize include paths across all architectures

2023-09-15 Thread Sean Christopherson
Standardize KVM's include paths across all architectures by declaring the KVM-specific includes in the common Makefile.kvm. Having common KVM "own" the included paths reduces the temptation to unnecessarily add virt/kvm to arch include paths, and conversely if allowing arch code to grab headers fr

[PATCH 20/26] perf/x86: KVM: Have perf define a dedicated struct for getting guest PEBS data

2023-09-15 Thread Sean Christopherson
Have perf define a struct for getting guest PEBS data from KVM instead of poking into the kvm_pmu structure. Passing in an entire "struct kvm_pmu" _as an opaque pointer_ to get at three fields is silly, especially since one of the fields exists purely to convey information to perf, i.e. isn't used

[PATCH 21/26] entry/kvm: Drop @vcpu param from arch_xfer_to_guest_mode_handle_work()

2023-09-15 Thread Sean Christopherson
Drop the "struct kvm_vcpu" parameter from arch_xfer_to_guest_mode_handle_work() as a preparatory step towards removing the vCPU parameter from xfer_to_guest_mode_work() as well. Signed-off-by: Sean Christopherson --- include/linux/entry-kvm.h | 7 ++- kernel/entry/kvm.c| 2 +- 2 file

[PATCH 22/26] entry/kvm: KVM: Move KVM details related to signal/-EINTR into KVM proper

2023-09-15 Thread Sean Christopherson
Move KVM's morphing of pending signals into exits to userspace into KVM proper, and drop the @vcpu param from xfer_to_guest_mode_handle_work(). How KVM responds to -EINTR is a detail that really belongs in KVM itself, and removing the non-KVM call to kvm_handle_signal_exit() will allow hiding said

[PATCH 23/26] KVM: arm64: Move and consolidate "public" functions in asm/kvm_host.h

2023-09-15 Thread Sean Christopherson
Move a variety of "public" symbols in arm64's kvm_host.h, i.e. symbols and functions that are used by non-KVM code, towards the top of the header. This will allow hiding the "private" code in kvm_host.h, i.e. the stuff that is intended to be KVM-internal, with a minimal amount of #ifdeffery. Signe

[PATCH 24/26] powerpc/xics: Move declaration of xics_wake_cpu() out of kvm_ppc.h

2023-09-15 Thread Sean Christopherson
xics_wake_cpu() is provided by core PPC code, not by KVM. Move its declaration out of kvm_ppc.h and into xics.h. Signed-off-by: Sean Christopherson --- arch/powerpc/include/asm/kvm_ppc.h | 2 -- arch/powerpc/include/asm/xics.h| 3 +++ 2 files changed, 3 insertions(+), 2 deletions(-) diff -

[PATCH 25/26] KVM: PPC: Rearrange code in kvm_ppc.h to isolate "public" information

2023-09-15 Thread Sean Christopherson
Move all declarations and definitions in kvm_ppc.h that are consumed by things other than KVM to the top of the file. This will allow wrapping the parts of kvm_ppc.h that are intended only for KVM, i.e. are intended to be "private" to KVM, with an #ifdef to hide KVM's internal details from the ker

[PATCH 26/26] KVM: Hide KVM internal data structures and values from kernel at-large

2023-09-15 Thread Sean Christopherson
Wrap all KVM internal APIs, data structures, values, etc. in public headers with "#ifdef __KVM__" to effectively hide KVM's internal details from other subsystems and the kernel at-large. Hiding KVM details for all architectures will, in the very distant future, allow loading a new (or old) KVM mo

Re: [PATCH tty v1 00/74] serial: wrappers for uart port lock

2023-09-15 Thread Maciej W. Rozycki
On Fri, 15 Sep 2023, Thomas Gleixner wrote: > >> Patches 2-74 switch all uart port locking call sites to use the new > >> wrappers. These patches were automatically generated using coccinelle. > > > > Hmm, no need to do this for drivers/tty/serial/zs.c? > > zs.c does not use port lock at all. It