Received: by 2002:a05:7412:8521:b0:e2:908c:2ebd with SMTP id t33csp1660981rdf; Sun, 5 Nov 2023 08:33:13 -0800 (PST) X-Google-Smtp-Source: AGHT+IH1PJqZ1t+IZRpwoxboQoDNWoVdT4J5fWEUITkCIzWSHLpAsKgMGdmTTsPP+43xNSORCXwe X-Received: by 2002:a05:6870:f210:b0:1d7:1533:6869 with SMTP id t16-20020a056870f21000b001d715336869mr31957141oao.31.1699201993599; Sun, 05 Nov 2023 08:33:13 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1699201993; cv=none; d=google.com; s=arc-20160816; b=P+6vuzAXKTC4O+niAGkPJEGaB3WMuDkRN7CltT0J1tSZZvLGTi+dk2VqdqwV8gEYUu FAa+NADD2XDBuQp7fXOWNW5sG6RIBdtoqviygeQrezG1gd1KQpC1Zdw6Y/9mu9L0zh4R fKx63bMDpVrJV3RT73mQNRePhzkJg2J3Ebl8zAIPbnnbnj+ke8gjkeeftFOBb3d4H+BW ifSl2rRcxvOldqjwwDj4AC8UYEV1b+HU9+i2om2vrTvEd4heFOp3IsUlWGE8jIIG0GME t5CcP0IfChXTlulLPIWjHcmfcQA3AuexRWsLq2eoadoMaUTEs5qlMqKG0T/cSW1EoCaK 01Uw== 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=Wy7aPpHLtWOGAPHruBeDz3atnMm25qsUem0Te4OsDCw=; fh=HrMuB0qA2qw4RqBwyiyN+RBlGw+Ob1hcALwHW/PphXs=; b=JgfxAbwC0cM5xJ+bIVqmwTuSkIqkSAmv8Y00UaPG+fwjaMQKG+VtThZBFserKqJaZy 4Z5N6sjFthQOMca4HNgVbhHsYbezNPlgMEtUlxl6eDc+8Lpbp+Qj/GEfFu5F0anSfX/E ge4pwYfIQ58/x/QtJnECzcDtk0SdMHe51kaiIvvnvTemmpNr7q1qrAnMBIqulhsWbrYz PvhmEreIFmWRIzcSUa5aJxJXqLFWj7ubrsgWlN52UV0iKVyGRF1jryskgmR3CdzNCAI3 uR52g6p9mIGJH6/d/jSNI+L917X1TufVAmMm97zz4yuDBB7ZvXwwwXXYHBVFS7J5It/h BQOQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=M3UvuEHY; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:2 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 agentk.vger.email (agentk.vger.email. [2620:137:e000::3:2]) by mx.google.com with ESMTPS id d124-20020a633682000000b005b86b35778fsi6094702pga.180.2023.11.05.08.33.13 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 05 Nov 2023 08:33:13 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:2 as permitted sender) client-ip=2620:137:e000::3:2; Authentication-Results: mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=M3UvuEHY; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:2 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 agentk.vger.email (Postfix) with ESMTP id 07E2C80560C3; Sun, 5 Nov 2023 08:33:09 -0800 (PST) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at agentk.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230122AbjKEQcv (ORCPT + 99 others); Sun, 5 Nov 2023 11:32:51 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:60530 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229750AbjKEQce (ORCPT ); Sun, 5 Nov 2023 11:32:34 -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 CB4F4FA for ; Sun, 5 Nov 2023 08:31:42 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1699201902; 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=Wy7aPpHLtWOGAPHruBeDz3atnMm25qsUem0Te4OsDCw=; b=M3UvuEHYcxwokhTe1zD5x7y0WxWqu1NyTsz4UeIJ1Rx1DXSh0uqpNNZ1IjReyXhjT+NEfk nmNfsfRj6CQ4Jxaj7wawVg8zgFccI54toO3sm5pKj/bB8grMmRzQbHjggdkMmgFqr+cHpN rBWb8CAHkvSZf0k27hslC4uSEIM/wsE= Received: from mimecast-mx02.redhat.com (mimecast-mx02.redhat.com [66.187.233.88]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-22-Q5mEPktMNSW-r_iLFNaPsQ-1; Sun, 05 Nov 2023 11:31:35 -0500 X-MC-Unique: Q5mEPktMNSW-r_iLFNaPsQ-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 5395580B639; Sun, 5 Nov 2023 16:31:33 +0000 (UTC) Received: from avogadro.redhat.com (unknown [10.39.192.93]) by smtp.corp.redhat.com (Postfix) with ESMTP id 92C8D2166B26; Sun, 5 Nov 2023 16:31:26 +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 06/34] KVM: PPC: Return '1' unconditionally for KVM_CAP_SYNC_MMU Date: Sun, 5 Nov 2023 17:30:09 +0100 Message-ID: <20231105163040.14904-7-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 agentk.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 (agentk.vger.email [0.0.0.0]); Sun, 05 Nov 2023 08:33:09 -0800 (PST) From: Sean Christopherson Advertise that KVM's MMU is synchronized with the primary MMU for all flavors of PPC KVM support, i.e. advertise that the MMU is synchronized when CONFIG_KVM_BOOK3S_HV_POSSIBLE=y but the VM is not using hypervisor mode (a.k.a. PR VMs). PR VMs, via kvm_unmap_gfn_range_pr(), do the right thing for mmu_notifier invalidation events, and more tellingly, KVM returns '1' for KVM_CAP_SYNC_MMU when CONFIG_KVM_BOOK3S_HV_POSSIBLE=n and CONFIG_KVM_BOOK3S_PR_POSSIBLE=y, i.e. KVM already advertises a synchronized MMU for PR VMs, just not when CONFIG_KVM_BOOK3S_HV_POSSIBLE=y. Suggested-by: Paolo Bonzini Signed-off-by: Sean Christopherson Message-Id: <20231027182217.3615211-7-seanjc@google.com> Signed-off-by: Paolo Bonzini --- arch/powerpc/kvm/powerpc.c | 4 ---- 1 file changed, 4 deletions(-) diff --git a/arch/powerpc/kvm/powerpc.c b/arch/powerpc/kvm/powerpc.c index b0a512ede764..8d3ec483bc2b 100644 --- a/arch/powerpc/kvm/powerpc.c +++ b/arch/powerpc/kvm/powerpc.c @@ -635,11 +635,7 @@ int kvm_vm_ioctl_check_extension(struct kvm *kvm, long ext) #if !defined(CONFIG_MMU_NOTIFIER) || !defined(KVM_ARCH_WANT_MMU_NOTIFIER) BUILD_BUG(); #endif -#ifdef CONFIG_KVM_BOOK3S_HV_POSSIBLE - r = hv_enabled; -#else r = 1; -#endif break; #ifdef CONFIG_KVM_BOOK3S_HV_POSSIBLE case KVM_CAP_PPC_HTAB_FD: -- 2.39.1