[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <Yie2UmdzumoVNWGA@google.com>
Date: Tue, 8 Mar 2022 20:02:26 +0000
From: Sean Christopherson <seanjc@...gle.com>
To: Paolo Bonzini <pbonzini@...hat.com>
Cc: linux-kernel@...r.kernel.org, kvm@...r.kernel.org,
dmatlack@...gle.com
Subject: Re: [PATCH v2 25/25] KVM: x86/mmu: extract initialization of the
page walking data
On Mon, Feb 21, 2022, Paolo Bonzini wrote:
> +static void kvm_vcpu_init_walker(struct kvm_vcpu *vcpu,
> + struct kvm_mmu *mmu,
> + union kvm_mmu_paging_mode new_mode)
kvm_vcpu_init_walker() is a rather odd and almost maliciously obtuse. We're not
short on space for this one, so how about?
static void kvm_mmu_init_guest_walker(struct kvm_vcpu *vcpu,
struct kvm_mmu *mmu,
union kvm_mmu_paging_mode new_mode)
> void kvm_init_mmu(struct kvm_vcpu *vcpu)
> {
> struct kvm_mmu_role_regs regs = vcpu_to_role_regs(vcpu);
> union kvm_mmu_paging_mode cpu_mode = kvm_calc_cpu_mode(vcpu, ®s);
>
> + kvm_vcpu_init_walker(vcpu, vcpu->arch.walk_mmu, cpu_mode);
> if (mmu_is_nested(vcpu))
> - init_kvm_nested_mmu(vcpu, cpu_mode);
> - else if (tdp_enabled)
> + return;
Nice! I really like that this highlights that the nested_mmu crud is just for
the walker. Can you also add a comment here explaining that part?
> +
> + if (tdp_enabled)
> init_kvm_tdp_mmu(vcpu, cpu_mode);
> else
> init_kvm_softmmu(vcpu, cpu_mode);
> --
> 2.31.1
>
Powered by blists - more mailing lists