linux-arm-kernel.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
From: Marc Zyngier <maz@kernel.org>
To: Rongwei Wang <rongwei.wang@linux.alibaba.com>
Cc: vkoul@kernel.org, gshan@redhat.com, Anson.Huang@nxp.com,
	geert+renesas@glider.be, catalin.marinas@arm.com,
	masahiroy@kernel.org, linux-kernel@vger.kernel.org,
	krzk@kernel.org, bjorn.andersson@linaro.org, michael@walle.cc,
	olof@lixom.net, shawnguo@kernel.org, vincenzo.frascino@arm.com,
	Will Deacon <will@kernel.org>,
	ardb@kernel.org, linux-arm-kernel@lists.infradead.org
Subject: Re: [PATCH 0/3] arm64:msr: Add MSR driver
Date: Thu, 03 Dec 2020 08:35:24 +0000	[thread overview]
Message-ID: <4f89671e080eb23b084c0e0942f111e6@kernel.org> (raw)
In-Reply-To: <4513911D-77BF-4459-B8DF-9889395C16AC@linux.alibaba.com>

On 2020-12-03 05:45, Rongwei Wang wrote:
>> 2020年12月1日 下午11:37,Marc Zyngier <maz@kernel.org> 写道:
>> 
>> On 2020-12-01 14:25, wangrongwei wrote:
>>>> 2020年12月1日 下午4:12,Marc Zyngier <maz@kernel.org> 写道:
>>>> On 2020-12-01 03:09, wangrongwei wrote:
>>>>> Hi
>>>>> We have validate this driver in vm and physical machine, and works 
>>>>> fine.
>>>> But what does "work fine" mean? None of these system registers are 
>>>> supposed
>>>> to be accessible from userspace, so please explain *what* you are 
>>>> trying to
>>>> do with this, other that introducing security holes and general 
>>>> system
>>>> instability?
>>> I think I know what you mean. Do you want me to describe how we 
>>> achieved it?
>>> In x86, the different registers can be accessed directly using the
>>> rdmsr and wrmsr instructions, but in ARM, since these two 
>>> instructions
>>> are missing, so we modify the code segment during runtime, similar to
>>> the principle of static_key.
>> 
>> [...]
>> 
>> These are implementation details, none of which answer my question:
>> 
>> What makes you think this is a good idea? I cannot see any legitimate
> In fact, I think this tool useful mainly in the following scenarios:
> 	1. performance debug
> 	2. Arm-core features test
> 	3. Debug-tool for kernel developer
> Also, for example, MSR-ARM is needed for chip verification and
> system-level functional verification.
> A simple example, perf stat can test pmu, but the overflow interrupt
> function and forced overflow function of pmu is not covered.

But what does it mean to change random system registers while the kernel
itself is using them in parallel? All you are introducing is a bunch of
uncontrolled, unexpected, and possibly fatal side effects.

Introducing such an interface makes the kernel unsafe, insecure, and
and violates all the possible guarantees that we are trying hard to
provide. After all, why would we even try to mitigate side channel
vulnerabilities if we were to introduce such a thing?

> In both cases, we need a special interface to configure it, which can
> be considered as testing requirements, so it can only be tested by
> configuring (access) registers, e.g., devmem command for memmap
> registers, MSR-ARM driver for system registers.

devmem was a terrible mistake. Unprivileged sysreg access is another
instance of the same mistake.

The kernel is not a validation tool. It is designed to operate safely,
securely, and reliably. What you propose is the negation of these goals
for dubious purposes, and I think I represent a large number of kernel
developers when I say that we really do not want it.

This will (hopefully) be my last message on this subject.

Thanks,

         M.
-- 
Jazz is not dead. It just smells funny...

_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

  reply	other threads:[~2020-12-03  8:36 UTC|newest]

Thread overview: 28+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
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 [this message]
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=4f89671e080eb23b084c0e0942f111e6@kernel.org \
    --to=maz@kernel.org \
    --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=rongwei.wang@linux.alibaba.com \
    --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).