From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-pj1-f74.google.com (mail-pj1-f74.google.com [209.85.216.74]) (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 C54D019CD0A for ; Tue, 19 May 2026 00:59:15 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.216.74 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1779152357; cv=none; b=LX3iDzZ+nRx+CaaicJCC9qPoQDkW2fnVTztKmktr5siFHTTt7A8eq68SNPVIEDTxa6plc6WmFlU0Ba33nEaoJcWlsBT3Zybi56WnHOTjPlq8TWzzIZqDmESh249YXkS1rpDERnsLB/sSdVoqEBrYMsk6chdJtp8YtW8xrQoJdRY= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1779152357; c=relaxed/simple; bh=rh89P16/oU7KuKChGPAARzVM3d+bN73c15krqTD79Xc=; h=Date:In-Reply-To:Mime-Version:References:Message-ID:Subject:From: To:Cc:Content-Type; b=ISNwBQKYFA++g8y0vLIbJcoDGbpMBt3yHlt367YKR8klFKorIzIfSrPPP0UiIFAaM8S/7JvIy9rw/BF7QV01QDZMloCD/431kgqauuWMBCAJ1gYDjshozPGURMuTqzpyD+VdVyj+wFKGeItlO8bHaoFAES02q3MGoEyQG+AvgZA= 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=VjuonrPZ; arc=none smtp.client-ip=209.85.216.74 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="VjuonrPZ" Received: by mail-pj1-f74.google.com with SMTP id 98e67ed59e1d1-366122e01fcso2965482a91.2 for ; Mon, 18 May 2026 17:59:15 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20251104; t=1779152355; x=1779757155; darn=vger.kernel.org; h=content-transfer-encoding:cc:to:from:subject:message-id:references :mime-version:in-reply-to:date:from:to:cc:subject:date:message-id :reply-to; bh=emAEVdJqXaLndzifpgbdJIJE33a6OJ6s+mz3Tmc6oL4=; b=VjuonrPZXUFRdbkmJqLXvV3J7eIbRbRzeH0FTxbGLDYe2BBXGkXRUeDEufFxpQkEyl LhxX6iO8fzMGNlCU2WCGSx3EXvKc7gvWHNvnR2apVWDh/ZzIjbMGC2GukKL3nB4/NT+K sSZ57SpT/23PfGvdo2VHIMoaEwrPsF20PM2owX9rlrqZ332CzMDFiNRjhHIxEslOGutj pW1prf1wsc8Jo23jlKOFsYKvln9C8p5ku7Ffyv1H6hqmP75o0FYND7tMZxGiy5pdVEJz iSyAJ6mDz8qgIWbhFadd4mAwBH48sy/FVnGNJsx9aGIwp6I9nYfsspO7U0hzfxZ41fJ/ J1mQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1779152355; x=1779757155; h=content-transfer-encoding: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; bh=emAEVdJqXaLndzifpgbdJIJE33a6OJ6s+mz3Tmc6oL4=; b=Aej4HUsbeK8VzGAFgBDLEx+tidm46vRTTcxGXTCxEwXhIFlTVDgCNnHZCoXvxhiwCr nxbET4EcwIc8S2QqQGJfmtB/qeUASD43tNz1J5V2rrfi1LiRtRuxXnKij9YVvz9HhNMu thjHWYFUJkmjadGK3+f/4MfvTx6eq0WgixePXCboOE5uTINNbjM9Ni6BAJoHWQKaBMSa zDhartOcPMn3Hcm5aLfYWYdq1VdaocxvB5vgeh8pc+HJ1d0SKAgtBR+XtMdeOH44McZQ BjHOzXiCDaeoeUr8ysMwZaFVhqRN9SLaN0wRvOw09c6culWFISi9hkhNUpZ/SdlSo4zE aJCw== X-Forwarded-Encrypted: i=1; AFNElJ/9VOX5wYGos1Pde5ovy6Za2ZEi9osSlr8RfBlk+CkmFhdWBuxjEDloAFG1rDHQReTlRjj9U4fZ5lv/IdA=@vger.kernel.org X-Gm-Message-State: AOJu0YwUB+XwRpQ3S/hwqKkyutxHucTQjXVp/muvzKokmGvTcC+XZAl0 w+x5Xr+4GL9qfh6ItBp4iuG07bkPUPL5R2HWGFPSredXPbuMlUZ+Omqv1EUxTOm0tqIi+DXjVi3 SsZu8lA== X-Received: from pfbem25.prod.google.com ([2002:a05:6a00:3759:b0:835:2a09:221c]) (user=seanjc job=prod-delivery.src-stubby-dispatcher) by 2002:a05:6a20:72aa:b0:3a2:f14a:4287 with SMTP id adf61e73a8af0-3b22e67d172mr18605845637.6.1779152354942; Mon, 18 May 2026 17:59:14 -0700 (PDT) Date: Mon, 18 May 2026 17:59:14 -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: <20260511150648.685374-1-pbonzini@redhat.com> <20260511150648.685374-18-pbonzini@redhat.com> Message-ID: Subject: Re: [PATCH 17/22] KVM: x86/mmu: pull struct kvm_pagewalk out of struct kvm_mmu From: Sean Christopherson To: Kishen Maloor Cc: Yosry Ahmed , Paolo Bonzini , linux-kernel@vger.kernel.org, kvm@vger.kernel.org, jon@nutanix.com, mtosatti@redhat.com Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable On Mon, May 18, 2026, Kishen Maloor wrote: > On 5/13/26 2:36 PM, Yosry Ahmed wrote: > > > @@ -6767,11 +6748,11 @@ int kvm_mmu_create(struct kvm_vcpu *vcpu) > > >=20 > > > vcpu->arch.mmu =3D &vcpu->arch.root_mmu; > > >=20 > > > - ret =3D __kvm_mmu_create(vcpu, &vcpu->arch.guest_mmu); > > > + ret =3D __kvm_mmu_create(vcpu, &vcpu->arch.guest_mmu, &vcpu->= arch.tdp_walk); > > > if (ret) > > > return ret; > > >=20 > > > - ret =3D __kvm_mmu_create(vcpu, &vcpu->arch.root_mmu); > > > + ret =3D __kvm_mmu_create(vcpu, &vcpu->arch.root_mmu, &vcpu->a= rch.cpu_walk); > > > if (ret) > > > goto fail_allocate_root; > >=20 > > I admittedly did not take a close look at the series. Just wanted to > > chime in about naming. I *love* that we are getting rid of nested_mmu > > because I can never immediately tell the difference between guest_mmu > > and nested_mmu, so thank you for that. > >=20 > > However, I can't immediately tell what vcpu->arch.cpu_walk is doing > > either (compared to vcpu->arch.tdp_walk), so maybe the names can be > > improved? If these walks are tied to these MMUs, maybe name them as > > such (e.g. root_pg_walk and guest_pg_walk)? They aren't tied to MMUs in that way though. If L1 is using shadow paging = for L2, than the so called "root" MMU is used for both L1 and L2, albeit with a dif= ferent role (kvm_mmu_page_role.guest_mode will be different). > > I also think root_mmu and guest_mmu could still use some improvement > > but that's probably outside the scope of this series. These are > > essentially L1 MMU and L2 MMU, right? Almost, but not quite. See above. > > Maybe just mmu and nested_mmu could work?=20 > > But I am not sure if we can reclaim the nested_mmu name, it's gonna scr= ew > > with anyone doing backports :/ Heh, could be fun. > +1, and I wonder if it helps to name the walkers after what they walk, to > shape one's conceptual model. E.g. cr3_walk (instead of cpu_walk) for the > walker over CR3-rooted tables of the currently executing guest (L1's or L= 2's > CR3), and nested_tdp_walk for the walker over L1's nested EPT/NPT when L0 > services L2. tdp_walk alone felt a bit vague =E2=80=94 it read as "the TD= P MMU's > walker," whereas this specifically applies to the nested TDP path. Or maybe legacy_walk instead of cr3_walk? Purely because of nCR3 with NPT = :-/ Good xxx_mmu names remain elusive...