From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.8 required=3.0 tests=BAYES_00,DKIM_INVALID, DKIM_SIGNED,HEADER_FROM_DIFFERENT_DOMAINS,HTML_MESSAGE,INCLUDES_PATCH, MAILING_LIST_MULTI,SIGNED_OFF_BY,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED autolearn=no autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 57934C433DF for ; Wed, 29 Jul 2020 15:34:06 +0000 (UTC) Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 2DD3E20809 for ; Wed, 29 Jul 2020 15:34:06 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=fail reason="signature verification failed" (1024-bit key) header.d=amdcloud.onmicrosoft.com header.i=@amdcloud.onmicrosoft.com header.b="1+jPu0T7" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 2DD3E20809 Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=amd.com Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=dri-devel-bounces@lists.freedesktop.org Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 7B27B6E544; Wed, 29 Jul 2020 15:34:05 +0000 (UTC) Received: from NAM10-BN7-obe.outbound.protection.outlook.com (mail-bn7nam10on2048.outbound.protection.outlook.com [40.107.92.48]) by gabe.freedesktop.org (Postfix) with ESMTPS id 811526E532; Wed, 29 Jul 2020 15:34:03 +0000 (UTC) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=VwDsu/TWfZt/Nda68YjEHsCmtCMOR96+My2qAT5fDD6xn11+ybtOsQ2eKcXQFhVq/ztxDPLen8CZi6TTan/MXMNZYz0c8dgNV0JZsf/KJE0wimx3Q+T0whdPpUewNAOS9jgbDXzQSl9SjTbKUJexOrdWHTwkPl2C7/MgjA+TU2Y1DKEFOHpSWpsrufh6Stn52qV+ZdKX9LkRc2AmlocFGisUuz7lrzcZQXCWe9ILXnQwzjwy5Smu3V2H9ELr1Ryc3ZAESt87yVPNlIkgq7gnA9lFf3gA/kgm9HykneclDkUQzg+eOh9xt4W7iNg+KzODNVsuwAZKgZkxaJ8dR8z8lA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=fBsvIovf8WuCPxc+FQPoqTvV2a+KdksvuXexX6TeUeo=; b=b7BlgidJqzvvH0tBx5IK2fc5pyHadte88p8/BT78QPLoBFZrG0as6bsQ3MVL1O/+r/ccuSluKFbw7/tKygoO3U4wGfFvNE2rIdo8a9Mcod5G23vDlTfkvez2zLWsPkxkneSy9a7iUKtrXWC1P9dk+/Le8b1i4ztwkz64fjELEmj8wTRB5PZfe4p2DPAEfokIV/Q96VcmowpbTx8WRC2Gn7YDBbMHfZWXtlDOYEh5YcGyzIiT5isnvaEDCL752fE4g+1CR6G4xB8sPQ9eEWT0Y79m0eY7KO29iwVq9TLJfgHil3oKTzmXWC/l9j8r9VFWOAmSWZhwJrAd8lbwWGHMnw== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=amd.com; dmarc=pass action=none header.from=amd.com; dkim=pass header.d=amd.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=amdcloud.onmicrosoft.com; s=selector2-amdcloud-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=fBsvIovf8WuCPxc+FQPoqTvV2a+KdksvuXexX6TeUeo=; b=1+jPu0T7SkZOq53W9OMEE8RhQXGd7kxySbOwuzfk1ig74nCyeYbD5fJDfH2iis68FTK6bg8rk2ZQtAMUfsIDZK6ymoUrZvHI1Z8GoPui1o07WLjEyIgyMjfm6YQukc+yXyuL8eHjlOK9NCtYw9QBEoArBpDsp4Qo1h43OC8RbDw= Received: from MN2PR12MB3775.namprd12.prod.outlook.com (2603:10b6:208:159::19) by MN2PR12MB3952.namprd12.prod.outlook.com (2603:10b6:208:164::21) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3239.16; Wed, 29 Jul 2020 15:33:58 +0000 Received: from MN2PR12MB3775.namprd12.prod.outlook.com ([fe80::a16e:8812:b4c0:918d]) by MN2PR12MB3775.namprd12.prod.outlook.com ([fe80::a16e:8812:b4c0:918d%6]) with mapi id 15.20.3216.034; Wed, 29 Jul 2020 15:33:58 +0000 From: "Koenig, Christian" To: "Deucher, Alexander" Subject: Re: [PATCH 1/1] drm/ttm: fix offset in VMAs with a pg_offs in ttm_bo_vm_access Thread-Topic: [PATCH 1/1] drm/ttm: fix offset in VMAs with a pg_offs in ttm_bo_vm_access Thread-Index: AQHWZbLAdrp11VXrm0ybkP64nkDMG6kerxeAgAAA3V8= Date: Wed, 29 Jul 2020 15:33:58 +0000 Message-ID: <9b384c46-ec71-46be-ac60-1335e9682c05@email.android.com> References: <20200728182704.1809-1-Felix.Kuehling@amd.com> <9994a650-8065-c51c-6454-47064d20c729@gmail.com>, <7c389ab3-4322-ebd5-f042-e80204dbcfbc@amd.com>, In-Reply-To: Accept-Language: de-DE, en-US Content-Language: de-DE X-MS-Has-Attach: X-MS-TNEF-Correlator: authentication-results: amd.com; dkim=none (message not signed) header.d=none;amd.com; dmarc=none action=none header.from=amd.com; x-originating-ip: [2a02:908:1252:fb60:a9b1:7286:e493:7e98] x-ms-publictraffictype: Email x-ms-office365-filtering-ht: Tenant x-ms-office365-filtering-correlation-id: a5add2e1-0164-4fcf-bd6f-08d833d4cfc1 x-ms-traffictypediagnostic: MN2PR12MB3952: x-ms-exchange-transport-forked: True x-microsoft-antispam-prvs: x-ms-oob-tlc-oobclassifiers: OLM:5797; x-ms-exchange-senderadcheck: 1 x-microsoft-antispam: BCL:0; x-microsoft-antispam-message-info: j6eLwURQZxcGxKMocp06qZ0iA8GJuoimFjXJP3yKN/vi8/ZLoX8D8GlPpUrmB/+Vut3cdY7h8FASyc4Zs2NY/I8bUGtywHi58d1P34icMj/AoprCNQ1Jpbr8Ooo8VkoSLo36rL3IqmxrjpRGVDtRjYUuy5hXwP4m+oIIi3SwDX7Bu1/CgEpUPVjqkWF6NVpCc6+OWEOdWOG425pk3jn32LZqS/q6K51URglio3vVDXQIpPI6yTr3dXE7acfkI8CP64n7m7NglfzXWjJvsyUOKTi5nw3+yj0vZ825CIWSqXGSaJcGOhXkVzjxW/44xuqu3VPls/3XkDx66isR357K1w== x-forefront-antispam-report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:MN2PR12MB3775.namprd12.prod.outlook.com; PTR:; CAT:NONE; SFTY:; SFS:(4636009)(39860400002)(396003)(346002)(376002)(366004)(136003)(6486002)(478600001)(86362001)(66446008)(5660300002)(6636002)(19627405001)(316002)(8936002)(9686003)(6512007)(4326008)(71200400001)(186003)(450100002)(31686004)(76116006)(66946007)(53546011)(83380400001)(31696002)(6506007)(6862004)(8676002)(2906002)(66574015)(64756008)(54906003)(91956017)(66556008)(66476007); DIR:OUT; SFP:1101; x-ms-exchange-antispam-messagedata: fIYUbEVumqlXieb0nPIiVWC0MJ+EhnImEa3FUYPKxtYfsRjeQFm0nKck0KCptTwUGKMr51vRzh0ve8fCH42aTH9DkFRlbSwx1/klibT1ZeEZYwDKgWfqHir6CZNIU5BGDJR4NrABhb0lhFu/LbcEkT1KOfNvotsrwpW+ldBai27VGmw+3b0kEHtOKv/eVkapdWth3BTSglJn+CvFLM/gtW38Tvo+sk49a0ZCN88DwGjpyiXPqEUopIOX4Q+0B3xSk8h1qeBN0Thn6aTWOtmdmdNfiFNpPk15QaK/7a8dGdS2BpIOUR/1sDNuBsYWUB6mxTSMZ85rFCbxQ1BqD4K2F+WXSKWczRixooJs3XOXlytmF9zwBIMXw2LaKFLdQ/n5P8nPrujIlIzYMoW+C7ogEgorMRSbCrAx002J3n/1q4ExcBh61ucJq2cqZsiOOfQKpkQZPXUAv63ItT8N8J4owZOJrgdrE8prG6sfK5iftJ67HcDWj/etGhAIvIgbtQw9gDw9EvvaVtmnspqnCxNv8bsZSEIIs7JVXQ/xDAqJ9XPl3dIy1fIyMWzFwgsti/JeylhFfEQU4kn21WQ2aFYwnJjmkdep4Fx/BcXtl9obeAK0XTP4Wk98ZcE29rYxzmkdgaAxuhH6ib2zej/ptdKVTJDpCb4g9jZjZ5p7e4FrtZtuR/qYJUl6dNU9tNe5JR0IIxPTHypdKfx7i7xyz1YvjA== MIME-Version: 1.0 X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-AuthSource: MN2PR12MB3775.namprd12.prod.outlook.com X-MS-Exchange-CrossTenant-Network-Message-Id: a5add2e1-0164-4fcf-bd6f-08d833d4cfc1 X-MS-Exchange-CrossTenant-originalarrivaltime: 29 Jul 2020 15:33:58.2900 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 3dd8961f-e488-4e60-8e11-a82d994e183d X-MS-Exchange-CrossTenant-mailboxtype: HOSTED X-MS-Exchange-CrossTenant-userprincipalname: 1jdIHx37vStvWVG8/A56ehx+GPfX5wv85N0rq81P9JdolXzqMw5SU4626m46sSmm X-MS-Exchange-Transport-CrossTenantHeadersStamped: MN2PR12MB3952 X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: "Kuehling, Felix" , "Morichetti, Laurent" , "amd-gfx@lists.freedesktop.org" , "dri-devel@lists.freedesktop.org" Content-Type: multipart/mixed; boundary="===============0028915307==" Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" --===============0028915307== Content-Language: de-DE Content-Type: multipart/alternative; boundary="_000_9b384c46ec7146beac601335e9682c05emailandroidcom_" --_000_9b384c46ec7146beac601335e9682c05emailandroidcom_ Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable Sure. Christian. Am 29.07.2020 17:30 schrieb "Deucher, Alexander" : [AMD Public Use] Christian, Can you cc stable when you apply it to drm-misc? Alex ________________________________ From: Kuehling, Felix Sent: Wednesday, July 29, 2020 10:15 AM To: Koenig, Christian ; dri-devel@lists.freedeskt= op.org ; amd-gfx@lists.freedesktop.org ; Deucher, Alexander Cc: Morichetti, Laurent Subject: Re: [PATCH 1/1] drm/ttm: fix offset in VMAs with a pg_offs in ttm_= bo_vm_access Am 2020-07-29 um 4:08 a.m. schrieb Christian K=F6nig: > Am 28.07.20 um 20:27 schrieb Felix Kuehling: >> VMAs with a pg_offs that's offset from the start of the vma_node need >> to adjust the offset within the BO accordingly. This matches the >> offset calculation in ttm_bo_vm_fault_reserved. >> >> Signed-off-by: Felix Kuehling >> Tested-by: Laurent Morichetti > > Reviewed-by: Christian K=F6nig > > Going to pick that up for inclusion in drm-misc-next. Thanks. I'll submit it to amd-staging-drm-next so it makes its way into our DKMS branch quickly. Alex, would you push this to drm-fixes? Regards, Felix > >> --- >> drivers/gpu/drm/ttm/ttm_bo_vm.c | 4 +++- >> 1 file changed, 3 insertions(+), 1 deletion(-) >> >> diff --git a/drivers/gpu/drm/ttm/ttm_bo_vm.c >> b/drivers/gpu/drm/ttm/ttm_bo_vm.c >> index 389128b8c4dd..60b41447bec8 100644 >> --- a/drivers/gpu/drm/ttm/ttm_bo_vm.c >> +++ b/drivers/gpu/drm/ttm/ttm_bo_vm.c >> @@ -405,8 +405,10 @@ static int ttm_bo_vm_access_kmap(struct >> ttm_buffer_object *bo, >> int ttm_bo_vm_access(struct vm_area_struct *vma, unsigned long addr, >> void *buf, int len, int write) >> { >> - unsigned long offset =3D (addr) - vma->vm_start; >> struct ttm_buffer_object *bo =3D vma->vm_private_data; >> + unsigned long offset =3D (addr) - vma->vm_start + >> + ((vma->vm_pgoff - drm_vma_node_start(&bo->base.vma_node)) >> + << PAGE_SHIFT); >> int ret; >> if (len < 1 || (offset + len) >> PAGE_SHIFT > bo->num_pages) > --_000_9b384c46ec7146beac601335e9682c05emailandroidcom_ Content-Type: text/html; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable
Sure.

Christian.

Am 29.07.2020 17:30 schrieb "Deucher, Alexa= nder" <Alexander.Deucher@amd.com>:

[AMD Public Use]


Christian, Can you cc stable when you apply it to drm-misc?

Alex

From: Kuehling, Felix <F= elix.Kuehling@amd.com>
Sent: Wednesday, July 29, 2020 10:15 AM
To: Koenig, Christian <Christian.Koenig@amd.com>; dri-devel@li= sts.freedesktop.org <dri-devel@lists.freedesktop.org>; amd-gfx@lists.= freedesktop.org <amd-gfx@lists.freedesktop.org>; Deucher, Alexander &= lt;Alexander.Deucher@amd.com>
Cc: Morichetti, Laurent <Laurent.Morichetti@amd.com>
Subject: Re: [PATCH 1/1] drm/ttm: fix offset in VMAs with a pg_offs = in ttm_bo_vm_access
 
Am 2020-07-29 um 4:08 a.m. schrieb Christian K=F6n= ig:
> Am 28.07.20 um 20:27 schrieb Felix Kuehling:
>> VMAs with a pg_offs that's offset from the start of the vma_node n= eed
>> to adjust the offset within the BO accordingly. This matches the >> offset calculation in ttm_bo_vm_fault_reserved.
>>
>> Signed-off-by: Felix Kuehling <Felix.Kuehling@amd.com>
>> Tested-by: Laurent Morichetti <laurent.morichetti@amd.com> >
> Reviewed-by: Christian K=F6nig <christian.koenig@amd.com>
>
> Going to pick that up for inclusion in drm-misc-next.

Thanks. I'll submit it to amd-staging-drm-next so it makes its way into
our DKMS branch quickly.

Alex, would you push this to drm-fixes?

Regards,
  Felix


>
>> ---
>>   drivers/gpu/drm/ttm/ttm_bo_vm.c | 4 +++-
>>   1 file changed, 3 insertions(+), 1 deletion(-)
>>
>> diff --git a/drivers/gpu/drm/ttm/ttm_bo_vm.c
>> b/drivers/gpu/drm/ttm/ttm_bo_vm.c
>> index 389128b8c4dd..60b41447bec8 100644
>> --- a/drivers/gpu/drm/ttm/ttm_bo_vm.c
>> +++ b/drivers/gpu/drm/ttm/ttm_bo_vm.c
>> @@ -405,8 +405,10 @@ static int ttm_bo_vm_access_kmap(struct
>> ttm_buffer_object *bo,
>>   int ttm_bo_vm_access(struct vm_area_struct *vma, unsigned l= ong addr,
>>            =     void *buf, int len, int write)
>>   {
>> -    unsigned long offset =3D (addr) - vma->vm_s= tart;
>>       struct ttm_buffer_object *bo =3D vm= a->vm_private_data;
>> +    unsigned long offset =3D (addr) - vma->vm_s= tart +
>> +        ((vma->vm_pgoff - d= rm_vma_node_start(&bo->base.vma_node))
>> +         << PAGE_SH= IFT);
>>       int ret;
>>         if (len < 1 || (offset + = len) >> PAGE_SHIFT > bo->num_pages)
>
--_000_9b384c46ec7146beac601335e9682c05emailandroidcom_-- --===============0028915307== Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Disposition: inline _______________________________________________ dri-devel mailing list dri-devel@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/dri-devel --===============0028915307==--