From patchwork Thu Sep 14 01:55:01 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sean Christopherson X-Patchwork-Id: 13384010 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by smtp.lore.kernel.org (Postfix) with ESMTP id 0953BEE0213 for ; Thu, 14 Sep 2023 01:55:46 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 3CEFB6B027F; Wed, 13 Sep 2023 21:55:46 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 3576D6B0288; Wed, 13 Sep 2023 21:55:46 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 1A9D96B0289; Wed, 13 Sep 2023 21:55:46 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0014.hostedemail.com [216.40.44.14]) by kanga.kvack.org (Postfix) with ESMTP id 04E4B6B027F for ; Wed, 13 Sep 2023 21:55:46 -0400 (EDT) Received: from smtpin18.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay03.hostedemail.com (Postfix) with ESMTP id D29F1A0F4D for ; Thu, 14 Sep 2023 01:55:45 +0000 (UTC) X-FDA: 81233536650.18.9042FFE Received: from mail-yw1-f201.google.com (mail-yw1-f201.google.com [209.85.128.201]) by imf02.hostedemail.com (Postfix) with ESMTP id 19C1F80005 for ; Thu, 14 Sep 2023 01:55:42 +0000 (UTC) Authentication-Results: imf02.hostedemail.com; dkim=pass header.d=google.com header.s=20230601 header.b=Zdac4Ao6; dmarc=pass (policy=reject) header.from=google.com; spf=pass (imf02.hostedemail.com: domain of 3HmgCZQYKCCcVHDQMFJRRJOH.FRPOLQXa-PPNYDFN.RUJ@flex--seanjc.bounces.google.com designates 209.85.128.201 as permitted sender) smtp.mailfrom=3HmgCZQYKCCcVHDQMFJRRJOH.FRPOLQXa-PPNYDFN.RUJ@flex--seanjc.bounces.google.com ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1694656543; h=from:from:sender:reply-to:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type:content-transfer-encoding: in-reply-to:in-reply-to:references:references:dkim-signature; bh=ipMZPiP5QxzJYr8+L2XHaFOQ2agfNk5lTTsPLIZe0Eo=; b=XR3l/nKfoXKrkf/WVaS9ozSom0YE3ah1kqX6NoN59OMasj0W2679sMnWBJZtvTTu7Wvp84 V1TtQ0OEQz0CXAh96csNGU5bvMgMBKFAI/VR5yjFsvC1FN41HdnQiehXy8Z35nj8jBqazj Y1r1DxwZkgHb0bZZT1cYoCFek0tWySc= ARC-Authentication-Results: i=1; imf02.hostedemail.com; dkim=pass header.d=google.com header.s=20230601 header.b=Zdac4Ao6; dmarc=pass (policy=reject) header.from=google.com; spf=pass (imf02.hostedemail.com: domain of 3HmgCZQYKCCcVHDQMFJRRJOH.FRPOLQXa-PPNYDFN.RUJ@flex--seanjc.bounces.google.com designates 209.85.128.201 as permitted sender) smtp.mailfrom=3HmgCZQYKCCcVHDQMFJRRJOH.FRPOLQXa-PPNYDFN.RUJ@flex--seanjc.bounces.google.com ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1694656543; a=rsa-sha256; cv=none; b=OfcVP7PUR7+c7grxMJ10nwlBCLjV6jFeMxa9mFWDVQPWCAEjHTKZE4KSGqFgXw4dYupJyu kIK2ci+IZWe4rsZ1MBEOrfYpC1RRa1kDAgGLbjm6A+GroJYFKCk3mt9N5pwV2fzOrMHWqv f6x7WE4FHfOmFnyNG1ag9d7oYYpSedE= Received: by mail-yw1-f201.google.com with SMTP id 00721157ae682-58cb845f2f2so6171017b3.1 for ; Wed, 13 Sep 2023 18:55:42 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20230601; t=1694656542; x=1695261342; darn=kvack.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=ipMZPiP5QxzJYr8+L2XHaFOQ2agfNk5lTTsPLIZe0Eo=; b=Zdac4Ao6elJ2FlJgia3JQZ1h822RopV2q4fEJ7UgeL9Be9Vlz0kq47fUeuBwRaMEJ6 DoG3ZB0vlBLRvCNV+M3s64dRL9Fo8H9fC+KJz1Olcf98Z2cWT7j995Z7yTjuBgxfPKq8 yXYTkdnqvVtA6zml4VCWmuLD+hyKuCEgfPQH6B+RVZ5/85G3vVdZzwVYs5mUI8KhB0P3 T63aD39oRB89i/X6jr4afD4E/fl6B1It+gZaevfAUPlg868+mVwsUws+HZCED2wUurJL XE1Qe7fYukvZ6FNrfBx68KxuIfzyQsW1mZNgnpm6swHkLknoypXc9piLc3BbpBqfoMqc iH/g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1694656542; x=1695261342; 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=ipMZPiP5QxzJYr8+L2XHaFOQ2agfNk5lTTsPLIZe0Eo=; b=BPFXVwrDEgD0ejJeehFfhT1xLgHYcuoWXvh+RRY5RPHVB+2pojHIfeiQCRAetUZYXe rYPPjbhudWdvnPq9fB2A2Qcx5LauO9aNkw+VAkPs9faZ+BZK/Ge7NR7/7WEqJgRW6POp Xs4KWGDrxLktg6OOQUyxmPYGy3pAxBv+8t4q7MS1f69aJmOiyMoBLywJV0cjIBBmPiiu fPCizT1yTPhDxt1tcnNs03Z2T4jg/QgibusRHPOydlrZu4p6rkXGjxCpF4dYr+AxIRi4 SuIS0Psgt+srSbk6y9RvSyuM4CcR+giBCGxnc/JjCZbnBsPMhVfmBoONsJb+6i2b8OU/ ItEw== X-Gm-Message-State: AOJu0Yyp5i92/uaqa7I04B7My8y2oHjIrWYjOIm9y7eNonwzTw1HVREg 1NkqELnZ5Vt3bI2jgBu4RWrxpybM/wE= X-Google-Smtp-Source: AGHT+IHZ9maMkZbk/mDeS4QG3cCYdpuky8EXqvBvcYXtjkjg3bX1mPxWKIK7RZclMdxYQ1SdoMO1l2xcItw= X-Received: from zagreus.c.googlers.com ([fda3:e722:ac3:cc00:7f:e700:c0a8:5c37]) (user=seanjc job=sendgmr) by 2002:a05:690c:b0a:b0:59b:ebe0:9fd6 with SMTP id cj10-20020a05690c0b0a00b0059bebe09fd6mr14465ywb.6.1694656542028; Wed, 13 Sep 2023 18:55:42 -0700 (PDT) Reply-To: Sean Christopherson Date: Wed, 13 Sep 2023 18:55:01 -0700 In-Reply-To: <20230914015531.1419405-1-seanjc@google.com> Mime-Version: 1.0 References: <20230914015531.1419405-1-seanjc@google.com> X-Mailer: git-send-email 2.42.0.283.g2d96d420d3-goog Message-ID: <20230914015531.1419405-4-seanjc@google.com> Subject: [RFC PATCH v12 03/33] KVM: PPC: Drop dead code related to KVM_ARCH_WANT_MMU_NOTIFIER From: Sean Christopherson To: Paolo Bonzini , Marc Zyngier , Oliver Upton , Huacai Chen , Michael Ellerman , Anup Patel , Paul Walmsley , Palmer Dabbelt , Albert Ou , Sean Christopherson , "Matthew Wilcox (Oracle)" , Andrew Morton , Paul Moore , James Morris , "Serge E. Hallyn" 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-security-module@vger.kernel.org, linux-kernel@vger.kernel.org, Chao Peng , Fuad Tabba , Jarkko Sakkinen , Anish Moorthy , Yu Zhang , Isaku Yamahata , Xu Yilun , Vlastimil Babka , Vishal Annapurve , Ackerley Tng , Maciej Szmigiero , David Hildenbrand , Quentin Perret , Michael Roth , Wang , Liam Merwick , Isaku Yamahata , "Kirill A . Shutemov" X-Rspam-User: X-Stat-Signature: p1agnaais8ba7xfjfbjpo7iugxf6trib X-Rspamd-Server: rspam07 X-Rspamd-Queue-Id: 19C1F80005 X-HE-Tag: 1694656542-707866 X-HE-Meta: U2FsdGVkX1+icok/XfPDQgi/p8ezWpTBkhkRajvG2i47eGjp0LZjuXmjFctBdNJxpBofUoTwsdRJ5aoC9AC3VJuU0zPtCjuMVHS/p62IGYKg23C9yygL+J+pXCuNut0dpVTpleuMrQpCbMqPnKjZEqxHt2tqELUmLRgtvh3144pLGf75R7Hr5+wKdFYkoPRZIs3Yf1RBGmeRay6xSaElLkYiMY3M5h359yMEX7waEnPPwoG/ifLHYZuGK1NGq0TS8Zs9z4MlCyx34Y+3MGLSL/b3NYsk293yXCMKENSS7m0UvhkJfCqmbeocPD2eqdEwvVaLkxTQ12BCSpXqEYIQYNu0mkPjSxhGrR+RmZ5sw6dRfaYwd/cIISpstg9nSwA8Xf2EZ3xwNSVy6C2D4Tvtr7WMdCzsswuJEuUAXimF6ZZiX3MNsZSmFaHI+z2TcSnEYEhjyH30ynMuxPgDhkB8Xn0pVRVbV87xEATnCTGA4eFcMfFrH0mmjmRKscl5SrBLBvf1ihwBQMA5rVynSulcJ/sov0orOEHimkGsbbs54BgqdtuBfxLvcGg4ShlFFNvI5F2nUbznBtnYNoLThLWuPELxA8FyW1Jas5lGZYr8DTJrUjuyQeT9Vme9AD9Rn/NY0IDU4a3rxct2XWmh98SeSLMNgUvh/Xewbq3bTUnuDd5FvrBZ1xzScW2r6ewvKGTF0fIIVTagqCzP3VtM9w21dF/tjprkYYBqbiOP5ZABuR5/W1aS7v2RfDGPer1izguC/5QKqZsdKRos7UUkWtxbY/SxCsn0UH7l1BZB8SPf0iJ6VN/iAgeTFQAe2SkCyAjSoMY9uWT7c+Fm2t1L6wnnZGkkBhiJu4pFW/2xl/0HjrWXl5XsSNO5RIWYeSSNJ4Ohci/CoABN/wWHVnr8i2n+xyeR4ftxfbfr1H/BR5qcmIbw2m/WTJ9pbq6eEts1z1Z3IKPJDDyLTu/LUoM6/Ou eHfhhzHW qI52/aJ7UCHHhMnB1ooyFLnxhkv73zdhjP72HSuyqFdy27ZcCQ79LFxwTBkiFaWwIoeslczBCMfanoTMBcXDBcIHRwMIrUmbTorftieTRXODlD1NMD4ETGk3XWhiwLjfzVdavXb+JVb930Fgy+4PkpYTHjpXKH9FY/SXCsyr2q66EbR99bC9+R+lxqk8nBkCNr50akP0tyy7cxPQIAr2Cxt656J7XPG1xvX1tx2Cq79HjMaQqSDYbDJhqnNTTsKhGsqUhm2NcEB/QDh2OmV3/amUE9H+ugSRde2QYNtx5zUPKUGT0GUFBDwt8Jl+3piDr2rWgLgNsFZtGclKPc2eTg9VGBw5ka/EHqm5IgPW+7bBIykRSq9jVRWP+Fi77m+PkmHc6a/WU5SAQQGx5PwnKxg+yC+Z16JJp6aPEOSkWrQW1Fo/V5NdpHTl3s4qi1U6oWBf3Noi42pzB7x/GPFaTyaLnC6BUGxrJfBT45JE0D65VXR8QNAbKR+XYdvm+oSKcCaCCG+hEFfkfXDd+y/tvli2UbCqpeO5MSZjaNU+HEZexaYWVjn637m2IrcTWWsB4pVmo6WQHDd8jqHaghAi6+F83IZZKcZHCZDghEgoNyQRHHI+4ev+1tdLbyYgRrS1RCjJAEeAQfMPBEv105LsuHaxG4yBFnzM8Ei0NrfxYxCCgu6UcFLOMUDhgsdWAzPHTN3vdUahSECxYZOfK3nBEIkkj1xXmzeZNoveUhrUclwe6eJAtiUD461UgXH6xF3INBxeu0cvtj7rUieLJ0AVJ130Jfa1XKGYLNfTfpKCWBxSNbfs6EGmbhGLoJw== X-Bogosity: Ham, tests=bogofilter, spamicity=0.000000, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: 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 --- 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