Received: by 2002:a05:6358:3188:b0:123:57c1:9b43 with SMTP id q8csp1816157rwd; Tue, 13 Jun 2023 14:53:05 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ7Lvnkyg64cL1yjh6ItSjfwS6Uz94BC75M0lDDNH1z52Mnp0xQ/4n3g55f1wWwb3u4w3dRp X-Received: by 2002:aa7:d313:0:b0:50d:89d5:bf95 with SMTP id p19-20020aa7d313000000b0050d89d5bf95mr9287650edq.20.1686693184883; Tue, 13 Jun 2023 14:53:04 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1686693184; cv=none; d=google.com; s=arc-20160816; b=EVuh0ulo6NTIFaO3JnbyfsnkPJkaFQ9jGEf+7RkHLMNy6aQOeWjwyOPwd7T1cN/XrJ vrg4UCPGfSG8UIPnwfouiW9azSHy3aBJxysRYWlwh6F3ZQgn96Pl8glg70UQnqV/8i0B yllnD1SZ2ynpvfpyroN3g7FxwJdXGTEs1cj7da2Cr+Rz5rnYH30iQNELXtNN5MjmeGRe cff76Lv+eDTQkAQeensGp6lHYfQ0eknMuiJ6vezyIobIbCFbJ8X2BYvFnj5/Ii5SEnZ7 3uRhQN3vYtzCIfvA59s03nKMF7cjiHfKx8OVljpE2lGri/ho4GrVXdew1sHJI/j+agpi o4dA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:from:subject:message-id:references :mime-version:in-reply-to:date:dkim-signature; bh=zoXsbeVfXLLEsjLQrLANrMHnuV7SIcBeWtBPaSlJE0U=; b=GeZZ/0OeG2U2jA+ca5FVF2xCsX4y9tij+PlgHSck+SUJ4Ui0Aibag1WW7CUp3QoQ+s qOgYiqYeOFtsDIJlwpZqJ47D/yhn+9vxL/FH/zb4/qpgjL42DCdLJrSWrXDsRh3yiex3 lV1SfVN63N4JMVq6PL8pzg2aJhIGwcBSpLh+EzEaM97wLRfu7dm95UL2+2o2os9FeRJ4 yp7g6fUrk8NInLLttdd1mWpb4dmGhzJTeU1xiif4N7kbVa6K6Oq3DTamM/MXpO+P9Ena u24IYhZCMfmdT1whnfBHFlnprHwl4UcZEl8D08qoiXMkfSHtoDduXWRCwXEObVhdiruO QRIA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@google.com header.s=20221208 header.b=zQ7R5o0c; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id q7-20020a1709064c8700b0094f67fc03d4si7552219eju.991.2023.06.13.14.52.38; Tue, 13 Jun 2023 14:53:04 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@google.com header.s=20221208 header.b=zQ7R5o0c; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S237893AbjFMVQV (ORCPT + 99 others); Tue, 13 Jun 2023 17:16:21 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:60734 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235998AbjFMVQU (ORCPT ); Tue, 13 Jun 2023 17:16:20 -0400 Received: from mail-pf1-x449.google.com (mail-pf1-x449.google.com [IPv6:2607:f8b0:4864:20::449]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 19171133 for ; Tue, 13 Jun 2023 14:16:19 -0700 (PDT) Received: by mail-pf1-x449.google.com with SMTP id d2e1a72fcca58-651ce788961so3506436b3a.2 for ; Tue, 13 Jun 2023 14:16:19 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20221208; t=1686690978; x=1689282978; h=cc:to:from:subject:message-id:references:mime-version:in-reply-to :date:from:to:cc:subject:date:message-id:reply-to; bh=zoXsbeVfXLLEsjLQrLANrMHnuV7SIcBeWtBPaSlJE0U=; b=zQ7R5o0craf7u+8BFUd0XqKzaiFd07QQ12Eidv2oX82/8xpvNaNd5d3F1TCTk6N0Hu 7fMAmHEwJDyPmDip2pmYEeWftlaTmP5dIu41ZGeOFz45S21m6tXwg30hbcF3thUzi676 vzpD724q+62Lf8U9Gs9MKk4E/8JtwMR99WvwZB1LR98kFvEt6ayHb9QgvMry583OCgJV lblJoGrE/X04cAdDQliEfEc/u/0GX09ErJvgFy+LvpVV5l8d0IOk2DTITEBHELAeAkNh 50M+uJ4OhYkQVSE9h6BW4mKFbmJK1/oUtMREUc0flhuMb3gVbi/lwRS/0faB5gRn/RtF ddZw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1686690978; x=1689282978; h=cc:to:from:subject:message-id:references:mime-version:in-reply-to :date:x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=zoXsbeVfXLLEsjLQrLANrMHnuV7SIcBeWtBPaSlJE0U=; b=jGJ1S2jmGXcRX+e9+anUmhe//wRy5zqt2xjz3ND0qFU0U/9Gfo3f0KguSugQc9ZCWx FZumvuuIgK6a7VlfF6shGIh6UwrxpifUCKrp8GIajGqgX9CmD+3lMklQJlzAkLxaDfP/ UkCsqFFt9/U9uwEKb4RBOgQ9iXALVMs/dogEk2cfQDdPaiSC1PuPyuyERmev3ADO66fv VTl9aPRmlI1srnuu4kF9FFnS9YRbLx/hlG550dwMOpiF3er85+DWngyNXwyDmcun+XJ+ RhG2C5aP5wIwOZp02EJTFYQf/C9/J6aKCOeheXvF3o8UAh0J4TwYGv7oCDD+QKfpo0tq UxxA== X-Gm-Message-State: AC+VfDwJSPVNzZ5zJEwekIZhh8W5cHW/1GWm5xJAEqW3TYpZwCFLOeyd vkhvzkpXZHkzGmTsKgSaPcMNdMiLdK4= X-Received: from zagreus.c.googlers.com ([fda3:e722:ac3:cc00:7f:e700:c0a8:5c37]) (user=seanjc job=sendgmr) by 2002:a05:6a00:2d1d:b0:63a:ff2a:bf9f with SMTP id fa29-20020a056a002d1d00b0063aff2abf9fmr9201pfb.2.1686690978636; Tue, 13 Jun 2023 14:16:18 -0700 (PDT) Date: Tue, 13 Jun 2023 14:16:16 -0700 In-Reply-To: <20230315101606.10636-1-wei.w.wang@intel.com> Mime-Version: 1.0 References: <20230315101606.10636-1-wei.w.wang@intel.com> Message-ID: Subject: Re: [PATCH RESEND v2] KVM: move KVM_CAP_DEVICE_CTRL to the generic check From: Sean Christopherson To: Wei Wang Cc: pbonzini@redhat.com, kvm@vger.kernel.org, linux-kernel@vger.kernel.org, Marc Zyngier , Oliver Upton , Anup Patel , Paul Walmsley , Palmer Dabbelt , Albert Ou , Christian Borntraeger , Janosch Frank , Claudio Imbrenda , linux-arm-kernel@lists.infradead.org, kvmarm@lists.linux.dev, linuxppc-dev@lists.ozlabs.org, kvm-riscv@lists.infradead.org, linux-riscv@lists.infradead.org Content-Type: text/plain; charset="us-ascii" X-Spam-Status: No, score=-9.6 required=5.0 tests=BAYES_00,DKIMWL_WL_MED, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_NONE, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE,USER_IN_DEF_DKIM_WL autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org + Please use scripts/get_maintainer.pl to generate the To/Cc lists. This may be trivial, but it still needs eyeballs from the relevant maintainers. On Wed, Mar 15, 2023, Wei Wang wrote: > KVM_CAP_DEVICE_CTRL allows userspace to check if the kvm_device > framework (e.g. KVM_CREATE_DEVICE) is supported by KVM. Move > KVM_CAP_DEVICE_CTRL to the generic check for the two reasons: > 1) it already supports arch agnostic usages (i.e. KVM_DEV_TYPE_VFIO). > For example, userspace VFIO implementation may needs to create > KVM_DEV_TYPE_VFIO on x86, riscv, or arm etc. It is simpler to have it > checked at the generic code than at each arch's code. > 2) KVM_CREATE_DEVICE has been added to the generic code. > > Link: https://lore.kernel.org/all/20221215115207.14784-1-wei.w.wang@intel.com > Signed-off-by: Wei Wang > Reviewed-by: Sean Christopherson > --- > arch/arm64/kvm/arm.c | 1 - > arch/powerpc/kvm/powerpc.c | 1 - > arch/riscv/kvm/vm.c | 1 - > arch/s390/kvm/kvm-s390.c | 1 - > virt/kvm/kvm_main.c | 1 + > 5 files changed, 1 insertion(+), 4 deletions(-) > > diff --git a/arch/arm64/kvm/arm.c b/arch/arm64/kvm/arm.c > index 3bd732eaf087..96329e675771 100644 > --- a/arch/arm64/kvm/arm.c > +++ b/arch/arm64/kvm/arm.c > @@ -202,7 +202,6 @@ int kvm_vm_ioctl_check_extension(struct kvm *kvm, long ext) > r = vgic_present; > break; > case KVM_CAP_IOEVENTFD: > - case KVM_CAP_DEVICE_CTRL: > case KVM_CAP_USER_MEMORY: > case KVM_CAP_SYNC_MMU: > case KVM_CAP_DESTROY_MEMORY_REGION_WORKS: > diff --git a/arch/powerpc/kvm/powerpc.c b/arch/powerpc/kvm/powerpc.c > index 4c5405fc5538..185efed23896 100644 > --- a/arch/powerpc/kvm/powerpc.c > +++ b/arch/powerpc/kvm/powerpc.c > @@ -526,7 +526,6 @@ int kvm_vm_ioctl_check_extension(struct kvm *kvm, long ext) > case KVM_CAP_ENABLE_CAP: > case KVM_CAP_ONE_REG: > case KVM_CAP_IOEVENTFD: > - case KVM_CAP_DEVICE_CTRL: > case KVM_CAP_IMMEDIATE_EXIT: > case KVM_CAP_SET_GUEST_DEBUG: > r = 1; > diff --git a/arch/riscv/kvm/vm.c b/arch/riscv/kvm/vm.c > index 65a964d7e70d..6efe93b282e1 100644 > --- a/arch/riscv/kvm/vm.c > +++ b/arch/riscv/kvm/vm.c > @@ -57,7 +57,6 @@ int kvm_vm_ioctl_check_extension(struct kvm *kvm, long ext) > > switch (ext) { > case KVM_CAP_IOEVENTFD: > - case KVM_CAP_DEVICE_CTRL: > case KVM_CAP_USER_MEMORY: > case KVM_CAP_SYNC_MMU: > case KVM_CAP_DESTROY_MEMORY_REGION_WORKS: > diff --git a/arch/s390/kvm/kvm-s390.c b/arch/s390/kvm/kvm-s390.c > index 39b36562c043..7b097b5253ca 100644 > --- a/arch/s390/kvm/kvm-s390.c > +++ b/arch/s390/kvm/kvm-s390.c > @@ -556,7 +556,6 @@ int kvm_vm_ioctl_check_extension(struct kvm *kvm, long ext) > case KVM_CAP_ENABLE_CAP: > case KVM_CAP_S390_CSS_SUPPORT: > case KVM_CAP_IOEVENTFD: > - case KVM_CAP_DEVICE_CTRL: > case KVM_CAP_S390_IRQCHIP: > case KVM_CAP_VM_ATTRIBUTES: > case KVM_CAP_MP_STATE: > diff --git a/virt/kvm/kvm_main.c b/virt/kvm/kvm_main.c > index d255964ec331..71cc63640173 100644 > --- a/virt/kvm/kvm_main.c > +++ b/virt/kvm/kvm_main.c > @@ -4523,6 +4523,7 @@ static long kvm_vm_ioctl_check_extension_generic(struct kvm *kvm, long arg) > #endif > case KVM_CAP_BINARY_STATS_FD: > case KVM_CAP_SYSTEM_EVENT_DATA: > + case KVM_CAP_DEVICE_CTRL: > return 1; > default: > break; > -- > 2.27.0 >