Skip to content

MSR code cleanup part one

Xin Li (Intel) kvm linux-acpi linux-edac linux-hwmon linux-hyperv linux-perf-users linux-pm lkml netdev oe-kbuild-all platform-driver-x86 virtualization xen-devel 4 versions – Applied

Status from this message: The following commit has been merged into the x86/merge branch of tip:

Get series with b4
b4 am [email protected]

Versions newest first · linked by author and title

  1. v4 Latest15 patches 17 repliesApplied
  2. v314 patches 9 repliesSuperseded
  3. v2 RFC34 patches 59 repliesSuperseded
Earlier versions · 1
VersionPostedPatchesRepliesStatus
v1 RFC15 patches38 repliesSuperseded

Changes in v4 from the cover letter

1) Add missing includes in a different patch (Ilpo Järvinen).
2) Add all necessary direct inclusions for msr.h (Ilpo Järvinen).
3) Remove two "else" that no longer make sense (Juergen Gross).
4) Collect RBs from Jürgen Groß and ABs from Peter Zijlstra.

Patches in v4 Applied

#Subject and filesSizeRepliesApplied
1/15x86/msr: Add missing includes of <asm/msr.h>arch/x86/events/msr.c arch/x86/events/perf_event.h arch/x86/events/probe.c +47 more+63 -37 replies
1/15x86/msr: Add missing includes of <asm/msr.h>arch/x86/coco/sev/core.c arch/x86/events/amd/core.c arch/x86/events/amd/ibs.c +124 more+142 -82 replies
2/15x86/msr: Move rdtsc{,_ordered}() to <asm/tsc.h>arch/x86/include/asm/msr.h arch/x86/include/asm/tsc.h+75 -556 replies
3/15x86/msr: Remove rdpmc()arch/x86/include/asm/msr.h arch/x86/include/asm/paravirt.h+0 -140 replies
4/15x86/msr: Rename rdpmcl() to rdpmc()arch/x86/events/amd/uncore.c arch/x86/events/core.c arch/x86/events/intel/core.c +4 more+13 -130 replies
5/15x86/msr: Convert the rdpmc() macro into an always inline functionarch/x86/events/amd/uncore.c arch/x86/events/core.c arch/x86/events/intel/core.c +4 more+16 -150 replies
6/15x86/xen/msr: Return u64 consistently in Xen PMC read functionsarch/x86/xen/pmu.c arch/x86/xen/xen-ops.h+4 -40 replies
7/15x86/msr: Convert __wrmsr() uses to native_wrmsr{,q}() usesarch/x86/events/amd/brs.c arch/x86/include/asm/apic.h arch/x86/include/asm/msr.h +2 more+10 -80 replies
8/15x86/msr: Add the native_rdmsrq() helperarch/x86/include/asm/msr.h+5 -00 replies
9/15x86/msr: Convert __rdmsr() uses to native_rdmsrq() usesarch/x86/coco/sev/core.c arch/x86/events/amd/brs.c arch/x86/hyperv/hv_vtl.c +7 more+14 -140 replies
10/15x86/xen/msr: Remove calling native_{read,write}_msr{,_safe}() in pmu_msr_{read,write}()arch/x86/xen/enlighten_pv.c arch/x86/xen/pmu.c arch/x86/xen/xen-ops.h+12 -271 reply
11/15x86/xen/msr: Remove pmu_msr_{read,write}()arch/x86/xen/enlighten_pv.c arch/x86/xen/pmu.c arch/x86/xen/xen-ops.h+17 -340 replies
12/15x86/xen/msr: Remove the error pointer argument from set_seg()arch/x86/xen/enlighten_pv.c+5 -110 replies
13/15x86/pvops/msr: refactor pv_cpu_ops.write_msr{,_safe}()arch/x86/include/asm/msr.h arch/x86/include/asm/paravirt.h arch/x86/include/asm/paravirt_types.h +3 more+46 -670 replies
14/15x86/msr: Replace wrmsr(msr, low, 0) with wrmsrq(msr, low)arch/x86/hyperv/hv_apic.c arch/x86/include/asm/apic.h arch/x86/include/asm/switch_to.h +6 more+16 -160 replies
15/15x86/msr: Change the function type of native_read_msr_safe()arch/x86/include/asm/msr.h arch/x86/include/asm/paravirt.h arch/x86/include/asm/paravirt_types.h +3 more+45 -470 replies

Reviews trailers per patch

All 16 patches have a Reviewed-by or Acked-by.

PatchXin Li (Intel)Juergen GrossPeter Zijlstra (Intel)Dave HansenIlpo JärvinenMichael Kelley
SeriesT-b
1/15A-b A-b A-b A-b A-b A-b
1/15A-b A-b A-b A-b A-b A-b
2/15A-b A-b
3/15A-b A-b
4/15A-b A-b
5/15A-b A-b
6/15R-b A-b
7/15A-b
8/15A-b
9/15A-b
10/15Sign-off-by R-b A-b
11/15R-b A-b
12/15R-b A-b
13/15R-b A-b
14/15A-b
15/15A-b

Trailers given in replies are filled; those carried in the patches from earlier versions are outlined with dashes. Scroll the table sideways for all 6 reviewers.

Read the v4 thread

Cover letter [PATCH v4 00/15] MSR code cleanup part one

This patch set is the first part of the patch set:

MSR refactor with new MSR instructions support

@ https://lore.kernel.org/lkml/[email protected]/T/#m5a34be7d4ed55f0baca965cb65452a08e9ad7c8a

It's getting *WAY* too big, and whether to zap the pv_ops MSR APIs is still under argument. Dave Hansen suggested to focus on rename stuff first, most of which he acked.

Jürgen Groß also gave his RBs to the Xen MSR cleanup patches.

So here comes the first MSR cleanup patch set with version 4.

Changes in v4:
1) Add missing includes in a different patch (Ilpo Järvinen).
2) Add all necessary direct inclusions for msr.h (Ilpo Järvinen).
3) Remove two "else" that no longer make sense (Juergen Gross).
4) Collect RBs from Jürgen Groß and ABs from Peter Zijlstra.

Link to the previous v3 patch set:
https://lore.kernel.org/lkml/[email protected]/

This patch series is based on:

git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip.git x86/msr

Xin Li (Intel) (15):
x86/msr: Add missing includes of <asm/msr.h>
x86/msr: Move rdtsc{,_ordered}() to <asm/tsc.h> x86/msr: Remove rdpmc()
x86/msr: Rename rdpmcl() to rdpmc()
x86/msr: Convert the rdpmc() macro into an always inline function x86/xen/msr: Return u64 consistently in Xen PMC read functions x86/msr: Convert __wrmsr() uses to native_wrmsr{,q}() uses x86/msr: Add the native_rdmsrq() helper
x86/msr: Convert __rdmsr() uses to native_rdmsrq() uses x86/xen/msr: Remove calling native_{read,write}_msr{,_safe}() in

    pmu_msr_{read,write}()

x86/xen/msr: Remove pmu_msr_{read,write}() x86/xen/msr: Remove the error pointer argument from set_seg() x86/pvops/msr: refactor pv_cpu_ops.write_msr{,_safe}() x86/msr: Replace wrmsr(msr, low, 0) with wrmsrq(msr, low) x86/msr: Change the function type of native_read_msr_safe()

 arch/x86/coco/sev/core.c                      |   2 +-
 arch/x86/events/amd/brs.c                     |   4 +-
 arch/x86/events/amd/uncore.c                  |   2 +-
 arch/x86/events/core.c                        |   2 +-
 arch/x86/events/intel/core.c                  |   4 +-
 arch/x86/events/intel/ds.c                    |   2 +-
 arch/x86/events/msr.c                         |   3 +
 arch/x86/events/perf_event.h                  |   1 +
 arch/x86/events/probe.c                       |   2 +
 arch/x86/hyperv/hv_apic.c                     |   6 +-
 arch/x86/hyperv/hv_vtl.c                      |   4 +-
 arch/x86/hyperv/ivm.c                         |   3 +-
 arch/x86/include/asm/apic.h                   |   4 +-
 arch/x86/include/asm/fred.h                   |   1 +
 arch/x86/include/asm/microcode.h              |   2 +
 arch/x86/include/asm/mshyperv.h               |   3 +-
 arch/x86/include/asm/msr.h                    | 130 +++++-------------
 arch/x86/include/asm/paravirt.h               |  57 ++++----
 arch/x86/include/asm/paravirt_types.h         |  10 +-
 arch/x86/include/asm/suspend_32.h             |   1 +
 arch/x86/include/asm/suspend_64.h             |   1 +
 arch/x86/include/asm/switch_to.h              |   4 +-
 arch/x86/include/asm/tsc.h                    |  76 +++++++++-
 arch/x86/kernel/cpu/amd.c                     |   2 +-
 arch/x86/kernel/cpu/common.c                  |  10 +-
 arch/x86/kernel/cpu/mce/core.c                |   6 +-
 arch/x86/kernel/cpu/resctrl/pseudo_lock.c     |  25 ++--
 arch/x86/kernel/cpu/resctrl/rdtgroup.c        |   2 +-
 arch/x86/kernel/cpu/umwait.c                  |   4 +-
 arch/x86/kernel/fpu/xstate.h                  |   1 +
 arch/x86/kernel/hpet.c                        |   1 +
 arch/x86/kernel/kvm.c                         |   2 +-
 arch/x86/kernel/kvmclock.c                    |   2 +-
 arch/x86/kernel/process_64.c                  |   1 +
 arch/x86/kernel/trace_clock.c                 |   2 +-
 arch/x86/kernel/tsc_sync.c                    |   1 +
 arch/x86/kvm/svm/svm.c                        |  34 ++---
 arch/x86/kvm/vmx/vmx.c                        |   4 +-
 arch/x86/lib/kaslr.c                          |   2 +-
 arch/x86/mm/mem_encrypt_identity.c            |   5 +-
 arch/x86/realmode/init.c                      |   1 +
 arch/x86/xen/enlighten_pv.c                   |  58 ++++----
 arch/x86/xen/pmu.c                            |  72 +++-------
 arch/x86/xen/xen-ops.h                        |   5 +-
 drivers/acpi/acpi_extlog.c                    |   1 +
 drivers/acpi/processor_perflib.c              |   1 +
 drivers/acpi/processor_throttling.c           |   3 +-
 drivers/char/agp/nvidia-agp.c                 |   1 +
 drivers/cpufreq/amd-pstate-ut.c               |   2 +
 drivers/crypto/ccp/sev-dev.c                  |   1 +
 drivers/edac/amd64_edac.c                     |   1 +
 drivers/edac/ie31200_edac.c                   |   1 +
 drivers/edac/mce_amd.c                        |   1 +
 drivers/hwmon/hwmon-vid.c                     |   4 +
 drivers/idle/intel_idle.c                     |   1 +
 drivers/misc/cs5535-mfgpt.c                   |   1 +
 drivers/net/vmxnet3/vmxnet3_drv.c             |   4 +
 drivers/platform/x86/intel/ifs/core.c         |   1 +
 drivers/platform/x86/intel/ifs/load.c         |   1 +
 drivers/platform/x86/intel/ifs/runtest.c      |   1 +
 drivers/platform/x86/intel/pmc/cnp.c          |   1 +
 .../intel/speed_select_if/isst_if_common.c    |   1 +
 .../intel/speed_select_if/isst_if_mbox_msr.c  |   1 +
 .../intel/speed_select_if/isst_tpmi_core.c    |   1 +
 drivers/platform/x86/intel/turbo_max_3.c      |   1 +
 .../intel/uncore-frequency/uncore-frequency.c |   1 +
 drivers/powercap/intel_rapl_common.c          |   1 +
 drivers/powercap/intel_rapl_msr.c             |   1 +
 .../processor_thermal_device.c                |   1 +
 drivers/thermal/intel/intel_tcc_cooling.c     |   1 +
 drivers/thermal/intel/x86_pkg_temp_thermal.c  |   1 +
 drivers/video/fbdev/geode/display_gx.c        |   1 +
 drivers/video/fbdev/geode/gxfb_core.c         |   1 +
 drivers/video/fbdev/geode/lxfb_ops.c          |   1 +
 74 files changed, 308 insertions(+), 295 deletions(-)

base-commit: a5447e92e169dafaf02fd653500105c7186d7128

Signature · 1 line
2.49.0