Message ID | 20231027182217.3615211-6-seanjc@google.com |
---|---|
State | New |
Headers |
Return-Path: <linux-kernel-owner@vger.kernel.org> Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:d641:0:b0:403:3b70:6f57 with SMTP id cy1csp801096vqb; Fri, 27 Oct 2023 11:23:52 -0700 (PDT) X-Google-Smtp-Source: AGHT+IHW0QQWGUM2w7ZUk317n1th2h8Gf0TDRzgBGZvCrQAQiNn20cxwIo3HUKOFBuGbCyLlU60D X-Received: by 2002:a05:690c:18:b0:59f:72a6:da0e with SMTP id bc24-20020a05690c001800b0059f72a6da0emr3967604ywb.41.1698431032298; Fri, 27 Oct 2023 11:23:52 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1698431032; cv=none; d=google.com; s=arc-20160816; b=FVYYSP7Aj4J9y3FGY6egTwHh3YDBRnTIpeRdK0hgCVn16JfackcWQIwyAWCIgIg8tG Jq/+XWcRyshbJlsA0U8X2JNr66o320A3ZNuiyE/4bIUGkp4mRpJoj/wbE9oq7jFbmf1A ql4ls9Mjs2K/EPHnCXGkLDLLCUnbR17B3F0MdZB+x6Q4/yH7oUANx5l5uPHAFk96ln4m 8ehpYpIkfXz+nCTFDg5e6ItYHnm/1Z39t38fQt5pI0uMxDCM7kzHuUadgAqDKyxX5Hql OaQ/dSVDI12eQtzT30rapbV9cD4j2M1rExsyzwCragej7C36hnKsITQqe53bvKDhs/Z3 qM1w== 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:reply-to:dkim-signature; bh=JgU06SXMv6nm3bYLetCIh2Atkw0AeiFtLr3TWBcGDvg=; fh=lhteFENhZrfxRoH7K7/E/bqXvDWa/XLvUszFia9mLtM=; b=adtXGZ040nanQlE5HoEKGP+Oh0xYx751cTvbiMip6CG1KB33C/GHe+1f6Nap7q35Ch 0ECmRhjjSW9uST75dK1FEp2uwEPB19rAwUPRNopnLF6Rd5zSZWXGdaplwuWbBCfoe3IZ VqDHBP+mYIECAZtzZeEHsAeNro/16zXfQGsM0rNmpD4Yk7Ss4O5Ce7f9sIKaH/L7usC0 T2z0SDg6Ah0uo8JESMTw2pgsDhHujf+IQc+t+UDxjDHRW2NnrFcgyv7cF29VihlWl0KH ZRYLVSsqVHWiBvgUaxzsufRUXw1F7y68BMWAM6OriDmsUJfkXZ4DbF3gM6S1vJhzjTR7 ZY5g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@google.com header.s=20230601 header.b=siqQ9m0B; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:7 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.com Received: from snail.vger.email (snail.vger.email. [2620:137:e000::3:7]) by mx.google.com with ESMTPS id w3-20020a816203000000b005a7a6a42f8fsi4060766ywb.269.2023.10.27.11.23.51 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 27 Oct 2023 11:23:52 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:7 as permitted sender) client-ip=2620:137:e000::3:7; Authentication-Results: mx.google.com; dkim=pass header.i=@google.com header.s=20230601 header.b=siqQ9m0B; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:7 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.com Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by snail.vger.email (Postfix) with ESMTP id 2F12583896EF; Fri, 27 Oct 2023 11:23:23 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at snail.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S235206AbjJ0SXD (ORCPT <rfc822;a1648639935@gmail.com> + 25 others); Fri, 27 Oct 2023 14:23:03 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:45654 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233129AbjJ0SWu (ORCPT <rfc822;linux-kernel@vger.kernel.org>); Fri, 27 Oct 2023 14:22:50 -0400 Received: from mail-pl1-x649.google.com (mail-pl1-x649.google.com [IPv6:2607:f8b0:4864:20::649]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 3079A1B8 for <linux-kernel@vger.kernel.org>; Fri, 27 Oct 2023 11:22:36 -0700 (PDT) Received: by mail-pl1-x649.google.com with SMTP id d9443c01a7336-1cc252cbde2so6358835ad.0 for <linux-kernel@vger.kernel.org>; Fri, 27 Oct 2023 11:22:36 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20230601; t=1698430955; x=1699035755; darn=vger.kernel.org; h=cc:to:from:subject:message-id:references:mime-version:in-reply-to :date:reply-to:from:to:cc:subject:date:message-id:reply-to; bh=JgU06SXMv6nm3bYLetCIh2Atkw0AeiFtLr3TWBcGDvg=; b=siqQ9m0B9m40Qs7PaCCnI/qS3fb1gku1RkXCkFjHYwI695lydFEzhsJcEwBrjmwFpF IWagKZp3oqCf1sQ0d00aRsezW1on4j+vUKS0GoMckHY5laTg/4r4A8lD67Ox9ovxMl51 oyDooZIHskjXtEE71IOIYGISQluIafOLvjb2Y3mWT5b7ufKS7Z0VSXpgiiLGchattunq SC41iGTcZC/QXcObDgLcvbswqbZYHQAeO9Mb8Oxi2Dk+c0R0u3Q/7dpu8D1Elz9/QUVJ s5oUXolbLZekpH2blov4AhJvHwV/6uKGdHfDAnFita7fVdl6IrUW5oZBVn2dVerunUdV wLdw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1698430955; x=1699035755; h=cc:to:from:subject:message-id:references:mime-version:in-reply-to :date:reply-to:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=JgU06SXMv6nm3bYLetCIh2Atkw0AeiFtLr3TWBcGDvg=; b=xUOQ9Y21esRVoeAVxye3ej9PZvOJshdWYK7RNdw9/K60fOUdyaEcouN+QzInYzSkpD 3+ruu8EXDuskWoiuYDXxq3sb8eTy1DFi6WacaXxgfxCQiLP/JFprf8H6fs0ORBOHRmWv 1SXe1CG7hVD8jLAE1FMw8EPGP9N7St6sYf7H/VVssySjcRnBm+HjzsF0TtAK8xNN/n76 JNRpqlfgpnC8EbSQdz5fo+G3y5W2p1sQdDMSLcxiSzTLA2YYK1dzI0kjOrubGk4pDT2k 7Z90YGH+ouGAhRb+d8Y/erxVcSrKpj7WAGewp3GqCWGzmNLp50KvUOscKwWo996kHthN hyVw== X-Gm-Message-State: AOJu0Yw1fhweLOUGvAjVaaFqi8c3YM9LWaZHJKqV6W+/mXYQH5+Ulmc0 J6flDijjmK684Zq3dzEIW+r2tJJR6cc= X-Received: from zagreus.c.googlers.com ([fda3:e722:ac3:cc00:7f:e700:c0a8:5c37]) (user=seanjc job=sendgmr) by 2002:a17:902:c144:b0:1cc:281a:8463 with SMTP id 4-20020a170902c14400b001cc281a8463mr32525plj.7.1698430955693; Fri, 27 Oct 2023 11:22:35 -0700 (PDT) Reply-To: Sean Christopherson <seanjc@google.com> Date: Fri, 27 Oct 2023 11:21:47 -0700 In-Reply-To: <20231027182217.3615211-1-seanjc@google.com> Mime-Version: 1.0 References: <20231027182217.3615211-1-seanjc@google.com> X-Mailer: git-send-email 2.42.0.820.g83a721a137-goog Message-ID: <20231027182217.3615211-6-seanjc@google.com> Subject: [PATCH v13 05/35] KVM: PPC: Drop dead code related to KVM_ARCH_WANT_MMU_NOTIFIER From: Sean Christopherson <seanjc@google.com> To: Paolo Bonzini <pbonzini@redhat.com>, Marc Zyngier <maz@kernel.org>, Oliver Upton <oliver.upton@linux.dev>, Huacai Chen <chenhuacai@kernel.org>, Michael Ellerman <mpe@ellerman.id.au>, Anup Patel <anup@brainfault.org>, Paul Walmsley <paul.walmsley@sifive.com>, Palmer Dabbelt <palmer@dabbelt.com>, Albert Ou <aou@eecs.berkeley.edu>, Sean Christopherson <seanjc@google.com>, Alexander Viro <viro@zeniv.linux.org.uk>, Christian Brauner <brauner@kernel.org>, "Matthew Wilcox (Oracle)" <willy@infradead.org>, Andrew Morton <akpm@linux-foundation.org> Cc: kvm@vger.kernel.org, linux-arm-kernel@lists.infradead.org, kvmarm@lists.linux.dev, linux-mips@vger.kernel.org, linuxppc-dev@lists.ozlabs.org, kvm-riscv@lists.infradead.org, linux-riscv@lists.infradead.org, linux-fsdevel@vger.kernel.org, linux-mm@kvack.org, linux-kernel@vger.kernel.org, Xiaoyao Li <xiaoyao.li@intel.com>, Xu Yilun <yilun.xu@intel.com>, Chao Peng <chao.p.peng@linux.intel.com>, Fuad Tabba <tabba@google.com>, Jarkko Sakkinen <jarkko@kernel.org>, Anish Moorthy <amoorthy@google.com>, David Matlack <dmatlack@google.com>, Yu Zhang <yu.c.zhang@linux.intel.com>, Isaku Yamahata <isaku.yamahata@intel.com>, " =?utf-8?q?Micka=C3=ABl_Sala?= =?utf-8?q?=C3=BCn?= " <mic@digikod.net>, Vlastimil Babka <vbabka@suse.cz>, Vishal Annapurve <vannapurve@google.com>, Ackerley Tng <ackerleytng@google.com>, Maciej Szmigiero <mail@maciej.szmigiero.name>, David Hildenbrand <david@redhat.com>, Quentin Perret <qperret@google.com>, Michael Roth <michael.roth@amd.com>, Wang <wei.w.wang@intel.com>, Liam Merwick <liam.merwick@oracle.com>, Isaku Yamahata <isaku.yamahata@gmail.com>, "Kirill A . Shutemov" <kirill.shutemov@linux.intel.com> Content-Type: text/plain; charset="UTF-8" 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_BLOCKED,SPF_HELO_NONE,SPF_PASS,USER_IN_DEF_DKIM_WL autolearn=unavailable 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: <linux-kernel.vger.kernel.org> X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (snail.vger.email [0.0.0.0]); Fri, 27 Oct 2023 11:23:23 -0700 (PDT) X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1780934018097861051 X-GMAIL-MSGID: 1780934018097861051 |
Series |
KVM: guest_memfd() and per-page attributes
|
|
Commit Message
Sean Christopherson
Oct. 27, 2023, 6:21 p.m. UTC
Assert that both KVM_ARCH_WANT_MMU_NOTIFIER and CONFIG_MMU_NOTIFIER are
defined when KVM is enabled, and return '1' unconditionally for the
CONFIG_KVM_BOOK3S_HV_POSSIBLE=n path. All flavors of PPC support for KVM
select MMU_NOTIFIER, and KVM_ARCH_WANT_MMU_NOTIFIER is unconditionally
defined by arch/powerpc/include/asm/kvm_host.h.
Effectively dropping use of KVM_ARCH_WANT_MMU_NOTIFIER will simplify a
future cleanup to turn KVM_ARCH_WANT_MMU_NOTIFIER into a Kconfig, i.e.
will allow combining all of the
#if defined(CONFIG_MMU_NOTIFIER) && defined(KVM_ARCH_WANT_MMU_NOTIFIER)
checks into a single
#ifdef CONFIG_KVM_GENERIC_MMU_NOTIFIER
without having to worry about PPC's "bare" usage of
KVM_ARCH_WANT_MMU_NOTIFIER.
Signed-off-by: Sean Christopherson <seanjc@google.com>
---
arch/powerpc/kvm/powerpc.c | 7 ++++---
1 file changed, 4 insertions(+), 3 deletions(-)
Comments
On 10/27/23 20:21, Sean Christopherson wrote: > Assert that both KVM_ARCH_WANT_MMU_NOTIFIER and CONFIG_MMU_NOTIFIER are > defined when KVM is enabled, and return '1' unconditionally for the > CONFIG_KVM_BOOK3S_HV_POSSIBLE=n path. All flavors of PPC support for KVM > select MMU_NOTIFIER, and KVM_ARCH_WANT_MMU_NOTIFIER is unconditionally > defined by arch/powerpc/include/asm/kvm_host.h. > > Effectively dropping use of KVM_ARCH_WANT_MMU_NOTIFIER will simplify a > future cleanup to turn KVM_ARCH_WANT_MMU_NOTIFIER into a Kconfig, i.e. > will allow combining all of the > > #if defined(CONFIG_MMU_NOTIFIER) && defined(KVM_ARCH_WANT_MMU_NOTIFIER) > > checks into a single > > #ifdef CONFIG_KVM_GENERIC_MMU_NOTIFIER > > without having to worry about PPC's "bare" usage of > KVM_ARCH_WANT_MMU_NOTIFIER. > > Signed-off-by: Sean Christopherson <seanjc@google.com> > --- > arch/powerpc/kvm/powerpc.c | 7 ++++--- > 1 file changed, 4 insertions(+), 3 deletions(-) > > diff --git a/arch/powerpc/kvm/powerpc.c b/arch/powerpc/kvm/powerpc.c > index 7197c8256668..b0a512ede764 100644 > --- a/arch/powerpc/kvm/powerpc.c > +++ b/arch/powerpc/kvm/powerpc.c > @@ -632,12 +632,13 @@ int kvm_vm_ioctl_check_extension(struct kvm *kvm, long ext) > break; > #endif > case KVM_CAP_SYNC_MMU: > +#if !defined(CONFIG_MMU_NOTIFIER) || !defined(KVM_ARCH_WANT_MMU_NOTIFIER) > + BUILD_BUG(); > +#endif > #ifdef CONFIG_KVM_BOOK3S_HV_POSSIBLE > r = hv_enabled; > -#elif defined(KVM_ARCH_WANT_MMU_NOTIFIER) > - r = 1; > #else > - r = 0; > + r = 1; > #endif > break; > #ifdef CONFIG_KVM_BOOK3S_HV_POSSIBLE Reviewed-by: Paolo Bonzini <pbonzini@redhat.com>
On Fri, Oct 27, 2023 at 7:22 PM Sean Christopherson <seanjc@google.com> wrote: > > Assert that both KVM_ARCH_WANT_MMU_NOTIFIER and CONFIG_MMU_NOTIFIER are > defined when KVM is enabled, and return '1' unconditionally for the > CONFIG_KVM_BOOK3S_HV_POSSIBLE=n path. All flavors of PPC support for KVM > select MMU_NOTIFIER, and KVM_ARCH_WANT_MMU_NOTIFIER is unconditionally > defined by arch/powerpc/include/asm/kvm_host.h. > > Effectively dropping use of KVM_ARCH_WANT_MMU_NOTIFIER will simplify a > future cleanup to turn KVM_ARCH_WANT_MMU_NOTIFIER into a Kconfig, i.e. > will allow combining all of the > > #if defined(CONFIG_MMU_NOTIFIER) && defined(KVM_ARCH_WANT_MMU_NOTIFIER) > > checks into a single > > #ifdef CONFIG_KVM_GENERIC_MMU_NOTIFIER > > without having to worry about PPC's "bare" usage of > KVM_ARCH_WANT_MMU_NOTIFIER. > > Signed-off-by: Sean Christopherson <seanjc@google.com> > --- Reviewed-by: Fuad Tabba <tabba@google.com> Cheers, /fuad > arch/powerpc/kvm/powerpc.c | 7 ++++--- > 1 file changed, 4 insertions(+), 3 deletions(-) > > diff --git a/arch/powerpc/kvm/powerpc.c b/arch/powerpc/kvm/powerpc.c > index 7197c8256668..b0a512ede764 100644 > --- a/arch/powerpc/kvm/powerpc.c > +++ b/arch/powerpc/kvm/powerpc.c > @@ -632,12 +632,13 @@ int kvm_vm_ioctl_check_extension(struct kvm *kvm, long ext) > break; > #endif > case KVM_CAP_SYNC_MMU: > +#if !defined(CONFIG_MMU_NOTIFIER) || !defined(KVM_ARCH_WANT_MMU_NOTIFIER) > + BUILD_BUG(); > +#endif > #ifdef CONFIG_KVM_BOOK3S_HV_POSSIBLE > r = hv_enabled; > -#elif defined(KVM_ARCH_WANT_MMU_NOTIFIER) > - r = 1; > #else > - r = 0; > + r = 1; > #endif > break; > #ifdef CONFIG_KVM_BOOK3S_HV_POSSIBLE > -- > 2.42.0.820.g83a721a137-goog >
diff --git a/arch/powerpc/kvm/powerpc.c b/arch/powerpc/kvm/powerpc.c index 7197c8256668..b0a512ede764 100644 --- a/arch/powerpc/kvm/powerpc.c +++ b/arch/powerpc/kvm/powerpc.c @@ -632,12 +632,13 @@ int kvm_vm_ioctl_check_extension(struct kvm *kvm, long ext) break; #endif case KVM_CAP_SYNC_MMU: +#if !defined(CONFIG_MMU_NOTIFIER) || !defined(KVM_ARCH_WANT_MMU_NOTIFIER) + BUILD_BUG(); +#endif #ifdef CONFIG_KVM_BOOK3S_HV_POSSIBLE r = hv_enabled; -#elif defined(KVM_ARCH_WANT_MMU_NOTIFIER) - r = 1; #else - r = 0; + r = 1; #endif break; #ifdef CONFIG_KVM_BOOK3S_HV_POSSIBLE