Received: by 2002:a05:7412:8521:b0:e2:908c:2ebd with SMTP id t33csp1661164rdf; Sun, 5 Nov 2023 08:33:42 -0800 (PST) X-Google-Smtp-Source: AGHT+IES18ujVxl1YxBEKndzEfsC1BwnZtROrnSzXVhbxntTePHmj6vyC6xNu9V2CjS+UczEY/3Q X-Received: by 2002:a05:6358:704:b0:168:dea8:8896 with SMTP id e4-20020a056358070400b00168dea88896mr28940063rwj.3.1699202022000; Sun, 05 Nov 2023 08:33:42 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1699202021; cv=none; d=google.com; s=arc-20160816; b=rY9O1felUJFIR43diXhoZ493opwUHUH9Ki8a1gSZTBftSvJw5L2RnPxdsvupfe9RdK WtfH/lju9sDLeAyGr0YFlDPVyEoc3c2WkKFdy3uyMIQX4LtsW05oczpBobktmlzQQx7R CY8RnoqSXni3/AiqCkoPs7kO5t3efM63wMQ154DeOeGliOjnNzPonEtb+0q66D7HDV/i soU5CW8Qmzbz+LQ0bAUV0iZxZOqyO4gYCR4LX6vPMujDe8eY4NeCY2CV6vk+g4IzkMVl lXfd9Z5v1nHR+kfKhTw/obvytd13Z2C6Qe2CTT3pgNh4QkfFpc8gDq/u84I4CwccFk8G 92Xw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=DWUecQBqSYxsthfLu6yki5WSdxeUb1n6BavJ65xrvCw=; fh=HrMuB0qA2qw4RqBwyiyN+RBlGw+Ob1hcALwHW/PphXs=; b=yWVhoWSSMzO7Ntg8VMj4O6FBk9584UocevsMki7YawoLu4MGoPSDiWhdEKkpiUY63Y oRNAjwIs+IQrVn2qChN/1tDy8V7FsCJNYjQLxrZeoZ32Uj3wEo4FoDl5svGNgNQkX3KA YV+lsKlwtrJZlm8oa25lac59qq4EDmaUoJz95O1b8dkfpn82NBo8kKlngKsxj8hXpUyF dp+K8VDnftX1TMrlTobrJt74sQtJIBZH41iZU2b8hfZ6ZKINUeWR+28/RDjcDYXms7Vj Cdh/BbeY2hImjxDXCQZ2QiI4y2JfiY/s2yqbbCEH5sl8I0QX1g3cXV51UoTHsy/NtFtc fuxg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=NIsWql1C; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.38 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Return-Path: Received: from fry.vger.email (fry.vger.email. [23.128.96.38]) by mx.google.com with ESMTPS id o5-20020a656a45000000b005898b0b851asi6285690pgu.530.2023.11.05.08.33.37 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 05 Nov 2023 08:33:41 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.38 as permitted sender) client-ip=23.128.96.38; Authentication-Results: mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=NIsWql1C; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.38 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by fry.vger.email (Postfix) with ESMTP id 0AA068096A73; Sun, 5 Nov 2023 08:33:25 -0800 (PST) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at fry.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229669AbjKEQcc (ORCPT + 99 others); Sun, 5 Nov 2023 11:32:32 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:60524 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229893AbjKEQcT (ORCPT ); Sun, 5 Nov 2023 11:32:19 -0500 Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id CD333184 for ; Sun, 5 Nov 2023 08:31:36 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1699201896; h=from:from: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:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=DWUecQBqSYxsthfLu6yki5WSdxeUb1n6BavJ65xrvCw=; b=NIsWql1C5SgzujfsZ3PxCAjgQqga6DJYIC8MX0PnIqyzB6AdoxFS8VP7935ydtfHz/8NEI rPsFu0c/bNJfx4RiDiJkjbKmeau089gyRyhhX5baM6Il6JSpcXjejaoyZESfYmNCQ3C5Rz Y2WHb4n6286bsNbjd0kgT32erJDgkkk= Received: from mimecast-mx02.redhat.com (mx-ext.redhat.com [66.187.233.73]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-670-AWEpPfAoPNOq6EpWV5eR7w-1; Sun, 05 Nov 2023 11:31:28 -0500 X-MC-Unique: AWEpPfAoPNOq6EpWV5eR7w-1 Received: from smtp.corp.redhat.com (int-mx06.intmail.prod.int.rdu2.redhat.com [10.11.54.6]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 4769138117F2; Sun, 5 Nov 2023 16:31:26 +0000 (UTC) Received: from avogadro.redhat.com (unknown [10.39.192.93]) by smtp.corp.redhat.com (Postfix) with ESMTP id 8B09E2166B26; Sun, 5 Nov 2023 16:31:19 +0000 (UTC) From: Paolo Bonzini 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=20Sala=C3=BCn?= , Vlastimil Babka , Vishal Annapurve , Ackerley Tng , Maciej Szmigiero , David Hildenbrand , Quentin Perret , Michael Roth , Wang , Liam Merwick , Isaku Yamahata , "Kirill A. Shutemov" Subject: [PATCH 05/34] KVM: PPC: Drop dead code related to KVM_ARCH_WANT_MMU_NOTIFIER Date: Sun, 5 Nov 2023 17:30:08 +0100 Message-ID: <20231105163040.14904-6-pbonzini@redhat.com> In-Reply-To: <20231105163040.14904-1-pbonzini@redhat.com> References: <20231105163040.14904-1-pbonzini@redhat.com> MIME-Version: 1.0 Content-Type: text/plain Content-Transfer-Encoding: 8bit X-Scanned-By: MIMEDefang 3.4.1 on 10.11.54.6 X-Spam-Status: No, score=-1.4 required=5.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on fry.vger.email Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (fry.vger.email [0.0.0.0]); Sun, 05 Nov 2023 08:33:25 -0800 (PST) From: Sean Christopherson 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 Message-Id: <20231027182217.3615211-6-seanjc@google.com> Signed-off-by: Paolo Bonzini --- 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.39.1