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

2023-10-31 Thread Chao Gao
>+int kvm_gmem_create(struct kvm *kvm, struct kvm_create_guest_memfd *args) >+{ >+ loff_t size = args->size; >+ u64 flags = args->flags; >+ u64 valid_flags = 0; >+ >+ if (flags & ~valid_flags) >+ return -EINVAL; >+ >+ if (size < 0 || !PAGE_ALIGNED(size)) >+

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

2023-10-30 Thread Chao Gao
On Fri, Oct 27, 2023 at 11:21:55AM -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 cases

Re: [PATCH v2 00/50] KVM: Rework kvm_init() and hardware enabling

2022-12-02 Thread Chao Gao
On Wed, Nov 30, 2022 at 11:08:44PM +, Sean Christopherson wrote: >The main theme of this series is to kill off kvm_arch_init(), >kvm_arch_hardware_(un)setup(), and kvm_arch_check_processor_compat(), which >all originated in x86 code from way back when, and needlessly complicate >both common

Re: [PATCH 02/44] KVM: Initialize IRQ FD after arch hardware setup

2022-11-03 Thread Chao Gao
On Wed, Nov 02, 2022 at 11:18:29PM +, Sean Christopherson wrote: > >+ r = kvm_irqfd_init(); >+ if (r) >+ goto err_irqfd; >+ > r = kvm_async_pf_init(); > if (r) >- goto out_free_4; >+ goto err_async_pf; > >

Re: [PATCH v4 0/6] Improve KVM's interaction with CPU hotplug

2022-03-17 Thread Chao Gao
Ping. Anyone can help to review this series (particularly patch 3-5)? FYI, Sean gave his Reviewed-by to patch 1,2,5 and 6.

[PATCH v4 0/6] Improve KVM's interaction with CPU hotplug

2022-02-15 Thread Chao Gao
d CPU hotplug https://lore.kernel.org/lkml/3d3296f0-9245-40f9-1b5a-efffdb082...@redhat.com/T/ Note: this series is tested only on Intel systems. Chao Gao (4): KVM: x86: Move check_processor_compatibility from init ops to runtime ops Partially revert "KVM: Pass kvm_init()'s opaque param to a

[PATCH v4 2/6] Partially revert "KVM: Pass kvm_init()'s opaque param to additional arch funcs"

2022-02-15 Thread Chao Gao
omes after the commit. And changes about kvm_arch_hardware_setup() in original commit are still needed so they are not reverted. Signed-off-by: Chao Gao Reviewed-by: Sean Christopherson --- arch/arm64/kvm/arm.c | 2 +- arch/mips/kvm/mips.c | 2 +- arch/powerpc/kvm/powerpc.c | 2 +- arch

[PATCH v3 0/5] Improve KVM's interaction with CPU hotplug

2022-02-09 Thread Chao Gao
atibility checks on hotplugged CPUs. 3. abort onlining incompatible CPUs This series is a follow-up to the discussion about KVM and CPU hotplug https://lore.kernel.org/lkml/3d3296f0-9245-40f9-1b5a-efffdb082...@redhat.com/T/ Note: this series is tested only on Intel systems. Chao Gao (4):

[PATCH v3 2/5] Partially revert "KVM: Pass kvm_init()'s opaque param to additional arch funcs"

2022-02-08 Thread Chao Gao
omes after the commit. And changes about kvm_arch_hardware_setup() in original commit are still needed so they are not reverted. Signed-off-by: Chao Gao --- arch/arm64/kvm/arm.c | 2 +- arch/mips/kvm/mips.c | 2 +- arch/powerpc/kvm/powerpc.c | 2 +- arch/riscv/kvm/main.c | 2 +- arc

[PATCH v2 2/4] Partially revert "KVM: Pass kvm_init()'s opaque param to additional arch funcs"

2022-01-17 Thread Chao Gao
omes after the commit. And changes about kvm_arch_hardware_setup() in original commit are still needed so they are not reverted. Signed-off-by: Chao Gao --- arch/arm64/kvm/arm.c | 2 +- arch/mips/kvm/mips.c | 2 +- arch/powerpc/kvm/powerpc.c | 2 +- arch/riscv/kvm/main.c | 2 +- arc

[PATCH v2 0/4] Improve KVM's interaction with CPU hotplug

2022-01-17 Thread Chao Gao
t KVM and CPU hotplug https://lore.kernel.org/lkml/3d3296f0-9245-40f9-1b5a-efffdb082...@redhat.com/T/ Note: this series is tested only on Intel systems. Chao Gao (4): KVM: x86: Move check_processor_compatibility from init ops to runtime ops Partially revert "KVM: Pass kvm_init()'s opaque p

Re: [PATCH 3/6] KVM: Remove opaque from kvm_arch_check_processor_compat

2022-01-10 Thread Chao Gao
On Mon, Jan 10, 2022 at 11:06:44PM +, Sean Christopherson wrote: >On Mon, Dec 27, 2021, Chao Gao wrote: >> No arch implementation uses this opaque now. > >Except for the RISC-V part, this can be a pure revert of commit b99040853738 >("KVM: >Pass kvm_init()'s opaqu

[PATCH 3/6] KVM: Remove opaque from kvm_arch_check_processor_compat

2021-12-28 Thread Chao Gao
No arch implementation uses this opaque now. Signed-off-by: Chao Gao --- arch/arm64/kvm/arm.c | 2 +- arch/mips/kvm/mips.c | 2 +- arch/powerpc/kvm/powerpc.c | 2 +- arch/riscv/kvm/main.c | 2 +- arch/s390/kvm/kvm-s390.c | 2 +- arch/x86/kvm/x86.c | 2

[PATCH 0/6] Improve KVM's interaction with CPU hotplug

2021-12-28 Thread Chao Gao
if there is a running VM. This series is a follow-up to the discussion about KVM and CPU hotplug https://lore.kernel.org/lkml/3d3296f0-9245-40f9-1b5a-efffdb082...@redhat.com/T/ Note: this series is tested only on Intel systems. Chao Gao (6): KVM: x86: Move check_processor_compatibility from init ops