Received: by 2002:ab2:7407:0:b0:1f4:b336:87c4 with SMTP id e7csp26196lqn; Thu, 11 Apr 2024 12:35:58 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCWa6tyQB5d8Mxh76tTg5wSjWC6Zj/Ma/89Fj5Q+8+y1pzuJ4K6E68VuKyL8JGKLOrXJugLF2PEr6JYnFfZZU3878owupGBQJy8oQsaK/w== X-Google-Smtp-Source: AGHT+IF9M1s48bLc6x/YIbbZB6yrsEOPomD6u/ObTtE4jY2/wQiocGF60p/Db7Y5IFy/Fuw0mXxo X-Received: by 2002:a17:902:e8c9:b0:1e4:3429:cf1 with SMTP id v9-20020a170902e8c900b001e434290cf1mr383551plg.33.1712864158519; Thu, 11 Apr 2024 12:35:58 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1712864158; cv=pass; d=google.com; s=arc-20160816; b=ObGnnRZLBFl0cfaCQ5eLy2Jf0teP6pfP6+HcDMVvvVcyXcOugirlluELZxm8qMwxqd S9f4H6uh0P3qTRU9zGdu4ixR/ag9mFAbcqlbJjx32fMcFX5O20L3G4i02ivrCTZxu1Ek 5m0YUYT6gHKdLMWkOWrP+oTEyDwdNlg4XiNEDQDjQjVbIbx6mZCkdjprDMh0ylzLbWaW 6WyfWLBGfE08WZBnYMMeG3dqhTliu4uzlMa+lXI/0euTT6eGyIZjOwU6FtTzG+euly0j ezuAcQ8xPnLNVy5inVuaCS9EyY3PvK5cMAz0PsaOLWTiXhGIKukx8ed+uTRVhL2HcF4T 6bfA== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=in-reply-to:content-transfer-encoding:content-disposition :mime-version:list-unsubscribe:list-subscribe:list-id:precedence :references:message-id:subject:cc:to:from:date:dkim-signature; bh=KZYsCvW//u/CQQXOA7VquWR1RJVn5i/6cYVGpW0idNY=; fh=UBPqZS8piTNmAU3cDggA9r1jiZbUe0fnfFQ4fcf0raw=; b=aw3Q0eA9CTwJoKYs5dHJoO9I/ygTVibUDM0U7BERwbWr4PYqP+BV6xLBGt92pV4bFY qm5csrxHrNceuz1j88YIWZif/39dwZpntPDNljiv3nAdRr7aiKh6ra+55m7rIJY7yW2j 1ja3LPT7lVBHHc6gQSS2X68E7iKoFuJRKxSjK+Bxvmw2yGxV1CoumyEvF+WUEP/w4gj2 +cS2QBwHAYUuqyykC2Hw31IjQIZF7HUSRuYur0BS6Uro2vdKLetOjkg7vp4udx7NNIvH uXDNLLv/TE3r9Evd7WhA1/bCK5zKuX/ouL9bHGcpsEBbP3H/aVNPn+fDJ2hBWrDWWoSR 7XnQ==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=aFKWrQW6; arc=pass (i=1 spf=pass spfdomain=redhat.com dkim=pass dkdomain=redhat.com dmarc=pass fromdomain=redhat.com); spf=pass (google.com: domain of linux-kernel+bounces-141489-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:40f1:3f00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-141489-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Return-Path: Received: from sy.mirrors.kernel.org (sy.mirrors.kernel.org. [2604:1380:40f1:3f00::1]) by mx.google.com with ESMTPS id mc7-20020a1709032b0700b001ddda95075esi1761944plb.431.2024.04.11.12.35.57 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 11 Apr 2024 12:35:58 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-141489-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:40f1:3f00::1 as permitted sender) client-ip=2604:1380:40f1:3f00::1; Authentication-Results: mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=aFKWrQW6; arc=pass (i=1 spf=pass spfdomain=redhat.com dkim=pass dkdomain=redhat.com dmarc=pass fromdomain=redhat.com); spf=pass (google.com: domain of linux-kernel+bounces-141489-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:40f1:3f00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-141489-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by sy.mirrors.kernel.org (Postfix) with ESMTPS id B6EEBB29DF8 for ; Thu, 11 Apr 2024 18:48:17 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id B5ACE14A9F; Thu, 11 Apr 2024 18:48:06 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=redhat.com header.i=@redhat.com header.b="aFKWrQW6" Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 52B0B205E1C for ; Thu, 11 Apr 2024 18:48:04 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=170.10.129.124 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1712861285; cv=none; b=gaF3roavEIW5FKliCHkLb+f/33/p0mobwkwaEd1CiazmQ6kaEeblQ1ORHsEmOf2LpzYULCF4QJcnoZNQelCeaonP83nVOjEsKs1MxvNrDyACJAd4yNrxSI/XhpfuIWXDzAJnwjeHodGU08UC34Vtv8KRgn65HNofL+jotKDoRZc= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1712861285; c=relaxed/simple; bh=HfoacRHaPwwnTCmXDkoKk1PJpiX4sznxb7ZH8+YFYQA=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=Q6e9u6CJgbYNu2sH3hZWhaWTYSZUzDPE0AVJXeHetUcx9cLA/W0bOAeV2WR09lCY3K9Xmswq2nHGZBQtOFUlwP69pDtScmIelKVLOegnwNvetIcOJZa7xPjFz4kWVoICZMFIMVgJhs/kkCAV3j5WRoMPcIfU1YMKdiz01Qbfth4= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=redhat.com; spf=pass smtp.mailfrom=redhat.com; dkim=pass (1024-bit key) header.d=redhat.com header.i=@redhat.com header.b=aFKWrQW6; arc=none smtp.client-ip=170.10.129.124 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=redhat.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=redhat.com DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1712861283; 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=KZYsCvW//u/CQQXOA7VquWR1RJVn5i/6cYVGpW0idNY=; b=aFKWrQW60TAAZ+MkH5r/5SNShUtcUiIJYSw4jX2gF1HpRBjnLp4z9CZoK3UGv7Dri1SUus SqQ09ZIGKXQxC0gLW4Dzxcm50/87nZrhiHjxvrYU8QaktEdfOjO1OeTn9GnKNfVmSM2Tsj qV4S3konwmjLG0ZBbgN5ZXzaEdgItzM= Received: from mail-qv1-f69.google.com (mail-qv1-f69.google.com [209.85.219.69]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-675-t-_C-ZhQPOGgsd57OBo7hw-1; Thu, 11 Apr 2024 14:48:00 -0400 X-MC-Unique: t-_C-ZhQPOGgsd57OBo7hw-1 Received: by mail-qv1-f69.google.com with SMTP id 6a1803df08f44-69a01201ca0so696836d6.0 for ; Thu, 11 Apr 2024 11:48:00 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1712861280; x=1713466080; h=in-reply-to:content-transfer-encoding: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=KZYsCvW//u/CQQXOA7VquWR1RJVn5i/6cYVGpW0idNY=; b=k/dtyWX4fGERAe5NZu/y9PFXMZvlChTdkjr2FETbAuUU4n+EuYWOlJQq5lYl7y3/sL SLozS5IagYh/HfnF+QOS1nvQbCb2+lDKGLWJvR6NNYcH5ONFYd53QOzQTldaiKGc9R07 B2bOco3MOO7f/HCSAtVcaGuY7gJ90s61Sq0Nxo6gv7lIiHiScgyLeJVZBlGIqCr/dtbJ 4sBgeginzfQf+7PXyx7JVzxE8qYDfNpEv3dhsDdSjaUxalt35a9KhKdNJ3xeoQ8Q6yST PAiK9iYLaoaFvmId0bwGMEO/A14ItN6BXnB+6OJoUxnNrr4BJkH2lC8C4XnkMsYUAopp OPDQ== X-Gm-Message-State: AOJu0YxyTmXVBpHHBT2Z92mGYQoKrvRVDgcdt7glHSi3zOhUSC7LAz17 UkL7yE1xCCaouciBg6fv8ykFWDjBhMTGH16OSNMllAX9xSV5N8SrPkm9zZR+BcAQyUyrXVz9A0L 9vQi2RzBAw1XTjBcwuYqtzTIzYXEUiXuudKn9FMBnK9v0arKyKHaK7iJ97RMM4A== X-Received: by 2002:a05:6214:5299:b0:69b:1c5c:28fb with SMTP id kj25-20020a056214529900b0069b1c5c28fbmr648127qvb.0.1712861279769; Thu, 11 Apr 2024 11:47:59 -0700 (PDT) X-Received: by 2002:a05:6214:5299:b0:69b:1c5c:28fb with SMTP id kj25-20020a056214529900b0069b1c5c28fbmr648100qvb.0.1712861279132; Thu, 11 Apr 2024 11:47:59 -0700 (PDT) Received: from x1n (pool-99-254-121-117.cpe.net.cable.rogers.com. [99.254.121.117]) by smtp.gmail.com with ESMTPSA id ej6-20020ad45a46000000b00696b1050be8sm1276159qvb.133.2024.04.11.11.47.57 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 11 Apr 2024 11:47:58 -0700 (PDT) Date: Thu, 11 Apr 2024 14:47:56 -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> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: On Thu, Apr 11, 2024 at 06:55:44PM +0200, Paolo Bonzini wrote: > On Mon, Apr 8, 2024 at 3:56 PM Peter Xu wrote: > > 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 > > The patch enables it only for KSM, so it would still require a bunch > of cleanups, for example I also would still use set_pte_at() in all > the places that are not KSM. This would at least fix the issue with > the poor documentation of where to use set_pte_at_notify() vs > set_pte_at(). > > With regard to the implementation, I like the idea of disabling the > invalidation on the MMU notifier side, but I would rather have > MMU_NOTIFIER_CHANGE_PTE as a separate field in the range instead of > overloading the event field. > > > Maybe it can't be enabled for some reason that I overlooked in the current > > tree, or we just decided to not to? > > I have just learnt about the patch, nobody had ever mentioned it even > though it's almost 2 years old... It's a lot of code though and no one > has ever reported an issue for over 10 years, so I think it's easiest > to just rip the code out. Right, it was pretty old and I have no idea if that was discussed or published before.. It would be better to have discussed this earlier. As long as we have a decision with that being aware and in mind, then it looks fine to me to take either way to go, and I also agree either way is better than keep the status quo. I also have Andrea copied anyway when I replied, so I guess he should be aware of this and he can chim in anytime. Thanks! -- Peter Xu