linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 0/3] arm64:msr: Add MSR driver
@ 2020-11-30 17:48 Rongwei Wang
  2020-11-30 17:48 ` [PATCH 1/3] arm64:insn: Export symbols for MSR ARM driver Rongwei Wang
                   ` (5 more replies)
  0 siblings, 6 replies; 28+ messages in thread
From: Rongwei Wang @ 2020-11-30 17:48 UTC (permalink / raw)
  To: catalin.marinas, will, bjorn.andersson, shawnguo
  Cc: vkoul, geert+renesas, Anson.Huang, michael, krzk, olof,
	vincenzo.frascino, ardb, masahiroy, gshan, linux-arm-kernel,
	linux-kernel

Hi

MSR ARM driver aims to provide interfacs for user to read or write data to all
system registers. Its functions is same as MSR driver (x86 platform). It mainly
depends on kprobe and undef exception to read or write system registers
dynamicly.

In addition, this module create interfaces for each core. We have tested in the
virtual machine using tree command:

$ tree /dev/cpu
/dev/cpu
|-- 0
|   `-- msr
|-- 1
|   `-- msr
|-- 2
|   `-- msr
|-- 3
|   `-- msr
|-- 4
|   `-- msr
|-- 5
|   `-- msr
|-- 6
|   `-- msr
`-- 7
    `-- msr

8 directories, 8 files

The interfaces of this module is same as MSR module in user space, and to solve
the problem that ARM platform has no similar MSR module. Using this interface,
we did some pressure tests to test the stability and security of MSR driver. The
test results show that the driver will not cause system panic if various
illegal values and multithreading concurrent access are passed through the
interface.

We also designed a user space tool: system-register-tools. We have open
sourced this tool, which link as follows:
	https://github.com/alibaba/system-register-tools
In this tools, we provide two command: rdasr and wrasr, the aboving MSR driver
has been tested by:

$ rdasr -t
  0: OSDTRRX_EL1         : UNDEFINED or unreadable!
  1: DBGBVR0_EL1         : 0x0
  2: DBGBCR0_EL1         : 0x1e0
  3: DBGWVR0_EL1         : 0x0
  4: DBGWCR0_EL1         : 0x0
  5: DBGBVR1_EL1         : 0x0
  6: DBGBCR1_EL1         : 0x1e0
  7: DBGWVR1_EL1         : 0x0
  8: DBGWCR1_EL1         : 0x0
  9: MDCCINT_EL1         : 0x0
 10: MDSCR_EL1           : 0x1000
 11: DBGBVR2_EL1         : 0x0
...
...
598: ICC_IGRPEN1_EL3     : UNDEFINED or unreadable!
599: TPIDR_EL3           : UNDEFINED or unreadable!
600: SCXTNUM_EL3         : UNDEFINED or unreadable!
601: CNTPS_TVAL_EL1      : UNDEFINED or unreadable!
602: CNTPS_CTL_EL1       : UNDEFINED or unreadable!
603: CNTPS_CVAL_EL1      : UNDEFINED or unreadable!
604: CNTPS_CVAL_EL1      : UNDEFINED or unreadable!

The test ended and no system exception occurred!
Undefined or unreadable registers: 409
Readable registers: 196

The above is a test of more than 600 system registers, and no system exception
occurred

Rongwei Wang (3):
  arm64:insn: Export the symbol to modify code text
  arm64:msr: Introduce MSR ARM driver
  arm64:msr: Enable MSR ARM driver

 arch/arm64/Kconfig               |   9 +
 arch/arm64/configs/defconfig     |   1 +
 arch/arm64/include/asm/msr_arm.h |  80 ++++++++
 arch/arm64/kernel/Makefile       |   3 +-
 arch/arm64/kernel/insn.c         |   1 +
 arch/arm64/kernel/msr_arm.c      | 406 +++++++++++++++++++++++++++++++++++++++
 arch/arm64/kernel/msr_smp.c      | 297 ++++++++++++++++++++++++++++
 7 files changed, 796 insertions(+), 1 deletion(-)
 create mode 100644 arch/arm64/include/asm/msr_arm.h
 create mode 100644 arch/arm64/kernel/msr_arm.c
 create mode 100644 arch/arm64/kernel/msr_smp.c

-- 
1.8.3.1


^ permalink raw reply	[flat|nested] 28+ messages in thread

end of thread, other threads:[~2020-12-03 12:23 UTC | newest]

Thread overview: 28+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-11-30 17:48 [PATCH 0/3] arm64:msr: Add MSR driver Rongwei Wang
2020-11-30 17:48 ` [PATCH 1/3] arm64:insn: Export symbols for MSR ARM driver Rongwei Wang
2020-11-30 17:48 ` [PATCH 2/3] arm64:msr: Introduce " Rongwei Wang
2020-11-30 17:48 ` [PATCH 3/3] arm64:msr: Enable " Rongwei Wang
2020-11-30 17:57 ` [PATCH 0/3] arm64:msr: Add MSR driver Will Deacon
2020-12-01  2:55   ` wangrongwei
2020-12-01  5:44   ` wangrongwei
2020-11-30 18:05 ` Marc Zyngier
2020-11-30 18:20   ` Randy Dunlap
2020-12-01  3:09   ` wangrongwei
2020-12-01  8:12     ` Marc Zyngier
2020-12-01 14:25       ` wangrongwei
2020-12-01 15:37         ` Marc Zyngier
2020-12-03  5:45           ` Rongwei Wang
2020-12-03  8:35             ` Marc Zyngier
2020-12-03 11:25               ` Rongwei Wang
2020-12-03 11:45                 ` Marc Zyngier
2020-12-03 12:22                   ` Rongwei Wang
2020-12-03 11:50                 ` Mark Rutland
2020-11-30 19:03 ` Borislav Petkov
2020-12-01  3:44   ` wangrongwei
2020-12-01 11:26     ` Borislav Petkov
2020-12-01 14:33       ` wangrongwei
2020-12-01 14:54         ` Borislav Petkov
2020-12-01 15:17           ` Rongwei Wang
2020-12-01 15:25             ` Borislav Petkov
2020-12-03  2:09               ` Rongwei Wang
2020-12-01 15:26             ` Ard Biesheuvel

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).