Received: by 2002:ab2:7988:0:b0:1f4:b336:87c4 with SMTP id g8csp107165lqj; Thu, 11 Apr 2024 11:07:56 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCVxOOKC/m16GfUuq8tQIIBVdkkjyOw4HaM4MJw8ksRaLeK8PJttYqjWYmqphYdlq7zDKjKl92PhQ1F/IXofILHITA+UBPgVmQO5d70jHA== X-Google-Smtp-Source: AGHT+IHfq9YI6cDFwQywGSZAe2GE2OX786t/UgbHcIhDHk6oo4JpTpmEZ3DNA/LytFgXkEBRG14V X-Received: by 2002:a17:906:b15:b0:a4e:24cf:76d3 with SMTP id u21-20020a1709060b1500b00a4e24cf76d3mr306363ejg.50.1712858876276; Thu, 11 Apr 2024 11:07:56 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1712858876; cv=pass; d=google.com; s=arc-20160816; b=WLcg5RWeX38tMPa5c93PNdE7055T1nFV8Al2Q/AA8FCaGOyfqLbV+40yz0HdeNneZJ Ro2/yEf180dxEBLzWUqoQX+GSXN0c1JBXjcmjzSil/KJLu0JjFCkCHcThEUYSUQqz27j bQgfvKP93ol1HlEEFBqNmM5JMTgVjdG98hotc4JPoB9ZhAL9gfkbCrk7gVMYuCCnt4d8 48/MHvM3JWjEd4TkBElmmBqTylBvZcYWjanUEKXk0zV49gRPY/vTODvitkFaSWT81cVY CKpzf9IG0l1+eebTQnhxxaCHVbYwmZ/G0h9yiDeF6Sgjk+Cbjof7RFR1uSXSU/zlowQ7 eb8A== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:list-unsubscribe:list-subscribe :list-id:precedence:dkim-signature; bh=zMWXkXzR0H7lOgn05ANda8bjR25lnib+pFQqcdAFtGw=; fh=2KLKCXlHhMX/Z4pfxBGtbpz1Mo6EvqcZT5Z5CXVvT+M=; b=V5xMAZnzKAmgKvgTnRxnszWl4JXBRuYzWvJH0uJr9VyME3BsK3n47VqiNkuDAQkfkJ cb3xRx93jSKyg8qU6nMLE8pixUxHpQNkTdBjOf0HBObOM4hjpikfrXBnSaapNZudD5xy rfzwKsTK5fSZLp7IQDGWk4OBP5NJNmjAy1bD1qC+SWWIF3HZIVj4UpdVwz5dZU7yUe3d eG7QHfY8FWrrul9sBJx+ZSj3JfscjIQxsVNa45TFuOQsk/pi7LtJR9kY0PgZdmtxlBjk O9JGNqawI/GB/4MrBjyzCNK8DQObVdbPuvYUsuMdfCSqjkd9YfVIB50MlwUJPCr9EYHT J0xg==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=CEmduPtL; 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-141361-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-kernel+bounces-141361-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Return-Path: Received: from am.mirrors.kernel.org (am.mirrors.kernel.org. [147.75.80.249]) by mx.google.com with ESMTPS id oz19-20020a170906cd1300b00a4714e036fesi948341ejb.956.2024.04.11.11.07.56 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 11 Apr 2024 11:07:56 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-141361-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) client-ip=147.75.80.249; Authentication-Results: mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=CEmduPtL; 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-141361-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-kernel+bounces-141361-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 am.mirrors.kernel.org (Postfix) with ESMTPS id 0DD261F24AAD for ; Thu, 11 Apr 2024 18:07:20 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 595E61635A1; Thu, 11 Apr 2024 16:56:03 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=redhat.com header.i=@redhat.com header.b="CEmduPtL" 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 18B4C4C629 for ; Thu, 11 Apr 2024 16:55:59 +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=1712854562; cv=none; b=ZhC7bLXs24K6XKpkmAVCMryUz+q3OJTNl3Yuc61JOd+2L21sgBpxICNc0qHpIaFrZNj4TLDLO9Gc/hGq7cXgXC4M/Es6GjICPf0BAJqaFJYWSlQc8C6rCzDDDqjbTXwmOOaPKj6Iyl0nPToqxuqETjJpj4Kre6R18oaUtyCTiAA= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1712854562; c=relaxed/simple; bh=mdyviDc2SZiHERUxq8FwGAUG2lksvejg1L3R6/TQq04=; h=MIME-Version:References:In-Reply-To:From:Date:Message-ID:Subject: To:Cc:Content-Type; b=RtDtQCcW8mL9j7E12zPORBPTtFDS8G+kizLtnm9ta1vfDouucSoXyUYI/p4+LoNxwgxpF2z/PVAEM1iEUTJTF578e+nR5OpQ6JUu3f/1tBQc1g1AjQ/Gd4lbHgWiL9IPi4nKBNuTscEDtUskLSFOmXMeE8jmNCIKT8o94tvNebk= 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=CEmduPtL; 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=1712854559; 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=zMWXkXzR0H7lOgn05ANda8bjR25lnib+pFQqcdAFtGw=; b=CEmduPtL3NP5XNR+oFsDnVOJaZoVwlx7dy2SpDMkrYd+ByLjBPDNySLL9ouFDlwrBxagu3 BJkyt5CIUk3SQVwtjYimIGEWuF/N7Omn/wmbfHopdQCiAeWPKGQeIWT7U9sxB+ZjvYoz0W M/50ajYZgsI8RUEvSFEfgE31ub9wAJI= Received: from mail-wr1-f70.google.com (mail-wr1-f70.google.com [209.85.221.70]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-467-8HV4cHS-PLCF5pmO56dURQ-1; Thu, 11 Apr 2024 12:55:57 -0400 X-MC-Unique: 8HV4cHS-PLCF5pmO56dURQ-1 Received: by mail-wr1-f70.google.com with SMTP id ffacd0b85a97d-343e46df264so3569283f8f.1 for ; Thu, 11 Apr 2024 09:55:57 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1712854557; x=1713459357; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=zMWXkXzR0H7lOgn05ANda8bjR25lnib+pFQqcdAFtGw=; b=OfwUZaBaG+0xpdcbEPD40G9KUiXWm83MkNArOXIs9Ae8GRsgGmfAPzG3i3H0+fXZaK MpB3h37qYUKfarnDEcsb2usBC7SGQ4nGu34xQkLmr8PhRiZosxkoW4w6fwqy/1VMuZQH VWAPGgF3qVo2pMSEqb7Se2/cikEe44P6CizUsb5vXlNUm/cFG87ONqIpmHAKdmda6fP1 Kb4HrvVctEsXO/N4MS3iaOoXc5DDt/4C/GX1GE2BeWi6Q/Z9LZZ6MAxHGuCY2Rh8dNLe m2edns/12tKo3UmjmBsXNAVfFjvy3zJji1zTg3GoPNkYGCXG7bRYYlwd23d92HqSMmOi jBRA== X-Gm-Message-State: AOJu0YyqzpoG59YF5GtMdeBPIMMtTtI+CCIecCUiJ152FVLCDHPx7oFj vaZ3Bf71qXO9vb4M2FuRwfZoy06bvrOnH09rtGYm4yzyqglELDhCKkpSN8pfLrDicGPuD+MVtc1 weYWg7l+G+//uVobLLrgNQ/ECNq2EjnZf0NDgkv9GOgo3eybc1MV80KCykWYF7GV69nxZciZUaA /4C6ZRtg+zqlOp6uhfbHPCH6WxYynL/gwnKupx X-Received: by 2002:a5d:5143:0:b0:346:67fd:beeb with SMTP id u3-20020a5d5143000000b0034667fdbeebmr125061wrt.13.1712854556785; Thu, 11 Apr 2024 09:55:56 -0700 (PDT) X-Received: by 2002:a5d:5143:0:b0:346:67fd:beeb with SMTP id u3-20020a5d5143000000b0034667fdbeebmr125049wrt.13.1712854556481; Thu, 11 Apr 2024 09:55:56 -0700 (PDT) Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 References: <20240405115815.3226315-1-pbonzini@redhat.com> <20240405115815.3226315-2-pbonzini@redhat.com> In-Reply-To: From: Paolo Bonzini Date: Thu, 11 Apr 2024 18:55:44 +0200 Message-ID: Subject: Re: [PATCH 1/4] KVM: delete .change_pte MMU notifier callback To: Peter Xu 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 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable On Mon, Apr 8, 2024 at 3:56=E2=80=AFPM 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/c761078df7a77d13ddfaeebe56a0f4bc128b19= 68 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 curren= t > 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. Paolo > Thanks, > > -- > Peter Xu >