Received: by 2002:ab2:7855:0:b0:1f9:5764:f03e with SMTP id m21csp902902lqp; Thu, 23 May 2024 03:41:35 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCVpTL5SRQeyZEPcQH3ANwBLcREYdawdzVTFrxh90qSOXwxEfvetFzN3tMyiUyjCUTPW2fuDUqdur4LeN4a4Ocaf/v7xGdoZ1GCE3TkTVA== X-Google-Smtp-Source: AGHT+IG1Gudb8cdhDqKudiRaQv+N2RyH+SpYtGEEgdo67EgW2SZWy3kzS3YVHP+i4BhMZXrlIl2j X-Received: by 2002:a17:903:11c9:b0:1f2:fe1b:13b5 with SMTP id d9443c01a7336-1f31c9d0682mr52599645ad.47.1716460894859; Thu, 23 May 2024 03:41:34 -0700 (PDT) Return-Path: Received: from sv.mirrors.kernel.org (sv.mirrors.kernel.org. [139.178.88.99]) by mx.google.com with ESMTPS id d9443c01a7336-1f2fbc9a1bfsi74849435ad.10.2024.05.23.03.41.34 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 23 May 2024 03:41:34 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-187344-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) client-ip=139.178.88.99; Authentication-Results: mx.google.com; dkim=pass header.i=@amd.com header.s=selector1 header.b=npU09icX; arc=fail (signature failed); spf=pass (google.com: domain of linux-kernel+bounces-187344-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) smtp.mailfrom="linux-kernel+bounces-187344-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=amd.com Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by sv.mirrors.kernel.org (Postfix) with ESMTPS id 4C524282CB7 for ; Thu, 23 May 2024 10:40:50 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id B0EEF13CFAF; Thu, 23 May 2024 10:40:45 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=amd.com header.i=@amd.com header.b="npU09icX" Received: from NAM10-DM6-obe.outbound.protection.outlook.com (mail-dm6nam10on2083.outbound.protection.outlook.com [40.107.93.83]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 0013B13CF98 for ; Thu, 23 May 2024 10:40:42 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=fail smtp.client-ip=40.107.93.83 ARC-Seal:i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1716460844; cv=fail; b=MVZ7ov/c3Kk9iahM2/04IPfIuiiweLlSRTdJ5O6EXn3HbeE2VTzTqbbHsH6+Tx0ei3CrUF2aWyNGoKyN92Vy5tb9g2FHrrmTU8YOyRFvk+mnZVvp2AS/IQ34KntzGVku6XUxd7HcuCup+mDVsLUk/Y5hFd8UbCYEEn+0WcYhTek= ARC-Message-Signature:i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1716460844; c=relaxed/simple; bh=4sGHe7qTSgh4kCYsHZnqHqbO6gqfsgeVmYR62JV+RcY=; h=Message-ID:Date:Subject:To:Cc:References:From:In-Reply-To: Content-Type:MIME-Version; b=H0GaGfhIamirfVY7fWOvkGZyb1M4CzgGtPWmUjiBDKW9O3WGs6xsbLZvZ6qCKo3CaGZ5EQ1vsiKDnfPu7m6DCRZ+9RlLLbVPSaX+Q41lPuzzix2llB0IwET8k+8OzIGJlcFwIJ6CnwsRrJSMNm2oqKzRg9w0P7MLEuCezOc6tF4= ARC-Authentication-Results:i=2; smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=amd.com; spf=fail smtp.mailfrom=amd.com; dkim=pass (1024-bit key) header.d=amd.com header.i=@amd.com header.b=npU09icX; arc=fail smtp.client-ip=40.107.93.83 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=amd.com Authentication-Results: smtp.subspace.kernel.org; spf=fail smtp.mailfrom=amd.com ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=U1CzCKQmQ4w5liUSr6mTAYvozjWEm4QycWuMKpBcxol1mRCGmHAsK6af6NghTYnE/T8w/q+kW06IAJm2C3MYH41706AhCYALTo/tQJHLaEYviMmYERyO2RW29pH8yJQ87dPhFuLKt3xqZ+V6rGm4RjKdBTi4Zw4Vcy1F1lXbOE9VZHbS98dAvv4JNzaMBKQVjfcPJSpnXquPzv+gswSzBq/EIhHoUXvu0kdmV7eCDo18ZDu8ct96CVZKYmFepo4Qe/VOP0M9PODErIOVQvUt0Zt82QLPttjkfAbvB9cs5DYQa9+rknGtWrgJnQ4wFl7nZ+uQ+MLmWDCT0lYfOapEGA== 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-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=qJPW3P3hjESHaBglB2CrG8PWbM9x7tGg1ozNuEQE56s=; b=h5WkL/yA+rZgHvYOSHnIGuUMhT35L0f9ItkGljO2wP5YXkaTk500RKqF/EEVGX0RquhCZlr3PqIcEGOWqEAFFsIrttbCQYt2Oq9O0OxUoJIxpOonXNrJOW+4DSeHDqSNwfeZPvwEv6orETeh/Ojs7Ny6WaKQ8eWRkVOxkaae6U/IVyLZok/Nq1O++lkK3hIjdDRtuv4TmgFed1KrNsY72qAXjqVcXmJcgDDhF9beDN4mKedRnDMKlelph7UbqCdMOk/PH1+rXgIYlApIxZ++wMiUvQbovtw5wK9/nTHvo+yaD4shDCBz3bjTxtbVsh7OAvMwEH8SNoIqaVI0GIz6dg== 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=qJPW3P3hjESHaBglB2CrG8PWbM9x7tGg1ozNuEQE56s=; b=npU09icXIlWDdVh8uAGb/vNl/yUZHkqeiWDYo1QWVv8/6mMKuTndJwCs88XIzvyTAC8RqJ+OuRH7wt3qcyFQUV/tHsCB+EECNx+13l1n3l1mjgKZ42XrB1Uyen2x7yD9ULG8eDmNTbwFtNAeJKykxPOE4Yn69jskhKzPPXoMbZk= Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=amd.com; Received: from DS7PR12MB6048.namprd12.prod.outlook.com (2603:10b6:8:9f::5) by IA1PR12MB6483.namprd12.prod.outlook.com (2603:10b6:208:3a8::14) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7611.22; Thu, 23 May 2024 10:40:38 +0000 Received: from DS7PR12MB6048.namprd12.prod.outlook.com ([fe80::af7d:5f4f:2139:ebd1]) by DS7PR12MB6048.namprd12.prod.outlook.com ([fe80::af7d:5f4f:2139:ebd1%4]) with mapi id 15.20.7587.035; Thu, 23 May 2024 10:40:38 +0000 Message-ID: Date: Thu, 23 May 2024 16:10:28 +0530 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH 1/3] iommu/amd: Use try_cmpxchg64() in v2_alloc_pte() To: Uros Bizjak , iommu@lists.linux.dev, linux-kernel@vger.kernel.org Cc: Joerg Roedel , Suravee Suthikulpanit , Will Deacon , Robin Murphy References: <20240522082729.971123-1-ubizjak@gmail.com> Content-Language: en-US From: Vasant Hegde In-Reply-To: <20240522082729.971123-1-ubizjak@gmail.com> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-ClientProxiedBy: BMXPR01CA0086.INDPRD01.PROD.OUTLOOK.COM (2603:1096:b00:54::26) To DS7PR12MB6048.namprd12.prod.outlook.com (2603:10b6:8:9f::5) Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: DS7PR12MB6048:EE_|IA1PR12MB6483:EE_ X-MS-Office365-Filtering-Correlation-Id: 0bdcc1f5-e8e0-490a-6eb3-08dc7b14c911 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0;ARA:13230031|376005|1800799015|366007; X-Microsoft-Antispam-Message-Info: =?utf-8?B?YWhCdWtCdjVaOUhjMU1CRzRpaVlURHhOcldMYnNjSWlBcHAwd2NuWUJ0V2M5?= =?utf-8?B?OUhZaHg0VG95aUtQTG83c1kxa29HbXV6SVlxZGJkc0RkblJNaDJLQzhHRjEr?= =?utf-8?B?RFErdnBveUxPQk1uejlDTnFCbmx6K2Izc3Fhc1Z5VE0yTm1BQzNoWVZvditL?= =?utf-8?B?OElxaC9CUlpORXEralJINFFtc0tJWHdBZ3Y3SUx2aHlPRGdKUHAzcTZnRmJT?= =?utf-8?B?Y1EreGlrcVEweDdTL0dXamtNeVhkSFpNU0dHeUo3YlV4OTBaZ3N6d25RQ2tB?= =?utf-8?B?ZSs4ZGJiZ2s3b3ppcDArZFQzSmc0Y3RkUGVJbXVJdXdJRjRQT0lIOTcvMDZD?= =?utf-8?B?ejdtMEkwQU4wb1VRaytEcE9VQzJkK2RrRFZ2WXQzZ3lhOXJVUU9VTEtGakN4?= =?utf-8?B?Q1JvUmdUOHhRS0lkRFNWeWdYdUs4bjhPdGVGTll3N2RXTEt6U3l0bXp1bURy?= =?utf-8?B?UnB4ZlkzcjVoY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djdxb2RGNGlt?= =?utf-8?B?UFFLdXlGNXl5UEhJS3hlaUg0YXUwelErSmxZNGRkUDBhVlZoVTBsRVB6VmE3?= =?utf-8?B?WUJrMmU5a3hnN1ZxYThlZFZOVVczSVU2OHlvRHdwUG9uNWZhbWRvNU5mdENG?= =?utf-8?B?NW9hek11d0ZZemFvNmNPbzBFME1FTjBLcTN4d0d0bTJUU1RrTUJyZXJ6ekNY?= =?utf-8?B?WlpjQ2FXdnk2ai9paVRLbk13TG1Fd3lNbmpBQVp3Yi9WL0g2b2piR3NoNWZZ?= =?utf-8?B?WmlCWmhUeGMxYXY0OHZ0c3Z4QmxITzFSTWNDa09LY2lQbG4vR09PdFlGWGlo?= =?utf-8?B?ZDlsTnRXNHdyc0dZMTZodGF6Vmg4c0VsM0Q5L3RoZm9OejFIVkJpR3ZnPT0=?= X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:DS7PR12MB6048.namprd12.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230031)(376005)(1800799015)(366007);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?utf-8?B?a0NGRWhDbXc4Q2NJcERFZEZNdytuZlJlMHFTemdJd1hVMXFvb0w5TEJMNERo?= =?utf-8?B?MDNiMmlNclBlK0h2cm9kbEUraEZnVjNKdHFaUlJobEtaSndsOVo2cThoTmFW?= =?utf-8?B?TUpRSDYxT092M0ZxRWxEYzVLbGpFYkJydjIyaE5QMlY3WmhJdWVhZXc5Wmls?= =?utf-8?B?cUxYRllsdFRtVEQ2dDZBdDl3SW5BcEZNTUhtQ085QzMwRExDVDhodG05czEz?= =?utf-8?B?NEV0R0c3NGFhSVo0bmtiRTczbmRNdDRtaDE4d1RzRjlkbWcyUDNtdzRZM0xy?= =?utf-8?B?bVRFaytSWXU2VGFtdXhzbW1OYU9sUEFOWlVaSWFl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8?Q?NcQGix4vz9mMzyhBeLJCU1ScU?= X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-Network-Message-Id: 0bdcc1f5-e8e0-490a-6eb3-08dc7b14c911 X-MS-Exchange-CrossTenant-AuthSource: DS7PR12MB6048.namprd12.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 23 May 2024 10:40:38.6142 (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: lZRD6ziPMcUWnaXYFg+CC6MgonJz7G8M5vddpAyU5AZQjNinvOuVC/YOOtuRvrACdWXKYXo++5CG1PiDTtQjpw== X-MS-Exchange-Transport-CrossTenantHeadersStamped: IA1PR12MB6483 On 5/22/2024 1:56 PM, Uros Bizjak wrote: > Use try_cmpxchg64() instead of cmpxchg64 (*ptr, old, new) != old in > v2_alloc_pte(). cmpxchg returns success in ZF flag, so this change > saves a compare after cmpxchg (and related move instruction > in front of cmpxchg). > > This is the same improvement as implemented for alloc_pte() in: > > commit 0d10fe759117 ("iommu/amd: Use try_cmpxchg64 in alloc_pte and free_clear_pte") > > Signed-off-by: Uros Bizjak > Cc: Joerg Roedel > Cc: Suravee Suthikulpanit > Cc: Will Deacon > Cc: Robin Murphy Thanks for fixing it. Looks good to me. Reviewed-by: Vasant Hegde -Vasant > --- > drivers/iommu/amd/io_pgtable_v2.c | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > diff --git a/drivers/iommu/amd/io_pgtable_v2.c b/drivers/iommu/amd/io_pgtable_v2.c > index 78ac37c5ccc1..664e91c88748 100644 > --- a/drivers/iommu/amd/io_pgtable_v2.c > +++ b/drivers/iommu/amd/io_pgtable_v2.c > @@ -158,7 +158,7 @@ static u64 *v2_alloc_pte(int nid, u64 *pgd, unsigned long iova, > > __npte = set_pgtable_attr(page); > /* pte could have been changed somewhere. */ > - if (cmpxchg64(pte, __pte, __npte) != __pte) > + if (!try_cmpxchg64(pte, &__pte, __npte)) > iommu_free_page(page); > else if (IOMMU_PTE_PRESENT(__pte)) > *updated = true;