From patchwork Fri Mar 26 16:35:40 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Nirmoy Das X-Patchwork-Id: 410586 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=-18.7 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_CR_TRAILER, INCLUDES_PATCH, MAILING_LIST_MULTI, MSGID_FROM_MTA_HEADER, SPF_HELO_NONE, SPF_PASS, URIBL_BLOCKED, USER_AGENT_GIT autolearn=ham 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 17771C433DB for ; Fri, 26 Mar 2021 16:36:34 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id DFB1C61A27 for ; Fri, 26 Mar 2021 16:36:33 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229871AbhCZQf7 (ORCPT ); Fri, 26 Mar 2021 12:35:59 -0400 Received: from mail-dm6nam12on2044.outbound.protection.outlook.com ([40.107.243.44]:53344 "EHLO NAM12-DM6-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S230076AbhCZQfz (ORCPT ); Fri, 26 Mar 2021 12:35:55 -0400 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=H1cUFY5peimk9Mvhm3I9EhdrRwc5GMJw0VtLzk91uMZxtRokdXa9rYwg0cFSbdsT7h1wBa5vT8q9CTXwtodvokEUrHmo0+kbzSKck+jpI6jStLvOOPDFBRfyF/Jt6AjsZ6L8D4eOACRTQbEE1WEmuNaExu+rwGGxlrubrmTM7sEoo1ueaLmFsx7R/OozG7PtbcR1zR8HGIyUaKZfptviT/fKFtS5gySbK6smAulwdGIlyI6OKdTmwzwKwkgMAYXRIHznIcKlZKDgGlkRc5rqWY/x8z1aoCB5WgL4t7XDpwfJz6fdVu33DvfwLYLDHtrQwvhxJf1I4iBF2gEFER9Ceg== 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=GqrORpp4t5HhzRTa52wtZDwZLYzrQG5kh5D068hlgZ8=; b=T3e4YqFQTLUX4g56DXS/52SyvBJ3YevfP/krv6VD3ld687DNDj02RWR6bYZ3UkRMVKQXJmageA6K9etpzR+oFIOohzsmWbhs1qui6YadhAIk90gfzn0qeLyQBKv5I+HT5E0Axic2P/xikZrJXClY997mZCXeKzQTbAkw5kWWem8RGNFi1l3k10R6GMHWDANLLFsDXnIV1lhPB+pKjWdbtdBBRoBBYJ2DAe88M0TWc0UKIB9HOJrDL6093affTGaYqe4rf4XjDHXZD7R4s4AV/Vo/5RtvfcksH7fQ4hw3WOeVEtyppRLM1G9gsw5eHwT3lqRdtA3RpUpBF4f89xCIOw== 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=amd.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=GqrORpp4t5HhzRTa52wtZDwZLYzrQG5kh5D068hlgZ8=; b=iGFrFzb6AYJv5qthWey1UshpsdUoCBI6RrOWVow2ZXouNzZcSLRAR6aIski+8FFO/XrS/FZcNYlwitVJGzpLSRzFw1x5JARexEwAVlMcVJwG7ps43avJBG/lTvYkRs3Szcfo1l3z0LlzXRJClrdGDeQIzPB7fArjAdbz/JH2Xy4= Authentication-Results: lists.freedesktop.org; dkim=none (message not signed) header.d=none; lists.freedesktop.org; dmarc=none action=none header.from=amd.com; Received: from CY4PR12MB1463.namprd12.prod.outlook.com (2603:10b6:910:e::19) by CY4PR1201MB0199.namprd12.prod.outlook.com (2603:10b6:910:1c::10) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3955.18; Fri, 26 Mar 2021 16:35:53 +0000 Received: from CY4PR12MB1463.namprd12.prod.outlook.com ([fe80::6504:7fc4:d02f:77f2]) by CY4PR12MB1463.namprd12.prod.outlook.com ([fe80::6504:7fc4:d02f:77f2%3]) with mapi id 15.20.3955.027; Fri, 26 Mar 2021 16:35:53 +0000 From: Nirmoy Das To: amd-gfx@lists.freedesktop.org Cc: Nirmoy Das , stable@vger.kernel.org, =?utf-8?q?Chr?= =?utf-8?q?istian_K=C3=B6nig?= Subject: [PATCH 1/1] drm/amdgpu: fix offset calculation in amdgpu_vm_bo_clear_mappings() Date: Fri, 26 Mar 2021 17:35:40 +0100 Message-Id: <20210326163540.10221-1-nirmoy.das@amd.com> X-Mailer: git-send-email 2.30.2 X-Originating-IP: [165.204.84.11] X-ClientProxiedBy: BN6PR17CA0059.namprd17.prod.outlook.com (2603:10b6:405:75::48) To CY4PR12MB1463.namprd12.prod.outlook.com (2603:10b6:910:e::19) MIME-Version: 1.0 X-MS-Exchange-MessageSentRepresentingType: 1 Received: from brihaspati.amd.com (165.204.84.11) by BN6PR17CA0059.namprd17.prod.outlook.com (2603:10b6:405:75::48) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3977.30 via Frontend Transport; Fri, 26 Mar 2021 16:35:52 +0000 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-HT: Tenant X-MS-Office365-Filtering-Correlation-Id: c8a287a7-d4c3-49e8-82d2-08d8f075390f X-MS-TrafficTypeDiagnostic: CY4PR1201MB0199: X-MS-Exchange-Transport-Forked: True X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:1751; X-MS-Exchange-SenderADCheck: 1 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: SdxkYhRM1mcdES7yDJgd9TiEA1ZK1ErWHmdEENRSbqnxyZTSAMXYQdpXEdzH2xY4z6p9kkM+POE3Zr7yA3+Oe5KtuufEG9J1EhsfYcdxGOrRM4rOUCIoL7hA5snaGGuCcpFoAQPSJ/iUJJEGInfhak1x41lrxG/6V3z/A7q0xAsco2xgHw33yaTCe/dtRAy3vM0mjf3779ynE8MlralWVanTQ2iUioA9XCoWzfTaSR1A4xumdq5Moz/WjAf3G8/GOnkiifUUT3sOoUAPcsKAHz9q5hodIudp8kt+Ioqa0jHYlcGT3l2eJA3UlsqKkq2TbHk2KZVXDullUNe1Wmvc6xN714fDRCBJqZiiliwtDBM8qnWzXvRRug2T0mvkGZwAYnJOtmpArBOhVvkM92c/6l+CCudUyslkr3pBNAcfGSNeeU+yKwulI5U7rnouU/Wm3fsc81iv5LyeSWhXSJ/f0ChNJpBavLSwk32ho0olYxR3T3KVKUAMIiiK1Pf35lGlR340uwmnURRLFIROeYiQd6w3jC/u8tMyCc/8j2wuhWftQqpsS+JobUZ04Vz2u1z85AtWB8IMSdCdBcQXpywA90D93AaPEDUXj5GphXkynVArTUDIPc2pItmNkkuLO2JyijJPPvbGBCAUaDvVOw4bwKkTnorB+yrQv7yo/LnHOJI= X-Forefront-Antispam-Report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:CY4PR12MB1463.namprd12.prod.outlook.com; PTR:; CAT:NONE; SFS:(4636009)(376002)(366004)(39860400002)(136003)(396003)(346002)(6666004)(66556008)(8936002)(83380400001)(8676002)(26005)(66574015)(52116002)(36756003)(54906003)(316002)(38100700001)(66476007)(6486002)(7696005)(66946007)(86362001)(956004)(6916009)(1076003)(4744005)(44832011)(2906002)(2616005)(16526019)(5660300002)(478600001)(186003)(4326008); DIR:OUT; SFP:1101; X-MS-Exchange-AntiSpam-MessageData: =?utf-8?q?eIp5JHUR/SarK4oWRcbZk9/8fw5?= =?utf-8?q?IJfJZGBKc5SXineXBexsdjZ11oyjwR4qdFIvgDu/cNsDqC1+xffF4wS1?= =?utf-8?q?HiB20POyoVrPjHyajhd75SYMIS9Ho5bMhOcIlKE7w0NS+bnRS6YJzBjU?= =?utf-8?q?XPE1QyW9y9Ss7GSAJd0dRFPdZqBZ/jAbdmoy4SqbkP3cXy2HwHr7ra4I?= =?utf-8?q?XoplNW/YaX2/aV2uB3/24XABucfm0mr2G2P7UjkJCGB6hLR690XS42a6?= =?utf-8?q?mam4N5xRezuyyD8v63GYeua3FKJ1+qkvQ31mSBjyYaoPmTdgZreLYKPm?= =?utf-8?q?rLq6Mt93MO2Wt+JyO6V3R2x2sbPMXFrEiORosasl/cp1440XRHaHgpmM?= =?utf-8?q?O9MOBPduNkhgmiM8JxXIU2lrOWf1Ma7b+DopJ6oGfLipkh1rlr6WKuhR?= =?utf-8?q?yTtdpTAsOsRkywWxA12Yiw22vMee2Zoz/T26u3xIzxrhi6NybYYM9/Oy?= =?utf-8?q?cRb9acJ7hGOFxPuU9FLj1MzmJL+FP8qD5SnysheO7Nr+ShXGBALoaVzn?= =?utf-8?q?kh2F4N7DXXjot3IhtcK8LPS5QNKm/VJTpY030F0eAhTHK5ytP5C2fARZ?= =?utf-8?q?A++XYlND/3q/EZSDsv5odP8mCrGHGoH+sUiQVluvOLGfsruqp30BBTAA?= =?utf-8?q?HAj+kZ07f61d9SQzKMJD8cE6hJhhpsI2HG4pE+PcyUk8VsDkLTANNPM/?= =?utf-8?q?poKy0Eh36BEhorZUA9dmqByDtH1bW1BjHPX55nsf6JzApxRHvJkmLwDA?= =?utf-8?q?A5bpbpwMblhj/EVSSvzrudgzfWwlIGXJcZ+OTYMvVekhfxULKK6Igun5?= =?utf-8?q?rv2FeHB8Fjh7XfYZ3CfVty+qag26/dI3v9T1DXXjsbsrCNh9m2daTzMV?= =?utf-8?q?TK5QWrUJHRecQ+Sj9SVitDWRxfAAXNz8/gZUAxZ3I4xJh4FgaAjLCnpB?= =?utf-8?q?InITyk1L0jblEhqjOv7RZ2TT/qUGLC5FkyO6MWJOTodHq48YS6txkdNQ?= =?utf-8?q?zCVonJ9qY7a2jH26blHrPpZCEDXA/ANjUkODMYLqwPMgPeTdZcm2UMuz?= =?utf-8?q?da+dZ9fJz7yeOVRv+62fbGd1jIt3DhjRgLGprdU/C5ub7XrrSNL64w6B?= =?utf-8?q?RjD+6yfH6eUAA+NXGUyczxHekiE0aP9q1ilu78JonnT7uemrgHfJPGj8?= =?utf-8?q?clb+rmdgkdmFxiRJgx3MuCmWxqdy+Rz3B98Xdsm86soUstyTqzz64RnF?= =?utf-8?q?Vtl/rZbH07Pj0kgVnoesp3Z/Bdu+Sk/DgHyPlKvDSt6FxkfY7YarExcI?= =?utf-8?q?bIaYQOy6H5fejPjqPDXXUvbIhG9A6MMxYOJtIFaBGaGfHfKDghE3L8qn?= =?utf-8?q?SGDB+97tp9jcKmRvuBLxH0CDHSmS5?= X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-Network-Message-Id: c8a287a7-d4c3-49e8-82d2-08d8f075390f X-MS-Exchange-CrossTenant-AuthSource: CY4PR12MB1463.namprd12.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 26 Mar 2021 16:35:53.6191 (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: P8tFKqrPonQ5WP0Srl1itU2AMKEAZqnFD6Y5bZbabN2QN+tOvFQNX+SNartfwbxgXnDpP2MSxzENvOkQ/i+eaA== X-MS-Exchange-Transport-CrossTenantHeadersStamped: CY4PR1201MB0199 Precedence: bulk List-ID: X-Mailing-List: stable@vger.kernel.org Offset calculation wasn't correct as start addresses are in pfn not in bytes. CC: stable@vger.kernel.org Signed-off-by: Nirmoy Das Reviewed-by: Christian König --- drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c index 9268db1172bd..dc4d6ae71476 100644 --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c @@ -2410,7 +2410,7 @@ int amdgpu_vm_bo_clear_mappings(struct amdgpu_device *adev, after->start = eaddr + 1; after->last = tmp->last; after->offset = tmp->offset; - after->offset += after->start - tmp->start; + after->offset += (after->start - tmp->start) << PAGE_SHIFT; after->flags = tmp->flags; after->bo_va = tmp->bo_va; list_add(&after->list, &tmp->bo_va->invalids);