From patchwork Fri Oct 27 18:21:47 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sean Christopherson X-Patchwork-Id: 13438932 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 C2983C25B47 for ; Fri, 27 Oct 2023 18:22:40 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 18BE0900002; Fri, 27 Oct 2023 14:22:39 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 0C7238000C; Fri, 27 Oct 2023 14:22:39 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id E5C2D900005; Fri, 27 Oct 2023 14:22:38 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0011.hostedemail.com [216.40.44.11]) by kanga.kvack.org (Postfix) with ESMTP id C82D1900002 for ; Fri, 27 Oct 2023 14:22:38 -0400 (EDT) Received: from smtpin05.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay03.hostedemail.com (Postfix) with ESMTP id 90B6FA09DB for ; Fri, 27 Oct 2023 18:22:38 +0000 (UTC) X-FDA: 81392061996.05.1FB50C7 Received: from mail-pl1-f202.google.com (mail-pl1-f202.google.com [209.85.214.202]) by imf18.hostedemail.com (Postfix) with ESMTP id C3F951C001C for ; Fri, 27 Oct 2023 18:22:36 +0000 (UTC) Authentication-Results: imf18.hostedemail.com; dkim=pass header.d=google.com header.s=20230601 header.b=mj4pTWxs; spf=pass (imf18.hostedemail.com: domain of 36_87ZQYKCAw4qmzvos00sxq.o0yxuz69-yyw7mow.03s@flex--seanjc.bounces.google.com designates 209.85.214.202 as permitted sender) smtp.mailfrom=36_87ZQYKCAw4qmzvos00sxq.o0yxuz69-yyw7mow.03s@flex--seanjc.bounces.google.com; dmarc=pass (policy=reject) header.from=google.com ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1698430956; 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=JgU06SXMv6nm3bYLetCIh2Atkw0AeiFtLr3TWBcGDvg=; b=D/56PpGG17rz7Mu+UjAGAzYfeRtFavgFO/81v6y2hEN4H5589bt8zm7BU9+pgU0GvhWNNr FQkQHzuOpjOQwudNTTQslp0FJgibiPCMCUj0eA+u8BMnRWQcAF0lkFuaq9EgZ+awZWq03C N6XnWV+Qq/PenlUQB3lK95BVW3BmnrM= ARC-Authentication-Results: i=1; imf18.hostedemail.com; dkim=pass header.d=google.com header.s=20230601 header.b=mj4pTWxs; spf=pass (imf18.hostedemail.com: domain of 36_87ZQYKCAw4qmzvos00sxq.o0yxuz69-yyw7mow.03s@flex--seanjc.bounces.google.com designates 209.85.214.202 as permitted sender) smtp.mailfrom=36_87ZQYKCAw4qmzvos00sxq.o0yxuz69-yyw7mow.03s@flex--seanjc.bounces.google.com; dmarc=pass (policy=reject) header.from=google.com ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1698430956; a=rsa-sha256; cv=none; b=ep8NiKFz+SV+0OPURdS4fkl5Va9BbGXYvaTIuiyR1hOkkVyCQVwpVkK5v2Uq+V42ddV1S3 RgL3YcONa98P1B+aDZiw18RSkhIuwbMddRWg+DGIqRVTrIlzolJ+vgrfKypfp6Jn2ASAgH Pl3XrjzRDScl1nnz2s5FZpPJ0gsezUc= Received: by mail-pl1-f202.google.com with SMTP id d9443c01a7336-1c9da175faaso20616475ad.1 for ; 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=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=JgU06SXMv6nm3bYLetCIh2Atkw0AeiFtLr3TWBcGDvg=; b=mj4pTWxsnJfBn3XSIdKCJWLBadKNzHpQ3r0oSrTv5GTQTjJPYZLwhqtSj+pZY/42Hp uvsPr6MKoLa+O7DFx0QZuzUPGO4VPB9DiL87RrHOQtKzYwrJ/+szFh5Qlkwv795JN16S N6wc5a+HrKxuyb6AwsGivhSg0fRa8AVn6Vy0RMd4lGjGB7I6pwXnpCqo1G+u0O05FOif G/UeitQq7oStTvnSAPIavmP3t81Jev/umQq3eNG8IyI2HpEtfpggB6qH8PcYifMJ/wCz pgMcdJ6Gp0O7Lli/ObBUEKbV1MZ5vAuOVWXO6uHn3CQyUg5y0EjnCe/ApMGcZUhf9C14 PTWA== 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=nc/WO3DXQCe25qY+tiAswMGb1rxIOncb4HbaXWPGmZgz8PXnwadqBkARSNVs5sRy0Q +Q38gHmN41HFNgAG6rfXVlZFospnL4IyoNLk0iblq7tmDJ7y9ZzjDQ+PyPhkCFGeb+GE gfhWrLPAQVo8s5HFpVN//Q2X/pghTyUT98KJjsuHTjb+lw0HFSV+r6h/5hVqag8PNFCg omycbaLnH/W0c1KojmYkOke9uPqO3qoStkzQ7UNwq/kwdaYj01P9UmPp79AFupGot7/3 b3PFNnjcTs8gsvl3La1wu0EBqRERNATUVzbdMKfpvM1FGbLgTzxDzg385NERU4dhDngE OOCw== X-Gm-Message-State: AOJu0Yy18qqG3Kws3RFGeBn+6Uxo69f4iPf8TO1er+kTkAx35J7eOBCj Fkfxh3X+v+OD75vnMXnMmLeXuIbYFrI= X-Google-Smtp-Source: AGHT+IGtvUvxtvF0vLnhcz0wuwQy/3Gylfgr5sP9pToido+ZyPcnNi9qskOerQDKma1HuMTn89KXKiciq2s= 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 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 To: Paolo Bonzini , Marc Zyngier , Oliver Upton , Huacai Chen , Michael Ellerman , Anup Patel , Paul Walmsley , Palmer Dabbelt , Albert Ou , Sean Christopherson , Alexander Viro , Christian Brauner , "Matthew Wilcox (Oracle)" , Andrew Morton 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 , Xu Yilun , Chao Peng , Fuad Tabba , Jarkko Sakkinen , Anish Moorthy , David Matlack , Yu Zhang , Isaku Yamahata , " =?utf-8?q?Micka=C3=ABl_Sala?= =?utf-8?q?=C3=BCn?= " , Vlastimil Babka , Vishal Annapurve , Ackerley Tng , Maciej Szmigiero , David Hildenbrand , Quentin Perret , Michael Roth , Wang , Liam Merwick , Isaku Yamahata , "Kirill A . Shutemov" X-Rspamd-Queue-Id: C3F951C001C X-Rspam-User: X-Stat-Signature: rpocj1u5kzydn5irf1h797ss77xo5j8a X-Rspamd-Server: rspam01 X-HE-Tag: 1698430956-199235 X-HE-Meta: U2FsdGVkX18NWZR4vjXrtprbM/MqnSl+LyYQ+2hEIT6DKi2JZgLEMrwMy50ORucTHgDLDG4ktgdxjCz5RmKiLrzi0Si/hsN9vWy3SRsFAi0/I5ivvIiP35Fqin8JwHfIHUFxgDfKcug8xKNSDLr5c23QsdAC8WhxmoBqByxxebTXOzLnyflKEyirNtLk1v0IRPWpZSiDkSQTT1GYsiZ+1RywaYmtqCTQhaJd7WaBEILxGk9RaQyLojOxiMu7p1BK9ojcNLUq3LR0O++/gc8uRjPayOTSfhwAKNXQygTrnk7ABeShDYixQoFkO6cBe70A99gbB+JMt9jVA6xBnpFFYe3ol3tXaobVdaBd+maEfAAVi30bdrVdm7OuacIOxCba/chF1+gnW8ji/kOHHPYuLitHzHkr5BKG8kjYjukrqXC/FSJKIC1xfb0g6mWxvD2ytDQvyUMjmoUzeYSwlAV8ctgBINYEidCT1pVnyoYAbeycFfcITQVQ0cEDo67cw28Ndl7URS8o5HzvbYMLmAAF6iF+C/DLuE98QLaZrTJoYytwlDmGywfp6c15wDX+Fr6wggFCryB8uflnY7wwbxvRdJi1Ox4xiXwXcJrRvPGjqm2hZEWXls3O4lPc44QSW4vfmDfMYiMWhoOGbEOMevsfNpoTqKekjQ7hFOH/mVD14yfDpz/wVJQ2S1bdOUD5sFU8myDF1HxEntlB/auz5ebvWcf3Ejeb8NConmeskyZorp5imXMJTW/6XyATrub6YILxuacyqk9XV8hJPIlclSNaVQ2A6ZgcXswBAQmRgp3diwB32xOhmKkuKjz8jd6VRSxD1RXB/8JqHrKmIpM7gBDHgI/ggGvVvAg11w4ZkqUeuakQMfgZHK4ei7SEl+yXpUsQoD2ToGtXIAGJZ2pYLNXHmsB6vSyC8hCvrmdWtLgOzsw03G2mtonxSAVgCQGDuPdppGokjJq79TYLiPYcLCq fUMrQU63 p/qNiYtZGlna/qZ1FmBKLq4WLgoFfOsclHsE4/Q/2NWL0Ndha5a2+LBsN99ZZ1mIAf8zfdunMACnnTyMqVeWubxBc4uJ1/2SqsOeFE9p2TLRfamWdivTlZ9bBILxLfwTHXVzzNijbqcEBeiJMRKsfTEfJqktCxPzH/bk4DEtdowKWGbHywAXmyR3jo0Az43b9tpGLjv2rz4X+CDuIupCGXGQhODRvYoOCPSLAvAQehtLbGkSG78x+NQKZBiiHHlkabqE0bZRK/f7gRsFaKgp/abjTcq1M9xH6ykepcl0MtIdD3DpEDgpKZmYXTZgyyON35I/SkxG55uY1yMmixjW8n//g5S0NjTUffTqk2T3SlB/HpM81YB4kujiSudtjY5ExXH+qkWLozg+2tE8eB3oul51n/MBv5LZ0eRn2TkzXUUloiU9Gw4EgYSwdgv/cfKgaxHB035Gt0l6LdZlorYJGIn1FtcN0kCuatPlQIRUFyNiytG6Kr+ZB1Uu9Lal5UiDUm93OTN+n3RLtlP10yYly7z/K77JnBqT5b9iPav0MvY1poXj6rkVWBmAIqXWHLkfVpVemF/31OonFxWhUj4V4hB3WfjmrmqX5g7sckQLv1JQwevOYzj+4Cdzopm2kDQ3qIkNveFWkd1K55oUPpdMvz+4bZknuNSU4hEIcWdHxlGf95fkNa78nZfRKItMz41F5jkSYPS4fRi8zIQJX6+0qlzCW3MZRpPDz2ZxOLtTiVTVMYF6qW83JrePmmSccO68cisrOZ677wNeaWykm9+EwjH4EOemkgVS7BZCjxkeznj4VImq8EgShEyyrQtVVMZWUg7yg 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: List-Subscribe: List-Unsubscribe: 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 Reviewed-by: Paolo Bonzini Reviewed-by: Fuad Tabba --- 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