From: Rongwei Wang <rongwei.wang@linux.alibaba.com>
To: catalin.marinas@arm.com, will@kernel.org,
bjorn.andersson@linaro.org, shawnguo@kernel.org
Cc: gshan@redhat.com, geert+renesas@glider.be, Anson.Huang@nxp.com,
masahiroy@kernel.org, michael@walle.cc, krzk@kernel.org,
linux-kernel@vger.kernel.org, vkoul@kernel.org, olof@lixom.net,
vincenzo.frascino@arm.com, ardb@kernel.org,
linux-arm-kernel@lists.infradead.org
Subject: [PATCH 0/3] arm64:msr: Add MSR driver
Date: Tue, 1 Dec 2020 01:48:30 +0800 [thread overview]
Message-ID: <20201130174833.41315-1-rongwei.wang@linux.alibaba.com> (raw)
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
_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
next reply other threads:[~2020-11-30 17:50 UTC|newest]
Thread overview: 28+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-11-30 17:48 Rongwei Wang [this message]
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
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20201130174833.41315-1-rongwei.wang@linux.alibaba.com \
--to=rongwei.wang@linux.alibaba.com \
--cc=Anson.Huang@nxp.com \
--cc=ardb@kernel.org \
--cc=bjorn.andersson@linaro.org \
--cc=catalin.marinas@arm.com \
--cc=geert+renesas@glider.be \
--cc=gshan@redhat.com \
--cc=krzk@kernel.org \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-kernel@vger.kernel.org \
--cc=masahiroy@kernel.org \
--cc=michael@walle.cc \
--cc=olof@lixom.net \
--cc=shawnguo@kernel.org \
--cc=vincenzo.frascino@arm.com \
--cc=vkoul@kernel.org \
--cc=will@kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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).