Re: [PATCH] i386 add Intel PEBS and BTS cpufeature bits and detection

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Andi Kleen (on Sat, 18 Nov 2006 09:24:01 +0100) wrote:
>On Friday 17 November 2006 23:57, Jeremy Fitzhardinge wrote:
>> Andi Kleen wrote:
>> > I have had private patches for that myself, using the MSRs on AMD
>> > and Intel.
>> >   
>> 
>> Would they be something that could be cleaned up into something
>> mergeable?  
>
>Hmm maybe.
>
>> It would be nice to have something that could be left 
>> enabled all the time, 
>
>That would add considerable latency to all exceptions.
>
>And unfortunately we take more than 16 jumps before
>we figure out an oops, so all the previous data would be gone
>if it was only done in the error path.
>
>If the CPU had a "disable LBR on exceptions" bit that would
>work. Unfortunately it hasn't.

LBR is mainly useful on wild branches to random addresses.  As such,
you really only need to disable LBR in the page fault handler.  For a
long time, KDB had LBR support with this replacement for the i386 page
fault handler.

#if defined(CONFIG_KDB)
ENTRY(page_fault_mca)
       pushl %ecx
       pushl %edx
       pushl %eax
       movl  $473,%ecx
       rdmsr
       andl  $0xfffffffe,%eax          /* Disable last branch recording */
       wrmsr
       popl  %eax
       popl  %edx
       popl  %ecx
       pushl $do_page_fault
       jmp error_code
#endif

Nobody was using the LBR feature of KDB so I removed it in 2.6.17.

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

[Index of Archives]     [Kernel Newbies]     [Netfilter]     [Bugtraq]     [Photo]     [Stuff]     [Gimp]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Video 4 Linux]     [Linux for the blind]     [Linux Resources]
  Powered by Linux