From: Mark Rutland <mark.rutland@arm.com>
To: Sumit Gupta <sumitg@nvidia.com>
Cc: treding@nvidia.com, krzysztof.kozlowski@linaro.org,
jonathanh@nvidia.com, maz@kernel.org,
linux-kernel@vger.kernel.org, linux-tegra@vger.kernel.org,
amhetre@nvidia.com, bbasu@nvidia.com
Subject: Re: [Patch] memory: tegra: Skip SID override from Guest VM
Date: Tue, 6 Feb 2024 12:08:07 +0000 [thread overview]
Message-ID: <ZcIhJxPUZOTjOOYZ@FVFF77S0Q05N.cambridge.arm.com> (raw)
In-Reply-To: <20240206114852.8472-1-sumitg@nvidia.com>
On Tue, Feb 06, 2024 at 05:18:52PM +0530, Sumit Gupta wrote:
> MC SID register access is restricted for Guest VM.
> So, skip the SID override programming from the Guest VM.
>
> Signed-off-by: Sumit Gupta <sumitg@nvidia.com>
Surely this is probed from the DT?
Why would the hypervisor put this in the guest's DT if that hypervisor isn't
exposing it to the guest?
Mark.
> ---
> drivers/memory/tegra/tegra186.c | 11 +++++++++++
> 1 file changed, 11 insertions(+)
>
> diff --git a/drivers/memory/tegra/tegra186.c b/drivers/memory/tegra/tegra186.c
> index 1b3183951bfe..df441896b69d 100644
> --- a/drivers/memory/tegra/tegra186.c
> +++ b/drivers/memory/tegra/tegra186.c
> @@ -10,6 +10,7 @@
> #include <linux/of.h>
> #include <linux/of_platform.h>
> #include <linux/platform_device.h>
> +#include <asm/virt.h>
>
> #include <soc/tegra/mc.h>
>
> @@ -118,6 +119,11 @@ static int tegra186_mc_probe_device(struct tegra_mc *mc, struct device *dev)
> unsigned int i, index = 0;
> u32 sid;
>
> + if (!is_kernel_in_hyp_mode()) {
> + dev_dbg(mc->dev, "Register access not allowed\n");
> + return 0;
> + }
> +
> if (!tegra_dev_iommu_get_stream_id(dev, &sid))
> return 0;
>
> @@ -146,6 +152,11 @@ static int tegra186_mc_resume(struct tegra_mc *mc)
> #if IS_ENABLED(CONFIG_IOMMU_API)
> unsigned int i;
>
> + if (!is_kernel_in_hyp_mode()) {
> + dev_dbg(mc->dev, "Register access not allowed\n");
> + return 0;
> + }
> +
> for (i = 0; i < mc->soc->num_clients; i++) {
> const struct tegra_mc_client *client = &mc->soc->clients[i];
>
> --
> 2.17.1
>
next prev parent reply other threads:[~2024-02-06 12:08 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-02-06 11:48 Sumit Gupta
2024-02-06 12:00 ` Krzysztof Kozlowski
2024-02-06 12:08 ` Mark Rutland [this message]
2024-02-06 12:17 ` Marc Zyngier
2024-02-06 12:28 ` Jon Hunter
2024-02-06 12:51 ` Jon Hunter
2024-02-06 12:54 ` Marc Zyngier
2024-02-06 12:53 ` Marc Zyngier
2024-02-06 14:07 ` Thierry Reding
2024-02-06 14:54 ` Marc Zyngier
2024-02-06 17:08 ` Thierry Reding
2024-02-07 12:03 ` Marc Zyngier
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=ZcIhJxPUZOTjOOYZ@FVFF77S0Q05N.cambridge.arm.com \
--to=mark.rutland@arm.com \
--cc=amhetre@nvidia.com \
--cc=bbasu@nvidia.com \
--cc=jonathanh@nvidia.com \
--cc=krzysztof.kozlowski@linaro.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-tegra@vger.kernel.org \
--cc=maz@kernel.org \
--cc=sumitg@nvidia.com \
--cc=treding@nvidia.com \
/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
all inboxes | Powered by JetHome®