From mboxrd@z Thu Jan 1 00:00:00 1970 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 bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 4A993CD128A for ; Mon, 8 Apr 2024 13:56:56 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:In-Reply-To:MIME-Version:References: Message-ID:Subject:Cc:To:From:Date:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=DCOkJHqk3RWyA1WCvEkAKSEHq2IFCk9vlmxIkJkIFig=; b=2OwNuLGQaKhe+d SZ8MsrGVWRQy5Km2qQRh6VlETTYg7oTZJ8ukf5gFdJ+K/fUoR2ku4VtuTPOdaCTuqpEc+57kVZO01 dKYydbk68EbE6/CGjTXQFF0yAvkPKloPXvw14YDhlKsZIcqF1ZiKXdPFg0whyAf8hdxDfkJ+Y9r4O jFnGFR8PYtQkeRyZupkP1UGeFEujqww7jXNy/U/70MkO/XtCJXiujUbVp382m5ynWJg4oEnJeinsz OAf8d+Yd68l6751zxkpBDa1mCrGzKgIdrxnVciA1ql5QnP5kffRX+5IdK/RtIVHQovtedSv/Ghx9o ETUsfCaxBV0OJx0m3t2g==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.97.1 #2 (Red Hat Linux)) id 1rtpUL-0000000FnAO-45wc; Mon, 08 Apr 2024 13:56:46 +0000 Received: from us-smtp-delivery-124.mimecast.com ([170.10.129.124]) by bombadil.infradead.org with esmtps (Exim 4.97.1 #2 (Red Hat Linux)) id 1rtpUF-0000000Fn5Q-3h3m for linux-arm-kernel@lists.infradead.org; Mon, 08 Apr 2024 13:56:44 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1712584585; 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: in-reply-to:in-reply-to:references:references; bh=rmNJpHW5Hyb1elegWpLMoq/S1yVvTDK8DJLj5yKd5mI=; b=YknS0oZnF7n6p+YJDgLkjAUF/d5DU8J3xGo2qEWOu1Bers3mCY8BKYoRgMlPuhw4hypGPc K8cj+M2M7przg0Q6oC5Jma/GDs/840REKdyR4dnR0HWRO88geWwKBj6iXvsHbE6CVdhUQo uUsWii6QyJcjnHe260gnYCQ3zr4o63s= Received: from mail-ot1-f71.google.com (mail-ot1-f71.google.com [209.85.210.71]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-529-JXFjDyQOOvGFe5LQjMOjLw-1; Mon, 08 Apr 2024 09:56:24 -0400 X-MC-Unique: JXFjDyQOOvGFe5LQjMOjLw-1 Received: by mail-ot1-f71.google.com with SMTP id 46e09a7af769-6ea20a966b0so46683a34.0 for ; Mon, 08 Apr 2024 06:56:24 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1712584584; x=1713189384; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to; bh=rmNJpHW5Hyb1elegWpLMoq/S1yVvTDK8DJLj5yKd5mI=; b=sXgg3+0z2GOWhTd9jFKpg/HEmdrrydGLBHDpZ+vDRO54y6LVBgTjGM25+baXR7tG0k MuppLDlEXOMxNhE9BoR6jw688mTPwsnQjK9LbfQQX4lxKmor9fUet0OILmbnQqfLMbJC PqMD1uc2scqCvlixvuzmyo/x2T68iNS0yAm8tPi7YviYi6Za646hK7nDnaGnAgqv5YOg WxAH1+Is/7c3qC05/Zy5otLfS/K/onKtuCTwmzUWFSYG1JNKVl1fHFpU8uby5dKVKE0l RJeoWkgyZs1kiXrKmiCT/nTPMNJ9K7V85+4SmBHRfV/j5btfYRboIhZ6NHv2MdZ4RQYp DB0A== X-Forwarded-Encrypted: i=1; AJvYcCWqbfECbCl3BO46QK0S00JByfT44o3AynAip/5OjfdT6UQEZ93kSvcBlJq9aGtT3aI8Lkqkm54CUoNaDlWkjYBZcWTxoMsHlIbYZ8WlunqXbMAzZT4= X-Gm-Message-State: AOJu0Yw7fCh0Q7fHl3E3Ujfh3/lXmM6rB0jORgsbj9k2RvKZ8tTYZGmn t/zFd0BBUVgEmT7u1EPoKg3MlzIWXnPjNEn43lquHYfW0jkAEXuxzUytmgaSmlp/xAtuH2Kk3JJ 0PFpIY7ZMZPtrUex64r9Zgwn4QYKL+qANYuBolp5EoaHG8Xqphip8jhc0mOGPIsF6FuCLe4ha X-Received: by 2002:a05:6830:a5a:b0:6e7:592:87ab with SMTP id g26-20020a0568300a5a00b006e7059287abmr9702512otu.2.1712584583697; Mon, 08 Apr 2024 06:56:23 -0700 (PDT) X-Google-Smtp-Source: AGHT+IE/6cZVOu40ZE5XkeceEvB5GWIk5ESL9MdZGK/RmwIM5NG0Lyufyd1ejET8K1FRMeVweFzXgg== X-Received: by 2002:a05:6830:a5a:b0:6e7:592:87ab with SMTP id g26-20020a0568300a5a00b006e7059287abmr9702473otu.2.1712584583118; Mon, 08 Apr 2024 06:56:23 -0700 (PDT) Received: from x1n ([99.254.121.117]) by smtp.gmail.com with ESMTPSA id vw25-20020a05620a565900b0078d63baf516sm1301217qkn.129.2024.04.08.06.56.21 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 08 Apr 2024 06:56:22 -0700 (PDT) Date: Mon, 8 Apr 2024 09:56:20 -0400 From: Peter Xu To: Paolo Bonzini Cc: linux-kernel@vger.kernel.org, kvm@vger.kernel.org, Marc Zyngier , Oliver Upton , Tianrui Zhao , Bibo Mao , Thomas Bogendoerfer , Nicholas Piggin , Anup Patel , Atish Patra , Sean Christopherson , Andrew Morton , David Hildenbrand , linux-arm-kernel@lists.infradead.org, kvmarm@lists.linux.dev, loongarch@lists.linux.dev, linux-mips@vger.kernel.org, linuxppc-dev@lists.ozlabs.org, kvm-riscv@lists.infradead.org, linux-mm@kvack.org, linux-trace-kernel@vger.kernel.org, linux-perf-users@vger.kernel.org, Andrea Arcangeli Subject: Re: [PATCH 1/4] KVM: delete .change_pte MMU notifier callback Message-ID: References: <20240405115815.3226315-1-pbonzini@redhat.com> <20240405115815.3226315-2-pbonzini@redhat.com> MIME-Version: 1.0 In-Reply-To: <20240405115815.3226315-2-pbonzini@redhat.com> X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Disposition: inline X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20240408_065640_066389_6AD4803B X-CRM114-Status: GOOD ( 17.66 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org On Fri, Apr 05, 2024 at 07:58:12AM -0400, Paolo Bonzini wrote: > The .change_pte() MMU notifier callback was intended as an > optimization. The original point of it was that KSM could tell KVM to flip > its secondary PTE to a new location without having to first zap it. At > the time there was also an .invalidate_page() callback; both of them were > *not* bracketed by calls to mmu_notifier_invalidate_range_{start,end}(), > and .invalidate_page() also doubled as a fallback implementation of > .change_pte(). > > Later on, however, both callbacks were changed to occur within an > invalidate_range_start/end() block. > > In the case of .change_pte(), commit 6bdb913f0a70 ("mm: wrap calls to > set_pte_at_notify with invalidate_range_start and invalidate_range_end", > 2012-10-09) did so to remove the fallback from .invalidate_page() to > .change_pte() and allow sleepable .invalidate_page() hooks. > > This however made KVM's usage of the .change_pte() callback completely > moot, because KVM unmaps the sPTEs during .invalidate_range_start() > and therefore .change_pte() has no hope of finding a sPTE to change. > Drop the generic KVM code that dispatches to kvm_set_spte_gfn(), as > well as all the architecture specific implementations. Paolo, I may miss a bunch of details here (as I still remember some change_pte patches previously on the list..), however not sure whether we considered enable it? Asked because I remember Andrea used to have a custom tree maintaining that part: https://github.com/aagit/aa/commit/c761078df7a77d13ddfaeebe56a0f4bc128b1968 Maybe it can't be enabled for some reason that I overlooked in the current tree, or we just decided to not to? Thanks, -- Peter Xu _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel