lkml.org 
[lkml]   [2010]   [Dec]   [9]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
    /
    Date
    From
    SubjectRe: perf hw in kexeced kernel broken in tip
    On Wed, Dec 08, 2010 at 03:59:16PM +0100, Peter Zijlstra wrote:
    > On Wed, 2010-12-08 at 15:20 +0100, Peter Zijlstra wrote:
    >
    > > > I wonder if you should reverse these checks. If the bios has the perf
    > > > counter enabled, there might be a high chance that it fails the first
    > > > check and never gets to the actually bios checks.
    > >
    > > Ah, good point.
    >
    > Something like so..

    Getting closer...

    Pentium4s are special they need the double write, so...

    > + /*
    > + * Now write a value and read it back to see if it matches,
    > + * this is needed to detect certain hardware emulators (qemu/kvm)
    > + * that don't trap on the MSR access and always return 0s.
    > + */
    > val = 0xabcdUL;
    > - ret |= checking_wrmsrl(x86_pmu.perfctr, val);
    > + ret = checking_wrmsrl(x86_pmu.perfctr, val);

    if (x86_pmu.perfctr_second_write)
    ret |= checking_wrmsrl(x86_pmu.perfctr, val);


    solved my p4 problems for kexec.

    > ret |= rdmsrl_safe(x86_pmu.perfctr, &val_new);
    > if (ret || val != val_new)
    > - return false;
    > + goto msr_fail;
    >
    > return true;

    Cheers,
    Don


    \
     
     \ /
      Last update: 2010-12-09 21:23    [W:0.024 / U:1.648 seconds]
    ©2003-2016 Jasper Spaans. hosted at Digital OceanAdvertise on this site