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: <53767AE6.5020202@zytor.com>
Date:	Fri, 16 May 2014 13:53:58 -0700
From:	"H. Peter Anvin" <hpa@...or.com>
To:	Dave Hansen <dave@...1.net>, linux-kernel@...r.kernel.org
CC:	dave.hansen@...ux.intel.com, tglx@...utronix.de, x86@...nel.org,
	peterz@...radead.org, gleb@...hat.com, kvm@...r.kernel.org,
	pbonzini@...hat.com, rostedt@...dmis.org
Subject: Re: [PATCH] x86: fix page fault tracing when KVM guest support enabled

On 05/16/2014 12:45 PM, Dave Hansen wrote:
> From: Dave Hansen <dave.hansen@...ux.intel.com>
> 
> I noticed on some of my systems that page fault tracing doesn't
> work:
> 
> 	cd /sys/kernel/debug/tracing
> 	echo 1 > events/exceptions/enable
> 	cat trace;
> 	# nothing shows up
> 
> I eventually traced it down to CONFIG_KVM_GUEST.  At least in a
> KVM VM, enabling that option breaks page fault tracing, and
> disabling fixes it.  I tried on some old kernels and this does
> not appear to be a regression: it never worked.
> 
> There are two page-fault entry functions today.  One when tracing
> is on and another when it is off.  The KVM code calls do_page_fault()
> directly instead of calling the traced version:
> 
>> dotraplinkage void __kprobes
>> do_async_page_fault(struct pt_regs *regs, unsigned long
>> error_code)
>> {
>>         enum ctx_state prev_state;
>>
>>         switch (kvm_read_and_reset_pf_reason()) {
>>         default:
>>                 do_page_fault(regs, error_code);
>>                 break;
>>         case KVM_PV_REASON_PAGE_NOT_PRESENT:
> 
> I'm also having problems with the page fault tracing on bare
> metal (same symptom of no trace output).  I'm unsure if it's
> related.
> 
> Steven had an alternative to this which has zero overhead when
> tracing is off where this includes the standard noops even when
> tracing is disabled.  I'm unconvinced that the extra complexity
> of his apporach:
> 
> 	http://lkml.kernel.org/r/20140508194508.561ed220@gandalf.local.home
> 
> is worth it, expecially considering that the KVM code is already
> making page fault entry slower here.  This solution is
> dirt-simple.
> 
> Gleb, please apply.
> 
> Signed-off-by: Dave Hansen <dave.hansen@...ux.intel.com>
> Cc: Thomas Gleixner <tglx@...utronix.de>
> Cc: x86@...nel.org
> Cc: Peter Zijlstra <peterz@...radead.org>
> Cc: Gleb Natapov <gleb@...hat.com>
> Cc: "H. Peter Anvin" <hpa@...or.com>
> Cc: kvm@...r.kernel.org
> Cc: Paolo Bonzini <pbonzini@...hat.com>
> Cc: Steven Rostedt <rostedt@...dmis.org>

Acked-by: H. Peter Anvin <hpa@...ux.intel.com>

If Gleb and Paolo are okay with it, I am.

	-hpa




--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ