1. 22 8月, 2023 2 次提交
  2. 20 9月, 2022 1 次提交
    • D
      x86/speculation: Add RSB VM Exit protections · 3838336f
      Daniel Sneddon 提交于
      stable inclusion
      from stable-v5.10.136
      commit 509c2c9fe75ea7493eebbb6bb2f711f37530ae19
      category: bugfix
      bugzilla: https://gitee.com/src-openeuler/kernel/issues/I5N1SO
      CVE: CVE-2022-26373
      
      Reference: https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/commit/?id=509c2c9fe75ea7493eebbb6bb2f711f37530ae19
      
      --------------------------------
      
      commit 2b129932 upstream.
      
      tl;dr: The Enhanced IBRS mitigation for Spectre v2 does not work as
      documented for RET instructions after VM exits. Mitigate it with a new
      one-entry RSB stuffing mechanism and a new LFENCE.
      
      == Background ==
      
      Indirect Branch Restricted Speculation (IBRS) was designed to help
      mitigate Branch Target Injection and Speculative Store Bypass, i.e.
      Spectre, attacks. IBRS prevents software run in less privileged modes
      from affecting branch prediction in more privileged modes. IBRS requires
      the MSR to be written on every privilege level change.
      
      To overcome some of the performance issues of IBRS, Enhanced IBRS was
      introduced.  eIBRS is an "always on" IBRS, in other words, just turn
      it on once instead of writing the MSR on every privilege level change.
      When eIBRS is enabled, more privileged modes should be protected from
      less privileged modes, including protecting VMMs from guests.
      
      == Problem ==
      
      Here's a simplification of how guests are run on Linux' KVM:
      
      void run_kvm_guest(void)
      {
      	// Prepare to run guest
      	VMRESUME();
      	// Clean up after guest runs
      }
      
      The execution flow for that would look something like this to the
      processor:
      
      1. Host-side: call run_kvm_guest()
      2. Host-side: VMRESUME
      3. Guest runs, does "CALL guest_function"
      4. VM exit, host runs again
      5. Host might make some "cleanup" function calls
      6. Host-side: RET from run_kvm_guest()
      
      Now, when back on the host, there are a couple of possible scenarios of
      post-guest activity the host needs to do before executing host code:
      
      * on pre-eIBRS hardware (legacy IBRS, or nothing at all), the RSB is not
      touched and Linux has to do a 32-entry stuffing.
      
      * on eIBRS hardware, VM exit with IBRS enabled, or restoring the host
      IBRS=1 shortly after VM exit, has a documented side effect of flushing
      the RSB except in this PBRSB situation where the software needs to stuff
      the last RSB entry "by hand".
      
      IOW, with eIBRS supported, host RET instructions should no longer be
      influenced by guest behavior after the host retires a single CALL
      instruction.
      
      However, if the RET instructions are "unbalanced" with CALLs after a VM
      exit as is the RET in #6, it might speculatively use the address for the
      instruction after the CALL in #3 as an RSB prediction. This is a problem
      since the (untrusted) guest controls this address.
      
      Balanced CALL/RET instruction pairs such as in step #5 are not affected.
      
      == Solution ==
      
      The PBRSB issue affects a wide variety of Intel processors which
      support eIBRS. But not all of them need mitigation. Today,
      X86_FEATURE_RSB_VMEXIT triggers an RSB filling sequence that mitigates
      PBRSB. Systems setting RSB_VMEXIT need no further mitigation - i.e.,
      eIBRS systems which enable legacy IBRS explicitly.
      
      However, such systems (X86_FEATURE_IBRS_ENHANCED) do not set RSB_VMEXIT
      and most of them need a new mitigation.
      
      Therefore, introduce a new feature flag X86_FEATURE_RSB_VMEXIT_LITE
      which triggers a lighter-weight PBRSB mitigation versus RSB_VMEXIT.
      
      The lighter-weight mitigation performs a CALL instruction which is
      immediately followed by a speculative execution barrier (INT3). This
      steers speculative execution to the barrier -- just like a retpoline
      -- which ensures that speculation can never reach an unbalanced RET.
      Then, ensure this CALL is retired before continuing execution with an
      LFENCE.
      
      In other words, the window of exposure is opened at VM exit where RET
      behavior is troublesome. While the window is open, force RSB predictions
      sampling for RET targets to a dead end at the INT3. Close the window
      with the LFENCE.
      
      There is a subset of eIBRS systems which are not vulnerable to PBRSB.
      Add these systems to the cpu_vuln_whitelist[] as NO_EIBRS_PBRSB.
      Future systems that aren't vulnerable will set ARCH_CAP_PBRSB_NO.
      
        [ bp: Massage, incorporate review comments from Andy Cooper. ]
      Signed-off-by: NDaniel Sneddon <daniel.sneddon@linux.intel.com>
      Co-developed-by: NPawan Gupta <pawan.kumar.gupta@linux.intel.com>
      Signed-off-by: NPawan Gupta <pawan.kumar.gupta@linux.intel.com>
      Signed-off-by: NBorislav Petkov <bp@suse.de>
      Signed-off-by: NGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      
      conflict:
          arch/x86/include/asm/cpufeatures.h
      Signed-off-by: NChen Jiahao <chenjiahao16@huawei.com>
      Reviewed-by: NZhang Jianhua <chris.zjh@huawei.com>
      Signed-off-by: NZheng Zengkai <zhengzengkai@huawei.com>
      3838336f
  3. 16 9月, 2022 9 次提交
  4. 05 7月, 2022 2 次提交
  5. 27 4月, 2022 1 次提交
  6. 29 12月, 2021 1 次提交
    • A
      tools arch x86: Sync the msr-index.h copy with the kernel sources · b9c76b02
      Arnaldo Carvalho de Melo 提交于
      mainline inclusion
      from mainline-5.16-rc6
      commit e9bde94f
      category: feature
      feature: milan cpu
      bugzilla: https://gitee.com/openeuler/kernel/issues/I4NX57
      CVE: NA
      
      --------------------------------
      
      To pick up the changes in:
      
        d205e0f1 ("x86/{cpufeatures,msr}: Add Intel SGX Launch Control hardware bits")
        e7b6385b ("x86/cpufeatures: Add Intel SGX hardware bits")
        43756a29 ("powercap: Add AMD Fam17h RAPL support")
        298ed2b3 ("x86/msr-index: sort AMD RAPL MSRs by address")
        68299a42 ("x86/mce: Enable additional error logging on certain Intel CPUs")
      
      That cause these changes in tooling:
      
        $ tools/perf/trace/beauty/tracepoints/x86_msr.sh > before
        $ cp arch/x86/include/asm/msr-index.h tools/arch/x86/include/asm/msr-index.h
        $ tools/perf/trace/beauty/tracepoints/x86_msr.sh > after
        $ diff -u before after
        --- before	2020-12-17 14:45:49.036994450 -0300
        +++ after	2020-12-17 14:46:01.654256639 -0300
        @@ -22,6 +22,10 @@
         	[0x00000060] = "LBR_CORE_TO",
         	[0x00000079] = "IA32_UCODE_WRITE",
         	[0x0000008b] = "IA32_UCODE_REV",
        +	[0x0000008C] = "IA32_SGXLEPUBKEYHASH0",
        +	[0x0000008D] = "IA32_SGXLEPUBKEYHASH1",
        +	[0x0000008E] = "IA32_SGXLEPUBKEYHASH2",
        +	[0x0000008F] = "IA32_SGXLEPUBKEYHASH3",
         	[0x0000009b] = "IA32_SMM_MONITOR_CTL",
         	[0x0000009e] = "IA32_SMBASE",
         	[0x000000c1] = "IA32_PERFCTR0",
        @@ -59,6 +63,7 @@
         	[0x00000179] = "IA32_MCG_CAP",
         	[0x0000017a] = "IA32_MCG_STATUS",
         	[0x0000017b] = "IA32_MCG_CTL",
        +	[0x0000017f] = "ERROR_CONTROL",
         	[0x00000180] = "IA32_MCG_EAX",
         	[0x00000181] = "IA32_MCG_EBX",
         	[0x00000182] = "IA32_MCG_ECX",
        @@ -294,6 +299,7 @@
         	[0xc0010241 - x86_AMD_V_KVM_MSRs_offset] = "F15H_NB_PERF_CTR",
         	[0xc0010280 - x86_AMD_V_KVM_MSRs_offset] = "F15H_PTSC",
         	[0xc0010299 - x86_AMD_V_KVM_MSRs_offset] = "AMD_RAPL_POWER_UNIT",
        +	[0xc001029a - x86_AMD_V_KVM_MSRs_offset] = "AMD_CORE_ENERGY_STATUS",
         	[0xc001029b - x86_AMD_V_KVM_MSRs_offset] = "AMD_PKG_ENERGY_STATUS",
         	[0xc00102f0 - x86_AMD_V_KVM_MSRs_offset] = "AMD_PPIN_CTL",
         	[0xc00102f1 - x86_AMD_V_KVM_MSRs_offset] = "AMD_PPIN",
        $
      
      Which causes these parts of tools/perf/ to be rebuilt:
      
        CC       /tmp/build/perf/trace/beauty/tracepoints/x86_msr.o
        LD       /tmp/build/perf/trace/beauty/tracepoints/perf-in.o
        LD       /tmp/build/perf/trace/beauty/perf-in.o
        LD       /tmp/build/perf/perf-in.o
        LINK     /tmp/build/perf/perf
      
      At some point these should just be tables read by perf on demand.
      
      This allows 'perf trace' users to use those strings to translate from
      the msr ids provided by the msr: tracepoints.
      
      This addresses this perf tools build warning:
      
        diff -u tools/arch/x86/include/asm/msr-index.h arch/x86/include/asm/msr-index.h
        Warning: Kernel ABI header at 'tools/arch/x86/include/asm/msr-index.h' differs from latest version at 'arch/x86/include/asm/msr-index.h'
      
      Cc: Adrian Hunter <adrian.hunter@intel.com>
      Cc: Borislav Petkov <bp@suse.de>
      Cc: Ian Rogers <irogers@google.com>
      Cc: Jiri Olsa <jolsa@kernel.org>
      Cc: Namhyung Kim <namhyung@kernel.org>
      Cc: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
      Cc: Sean Christopherson <seanjc@google.com>
      Cc: Tony Luck <tony.luck@intel.com>
      Cc: Victor Ding <victording@google.com>
      Signed-off-by: NArnaldo Carvalho de Melo <acme@redhat.com>
      
      conflicts:
      following patches haven't been backported:
        d205e0f1 ("x86/{cpufeatures,msr}: Add Intel SGX Launch Control
      hardware bits")
        e7b6385b ("x86/cpufeatures: Add Intel SGX hardware bits")
        68299a42 ("x86/mce: Enable additional error logging on certain
      Intel CPUs")
      so fixing code related to above patches in this patch is not applied.
      Signed-off-by: Nqinyu <qinyu16@huawei.com>
      Reviewed-by: NChao Liu <liuchao173@huawei.com>
      Reviewed-by: NXiongfeng Wang <wangxiongfeng2@huawei.com>
      Signed-off-by: NZheng Zengkai <zhengzengkai@huawei.com>
      b9c76b02
  7. 06 12月, 2020 1 次提交
  8. 13 11月, 2020 1 次提交
    • A
      tools arch: Update arch/x86/lib/mem{cpy,set}_64.S copies used in 'perf bench mem memcpy' · db1a8b97
      Arnaldo Carvalho de Melo 提交于
      To bring in the change made in this cset:
      
        4d6ffa27 ("x86/lib: Change .weak to SYM_FUNC_START_WEAK for arch/x86/lib/mem*_64.S")
        6dcc5627 ("x86/asm: Change all ENTRY+ENDPROC to SYM_FUNC_*")
      
      I needed to define SYM_FUNC_START_LOCAL() as SYM_L_GLOBAL as
      mem{cpy,set}_{orig,erms} are used by 'perf bench'.
      
      This silences these perf tools build warnings:
      
        Warning: Kernel ABI header at 'tools/arch/x86/lib/memcpy_64.S' differs from latest version at 'arch/x86/lib/memcpy_64.S'
        diff -u tools/arch/x86/lib/memcpy_64.S arch/x86/lib/memcpy_64.S
        Warning: Kernel ABI header at 'tools/arch/x86/lib/memset_64.S' differs from latest version at 'arch/x86/lib/memset_64.S'
        diff -u tools/arch/x86/lib/memset_64.S arch/x86/lib/memset_64.S
      
      Cc: Adrian Hunter <adrian.hunter@intel.com>
      Cc: Borislav Petkov <bp@suse.de>
      Cc: Fangrui Song <maskray@google.com>
      Cc: Ian Rogers <irogers@google.com>
      Cc: Jiri Olsa <jolsa@kernel.org>
      Cc: Jiri Slaby <jirislaby@kernel.org>
      Cc: Namhyung Kim <namhyung@kernel.org>
      Signed-off-by: NArnaldo Carvalho de Melo <acme@redhat.com>
      db1a8b97
  9. 03 11月, 2020 4 次提交
    • A
      tools kvm headers: Update KVM headers from the kernel sources · aa04899a
      Arnaldo Carvalho de Melo 提交于
      Some should cause changes in tooling, like the one adding LAST_EXCP, but
      the way it is structured end up not making that happen.
      
      The new SVM_EXIT_INVPCID should get used by arch/x86/util/kvm-stat.c,
      in the svm_exit_reasons table.
      
      The tools/perf/trace/beauty part has scripts to catch changes and
      automagically create tables, like tools/perf/trace/beauty/kvm_ioctl.sh,
      but changes are needed to make tools/perf/arch/x86/util/kvm-stat.c catch
      those automatically.
      
      These were handled by the existing scripts:
      
        $ tools/perf/trace/beauty/kvm_ioctl.sh > before
        $ cp include/uapi/linux/kvm.h tools/include/uapi/linux/kvm.h
        $ tools/perf/trace/beauty/kvm_ioctl.sh > after
        $ diff -u before after
        --- before	2020-11-03 08:43:52.910728608 -0300
        +++ after	2020-11-03 08:44:04.273959984 -0300
        @@ -89,6 +89,7 @@
         	[0xbf] = "SET_NESTED_STATE",
         	[0xc0] = "CLEAR_DIRTY_LOG",
         	[0xc1] = "GET_SUPPORTED_HV_CPUID",
        +	[0xc6] = "X86_SET_MSR_FILTER",
         	[0xe0] = "CREATE_DEVICE",
         	[0xe1] = "SET_DEVICE_ATTR",
         	[0xe2] = "GET_DEVICE_ATTR",
        $
        $ tools/perf/trace/beauty/vhost_virtio_ioctl.sh > before
        $ cp include/uapi/linux/vhost.h tools/include/uapi/linux/vhost.h
        $
        $ tools/perf/trace/beauty/vhost_virtio_ioctl.sh > after
        $ diff -u before after
        --- before	2020-11-03 08:45:55.522225198 -0300
        +++ after	2020-11-03 08:46:12.881578666 -0300
        @@ -37,4 +37,5 @@
         	[0x71] = "VDPA_GET_STATUS",
         	[0x73] = "VDPA_GET_CONFIG",
         	[0x76] = "VDPA_GET_VRING_NUM",
        +	[0x78] = "VDPA_GET_IOVA_RANGE",
         };
        $
      
      This addresses these perf build warnings:
      
        Warning: Kernel ABI header at 'tools/arch/arm64/include/uapi/asm/kvm.h' differs from latest version at 'arch/arm64/include/uapi/asm/kvm.h'
        diff -u tools/arch/arm64/include/uapi/asm/kvm.h arch/arm64/include/uapi/asm/kvm.h
        Warning: Kernel ABI header at 'tools/arch/s390/include/uapi/asm/sie.h' differs from latest version at 'arch/s390/include/uapi/asm/sie.h'
        diff -u tools/arch/s390/include/uapi/asm/sie.h arch/s390/include/uapi/asm/sie.h
        Warning: Kernel ABI header at 'tools/arch/x86/include/uapi/asm/kvm.h' differs from latest version at 'arch/x86/include/uapi/asm/kvm.h'
        diff -u tools/arch/x86/include/uapi/asm/kvm.h arch/x86/include/uapi/asm/kvm.h
        Warning: Kernel ABI header at 'tools/arch/x86/include/uapi/asm/svm.h' differs from latest version at 'arch/x86/include/uapi/asm/svm.h'
        diff -u tools/arch/x86/include/uapi/asm/svm.h arch/x86/include/uapi/asm/svm.h
        Warning: Kernel ABI header at 'tools/include/uapi/linux/kvm.h' differs from latest version at 'include/uapi/linux/kvm.h'
        diff -u tools/include/uapi/linux/kvm.h include/uapi/linux/kvm.h
        Warning: Kernel ABI header at 'tools/include/uapi/linux/vhost.h' differs from latest version at 'include/uapi/linux/vhost.h'
        diff -u tools/include/uapi/linux/vhost.h include/uapi/linux/vhost.h
      
      Cc: Adrian Hunter <adrian.hunter@intel.com>
      Cc: Alexander Yarygin <yarygin@linux.vnet.ibm.com>
      Cc: Borislav Petkov <bp@suse.de>
      Cc: Christian Borntraeger <borntraeger@de.ibm.com>
      Cc: Cornelia Huck <cornelia.huck@de.ibm.com>
      Cc: David Ahern <dsahern@gmail.com>
      Cc: Ian Rogers <irogers@google.com>
      Cc: Jiri Olsa <jolsa@kernel.org>
      Cc: Joerg Roedel <jroedel@suse.de>
      Cc: Namhyung Kim <namhyung@kernel.org>
      Signed-off-by: NArnaldo Carvalho de Melo <acme@redhat.com>
      aa04899a
    • A
      tools arch x86: Sync the msr-index.h copy with the kernel sources · 32b734e0
      Arnaldo Carvalho de Melo 提交于
      To pick up the changes in:
      
        29dcc60f ("x86/boot/compressed/64: Add stage1 #VC handler")
        36e1be8a ("perf/x86/amd/ibs: Fix raw sample data accumulation")
        59a854e2 ("perf/x86/intel: Support TopDown metrics on Ice Lake")
        7b2c05a1 ("perf/x86/intel: Generic support for hardware TopDown metrics")
        99e40204 ("x86/msr: Move the F15h MSRs where they belong")
        b57de6cd ("x86/sev-es: Add SEV-ES Feature Detection")
        ed7bde7a ("cpufreq: intel_pstate: Allow enable/disable energy efficiency")
        f0f2f9fe ("x86/msr-index: Define an IA32_PASID MSR")
      
      That cause these changes in tooling:
      
        $ tools/perf/trace/beauty/tracepoints/x86_msr.sh > before
        $ cp arch/x86/include/asm/msr-index.h tools/arch/x86/include/asm/msr-index.h
        $ tools/perf/trace/beauty/tracepoints/x86_msr.sh > after
        $ diff -u before after
        --- before	2020-10-19 13:27:33.195274425 -0300
        +++ after	2020-10-19 13:27:44.144507610 -0300
        @@ -113,6 +113,8 @@
         	[0x00000309] = "CORE_PERF_FIXED_CTR0",
         	[0x0000030a] = "CORE_PERF_FIXED_CTR1",
         	[0x0000030b] = "CORE_PERF_FIXED_CTR2",
        +	[0x0000030c] = "CORE_PERF_FIXED_CTR3",
        +	[0x00000329] = "PERF_METRICS",
         	[0x00000345] = "IA32_PERF_CAPABILITIES",
         	[0x0000038d] = "CORE_PERF_FIXED_CTR_CTRL",
         	[0x0000038e] = "CORE_PERF_GLOBAL_STATUS",
        @@ -222,6 +224,7 @@
         	[0x00000774] = "HWP_REQUEST",
         	[0x00000777] = "HWP_STATUS",
         	[0x00000d90] = "IA32_BNDCFGS",
        +	[0x00000d93] = "IA32_PASID",
         	[0x00000da0] = "IA32_XSS",
         	[0x00000dc0] = "LBR_INFO_0",
         	[0x00000ffc] = "IA32_BNDCFGS_RSVD",
        @@ -279,6 +282,7 @@
         	[0xc0010115 - x86_AMD_V_KVM_MSRs_offset] = "VM_IGNNE",
         	[0xc0010117 - x86_AMD_V_KVM_MSRs_offset] = "VM_HSAVE_PA",
         	[0xc001011f - x86_AMD_V_KVM_MSRs_offset] = "AMD64_VIRT_SPEC_CTRL",
        +	[0xc0010130 - x86_AMD_V_KVM_MSRs_offset] = "AMD64_SEV_ES_GHCB",
         	[0xc0010131 - x86_AMD_V_KVM_MSRs_offset] = "AMD64_SEV",
         	[0xc0010140 - x86_AMD_V_KVM_MSRs_offset] = "AMD64_OSVW_ID_LENGTH",
         	[0xc0010141 - x86_AMD_V_KVM_MSRs_offset] = "AMD64_OSVW_STATUS",
        $
      
      Which causes these parts of tools/perf/ to be rebuilt:
      
        CC       /tmp/build/perf/trace/beauty/tracepoints/x86_msr.o
        DESCEND  plugins
        GEN      /tmp/build/perf/python/perf.so
        INSTALL  trace_plugins
        LD       /tmp/build/perf/trace/beauty/tracepoints/perf-in.o
        LD       /tmp/build/perf/trace/beauty/perf-in.o
        LD       /tmp/build/perf/perf-in.o
        LINK     /tmp/build/perf/per
      
      At some point these should just be tables read by perf on demand.
      
      This addresses this perf tools build warning:
      
        diff -u tools/arch/x86/include/asm/msr-index.h arch/x86/include/asm/msr-index.h
        Warning: Kernel ABI header at 'tools/arch/x86/include/asm/msr-index.h' differs from latest version at 'arch/x86/include/asm/msr-index.h'
      
      Cc: Adrian Hunter <adrian.hunter@intel.com>
      Cc: Borislav Petkov <bp@suse.de>
      Cc: Fenghua Yu <fenghua.yu@intel.com>
      Cc: Ian Rogers <irogers@google.com>
      Cc: Jiri Olsa <jolsa@kernel.org>
      Cc: Joerg Roedel <jroedel@suse.de>
      Cc: Kan Liang <kan.liang@linux.intel.com>
      Cc: Kim Phillips <kim.phillips@amd.com>
      Cc: Namhyung Kim <namhyung@kernel.org>
      Cc: Peter Zijlstra <peterz@infradead.org>
      Cc: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
      Cc: Srinivas Pandruvada <srinivas.pandruvada@linux.intel.com>
      Signed-off-by: NArnaldo Carvalho de Melo <acme@redhat.com>
      32b734e0
    • A
      tools x86 headers: Update required-features.h header from the kernel · 8b2fc25a
      Arnaldo Carvalho de Melo 提交于
      To pick the changes from:
      
        ecac7181 ("x86/paravirt: Use CONFIG_PARAVIRT_XXL instead of CONFIG_PARAVIRT")
      
      That don entail any changes in tooling, just addressing these perf tools
      build warning:
      
        Warning: Kernel ABI header at 'tools/arch/x86/include/asm/required-features.h' differs from latest version at 'arch/x86/include/asm/required-features.h'
        diff -u tools/arch/x86/include/asm/required-features.h arch/x86/include/asm/required-features.h
      
      Cc: Adrian Hunter <adrian.hunter@intel.com>
      Cc: Ian Rogers <irogers@google.com>
      Cc: Ingo Molnar <mingo@kernel.org>
      Cc: Jiri Olsa <jolsa@kernel.org>
      Cc: Juergen Gross <jgross@suse.com>
      Cc: Namhyung Kim <namhyung@kernel.org>
      Signed-off-by: NArnaldo Carvalho de Melo <acme@redhat.com>
      8b2fc25a
    • A
      tools x86 headers: Update cpufeatures.h headers copies · 40a6bbf5
      Arnaldo Carvalho de Melo 提交于
      To pick the changes from:
      
        5866e920 ("x86/cpu: Add hardware-enforced cache coherency as a CPUID feature")
        ff4f8281 ("x86/cpufeatures: Enumerate ENQCMD and ENQCMDS instructions")
        360e7c5c ("x86/cpufeatures: Add SEV-ES CPU feature")
        18ec63fa ("x86/cpufeatures: Enumerate TSX suspend load address tracking instructions")
        e48cb1a3 ("x86/resctrl: Enumerate per-thread MBA controls")
      
      Which don't cause any changes in tooling, just addresses these build
      warnings:
      
        Warning: Kernel ABI header at 'tools/arch/x86/include/asm/cpufeatures.h' differs from latest version at 'arch/x86/include/asm/cpufeatures.h'
        diff -u tools/arch/x86/include/asm/cpufeatures.h arch/x86/include/asm/cpufeatures.h
        Warning: Kernel ABI header at 'tools/arch/x86/include/asm/disabled-features.h' differs from latest version at 'arch/x86/include/asm/disabled-features.h'
        diff -u tools/arch/x86/include/asm/disabled-features.h arch/x86/include/asm/disabled-features.h
      
      Cc: Adrian Hunter <adrian.hunter@intel.com>
      Cc: Borislav Petkov <bp@suse.de>
      Cc: Fenghua Yu <fenghua.yu@intel.com>
      Cc: Ian Rogers <irogers@google.com>
      Cc: Jiri Olsa <jolsa@kernel.org>
      Cc: Krish Sadhukhan <krish.sadhukhan@oracle.com>
      Cc: Kyung Min Park <kyung.min.park@intel.com>
      Cc: Namhyung Kim <namhyung@kernel.org>
      Cc: Tom Lendacky <thomas.lendacky@amd.com>
      Signed-off-by: NArnaldo Carvalho de Melo <acme@redhat.com>
      40a6bbf5
  10. 06 10月, 2020 1 次提交
    • D
      x86, powerpc: Rename memcpy_mcsafe() to copy_mc_to_{user, kernel}() · ec6347bb
      Dan Williams 提交于
      In reaction to a proposal to introduce a memcpy_mcsafe_fast()
      implementation Linus points out that memcpy_mcsafe() is poorly named
      relative to communicating the scope of the interface. Specifically what
      addresses are valid to pass as source, destination, and what faults /
      exceptions are handled.
      
      Of particular concern is that even though x86 might be able to handle
      the semantics of copy_mc_to_user() with its common copy_user_generic()
      implementation other archs likely need / want an explicit path for this
      case:
      
        On Fri, May 1, 2020 at 11:28 AM Linus Torvalds <torvalds@linux-foundation.org> wrote:
        >
        > On Thu, Apr 30, 2020 at 6:21 PM Dan Williams <dan.j.williams@intel.com> wrote:
        > >
        > > However now I see that copy_user_generic() works for the wrong reason.
        > > It works because the exception on the source address due to poison
        > > looks no different than a write fault on the user address to the
        > > caller, it's still just a short copy. So it makes copy_to_user() work
        > > for the wrong reason relative to the name.
        >
        > Right.
        >
        > And it won't work that way on other architectures. On x86, we have a
        > generic function that can take faults on either side, and we use it
        > for both cases (and for the "in_user" case too), but that's an
        > artifact of the architecture oddity.
        >
        > In fact, it's probably wrong even on x86 - because it can hide bugs -
        > but writing those things is painful enough that everybody prefers
        > having just one function.
      
      Replace a single top-level memcpy_mcsafe() with either
      copy_mc_to_user(), or copy_mc_to_kernel().
      
      Introduce an x86 copy_mc_fragile() name as the rename for the
      low-level x86 implementation formerly named memcpy_mcsafe(). It is used
      as the slow / careful backend that is supplanted by a fast
      copy_mc_generic() in a follow-on patch.
      
      One side-effect of this reorganization is that separating copy_mc_64.S
      to its own file means that perf no longer needs to track dependencies
      for its memcpy_64.S benchmarks.
      
       [ bp: Massage a bit. ]
      Signed-off-by: NDan Williams <dan.j.williams@intel.com>
      Signed-off-by: NBorislav Petkov <bp@suse.de>
      Reviewed-by: NTony Luck <tony.luck@intel.com>
      Acked-by: NMichael Ellerman <mpe@ellerman.id.au>
      Cc: <stable@vger.kernel.org>
      Link: http://lore.kernel.org/r/CAHk-=wjSqtXAqfUJxFtWNwmguFASTgB0dz1dT3V-78Quiezqbg@mail.gmail.com
      Link: https://lkml.kernel.org/r/160195561680.2163339.11574962055305783722.stgit@dwillia2-desk3.amr.corp.intel.com
      ec6347bb
  11. 10 9月, 2020 1 次提交
  12. 08 9月, 2020 1 次提交
  13. 07 8月, 2020 2 次提交
    • A
      tools arch x86: Sync asm/cpufeatures.h with the kernel sources · dd4a5c22
      Arnaldo Carvalho de Melo 提交于
      To pick up the changes from:
      
        85b23fbc ("x86/cpufeatures: Add enumeration for SERIALIZE instruction")
        bd657aa3 ("x86/cpufeatures: Add Architectural LBRs feature bit")
        fbd5969d ("x86/cpufeatures: Mark two free bits in word 3")
      
      These should't cause any changes in tooling, it just gets rebuilt by
      including those headers:
      
        CC       /tmp/build/perf/bench/mem-memcpy-x86-64-asm.o
        CC       /tmp/build/perf/bench/mem-memset-x86-64-asm.o
        LD       /tmp/build/perf/bench/perf-in.o
        LD       /tmp/build/perf/perf-in.o
        LINK     /tmp/build/perf/perf
      
      And silences this perf build warning:
      
        Warning: Kernel ABI header at 'tools/arch/x86/include/asm/cpufeatures.h' differs from latest version at 'arch/x86/include/asm/cpufeatures.h'
        diff -u tools/arch/x86/include/asm/cpufeatures.h arch/x86/include/asm/cpufeatures.h
      
      Cc: Adrian Hunter <adrian.hunter@intel.com>
      Cc: Borislav Petkov <bp@suse.de>
      Cc: Ingo Molnar <mingo@kernel.org>
      Cc: Jiri Olsa <jolsa@kernel.org>
      Cc: Kan Liang <kan.liang@linux.intel.com>
      Cc: Namhyung Kim <namhyung@kernel.org>
      Cc: Peter Zijlstra <peterz@infradead.org>
      Cc: Ricardo Neri <ricardo.neri-calderon@linux.intel.com>
      Signed-off-by: NArnaldo Carvalho de Melo <acme@redhat.com>
      dd4a5c22
    • A
      tools arch x86: Sync the msr-index.h copy with the kernel sources · f815fe51
      Arnaldo Carvalho de Melo 提交于
      To pick up the changes in:
      
        d6a162a4 x86/msr-index: Add bunch of MSRs for Arch LBR
        ed7bde7a cpufreq: intel_pstate: Allow enable/disable energy efficiency
        99e40204 (tip/x86/cleanups) x86/msr: Move the F15h MSRs where they belong
        1068ed45 x86/msr: Lift AMD family 0x15 power-specific MSRs
        5cde2653 (tag: perf-core-2020-06-01) perf/x86/rapl: Add AMD Fam17h RAPL support
      
      Addressing these tools/perf build warnings:
      
      That makes the beautification scripts to pick some new entries:
      
        $ tools/perf/trace/beauty/tracepoints/x86_msr.sh > before
        $ cp arch/x86/include/asm/msr-index.h tools/arch/x86/include/asm/msr-index.h
        $ tools/perf/trace/beauty/tracepoints/x86_msr.sh > after
        $ diff -u before after
        --- before	2020-08-07 08:45:18.801298854 -0300
        +++ after	2020-08-07 08:45:28.654456422 -0300
        @@ -271,6 +271,8 @@
         	[0xc0010062 - x86_AMD_V_KVM_MSRs_offset] = "AMD_PERF_CTL",
         	[0xc0010063 - x86_AMD_V_KVM_MSRs_offset] = "AMD_PERF_STATUS",
         	[0xc0010064 - x86_AMD_V_KVM_MSRs_offset] = "AMD_PSTATE_DEF_BASE",
        +	[0xc001007a - x86_AMD_V_KVM_MSRs_offset] = "F15H_CU_PWR_ACCUMULATOR",
        +	[0xc001007b - x86_AMD_V_KVM_MSRs_offset] = "F15H_CU_MAX_PWR_ACCUMULATOR",
         	[0xc0010112 - x86_AMD_V_KVM_MSRs_offset] = "K8_TSEG_ADDR",
         	[0xc0010113 - x86_AMD_V_KVM_MSRs_offset] = "K8_TSEG_MASK",
         	[0xc0010114 - x86_AMD_V_KVM_MSRs_offset] = "VM_CR",
        $
      
      And this gets rebuilt:
      
        CC       /tmp/build/perf/trace/beauty/tracepoints/x86_msr.o
        INSTALL  trace_plugins
        LD       /tmp/build/perf/trace/beauty/tracepoints/perf-in.o
        LD       /tmp/build/perf/trace/beauty/perf-in.o
        LD       /tmp/build/perf/perf-in.o
        LINK     /tmp/build/perf/perf
      
      Now one can trace systemwide asking to see backtraces to where those
      MSRs are being read/written with:
      
        # perf trace -e msr:*_msr/max-stack=32/ --filter="msr==F15H_CU_PWR_ACCUMULATOR || msr==F15H_CU_MAX_PWR_ACCUMULATOR"
        ^C#
        #
      
      If we use -v (verbose mode) we can see what it does behind the scenes:
      
        # perf trace -v -e msr:*_msr/max-stack=32/ --filter="msr==F15H_CU_PWR_ACCUMULATOR || msr==F15H_CU_MAX_PWR_ACCUMULATOR"
        Using CPUID GenuineIntel-6-8E-A
        0xc001007a
        0xc001007b
        New filter for msr:read_msr: (msr==0xc001007a || msr==0xc001007b) && (common_pid != 2448054 && common_pid != 2782)
        0xc001007a
        0xc001007b
        New filter for msr:write_msr: (msr==0xc001007a || msr==0xc001007b) && (common_pid != 2448054 && common_pid != 2782)
        mmap size 528384B
        ^C#
      
      Cc: Adrian Hunter <adrian.hunter@intel.com>
      Cc: Borislav Petkov <bp@suse.de>
      Cc: Ingo Molnar <mingo@kernel.org>
      Cc: Jiri Olsa <jolsa@kernel.org>
      Cc: Kan Liang <kan.liang@linux.intel.com>
      Cc: Namhyung Kim <namhyung@kernel.org>
      Cc: Peter Zijlstra <peterz@infradead.org>
      Cc: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
      Cc: Srinivas Pandruvada <srinivas.pandruvada@linux.intel.com>
      Cc: Stephane Eranian <eranian@google.com>
      Signed-off-by: NArnaldo Carvalho de Melo <acme@redhat.com>
      f815fe51
  14. 17 7月, 2020 1 次提交
    • A
      tools arch kvm: Sync kvm headers with the kernel sources · 25d4e7f5
      Arnaldo Carvalho de Melo 提交于
      To pick up the changes from:
      
        83d31e52 ("KVM: nVMX: fixes for preemption timer migration")
      
      That don't entail changes in tooling.
      
      This silences these tools/perf build warnings:
      
        Warning: Kernel ABI header at 'tools/arch/x86/include/uapi/asm/kvm.h' differs from latest version at 'arch/x86/include/uapi/asm/kvm.h'
        diff -u tools/arch/x86/include/uapi/asm/kvm.h arch/x86/include/uapi/asm/kvm.h
      
      Cc: Adrian Hunter <adrian.hunter@intel.com>
      Cc: Jiri Olsa <jolsa@kernel.org>
      Cc: Namhyung Kim <namhyung@kernel.org>
      Cc: Paolo Bonzini <pbonzini@redhat.com>
      Signed-off-by: NArnaldo Carvalho de Melo <acme@redhat.com>
      25d4e7f5
  15. 03 7月, 2020 1 次提交
  16. 22 6月, 2020 1 次提交
    • B
      x86/msr: Move the F15h MSRs where they belong · 99e40204
      Borislav Petkov 提交于
      1068ed45 ("x86/msr: Lift AMD family 0x15 power-specific MSRs")
      
      moved the three F15h power MSRs to the architectural list but that was
      wrong as they belong in the family 0x15 list. That also caused:
      
        In file included from trace/beauty/tracepoints/x86_msr.c:10:
        perf/trace/beauty/generated/x86_arch_MSRs_array.c:292:45: error: initialized field overwritten [-Werror=override-init]
          292 |  [0xc0010280 - x86_AMD_V_KVM_MSRs_offset] = "F15H_PTSC",
              |                                             ^~~~~~~~~~~
        perf/trace/beauty/generated/x86_arch_MSRs_array.c:292:45: note: (near initialization for 'x86_AMD_V_KVM_MSRs[640]')
      
      due to MSR_F15H_PTSC ending up being defined twice. Move them where they
      belong and drop the duplicate.
      
      Also, drop the respective tools/ changes of the msr-index.h copy the
      above commit added because perf tool developers prefer to go through
      those changes themselves in order to figure out whether changes to the
      kernel headers would need additional handling in perf.
      
      Fixes: 1068ed45 ("x86/msr: Lift AMD family 0x15 power-specific MSRs")
      Reported-by: NStephen Rothwell <sfr@canb.auug.org.au>
      Signed-off-by: NBorislav Petkov <bp@suse.de>
      Acked-by: NArnaldo Carvalho de Melo <acme@redhat.com>
      Link: https://lkml.kernel.org/r/20200621163323.14e8533f@canb.auug.org.au
      99e40204
  17. 18 6月, 2020 1 次提交
    • A
      tools arch x86: Sync the msr-index.h copy with the kernel sources · 25ca7e5c
      Arnaldo Carvalho de Melo 提交于
      To pick up the changes in:
      
        7e5b3c26 ("x86/speculation: Add Special Register Buffer Data Sampling (SRBDS) mitigation")
      
      Addressing these tools/perf build warnings:
      
        Warning: Kernel ABI header at 'tools/arch/x86/include/asm/msr-index.h' differs from latest version at 'arch/x86/include/asm/msr-index.h'
        diff -u tools/arch/x86/include/asm/msr-index.h arch/x86/include/asm/msr-index.h
        Warning: Kernel ABI header at 'tools/arch/x86/include/asm/cpufeatures.h' differs from latest version at 'arch/x86/include/asm/cpufeatures.h'
        diff -u tools/arch/x86/include/asm/cpufeatures.h arch/x86/include/asm/cpufeatures.h
      
      With this one will be able to use these new AMD MSRs in filters, by
      name, e.g.:
      
        # perf trace -e msr:* --filter "msr==IA32_MCU_OPT_CTRL"
        ^C#
      
      Using -v we can see how it sets up the tracepoint filters, converting
      from the string in the filter to the numeric value:
      
        # perf trace -v -e msr:* --filter "msr==IA32_MCU_OPT_CTRL"
        Using CPUID GenuineIntel-6-8E-A
        0x123
        New filter for msr:read_msr: (msr==0x123) && (common_pid != 335 && common_pid != 30344)
        0x123
        New filter for msr:write_msr: (msr==0x123) && (common_pid != 335 && common_pid != 30344)
        0x123
        New filter for msr:rdpmc: (msr==0x123) && (common_pid != 335 && common_pid != 30344)
        mmap size 528384B
        ^C#
      
      The updating process shows how this affects tooling in more detail:
      
        $ diff -u tools/arch/x86/include/asm/msr-index.h arch/x86/include/asm/msr-index.h
        --- tools/arch/x86/include/asm/msr-index.h	2020-06-03 10:36:09.959910238 -0300
        +++ arch/x86/include/asm/msr-index.h	2020-06-17 10:04:20.235052901 -0300
        @@ -128,6 +128,10 @@
         #define TSX_CTRL_RTM_DISABLE		BIT(0)	/* Disable RTM feature */
         #define TSX_CTRL_CPUID_CLEAR		BIT(1)	/* Disable TSX enumeration */
      
        +/* SRBDS support */
        +#define MSR_IA32_MCU_OPT_CTRL		0x00000123
        +#define RNGDS_MITG_DIS			BIT(0)
        +
         #define MSR_IA32_SYSENTER_CS		0x00000174
         #define MSR_IA32_SYSENTER_ESP		0x00000175
         #define MSR_IA32_SYSENTER_EIP		0x00000176
        $ set -o vi
        $ tools/perf/trace/beauty/tracepoints/x86_msr.sh > before
        $ cp arch/x86/include/asm/msr-index.h tools/arch/x86/include/asm/msr-index.h
        $ tools/perf/trace/beauty/tracepoints/x86_msr.sh > after
        $ diff -u before after
        --- before	2020-06-17 10:05:49.653114752 -0300
        +++ after	2020-06-17 10:06:01.777258731 -0300
        @@ -51,6 +51,7 @@
         	[0x0000011e] = "IA32_BBL_CR_CTL3",
         	[0x00000120] = "IDT_MCR_CTRL",
         	[0x00000122] = "IA32_TSX_CTRL",
        +	[0x00000123] = "IA32_MCU_OPT_CTRL",
         	[0x00000140] = "MISC_FEATURES_ENABLES",
         	[0x00000174] = "IA32_SYSENTER_CS",
         	[0x00000175] = "IA32_SYSENTER_ESP",
        $
      
      The related change to cpu-features.h affects this:
      
        CC       /tmp/build/perf/bench/mem-memcpy-x86-64-asm.o
        CC       /tmp/build/perf/bench/mem-memset-x86-64-asm.o
      
      This shouldn't be affecting that 'perf bench' entry:
      
        $ find tools/perf/ -type f | xargs grep SRBDS
        $
      
      Cc: Adrian Hunter <adrian.hunter@intel.com>
      Cc: Jiri Olsa <jolsa@kernel.org>
      Cc: Mark Gross <mgross@linux.intel.com>
      Cc: Namhyung Kim <namhyung@kernel.org>
      Cc: Thomas Gleixner <tglx@linutronix.de>
      Signed-off-by: NArnaldo Carvalho de Melo <acme@redhat.com>
      25ca7e5c
  18. 16 6月, 2020 1 次提交
  19. 09 6月, 2020 2 次提交
    • A
      tools headers UAPI: Sync kvm.h headers with the kernel sources · dd76c302
      Arnaldo Carvalho de Melo 提交于
      To pick the changes in:
      
        f97f5a56 ("x86/kvm/hyper-v: Add support for synthetic debugger interface")
        850448f3 ("KVM: nVMX: Fix VMX preemption timer migration")
        2c4c4132 ("KVM: x86: Print symbolic names of VMX VM-Exit flags in traces")
        cc440cda ("KVM: nSVM: implement KVM_GET_NESTED_STATE and KVM_SET_NESTED_STATE")
        f7d31e65 ("x86/kvm/hyper-v: Explicitly align hcall param for kvm_hyperv_exit")
        72de5fa4 ("KVM: x86: announce KVM_FEATURE_ASYNC_PF_INT")
        acd05785 ("kvm: add capability for halt polling")
        3ecad8c2 ("docs: fix broken references for ReST files that moved around")
      
      That do not result in any change in tooling, as the additions are not
      being used in any table generator.
      
      This silences these perf build warning:
      
        Warning: Kernel ABI header at 'tools/include/uapi/linux/kvm.h' differs from latest version at 'include/uapi/linux/kvm.h'
        diff -u tools/include/uapi/linux/kvm.h include/uapi/linux/kvm.h
        Warning: Kernel ABI header at 'tools/arch/x86/include/uapi/asm/kvm.h' differs from latest version at 'arch/x86/include/uapi/asm/kvm.h'
        diff -u tools/arch/x86/include/uapi/asm/kvm.h arch/x86/include/uapi/asm/kvm.h
        Warning: Kernel ABI header at 'tools/arch/x86/include/uapi/asm/vmx.h' differs from latest version at 'arch/x86/include/uapi/asm/vmx.h'
        diff -u tools/arch/x86/include/uapi/asm/vmx.h arch/x86/include/uapi/asm/vmx.h
      
      Cc: Adrian Hunter <adrian.hunter@intel.com>
      Cc: David Matlack <dmatlack@google.com>
      Cc: Jiri Olsa <jolsa@kernel.org>
      Cc: Jon Doron <arilou@gmail.com>
      Cc: Namhyung Kim <namhyung@kernel.org>
      Cc: Paolo Bonzini <pbonzini@redhat.com>
      Cc: Peter Shier <pshier@google.com>
      Cc: Sean Christopherson <sean.j.christopherson@intel.com>
      Cc: Vitaly Kuznetsov <vkuznets@redhat.com>
      Signed-off-by: NArnaldo Carvalho de Melo <acme@redhat.com>
      dd76c302
    • A
      tools arch x86 uapi: Synch asm/unistd.h with the kernel sources · 7e579f3a
      Arnaldo Carvalho de Melo 提交于
      To pick up the change in:
      
        700d3a5a ("x86/syscalls: Revert "x86/syscalls: Make __X32_SYSCALL_BIT be unsigned long"")
      
      That doesn't trigger any changes in tooling and silences this perf build
      warning:
      
        Warning: Kernel ABI header at 'tools/arch/x86/include/uapi/asm/unistd.h' differs from latest version at 'arch/x86/include/uapi/asm/unistd.h'
        diff -u tools/arch/x86/include/uapi/asm/unistd.h arch/x86/include/uapi/asm/unistd.h
      
      Cc: Adrian Hunter <adrian.hunter@intel.com>
      Cc: Andy Lutomirski <luto@kernel.org>
      Cc: Borislav Petkov <bp@suse.de>
      Cc: Jiri Olsa <jolsa@kernel.org>
      Cc: Namhyung Kim <namhyung@kernel.org>
      Signed-off-by: NArnaldo Carvalho de Melo <acme@redhat.com>
      7e579f3a
  20. 02 6月, 2020 1 次提交
    • A
      tools arch x86: Sync the msr-index.h copy with the kernel sources · 3b1f47d6
      Arnaldo Carvalho de Melo 提交于
      To pick up the changes in:
      
        5cde2653 ("perf/x86/rapl: Add AMD Fam17h RAPL support")
      
      Addressing this tools/perf build warning:
      
        Warning: Kernel ABI header at 'tools/arch/x86/include/asm/msr-index.h' differs from latest version at 'arch/x86/include/asm/msr-index.h'
        diff -u tools/arch/x86/include/asm/msr-index.h arch/x86/include/asm/msr-index.h
      
      With this one will be able to use these new AMD MSRs in filters, by
      name, e.g.:
      
         # perf trace -e msr:* --filter="msr==AMD_PKG_ENERGY_STATUS || msr==AMD_RAPL_POWER_UNIT"
      
      Just like it is now possible with other MSRs:
      
        [root@five ~]# uname -a
        Linux five 5.5.17-200.fc31.x86_64 #1 SMP Mon Apr 13 15:29:42 UTC 2020 x86_64 x86_64 x86_64 GNU/Linux
        [root@five ~]# grep 'model name' -m1 /proc/cpuinfo
        model name	: AMD Ryzen 5 3600X 6-Core Processor
        [root@five ~]#
        [root@five ~]# perf trace -e msr:*/max-stack=16/ --filter="msr==AMD_PERF_CTL" --max-events=2
             0.000 kworker/1:1-ev/2327824 msr:write_msr(msr: AMD_PERF_CTL, val: 2)
                                               do_trace_write_msr ([kernel.kallsyms])
                                               do_trace_write_msr ([kernel.kallsyms])
                                               [0xffffffffc01d71c3] ([acpi_cpufreq])
                                               [0] ([unknown])
                                               __cpufreq_driver_target ([kernel.kallsyms])
                                               od_dbs_update ([kernel.kallsyms])
                                               dbs_work_handler ([kernel.kallsyms])
                                               process_one_work ([kernel.kallsyms])
                                               worker_thread ([kernel.kallsyms])
                                               kthread ([kernel.kallsyms])
                                               ret_from_fork ([kernel.kallsyms])
             8.597 kworker/2:2-ev/2338099 msr:write_msr(msr: AMD_PERF_CTL, val: 2)
                                               do_trace_write_msr ([kernel.kallsyms])
                                               do_trace_write_msr ([kernel.kallsyms])
                                               [0] ([unknown])
                                               [0] ([unknown])
                                               __cpufreq_driver_target ([kernel.kallsyms])
                                               od_dbs_update ([kernel.kallsyms])
                                               dbs_work_handler ([kernel.kallsyms])
                                               process_one_work ([kernel.kallsyms])
                                               worker_thread ([kernel.kallsyms])
                                               kthread ([kernel.kallsyms])
                                               ret_from_fork ([kernel.kallsyms])
        [root@five ~]#
      
      Longer explanation with what happens in the perf build process,
      automatically after this is made in synch with the kernel sources:
      
        $ make -C tools/perf O=/tmp/build/perf install-bin
        <SNIP>
        Warning: Kernel ABI header at 'tools/arch/x86/include/asm/msr-index.h' differs from latest version at 'arch/x86/include/asm/msr-index.h'
        diff -u tools/arch/x86/include/asm/msr-index.h arch/x86/include/asm/msr-index.h
        <SNIP>
        make: Leaving directory '/home/acme/git/perf/tools/perf'
        $
        $ tools/perf/trace/beauty/tracepoints/x86_msr.sh > before
        $
        $ diff -u tools/arch/x86/include/asm/msr-index.h arch/x86/include/asm/msr-index.h
        --- tools/arch/x86/include/asm/msr-index.h	2020-06-02 10:46:36.217782288 -0300
        +++ arch/x86/include/asm/msr-index.h	2020-05-28 10:41:23.313794627 -0300
        @@ -301,6 +301,9 @@
         #define MSR_PP1_ENERGY_STATUS		0x00000641
         #define MSR_PP1_POLICY			0x00000642
      
        +#define MSR_AMD_PKG_ENERGY_STATUS	0xc001029b
        +#define MSR_AMD_RAPL_POWER_UNIT		0xc0010299
        +
         /* Config TDP MSRs */
         #define MSR_CONFIG_TDP_NOMINAL		0x00000648
         #define MSR_CONFIG_TDP_LEVEL_1		0x00000649
        $ cp arch/x86/include/asm/msr-index.h tools/arch/x86/include/asm/msr-index.h
        $
        $ make -C tools/perf O=/tmp/build/perf install-bin
        <SNIP>
          CC       /tmp/build/perf/trace/beauty/tracepoints/x86_msr.o
          LD       /tmp/build/perf/trace/beauty/tracepoints/perf-in.o
          LD       /tmp/build/perf/trace/beauty/perf-in.o
          LD       /tmp/build/perf/perf-in.o
          LINK     /tmp/build/perf/perf
        <SNIP>
        make: Leaving directory '/home/acme/git/perf/tools/perf'
        $
        $ tools/perf/trace/beauty/tracepoints/x86_msr.sh > after
        $ diff -u before after
        --- before	2020-06-02 10:47:08.486334348 -0300
        +++ after	2020-06-02 10:47:33.075008948 -0300
        @@ -286,6 +286,8 @@
         	[0xc0010240 - x86_AMD_V_KVM_MSRs_offset] = "F15H_NB_PERF_CTL",
         	[0xc0010241 - x86_AMD_V_KVM_MSRs_offset] = "F15H_NB_PERF_CTR",
         	[0xc0010280 - x86_AMD_V_KVM_MSRs_offset] = "F15H_PTSC",
        +	[0xc0010299 - x86_AMD_V_KVM_MSRs_offset] = "AMD_RAPL_POWER_UNIT",
        +	[0xc001029b - x86_AMD_V_KVM_MSRs_offset] = "AMD_PKG_ENERGY_STATUS",
         	[0xc00102f0 - x86_AMD_V_KVM_MSRs_offset] = "AMD_PPIN_CTL",
         	[0xc00102f1 - x86_AMD_V_KVM_MSRs_offset] = "AMD_PPIN",
         };
        $
      
      Cc: Adrian Hunter <adrian.hunter@intel.com>
      Cc: David Ahern <dsahern@gmail.com>
      Cc: Ingo Molnar <mingo@kernel.org>
      Cc: Jiri Olsa <jolsa@kernel.org>
      Cc: Namhyung Kim <namhyung@kernel.org>
      Cc: Stephane Eranian <eranian@google.com>
      Cc: Wang Nan <wangnan0@huawei.com>
      Signed-off-by: NArnaldo Carvalho de Melo <acme@redhat.com>
      3b1f47d6
  21. 01 6月, 2020 1 次提交
  22. 26 5月, 2020 1 次提交
  23. 22 4月, 2020 2 次提交
  24. 14 4月, 2020 1 次提交
    • A
      tools arch x86: Sync asm/cpufeatures.h with the kernel sources · e00a2d90
      Arnaldo Carvalho de Melo 提交于
      To pick up the changes from:
      
        077168e2 ("x86/mce/amd: Add PPIN support for AMD MCE")
        753039ef ("x86/cpu/amd: Call init_amd_zn() om Family 19h processors too")
        6650cdd9 ("x86/split_lock: Enable split lock detection by kernel")
      
      These don't cause any changes in tooling, just silences this perf build
      warning:
      
        Warning: Kernel ABI header at 'tools/arch/x86/include/asm/cpufeatures.h' differs from latest version at 'arch/x86/include/asm/cpufeatures.h'
        diff -u tools/arch/x86/include/asm/cpufeatures.h arch/x86/include/asm/cpufeatures.h
      
      Cc: Adrian Hunter <adrian.hunter@intel.com>
      Cc: Jiri Olsa <jolsa@kernel.org>
      Cc: Namhyung Kim <namhyung@kernel.org>
      Cc: Borislav Petkov <bp@suse.de>
      Cc: Kim Phillips <kim.phillips@amd.com>
      Cc: Peter Zijlstra (Intel) <peterz@infradead.org>
      Cc: Wei Huang <wei.huang2@amd.com>
      Signed-off-by: NArnaldo Carvalho de Melo <acme@redhat.com>
      e00a2d90