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: <878sleg2z7.fsf@vitty.brq.redhat.com>
Date:   Fri, 07 Feb 2020 10:29:16 +0100
From:   Vitaly Kuznetsov <vkuznets@...hat.com>
To:     Sean Christopherson <sean.j.christopherson@...el.com>
Cc:     Wanpeng Li <wanpengli@...cent.com>,
        Jim Mattson <jmattson@...gle.com>,
        Joerg Roedel <joro@...tes.org>, kvm@...r.kernel.org,
        linux-kernel@...r.kernel.org, Paolo Bonzini <pbonzini@...hat.com>
Subject: Re: [PATCH] KVM: x86/mmu: Avoid retpoline on ->page_fault() with TDP

Sean Christopherson <sean.j.christopherson@...el.com> writes:

> Wrap calls to ->page_fault() with a small shim to directly invoke the
> TDP fault handler when the kernel is using retpolines and TDP is being
> used.  Denote the TDP fault handler by nullifying mmu->page_fault, and
> annotate the TDP path as likely to coerce the compiler into preferring
> the TDP path.
>
> Rename tdp_page_fault() to kvm_tdp_page_fault() as it's exposed outside
> of mmu.c to allow inlining the shim.
>
> Signed-off-by: Sean Christopherson <sean.j.christopherson@...el.com>
> ---

Out of pure curiosity, if we do something like

if (vcpu->arch.mmu->page_fault == tdp_page_fault)
    tdp_page_fault(...)
else if (vcpu->arch.mmu->page_fault == nonpaging_page_fault)
   nonpaging_page_fault(...)
...

we also defeat the retpoline, right? Should we use this technique
... everywhere? :-)

-- 
Vitaly

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ