lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <ZcIhJxPUZOTjOOYZ@FVFF77S0Q05N.cambridge.arm.com>
Date: Tue, 6 Feb 2024 12:08:07 +0000
From: Mark Rutland <mark.rutland@....com>
To: Sumit Gupta <sumitg@...dia.com>
Cc: treding@...dia.com, krzysztof.kozlowski@...aro.org,
	jonathanh@...dia.com, maz@...nel.org, linux-kernel@...r.kernel.org,
	linux-tegra@...r.kernel.org, amhetre@...dia.com, bbasu@...dia.com
Subject: Re: [Patch] memory: tegra: Skip SID override from Guest VM

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@...dia.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
> 

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ