Re: [PATCH 07/12] amdgpu: using IB flags for TMZ or non-TMZ

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Am 18.11.19 um 10:19 schrieb Liu, Aaron:

BR,
Aaron Liu

-----Original Message-----
From: Koenig, Christian <Christian.Koenig@xxxxxxx>
Sent: Friday, November 15, 2019 8:50 PM
To: Huang, Ray <Ray.Huang@xxxxxxx>; Liu, Aaron <Aaron.Liu@xxxxxxx>
Cc: amd-gfx@xxxxxxxxxxxxxxxxxxxxx; Deucher, Alexander
<Alexander.Deucher@xxxxxxx>; Olsak, Marek <Marek.Olsak@xxxxxxx>;
Liu, Leo <Leo.Liu@xxxxxxx>; Tuikov, Luben <Luben.Tuikov@xxxxxxx>
Subject: Re: [PATCH 07/12] amdgpu: using IB flags for TMZ or non-TMZ

Am 15.11.19 um 10:32 schrieb Huang Rui:
On Fri, Nov 15, 2019 at 11:34:50AM +0800, Liu, Aaron wrote:
In kernel, cs->in.flags is used for TMZ. Hence libdrm should transfer
the flag to kernel.

Signed-off-by: Aaron Liu <aaron.liu@xxxxxxx>
---
   amdgpu/amdgpu.h    | 4 +++-
   amdgpu/amdgpu_cs.c | 4 ++++
   2 files changed, 7 insertions(+), 1 deletion(-)

diff --git a/amdgpu/amdgpu.h b/amdgpu/amdgpu.h index
f45f9f7..aee3f3d
100644
--- a/amdgpu/amdgpu.h
+++ b/amdgpu/amdgpu.h
@@ -342,7 +342,9 @@ struct amdgpu_cs_fence_info {
    * \sa amdgpu_cs_submit()
   */
   struct amdgpu_cs_request {
-	/** Specify flags with additional information */
+	/** Specify flags with additional information
+	 * 0-normal, 1-tmz
+	 */
   	uint64_t flags;

   	/** Specify HW IP block type to which to send the IB. */ diff
--git a/amdgpu/amdgpu_cs.c b/amdgpu/amdgpu_cs.c index
437c4a4..6f70771 100644
--- a/amdgpu/amdgpu_cs.c
+++ b/amdgpu/amdgpu_cs.c
@@ -254,6 +254,10 @@ static int
amdgpu_cs_submit_one(amdgpu_context_handle context,
   	memset(&cs, 0, sizeof(cs));
   	cs.in.chunks = (uint64_t)(uintptr_t)chunk_array;
   	cs.in.ctx_id = context->id;
+	/* in kernel, _pad is used as flags
+	 * #define AMDGPU_CS_FLAGS_SECURE          (1 << 0)
+	 */
+	cs.in._pad = (uint32_t)ibs_request->flags;
_pad is not good here. Because it's used to pass the flags to input param.

It's better to rename "_pad" in drm_amdgpu_cs_in as "flags" here.
Actually I don't think we need that stuff altogether, please sync up with
Marek on this.

As far asI know the whole amdgpu_cs_submit interface was deprecated in
favor of the new amdgpu_cs_submit_raw() interface.
Christian, Marek,
In addition to syncobj_command_submission_helper uses amdgpu_cs_submit_raw,
the other test suites still use older interface(amdgpu_cs_submit). We'd better to
reorganize the relevant codes. This does not make much sense to only modify one call.

Well in this case you need to change all other test cases to use amdgpu_cs_submit_raw as well.

I will certainly reject any changes to the deprecated command submission interface.

That has just way to much potential to break older versions of the userspace stack in unforeseen ways.

Regards,
Christian.



Regards,
Christian.

Thanks,
Ray

   	if (ibs_request->resources)
   		cs.in.bo_list_handle = ibs_request->resources->handle;
   	cs.in.num_chunks = ibs_request->number_of_ibs;
--
2.7.4


_______________________________________________
amd-gfx mailing list
amd-gfx@xxxxxxxxxxxxxxxxxxxxx
https://lists.freedesktop.org/mailman/listinfo/amd-gfx




[Index of Archives]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux