lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <96ff1628-eeb2-4d12-f4eb-287dd8fc9948@redhat.com>
Date:   Tue, 8 Mar 2022 17:43:08 +0100
From:   Paolo Bonzini <pbonzini@...hat.com>
To:     Sean Christopherson <seanjc@...gle.com>
Cc:     linux-kernel@...r.kernel.org, kvm@...r.kernel.org,
        dmatlack@...gle.com
Subject: Re: [PATCH v2 01/25] KVM: x86/mmu: avoid indirect call for get_cr3

On 3/8/22 17:32, Sean Christopherson wrote:
> 
> Aha!  An idea that would provide line of sight to avoiding retpoline in all cases
> once we use static_call() for nested_ops, which I really want to do...  Drop the
> mmu hook entirely and replace it with:
> 
> static inline kvm_mmu_get_guest_pgd(struct kvm_vcpu *vcpu)
> {
> 	if (!mmu_is_nested(vcpu))
> 		return kvm_read_cr3(vcpu);
> 	else
> 		return kvm_x86_ops.nested_ops->get_guest_pgd(vcpu);
> }

Makes sense, but I think you mean

static inline unsigned long kvm_mmu_get_guest_pgd(struct kvm_vcpu *vcpu,
						  struct kvm_mmu *mmu)
{
	if (unlikely(vcpu == &vcpu->arch.guest_mmu))
		return kvm_x86_ops.nested_ops->get_guest_pgd(vcpu);
	else
		return kvm_read_cr3(vcpu);
}

?

Paolo

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ