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>] [day] [month] [year] [list]
Message-ID: <958b71f4-fa5b-6aee-df9b-0b4b35c2fe0f@amd.com>
Date: Mon, 16 Jun 2025 22:37:15 -0700
From: Lizhi Hou <lizhi.hou@....com>
To: Jacek Lawrynowicz <jacek.lawrynowicz@...ux.intel.com>
CC: Maling list - DRI developers <dri-devel@...ts.freedesktop.org>,
	"linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>
Subject: Re: [PATCH V1] accel/amdxdna: Revise device bo creation and free

Pushed to drm-misc-next

On 6/16/25 04:30, Jacek Lawrynowicz wrote:
> Hi,
>
> On 6/16/2025 11:14 AM, Lizhi Hou wrote:
>> The device bo is allocated from the device heap memory. (a trunk of
>> memory dedicated to device)
>>
>> Rename amdxdna_gem_insert_node_locked to amdxdna_gem_heap_alloc
>> and move related sanity checks into it.
>>
>> Add amdxdna_gem_dev_obj_free and move device bo free code into it.
>>
>> Calculate the kernel virtual address of device bo by the device
>> heap memory address and offset.
>>
>> Signed-off-by: Lizhi Hou <lizhi.hou@....com>
>> ---
>>   drivers/accel/amdxdna/aie2_ctx.c    |   2 +-
>>   drivers/accel/amdxdna/amdxdna_gem.c | 193 +++++++++++++++-------------
>>   drivers/accel/amdxdna/amdxdna_gem.h |   3 +-
>>   3 files changed, 106 insertions(+), 92 deletions(-)
>>
> ...
>
>> @@ -855,10 +868,12 @@ int amdxdna_drm_sync_bo_ioctl(struct drm_device *dev,
>>   
>>   	if (is_import_bo(abo))
>>   		drm_clflush_sg(abo->base.sgt);
>> -	else if (abo->type == AMDXDNA_BO_DEV)
>> -		drm_clflush_pages(abo->mem.pages, abo->mem.nr_pages);
>> -	else
>> +	else if (abo->mem.kva)
>> +		drm_clflush_virt_range(abo->mem.kva + args->offset, args->size);
>> +	else if (abo->base.pages)
>>   		drm_clflush_pages(abo->base.pages, gobj->size >> PAGE_SHIFT);
>> +	else
>> +		WARN(1, "Can not get flush memory");
> drm_WARN() would also give you the device that caused the warning in case there may be multiple xdna accels.
>
> Reviewed-by: Jacek Lawrynowicz <jacek.lawrynowicz@...ux.intel.com>
>
> Regards,
> Jacek
>

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ