All of lore.kernel.org
 help / color / mirror / Atom feed
From: Sasha Levin <sashal@kernel.org>
To: linux-kernel@vger.kernel.org, stable@vger.kernel.org
Cc: Sasha Levin <sashal@kernel.org>,
	tao.zhou1@amd.com, srinivasan.shanmugam@amd.com,
	Felix.Kuehling@amd.com, Xinhui.Pan@amd.com,
	amd-gfx@lists.freedesktop.org,
	Victor Lu <victorchengchi.lu@amd.com>,
	le.ma@amd.com, dri-devel@lists.freedesktop.org,
	Alex Deucher <alexander.deucher@amd.com>,
	Samir Dhume <samir.dhume@amd.com>,
	christian.koenig@amd.com, Hawking.Zhang@amd.com
Subject: [PATCH AUTOSEL 6.6 14/17] drm/amdgpu: Do not program VF copy regs in mmhub v1.8 under SRIOV (v2)
Date: Wed, 22 Nov 2023 10:31:43 -0500	[thread overview]
Message-ID: <20231122153212.852040-14-sashal@kernel.org> (raw)
In-Reply-To: <20231122153212.852040-1-sashal@kernel.org>

From: Victor Lu <victorchengchi.lu@amd.com>

[ Upstream commit 0288603040c38ccfeb5342f34a52673366d90038 ]

MC_VM_AGP_* registers should not be programmed by guest driver.

v2: move early return outside of loop

Signed-off-by: Victor Lu <victorchengchi.lu@amd.com>
Reviewed-by: Samir Dhume <samir.dhume@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
 drivers/gpu/drm/amd/amdgpu/mmhub_v1_8.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/drivers/gpu/drm/amd/amdgpu/mmhub_v1_8.c b/drivers/gpu/drm/amd/amdgpu/mmhub_v1_8.c
index 784c4e0774707..3d8e579d5c4e8 100644
--- a/drivers/gpu/drm/amd/amdgpu/mmhub_v1_8.c
+++ b/drivers/gpu/drm/amd/amdgpu/mmhub_v1_8.c
@@ -130,6 +130,9 @@ static void mmhub_v1_8_init_system_aperture_regs(struct amdgpu_device *adev)
 	uint64_t value;
 	int i;
 
+	if (amdgpu_sriov_vf(adev))
+		return;
+
 	inst_mask = adev->aid_mask;
 	for_each_inst(i, inst_mask) {
 		/* Program the AGP BAR */
@@ -139,9 +142,6 @@ static void mmhub_v1_8_init_system_aperture_regs(struct amdgpu_device *adev)
 		WREG32_SOC15(MMHUB, i, regMC_VM_AGP_TOP,
 			     adev->gmc.agp_end >> 24);
 
-		if (amdgpu_sriov_vf(adev))
-			return;
-
 		/* Program the system aperture low logical page number. */
 		WREG32_SOC15(MMHUB, i, regMC_VM_SYSTEM_APERTURE_LOW_ADDR,
 			min(adev->gmc.fb_start, adev->gmc.agp_start) >> 18);
-- 
2.42.0


WARNING: multiple messages have this Message-ID (diff)
From: Sasha Levin <sashal@kernel.org>
To: linux-kernel@vger.kernel.org, stable@vger.kernel.org
Cc: Sasha Levin <sashal@kernel.org>,
	tao.zhou1@amd.com, srinivasan.shanmugam@amd.com,
	Felix.Kuehling@amd.com, Xinhui.Pan@amd.com,
	amd-gfx@lists.freedesktop.org,
	Victor Lu <victorchengchi.lu@amd.com>,
	le.ma@amd.com, dri-devel@lists.freedesktop.org, daniel@ffwll.ch,
	Alex Deucher <alexander.deucher@amd.com>,
	Samir Dhume <samir.dhume@amd.com>,
	airlied@gmail.com, christian.koenig@amd.com,
	Hawking.Zhang@amd.com
Subject: [PATCH AUTOSEL 6.6 14/17] drm/amdgpu: Do not program VF copy regs in mmhub v1.8 under SRIOV (v2)
Date: Wed, 22 Nov 2023 10:31:43 -0500	[thread overview]
Message-ID: <20231122153212.852040-14-sashal@kernel.org> (raw)
In-Reply-To: <20231122153212.852040-1-sashal@kernel.org>

From: Victor Lu <victorchengchi.lu@amd.com>

[ Upstream commit 0288603040c38ccfeb5342f34a52673366d90038 ]

MC_VM_AGP_* registers should not be programmed by guest driver.

v2: move early return outside of loop

Signed-off-by: Victor Lu <victorchengchi.lu@amd.com>
Reviewed-by: Samir Dhume <samir.dhume@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
 drivers/gpu/drm/amd/amdgpu/mmhub_v1_8.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/drivers/gpu/drm/amd/amdgpu/mmhub_v1_8.c b/drivers/gpu/drm/amd/amdgpu/mmhub_v1_8.c
index 784c4e0774707..3d8e579d5c4e8 100644
--- a/drivers/gpu/drm/amd/amdgpu/mmhub_v1_8.c
+++ b/drivers/gpu/drm/amd/amdgpu/mmhub_v1_8.c
@@ -130,6 +130,9 @@ static void mmhub_v1_8_init_system_aperture_regs(struct amdgpu_device *adev)
 	uint64_t value;
 	int i;
 
+	if (amdgpu_sriov_vf(adev))
+		return;
+
 	inst_mask = adev->aid_mask;
 	for_each_inst(i, inst_mask) {
 		/* Program the AGP BAR */
@@ -139,9 +142,6 @@ static void mmhub_v1_8_init_system_aperture_regs(struct amdgpu_device *adev)
 		WREG32_SOC15(MMHUB, i, regMC_VM_AGP_TOP,
 			     adev->gmc.agp_end >> 24);
 
-		if (amdgpu_sriov_vf(adev))
-			return;
-
 		/* Program the system aperture low logical page number. */
 		WREG32_SOC15(MMHUB, i, regMC_VM_SYSTEM_APERTURE_LOW_ADDR,
 			min(adev->gmc.fb_start, adev->gmc.agp_start) >> 18);
-- 
2.42.0


WARNING: multiple messages have this Message-ID (diff)
From: Sasha Levin <sashal@kernel.org>
To: linux-kernel@vger.kernel.org, stable@vger.kernel.org
Cc: Victor Lu <victorchengchi.lu@amd.com>,
	Samir Dhume <samir.dhume@amd.com>,
	Alex Deucher <alexander.deucher@amd.com>,
	Sasha Levin <sashal@kernel.org>,
	christian.koenig@amd.com, Xinhui.Pan@amd.com, airlied@gmail.com,
	daniel@ffwll.ch, Hawking.Zhang@amd.com, tao.zhou1@amd.com,
	le.ma@amd.com, Felix.Kuehling@amd.com,
	srinivasan.shanmugam@amd.com, amd-gfx@lists.freedesktop.org,
	dri-devel@lists.freedesktop.org
Subject: [PATCH AUTOSEL 6.6 14/17] drm/amdgpu: Do not program VF copy regs in mmhub v1.8 under SRIOV (v2)
Date: Wed, 22 Nov 2023 10:31:43 -0500	[thread overview]
Message-ID: <20231122153212.852040-14-sashal@kernel.org> (raw)
In-Reply-To: <20231122153212.852040-1-sashal@kernel.org>

From: Victor Lu <victorchengchi.lu@amd.com>

[ Upstream commit 0288603040c38ccfeb5342f34a52673366d90038 ]

MC_VM_AGP_* registers should not be programmed by guest driver.

v2: move early return outside of loop

Signed-off-by: Victor Lu <victorchengchi.lu@amd.com>
Reviewed-by: Samir Dhume <samir.dhume@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
 drivers/gpu/drm/amd/amdgpu/mmhub_v1_8.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/drivers/gpu/drm/amd/amdgpu/mmhub_v1_8.c b/drivers/gpu/drm/amd/amdgpu/mmhub_v1_8.c
index 784c4e0774707..3d8e579d5c4e8 100644
--- a/drivers/gpu/drm/amd/amdgpu/mmhub_v1_8.c
+++ b/drivers/gpu/drm/amd/amdgpu/mmhub_v1_8.c
@@ -130,6 +130,9 @@ static void mmhub_v1_8_init_system_aperture_regs(struct amdgpu_device *adev)
 	uint64_t value;
 	int i;
 
+	if (amdgpu_sriov_vf(adev))
+		return;
+
 	inst_mask = adev->aid_mask;
 	for_each_inst(i, inst_mask) {
 		/* Program the AGP BAR */
@@ -139,9 +142,6 @@ static void mmhub_v1_8_init_system_aperture_regs(struct amdgpu_device *adev)
 		WREG32_SOC15(MMHUB, i, regMC_VM_AGP_TOP,
 			     adev->gmc.agp_end >> 24);
 
-		if (amdgpu_sriov_vf(adev))
-			return;
-
 		/* Program the system aperture low logical page number. */
 		WREG32_SOC15(MMHUB, i, regMC_VM_SYSTEM_APERTURE_LOW_ADDR,
 			min(adev->gmc.fb_start, adev->gmc.agp_start) >> 18);
-- 
2.42.0


  parent reply	other threads:[~2023-11-22 15:33 UTC|newest]

Thread overview: 30+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-11-22 15:31 [PATCH AUTOSEL 6.6 01/17] scsi: sd: Fix sshdr use in sd_suspend_common() Sasha Levin
2023-11-22 15:31 ` [PATCH AUTOSEL 6.6 02/17] x86/acpi: Ignore invalid x2APIC entries Sasha Levin
2023-12-06  7:04   ` Andres Freund
2023-12-12 16:17     ` Thomas Gleixner
2023-11-22 15:31 ` [PATCH AUTOSEL 6.6 03/17] hrtimers: Push pending hrtimers away from outgoing CPU earlier Sasha Levin
2023-11-22 15:31 ` [PATCH AUTOSEL 6.6 04/17] i2c: designware: Fix corrupted memory seen in the ISR Sasha Levin
2023-11-22 15:31 ` [PATCH AUTOSEL 6.6 05/17] i2c: ocores: Move system PM hooks to the NOIRQ phase Sasha Levin
2023-11-22 15:31 ` [PATCH AUTOSEL 6.6 06/17] netfilter: ipset: fix race condition between swap/destroy and kernel side add/del/test Sasha Levin
2023-11-22 15:31 ` [PATCH AUTOSEL 6.6 07/17] nouveau: use an rwlock for the event lock Sasha Levin
2023-11-22 15:31   ` Sasha Levin
2023-11-22 15:31   ` [Nouveau] " Sasha Levin
2023-11-22 15:31 ` [PATCH AUTOSEL 6.6 08/17] zstd: Fix array-index-out-of-bounds UBSAN warning Sasha Levin
2023-11-22 15:31 ` [PATCH AUTOSEL 6.6 09/17] tg3: Move the [rt]x_dropped counters to tg3_napi Sasha Levin
2023-11-22 15:31 ` [PATCH AUTOSEL 6.6 10/17] tg3: Increment tx_dropped in tg3_tso_bug() Sasha Levin
2023-11-22 15:31 ` [PATCH AUTOSEL 6.6 11/17] modpost: fix section mismatch message for RELA Sasha Levin
2023-11-22 15:31   ` Sasha Levin
2023-11-22 15:31 ` [PATCH AUTOSEL 6.6 12/17] linux/export: clean up the IA-64 KSYM_FUNC macro Sasha Levin
2023-11-22 20:06   ` Lukas Bulwahn
2023-12-06  1:57     ` Sasha Levin
2023-11-22 15:31 ` [PATCH AUTOSEL 6.6 13/17] kconfig: fix memory leak from range properties Sasha Levin
2023-11-22 15:31 ` Sasha Levin [this message]
2023-11-22 15:31   ` [PATCH AUTOSEL 6.6 14/17] drm/amdgpu: Do not program VF copy regs in mmhub v1.8 under SRIOV (v2) Sasha Levin
2023-11-22 15:31   ` Sasha Levin
2023-11-22 15:31 ` [PATCH AUTOSEL 6.6 15/17] drm/amdgpu: finalizing mem_partitions at the end of GMC v9 sw_fini Sasha Levin
2023-11-22 15:31   ` Sasha Levin
2023-11-22 15:31   ` Sasha Levin
2023-11-22 15:31 ` [PATCH AUTOSEL 6.6 16/17] drm/amdgpu: correct chunk_ptr to a pointer to chunk Sasha Levin
2023-11-22 15:31   ` Sasha Levin
2023-11-22 15:31   ` Sasha Levin
2023-11-22 15:31 ` [PATCH AUTOSEL 6.6 17/17] dm-crypt: start allocating with MAX_ORDER Sasha Levin

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=20231122153212.852040-14-sashal@kernel.org \
    --to=sashal@kernel.org \
    --cc=Felix.Kuehling@amd.com \
    --cc=Hawking.Zhang@amd.com \
    --cc=Xinhui.Pan@amd.com \
    --cc=alexander.deucher@amd.com \
    --cc=amd-gfx@lists.freedesktop.org \
    --cc=christian.koenig@amd.com \
    --cc=dri-devel@lists.freedesktop.org \
    --cc=le.ma@amd.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=samir.dhume@amd.com \
    --cc=srinivasan.shanmugam@amd.com \
    --cc=stable@vger.kernel.org \
    --cc=tao.zhou1@amd.com \
    --cc=victorchengchi.lu@amd.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.