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] [day] [month] [year] [list]
Message-ID: <YTAMrQDY3eXY9lYO@google.com>
Date:   Wed, 1 Sep 2021 23:28:45 +0000
From:   Sean Christopherson <seanjc@...gle.com>
To:     Paolo Bonzini <pbonzini@...hat.com>
Cc:     linux-kernel@...r.kernel.org, kvm@...r.kernel.org,
        isaku.yamahata@...el.com, David Matlack <dmatlack@...gle.com>,
        peterx@...hat.com
Subject: Re: [PATCH 16/16] KVM: MMU: change tracepoints arguments to
 kvm_page_fault

On Sat, Aug 07, 2021, Paolo Bonzini wrote:
> @@ -377,9 +377,9 @@ TRACE_EVENT(
>  	),
>  
>  	TP_fast_assign(
> -		__entry->gfn = addr >> PAGE_SHIFT;
> -		__entry->pfn = pfn | (__entry->gfn & (KVM_PAGES_PER_HPAGE(level) - 1));
> -		__entry->level = level;
> +		__entry->gfn = fault->addr >> PAGE_SHIFT;

Eww.  The existing code also bastardizes addr vs. gpa, but this just looks even
more wrong because we have fault->gfn.

Maybe do this as a prep patch at the beginning of the series?  And then use
fault->gfn directly.

diff --git a/arch/x86/kvm/mmu/paging_tmpl.h b/arch/x86/kvm/mmu/paging_tmpl.h
index 7d03e9b7ccfa..b159749300b5 100644
--- a/arch/x86/kvm/mmu/paging_tmpl.h
+++ b/arch/x86/kvm/mmu/paging_tmpl.h
@@ -725,7 +725,7 @@ static int FNAME(fetch)(struct kvm_vcpu *vcpu, gpa_t addr,
        level = kvm_mmu_hugepage_adjust(vcpu, gw->gfn, max_level, &pfn,
                                        huge_page_disallowed, &req_level);

-       trace_kvm_mmu_spte_requested(addr, gw->level, pfn);
+       trace_kvm_mmu_spte_requested(gw->gfn << PAGE_SHIFT, gw->level, pfn);

        for (; shadow_walk_okay(&it); shadow_walk_next(&it)) {
                clear_sp_write_flooding_count(it.sptep);

> +		__entry->pfn = fault->pfn | (__entry->gfn & (KVM_PAGES_PER_HPAGE(fault->goal_level) - 1));

Similar thing here, it could use fault->gfn directly.

> +		__entry->level = fault->goal_level;
>  	),
>  
>  	TP_printk("gfn %llx pfn %llx level %d",

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ