Re: [PATCH V3] tools/perf: Add perf binary dependent rule for shellcheck log in Makefile.perf

2023-11-06 Thread Athira Rajeev
> On 23-Oct-2023, at 4:14 PM, James Clark wrote: > > > > On 13/10/2023 08:36, Athira Rajeev wrote: >> Add rule in new Makefile "tests/Makefile.tests" for running >> shellcheck on shell test scripts. This automates below shellcheck >> into the build. >> >> $ for F in $(find tests/shell/

Re: [PATCH 1/3] perf tests test_arm_coresight: Fix the shellcheck warning in latest test_arm_coresight.sh

2023-11-06 Thread Athira Rajeev
> On 07-Nov-2023, at 3:14 AM, Arnaldo Carvalho de Melo wrote: > > Em Thu, Oct 05, 2023 at 02:24:15PM +0530, Athira Rajeev escreveu: >>> On 05-Oct-2023, at 1:50 PM, James Clark wrote: >>> On 29/09/2023 05:11, Athira Rajeev wrote: Running shellcheck on tests/shell/test_arm_coresight.sh

Re: [PATCH v2 37/37] powerpc: Support execute-only on all powerpc

2023-11-06 Thread Aneesh Kumar K V
On 11/6/23 6:53 PM, Christophe Leroy wrote: > > > Le 02/11/2023 à 06:39, Aneesh Kumar K.V a écrit : >> Christophe Leroy writes: >> >>> Introduce PAGE_EXECONLY_X macro which provides exec-only rights. >>> The _X may be seen as redundant with the EXECONLY but it helps >>> keep consistancy, all

Re: [PATCH] powerpc: Fix signature of pfn_to_kaddr()

2023-11-06 Thread Michael Ellerman
Linus Walleij writes: > There is a const in the returned value from pfn_to_kaddr() > but there are consumers that want to modify the result > and the generic function pfn_to_virt() in > does allow this, so let's relax this requirement and do not > make the returned value const. > > Reported-by:

Re: [PATCH 08/34] KVM: Introduce KVM_SET_USER_MEMORY_REGION2

2023-11-06 Thread Yuan Yao
On Sun, Nov 05, 2023 at 05:30:11PM +0100, Paolo Bonzini wrote: > From: 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

Re: [PATCH 1/3] perf tests test_arm_coresight: Fix the shellcheck warning in latest test_arm_coresight.sh

2023-11-06 Thread Arnaldo Carvalho de Melo
Em Thu, Oct 05, 2023 at 02:24:15PM +0530, Athira Rajeev escreveu: > > On 05-Oct-2023, at 1:50 PM, James Clark wrote: > > On 29/09/2023 05:11, Athira Rajeev wrote: > >> Running shellcheck on tests/shell/test_arm_coresight.sh > >> throws below warnings: > >> > >> In

Re: [PATCH 25/34] KVM: selftests: Add helpers to convert guest memory b/w private and shared

2023-11-06 Thread Fuad Tabba
On Mon, Nov 6, 2023 at 4:13 PM Sean Christopherson wrote: > > On Mon, Nov 06, 2023, Fuad Tabba wrote: > > On Sun, Nov 5, 2023 at 4:34 PM Paolo Bonzini wrote: > > > +void vm_guest_mem_fallocate(struct kvm_vm *vm, uint64_t base, uint64_t > > > size, > > > + bool

Re: [PATCH 27/34] KVM: selftests: Introduce VM "shape" to allow tests to specify the VM type

2023-11-06 Thread Fuad Tabba
On Mon, Nov 6, 2023 at 4:04 PM Sean Christopherson wrote: > > On Mon, Nov 06, 2023, Fuad Tabba wrote: > > On Sun, Nov 5, 2023 at 4:34 PM Paolo Bonzini wrote: > > > > > > From: Sean Christopherson > > > > > > Add a "vm_shape" structure to encapsulate the selftests-defined "mode", > > > along

Re: [PATCH 25/34] KVM: selftests: Add helpers to convert guest memory b/w private and shared

2023-11-06 Thread Sean Christopherson
On Mon, Nov 06, 2023, Fuad Tabba wrote: > On Sun, Nov 5, 2023 at 4:34 PM Paolo Bonzini wrote: > > +void vm_guest_mem_fallocate(struct kvm_vm *vm, uint64_t base, uint64_t > > size, > > + bool punch_hole) > > +{ > > + const int mode = FALLOC_FL_KEEP_SIZE |

Re: [PATCH 27/34] KVM: selftests: Introduce VM "shape" to allow tests to specify the VM type

2023-11-06 Thread Sean Christopherson
On Mon, Nov 06, 2023, Fuad Tabba wrote: > On Sun, Nov 5, 2023 at 4:34 PM Paolo Bonzini wrote: > > > > From: 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

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

2023-11-06 Thread Sean Christopherson
On Mon, Nov 06, 2023, Xu Yilun wrote: > On Sun, Nov 05, 2023 at 05:19:36PM +0100, Paolo Bonzini wrote: > > On Sun, Nov 5, 2023 at 2:04 PM Xu Yilun wrote: > > > > > > > +static void kvm_mmu_prepare_memory_fault_exit(struct kvm_vcpu *vcpu, > > > > + struct

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

2023-11-06 Thread Sean Christopherson
On Sat, Nov 04, 2023, Xu Yilun wrote: > > +KVM_SET_USER_MEMORY_REGION2 is an extension to KVM_SET_USER_MEMORY_REGION > > that > > +allows mapping guest_memfd memory into a guest. All fields shared with > > +KVM_SET_USER_MEMORY_REGION identically. Userspace can set KVM_MEM_PRIVATE > > in > >

Re: [PATCH 14/34] fs: Rename anon_inode_getfile_secure() and anon_inode_getfd_secure()

2023-11-06 Thread Christian Brauner
On Sun, Nov 05, 2023 at 05:30:17PM +0100, Paolo Bonzini wrote: > The call to the inode_init_security_anon() LSM hook is not the sole > reason to use anon_inode_getfile_secure() or anon_inode_getfd_secure(). > For example, the functions also allow one to create a file with non-zero > size, without

Re: [PATCH 31/34] KVM: selftests: Expand set_memory_region_test to validate guest_memfd()

2023-11-06 Thread Paolo Bonzini
On 11/5/23 17:30, Paolo Bonzini wrote: 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

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

2023-11-06 Thread Hans Verkuil
On 27/10/2023 12:35, Shengjiu Wang wrote: > 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,

[PATCH] powerpc: Fix signature of pfn_to_kaddr()

2023-11-06 Thread Linus Walleij
) +static inline void *pfn_to_kaddr(unsigned long pfn) { return __va(pfn << PAGE_SHIFT); } --- base-commit: d2f51b3516dade79269ff45eae2a7668ae711b25 change-id: 20231106-virt-to-pfn-fix-ppc-d91de47c6017 Best regards, -- Linus Walleij

[PATCH 5/7] powerpc/rtas: Move post_mobility_fixup() declaration to pseries

2023-11-06 Thread Nathan Lynch via B4 Relay
From: Nathan Lynch This is a pseries-specific function declaration that doesn't belong in rtas.h. Move it to the pseries platform code and adjust pseries/suspend.c accordingly. Signed-off-by: Nathan Lynch --- arch/powerpc/include/asm/rtas.h | 1 -

[PATCH 3/7] powerpc/rtas: Drop declaration of undefined call_rtas() function

2023-11-06 Thread Nathan Lynch via B4 Relay
From: Nathan Lynch The call_rtas() function has never been a part of arch/powerpc, and its implementation was removed from arch/ppc by 0a26b1364f14 ("ppc: Remove CHRP, POWER3 and POWER4 support from arch/ppc"). Signed-off-by: Nathan Lynch --- arch/powerpc/include/asm/rtas.h | 2 -- 1 file

[PATCH 0/7] powerpc/rtas: Trivial, coding style, and kernel-doc fixes

2023-11-06 Thread Nathan Lynch via B4 Relay
* Fix recently introduced kernel-doc warnings. * Make minor coding style adjustments for readability. * Remove rtas_service_present() and an old call_rtas() declaration. * Move a pseries-specific function prototype to pseries code. --- Nathan Lynch (7): powerpc/pseries/rtas-work-area: Fix

[PATCH 6/7] powerpc/rtas: Remove trailing space

2023-11-06 Thread Nathan Lynch via B4 Relay
From: Nathan Lynch Use scripts/cleanfile to remove instances of trailing space in the core RTAS code and header. Signed-off-by: Nathan Lynch --- arch/powerpc/include/asm/rtas.h | 6 +++--- arch/powerpc/kernel/rtas.c | 18 +- 2 files changed, 12 insertions(+), 12

[PATCH 4/7] powerpc/rtas: Remove unused rtas_service_present()

2023-11-06 Thread Nathan Lynch via B4 Relay
From: Nathan Lynch rtas_service_present() has no more users. rtas_function_implemented() is now the appropriate API for determining whether a given RTAS function is available to call. Signed-off-by: Nathan Lynch --- arch/powerpc/include/asm/rtas.h | 1 - arch/powerpc/kernel/rtas.c | 5

[PATCH 1/7] powerpc/pseries/rtas-work-area: Fix rtas_work_area_reserve_arena() kernel-doc

2023-11-06 Thread Nathan Lynch via B4 Relay
From: Nathan Lynch >From a W=1 build: >> arch/powerpc/platforms/pseries/rtas-work-area.c:189: warning: Function >> parameter or member 'limit' not >> described in 'rtas_work_area_reserve_arena' Add the missing description of the limit parameter. Signed-off-by: Nathan Lynch Reported-by:

[PATCH 7/7] powerpc/rtas: Remove 'extern' from function declarations in rtas.h

2023-11-06 Thread Nathan Lynch via B4 Relay
From: Nathan Lynch This header occasionally gains new function declarations without the leading extern in accordance with current style rules. Leaving the legacy externs in place is making the header more difficult to read over time because of the inconsistency. Remove them. Signed-off-by:

[PATCH 2/7] powerpc/rtas: Fix ppc_rtas_rmo_buf_show() kernel-doc

2023-11-06 Thread Nathan Lynch via B4 Relay
From: Nathan Lynch >From a W=1 build: >> arch/powerpc/kernel/rtas-proc.c:771: warning: Function parameter or member >> 'm' not described in >> 'ppc_rtas_rmo_buf_show' >> arch/powerpc/kernel/rtas-proc.c:771: warning: Function parameter or member >> 'v' not described in >>

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

2023-11-06 Thread Xu Yilun
On Sun, Nov 05, 2023 at 05:19:36PM +0100, Paolo Bonzini wrote: > On Sun, Nov 5, 2023 at 2:04 PM Xu Yilun wrote: > > > > > +static void kvm_mmu_prepare_memory_fault_exit(struct kvm_vcpu *vcpu, > > > + struct kvm_page_fault *fault) > > > +{ > > > +

Re: [PATCH v2 37/37] powerpc: Support execute-only on all powerpc

2023-11-06 Thread Christophe Leroy
Le 02/11/2023 à 06:39, Aneesh Kumar K.V a écrit : > Christophe Leroy writes: > >> Introduce PAGE_EXECONLY_X macro which provides exec-only rights. >> The _X may be seen as redundant with the EXECONLY but it helps >> keep consistancy, all macros having the EXEC right have _X. >> >> And put it

Re: [PATCH v2 29/37] powerpc/nohash: Replace pte_user() by pte_read()

2023-11-06 Thread Christophe Leroy
Le 31/10/2023 à 11:15, Aneesh Kumar K.V a écrit : > Christophe Leroy writes: > >> pte_user() is now only used in pte_access_permitted() to check >> access on vmas. User flag is cleared to make a page unreadable. >> >> So rename it pte_read() and remove pte_user() which isn't used >> anymore.

Re: [PATCH 27/34] KVM: selftests: Introduce VM "shape" to allow tests to specify the VM type

2023-11-06 Thread Fuad Tabba
On Sun, Nov 5, 2023 at 4:34 PM Paolo Bonzini wrote: > > From: 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

Re: [PATCH 28/34] KVM: selftests: Add GUEST_SYNC[1-6] macros for synchronizing more data

2023-11-06 Thread Fuad Tabba
On Sun, Nov 5, 2023 at 4:34 PM Paolo Bonzini wrote: > > From: 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 > Message-Id:

Re: [PATCH 26/34] KVM: selftests: Add helpers to do KVM_HC_MAP_GPA_RANGE hypercalls (x86)

2023-11-06 Thread Fuad Tabba
On Sun, Nov 5, 2023 at 4:34 PM Paolo Bonzini wrote: > > 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

Re: [PATCH 14/34] fs: Rename anon_inode_getfile_secure() and anon_inode_getfd_secure()

2023-11-06 Thread Fuad Tabba
On Sun, Nov 5, 2023 at 4:32 PM Paolo Bonzini wrote: > > The call to the inode_init_security_anon() LSM hook is not the sole > reason to use anon_inode_getfile_secure() or anon_inode_getfd_secure(). > For example, the functions also allow one to create a file with non-zero > size, without needing

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

2023-11-06 Thread Fuad Tabba
On Fri, Oct 27, 2023 at 7:23 PM Sean Christopherson wrote: > > 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

Re: [PATCH 25/34] KVM: selftests: Add helpers to convert guest memory b/w private and shared

2023-11-06 Thread Fuad Tabba
On Sun, Nov 5, 2023 at 4:34 PM Paolo Bonzini wrote: > > 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

Re: [PATCH 24/34] KVM: selftests: Add support for creating private memslots

2023-11-06 Thread Fuad Tabba
Hi, Regarding the subject (and the commit message), should we still be calling them "private" slots, or guestmem_slots? On Sun, Nov 5, 2023 at 4:34 PM Paolo Bonzini wrote: > > From: Sean Christopherson > > Add support for creating "private" memslots via KVM_CREATE_GUEST_MEMFD and >

Re: [PATCH 23/34] KVM: selftests: Convert lib's mem regions to KVM_SET_USER_MEMORY_REGION2

2023-11-06 Thread Fuad Tabba
On Sun, Nov 5, 2023 at 4:33 PM Paolo Bonzini wrote: > > From: 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

Re: [PATCH 22/34] KVM: selftests: Drop unused kvm_userspace_memory_region_find() helper

2023-11-06 Thread Fuad Tabba
On Sun, Nov 5, 2023 at 4:33 PM Paolo Bonzini wrote: > > From: 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

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

2023-11-06 Thread Paolo Bonzini
On 11/6/23 12:00, Fuad Tabba wrote: Hi, On Fri, Oct 27, 2023 at 7:23 PM Sean Christopherson wrote: 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

Re: [PATCH 21/34] KVM: x86: Add support for "protected VMs" that can utilize private memory

2023-11-06 Thread Fuad Tabba
Hi, On Sun, Nov 5, 2023 at 4:33 PM Paolo Bonzini wrote: > > From: 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

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

2023-11-06 Thread Fuad Tabba
Hi, On Fri, Oct 27, 2023 at 7:23 PM Sean Christopherson wrote: > > 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

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

2023-11-06 Thread Fuad Tabba
Hi, On Sun, Nov 5, 2023 at 4:33 PM Paolo Bonzini wrote: > > 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

Re: [PATCH 15/34] KVM: Add KVM_CREATE_GUEST_MEMFD ioctl() for guest-specific backing memory

2023-11-06 Thread Fuad Tabba
Hi, > > diff --git a/Documentation/virt/kvm/api.rst b/Documentation/virt/kvm/api.rst > index 083ed507e200..6d681f45969e 100644 > --- a/Documentation/virt/kvm/api.rst > +++ b/Documentation/virt/kvm/api.rst ... > > +4.142 KVM_CREATE_GUEST_MEMFD > + > + > +:Capability:

Re: [PATCH 12/34] KVM: Introduce per-page memory attributes

2023-11-06 Thread Fuad Tabba
Hi, ... > diff --git a/include/linux/kvm_host.h b/include/linux/kvm_host.h > index 96aa930536b1..68a144cb7dbc 100644 > --- a/include/linux/kvm_host.h > +++ b/include/linux/kvm_host.h > @@ -256,6 +256,7 @@ int kvm_async_pf_wakeup_all(struct kvm_vcpu *vcpu); > #ifdef

Re: [PATCH 09/34] KVM: Add KVM_EXIT_MEMORY_FAULT exit to report faults to userspace

2023-11-06 Thread Fuad Tabba
On Sun, Nov 5, 2023 at 4:32 PM Paolo Bonzini wrote: > > 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

Re: [PATCH 03/34] KVM: Use gfn instead of hva for mmu_notifier_retry

2023-11-06 Thread Huang, Kai
On Sun, 2023-11-05 at 17:30 +0100, Paolo Bonzini wrote: > From: Chao Peng > > Currently in mmu_notifier invalidate path, hva range is recorded and then > checked against by mmu_invalidate_retry_hva() in the page fault handling > path. However, for the soon-to-be-introduced private memory, a page

Re: [PATCH 02/34] KVM: Assert that mmu_invalidate_in_progress *never* goes negative

2023-11-06 Thread Huang, Kai
On Sun, 2023-11-05 at 17:30 +0100, Paolo Bonzini wrote: > From: 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

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

2023-11-06 Thread Huang, Kai
On Sun, 2023-11-05 at 17:30 +0100, Paolo Bonzini wrote: > From: 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

Re: [PATCH 08/34] KVM: Introduce KVM_SET_USER_MEMORY_REGION2

2023-11-06 Thread Huang, Kai
> > diff --git a/Documentation/virt/kvm/api.rst b/Documentation/virt/kvm/api.rst > index 7025b3751027..bdea1423c5f8 100644 > --- a/Documentation/virt/kvm/api.rst > +++ b/Documentation/virt/kvm/api.rst > @@ -1340,6 +1340,7 @@ yet and must be cleared on entry. > __u64 guest_phys_addr; >

Re: mm/debug_vm_pgtable.c:860 warning triggered

2023-11-06 Thread David Hildenbrand
On 06.11.23 07:06, Michael Ellerman wrote: Anshuman Khandual writes: Hello Daniel, This test just ensures that PFN is preserved during pte <--> swap pte transformations , and the warning here seems to have been caused by powerpc platform specific helpers and/or its pte_t representation.

Re: [PATCH 2/8] leds: nic78bx: explicitly unregister LEDs at module's shutdown

2023-11-06 Thread Christophe Leroy
Le 25/10/2023 à 15:07, George Stark a écrit : > LEDs are registered using devm_led_classdev_register() and automatically > unregistered after module's remove(). led_classdev_unregister() calls > led_set_brightness() to turn off the LEDs and module's appropriate callback > uses resources those

Re: [PATCH 0/8] devm_led_classdev_register() usage problem

2023-11-06 Thread Christophe Leroy
Le 25/10/2023 à 15:07, George Stark a écrit : > Lots of drivers use devm_led_classdev_register() to register their led objects > and let the kernel free those leds at the driver's remove stage. > It can lead to a problem due to led_classdev_unregister() > implementation calls