linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Sasha Levin <sashal@kernel.org>
To: linux-kernel@vger.kernel.org, stable@vger.kernel.org
Cc: Nathan Chancellor <nathan@kernel.org>,
	Alex Deucher <alexander.deucher@amd.com>,
	Sasha Levin <sashal@kernel.org>,
	Felix.Kuehling@amd.com, christian.koenig@amd.com,
	Xinhui.Pan@amd.com, airlied@gmail.com, daniel@ffwll.ch,
	ndesaulniers@google.com, amd-gfx@lists.freedesktop.org,
	dri-devel@lists.freedesktop.org, llvm@lists.linux.dev
Subject: [PATCH AUTOSEL 6.0 28/34] drm/amdkfd: Fix type of reset_type parameter in hqd_destroy() callback
Date: Tue,  1 Nov 2022 07:27:20 -0400	[thread overview]
Message-ID: <20221101112726.799368-28-sashal@kernel.org> (raw)
In-Reply-To: <20221101112726.799368-1-sashal@kernel.org>

From: Nathan Chancellor <nathan@kernel.org>

[ Upstream commit e688ba3e276422aa88eae7a54186a95320836081 ]

When booting a kernel compiled with CONFIG_CFI_CLANG on a machine with
an RX 6700 XT, there is a CFI failure in kfd_destroy_mqd_cp():

  [   12.894543] CFI failure at kfd_destroy_mqd_cp+0x2a/0x40 [amdgpu] (target: hqd_destroy_v10_3+0x0/0x260 [amdgpu]; expected type: 0x8594d794)

Clang's kernel Control Flow Integrity (kCFI) makes sure that all
indirect call targets have a type that exactly matches the function
pointer prototype. In this case, hqd_destroy()'s third parameter,
reset_type, should have a type of 'uint32_t' but every implementation of
this callback has a third parameter type of 'enum kfd_preempt_type'.

Update the function pointer prototype to match reality so that there is
no more CFI violation.

Link: https://github.com/ClangBuiltLinux/linux/issues/1738
Signed-off-by: Nathan Chancellor <nathan@kernel.org>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
 drivers/gpu/drm/amd/include/kgd_kfd_interface.h | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/drivers/gpu/drm/amd/include/kgd_kfd_interface.h b/drivers/gpu/drm/amd/include/kgd_kfd_interface.h
index e85364dff4e0..5cb3e8634739 100644
--- a/drivers/gpu/drm/amd/include/kgd_kfd_interface.h
+++ b/drivers/gpu/drm/amd/include/kgd_kfd_interface.h
@@ -262,8 +262,9 @@ struct kfd2kgd_calls {
 				uint32_t queue_id);
 
 	int (*hqd_destroy)(struct amdgpu_device *adev, void *mqd,
-				uint32_t reset_type, unsigned int timeout,
-				uint32_t pipe_id, uint32_t queue_id);
+				enum kfd_preempt_type reset_type,
+				unsigned int timeout, uint32_t pipe_id,
+				uint32_t queue_id);
 
 	bool (*hqd_sdma_is_occupied)(struct amdgpu_device *adev, void *mqd);
 
-- 
2.35.1


  parent reply	other threads:[~2022-11-01 11:30 UTC|newest]

Thread overview: 36+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-11-01 11:26 [PATCH AUTOSEL 6.0 01/34] media: rkisp1: Fix source pad format configuration Sasha Levin
2022-11-01 11:26 ` [PATCH AUTOSEL 6.0 02/34] media: rkisp1: Don't pass the quantization to rkisp1_csm_config() Sasha Levin
2022-11-01 11:26 ` [PATCH AUTOSEL 6.0 03/34] media: rkisp1: Initialize color space on resizer sink and source pads Sasha Levin
2022-11-01 11:26 ` [PATCH AUTOSEL 6.0 04/34] media: rkisp1: Use correct macro for gradient registers Sasha Levin
2022-11-01 11:26 ` [PATCH AUTOSEL 6.0 05/34] media: rkisp1: Zero v4l2_subdev_format fields in when validating links Sasha Levin
2022-11-01 11:26 ` [PATCH AUTOSEL 6.0 06/34] media: s5p_cec: limit msg.len to CEC_MAX_MSG_SIZE Sasha Levin
2022-11-01 11:26 ` [PATCH AUTOSEL 6.0 07/34] media: cros-ec-cec: " Sasha Levin
2022-11-01 11:27 ` [PATCH AUTOSEL 6.0 08/34] media: dvb-frontends/drxk: initialize err to 0 Sasha Levin
2022-11-01 11:27 ` [PATCH AUTOSEL 6.0 09/34] media: platform: cros-ec: Add Kuldax to the match table Sasha Levin
2022-11-01 11:27 ` [PATCH AUTOSEL 6.0 10/34] media: meson: vdec: fix possible refcount leak in vdec_probe() Sasha Levin
2022-11-01 11:27 ` [PATCH AUTOSEL 6.0 11/34] media: hantro: Store HEVC bit depth in context Sasha Levin
2022-11-01 11:27 ` [PATCH AUTOSEL 6.0 12/34] media: hantro: HEVC: Fix auxilary buffer size calculation Sasha Levin
2022-11-01 11:27 ` [PATCH AUTOSEL 6.0 13/34] media: hantro: HEVC: Fix chroma offset computation Sasha Levin
2022-11-01 11:27 ` [PATCH AUTOSEL 6.0 14/34] media: v4l: subdev: Fail graciously when getting try data for NULL state Sasha Levin
2022-11-01 11:27 ` [PATCH AUTOSEL 6.0 15/34] media: atomisp-ov2680: Fix ov2680_set_fmt() Sasha Levin
2022-11-01 13:27   ` Hans de Goede
2022-11-06 17:05     ` Sasha Levin
2022-11-01 11:27 ` [PATCH AUTOSEL 6.0 16/34] media: atomisp: Fix VIDIOC_TRY_FMT Sasha Levin
2022-11-01 11:27 ` [PATCH AUTOSEL 6.0 17/34] media: atomisp: Ensure that USERPTR pointers are page aligned Sasha Levin
2022-11-01 11:27 ` [PATCH AUTOSEL 6.0 18/34] media: atomisp: Fix v4l2_fh resource leak on open errors Sasha Levin
2022-11-01 11:27 ` [PATCH AUTOSEL 6.0 19/34] media: atomisp: Fix locking around asd->streaming read/write Sasha Levin
2022-11-01 11:27 ` [PATCH AUTOSEL 6.0 20/34] drm/vc4: hdmi: Check the HSM rate at runtime_resume Sasha Levin
2022-11-01 11:27 ` [PATCH AUTOSEL 6.0 21/34] ACPI: APEI: Fix integer overflow in ghes_estatus_pool_init() Sasha Levin
2022-11-01 11:27 ` [PATCH AUTOSEL 6.0 22/34] hwrng: bcm2835 - use hwrng_msleep() instead of cpu_relax() Sasha Levin
2022-11-01 11:27 ` [PATCH AUTOSEL 6.0 23/34] io_uring: don't iopoll from io_ring_ctx_wait_and_kill() Sasha Levin
2022-11-01 11:27 ` [PATCH AUTOSEL 6.0 24/34] scsi: core: Restrict legal sdev_state transitions via sysfs Sasha Levin
2022-11-01 11:27 ` [PATCH AUTOSEL 6.0 25/34] HID: saitek: add madcatz variant of MMO7 mouse device ID Sasha Levin
2022-11-01 11:27 ` [PATCH AUTOSEL 6.0 26/34] drm/amdgpu: set vm_update_mode=0 as default for Sienna Cichlid in SRIOV case Sasha Levin
2022-11-01 11:27 ` [PATCH AUTOSEL 6.0 27/34] drm/amd/pm: skip loading pptable from driver on secure board for smu_v13_0_10 Sasha Levin
2022-11-01 11:27 ` Sasha Levin [this message]
2022-11-01 11:27 ` [PATCH AUTOSEL 6.0 29/34] drm/amdgpu: Program GC registers through RLCG interface in gfx_v11/gmc_v11 Sasha Levin
2022-11-01 11:27 ` [PATCH AUTOSEL 6.0 30/34] drm/amdgpu: dequeue mes scheduler during fini Sasha Levin
2022-11-01 11:27 ` [PATCH AUTOSEL 6.0 31/34] nvme-pci: disable write zeroes on various Kingston SSD Sasha Levin
2022-11-01 11:27 ` [PATCH AUTOSEL 6.0 32/34] nvme-hwmon: consistently ignore errors from nvme_hwmon_init Sasha Levin
2022-11-01 11:27 ` [PATCH AUTOSEL 6.0 33/34] i2c: xiic: Add platform module alias Sasha Levin
2022-11-01 11:27 ` [PATCH AUTOSEL 6.0 34/34] bio: safeguard REQ_ALLOC_CACHE bio put 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=20221101112726.799368-28-sashal@kernel.org \
    --to=sashal@kernel.org \
    --cc=Felix.Kuehling@amd.com \
    --cc=Xinhui.Pan@amd.com \
    --cc=airlied@gmail.com \
    --cc=alexander.deucher@amd.com \
    --cc=amd-gfx@lists.freedesktop.org \
    --cc=christian.koenig@amd.com \
    --cc=daniel@ffwll.ch \
    --cc=dri-devel@lists.freedesktop.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=llvm@lists.linux.dev \
    --cc=nathan@kernel.org \
    --cc=ndesaulniers@google.com \
    --cc=stable@vger.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).