From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-pf1-f199.google.com (mail-pf1-f199.google.com [209.85.210.199]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 34B83311C35 for ; Mon, 27 Jul 2026 16:41:14 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.210.199 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1785170475; cv=none; b=czTmvU6ptAZI6Wk4m/saxWuUkrZQVUeCtC2t1B11yPrbQTMd1PsZx7zCyeTBULZDFfYQ5l5yCSyVkKtA1UAdWovdyPESitK1ojNPIeTGYSvZB+TyyyzKIBbaIty2mnZ0rdyq3FMvKs2n7ErPBEYynCMZkQjcDvTaYbFJoPb3c7Q= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1785170475; c=relaxed/simple; bh=1l9qQQn5fFHI0f34R9RslK15csqZZ376J/mDNYFAOo0=; h=Date:In-Reply-To:Mime-Version:References:Message-ID:Subject:From: To:Cc:Content-Type; b=Qxnw/9eKHj/fD68MtqLuUGW3bIt2UgClJPC6oc7Yqh+wQvc5VCLR5oBLf/ZlWWWEfJBBnk2GRSRURVrFodrvdSXp0SNkzUwgBPHT94nicCG9OzlnipuPVWRpiDib9V3/LbhuaCdUnWyoSujiD3Lza0pkEphKxU/Ozns/hbHjdtw= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=google.com; spf=pass smtp.mailfrom=flex--seanjc.bounces.google.com; dkim=pass (2048-bit key) header.d=google.com header.i=@google.com header.b=UxIWk3qS; arc=none smtp.client-ip=209.85.210.199 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=google.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=flex--seanjc.bounces.google.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=google.com header.i=@google.com header.b="UxIWk3qS" Received: by mail-pf1-f199.google.com with SMTP id d2e1a72fcca58-84e04598adeso2436430b3a.2 for ; Mon, 27 Jul 2026 09:41:14 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20251104; t=1785170473; x=1785775273; darn=vger.kernel.org; h=content-transfer-encoding:content-type:cc:to:from:subject :message-id:references:mime-version:in-reply-to:date:from:to:cc :subject:date:message-id:reply-to:content-type; bh=PA/ZQauWXReUddivSfGtSx+I+B1NMIaiiIYPzRcsSKw=; b=UxIWk3qSXDfiJ+3UA8nyQ4PCZHB4cvr90pHDPFGMt6hnhBKouova2Wl0Aj0P/PHo3k isxsm1WYuAJCt254VgdmRi8l8x21puPRUEDIr+k2WAqLX4iAnO+2o/KsJq0jsctanG8/ 3NZ9I8B12c5BqORXsx65DzZQ6lIfX+WxCXnuAXPmCN27hRJfJ40FbW8l9ZTdgLQM5gPb 7A6AcMpPK1nT6HPXvFrCpzRPnu6MUHMztWviZrvdyBhoTczBRvX/4Pz9MYJswfDon1tZ ZlUoRauJpg5RHhj7VxyE6xWzuAfShAmrUcReJbsCEq8WKu9QJAc+UE6eqq38tfjrWWDk 7WKw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1785170473; x=1785775273; h=content-transfer-encoding:content-type:cc:to:from:subject :message-id:references:mime-version:in-reply-to:date :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to :content-type; bh=PA/ZQauWXReUddivSfGtSx+I+B1NMIaiiIYPzRcsSKw=; b=YK7C/02MO9zke1n4aahp/ikD/9H/mhYq6N16wERwvkASqs9m64mzZtlFwYHUQ62eVn Efzo2qaYxNoqeu2RcCKbWn3D4R+lsdUdw767gXMXNVDwlHh/69hNQRZL40/UYXfcPpby UE1itf2VAOuCvPG7C1hB1vcv2UwX7Nd94xStcIdjZVcsfTCyT5dXbJDwFdUrOfiNZx3W yS4LDduDS2+QF/r78eJ/UOShFfH3fRovsir2JLDIh7xHTDqGZaza3EtCpSTo5sg2hhb4 Tgf/y6HVn/NaD0PIArlE+fzhKLKPZhZB1OXVNUBBWFT4t4bl7Ga/A+XaHDZaABQhifKn /6qQ== X-Forwarded-Encrypted: i=1; AHgh+Ro/7x8r8YCJl7QhOIOPI7gG6mDaYqEx8zhppS2FyVapacFo22L/x68KmO7lhrWn4SutAxQUEVDlQ54FIhY=@vger.kernel.org X-Gm-Message-State: AOJu0YyM/twFfgzXeFGEfjoZ4rzZVAXABZALYz0+D/mmj9X58/Is/Y1Q gfuI6HLjj2z+2ZU4axGM5rI/9Lhb2nZIBecc7xmZVRhm1jewn/ix2vJBjV7PE+wks7hAKp7UF1M pLjH4cg== X-Received: from pfbjw9.prod.google.com ([2002:a05:6a00:9289:b0:847:8ffb:40ad]) (user=seanjc job=prod-delivery.src-stubby-dispatcher) by 2002:a05:6a00:12db:b0:848:70dd:f5a9 with SMTP id d2e1a72fcca58-84e59575393mr7220185b3a.38.1785170473307; Mon, 27 Jul 2026 09:41:13 -0700 (PDT) Date: Mon, 27 Jul 2026 09:41:12 -0700 In-Reply-To: Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: Mime-Version: 1.0 References: <20260616004155.1435766-1-yosry@kernel.org> <20260616004155.1435766-23-yosry@kernel.org> Message-ID: Subject: Re: [RFC PATCH v2 22/25] KVM: x86/mmu: Refactor kvm_mmu_invlpg() to allow skipping the gva flush From: Sean Christopherson To: Yosry Ahmed Cc: Paolo Bonzini , Jim Mattson , Maxim Levitsky , Vitaly Kuznetsov , Tom Lendacky , kvm@vger.kernel.org, linux-kernel@vger.kernel.org Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable On Mon, Jul 27, 2026, Yosry Ahmed wrote: > On Mon, Jul 27, 2026 at 8:38=E2=80=AFAM Sean Christopherson wrote: > > On Fri, Jul 24, 2026, Yosry Ahmed wrote: > > > > > What's the main objection to kvm_mmu_invalidate_addr_in_root()? > > > > > > > > I don't love the __kvm_mmu_invalidate_addr() =3D> kvm_mmu_invalidat= e_addr_in_root() > > > > callchain. It's not at all obvious that the in_root() helper shoul= dn't be called > > > > directly. I don't hate it, but I do think we need better clarity o= n what all this > > > > is doing. > > > > > > > > E.g. when looking at __kvm_inject_emulated_page_fault(), since it h= ardcodes a > > > > single root, it's a bit headscratching to use kvm_mmu_invalidate_ad= dr() instead > > > > of kvm_mmu_invalidate_addr_in_root. > > > > > > Coming back to this, I agree it's confusing. I think this can be fixe= d > > > with a better name though. Looking at > > > kvm_mmu_invalidate_addr_in_root() (or __kvm_mmu_invalidate_addr() in > > > current code), seems like what it does is find SPTEs for that address= , > > > sync them, and flush the TLB if needed. > > > > > > So maybe mmu_sync_addr_sptes() or mmu_sync_and_flush_addr_sptes()? > > > > kvm_mmu_sync_addr()? The "sptes" part is implied in things like kvm_sy= nc_page() > > and mmu_sync_children(). >=20 > Sounds good. I assume you're okay with keeping everything else the > same way? I assume you didn't like any of the alternatives? Ya, I don't want risk delaying this series chasing down flaws that no one c= ares about in practice.