Received: by 2002:a89:d88:0:b0:1fa:5c73:8e2d with SMTP id eb8csp256928lqb; Thu, 23 May 2024 18:11:19 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCWBMPElB6Q90zOy3NeWuIVGM5qApC+uxcd3Q2MjTHsyL4fvQ3oMqEcKgaab8fK8o5c89YZQ1H9G0Pea4H0J+6hq7h/t5wa/Hhwsd690Lw== X-Google-Smtp-Source: AGHT+IE1EsEo38CP1X7GAPVzzfMSJeysgRxN9gZKfFaVRsmoW0zDe/tVHCueLduh2AVkKK+MEjK2 X-Received: by 2002:a92:c561:0:b0:371:3502:60c9 with SMTP id e9e14a558f8ab-3737b2bba78mr10595465ab.1.1716513078735; Thu, 23 May 2024 18:11:18 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1716513078; cv=pass; d=google.com; s=arc-20160816; b=Muc3JSBObuN/VdQyhrNIfF+eGlgUpzgzqHmA6sQz2walQ8zDQxmoWZhijjof/SpPPY rWBfsJ/jl/OEzw0yijk8KGXndk12ATBKLJ08oVyLfK7KWSy3/hyOz+VhTFgdZMxq0hly FNqVqo5vFYWlrfZANrt++1IRhHcEYcIjPXslK5Xb0xycTtXrKLS9SP56N1qSwCe4ejmg 9FH/79Hl5T1vwl7chvmY1JN1BVUfuJ1z8GbQpUqEUPvpGIBAb4ZMCwZM6d/ksNx1p3xq dCyxXqATXnDYThCp7GdL9ga8/r90e5yvl/eC0uM5BMEHdvmiSse8Njw7NtYhSphbOPsp 7g9g== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:in-reply-to:from:content-language :references:to:subject:cc:user-agent:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:date:message-id:dkim-signature; bh=iJzFJNiYMh/qy0gc5IWqHd/Re+9D76EyMdFLlQT0XSU=; fh=uc6F0Ohn3UW1w84uHLY77zlgWj4U4PYcMZ6239x5PoQ=; b=nsvC7+kV12jbhqPIhY0B+cJ0VBBF4tSMLwmBdXpTW9aO0aJCHALZ70zFGmFXFNtGkQ 9OsOAKgCuKApcv2OolYC6lVv2Mfi7r0lDApyBNwVIWKveqokQxKMlB5jU/0jNT3yiYDy detDW+dUR+SLWlNRdFhT4Ym90cswP8BLfuz7ZKVpf5EppGsUF04AzbHg55IwYPWv+qUH LvdYHWAJyNIVZPjNFQtsoKWnvSH+HW0a3GId2FGbDtaWQVgyWHGK285ybuJp2z9mPNPH vT9RPfVgTl/zbfMfPIrlhrmcTNxueHahaf+ao+sNC1Fw2Dd4HoGxvHvehbYH37VkqiSF AOZw==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=nV1a2LlW; arc=pass (i=1 dkim=pass dkdomain=intel.com dmarc=pass fromdomain=linux.intel.com); spf=pass (google.com: domain of linux-kernel+bounces-188201-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-188201-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=intel.com Return-Path: Received: from sv.mirrors.kernel.org (sv.mirrors.kernel.org. [2604:1380:45e3:2400::1]) by mx.google.com with ESMTPS id 41be03b00d2f7-6822ae56a0bsi276508a12.796.2024.05.23.18.11.18 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 23 May 2024 18:11:18 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-188201-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) client-ip=2604:1380:45e3:2400::1; Authentication-Results: mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=nV1a2LlW; arc=pass (i=1 dkim=pass dkdomain=intel.com dmarc=pass fromdomain=linux.intel.com); spf=pass (google.com: domain of linux-kernel+bounces-188201-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-188201-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=intel.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 56718282FBC for ; Fri, 24 May 2024 01:11:18 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 131A28493; Fri, 24 May 2024 01:11:14 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=intel.com header.i=@intel.com header.b="nV1a2LlW" Received: from mgamail.intel.com (mgamail.intel.com [198.175.65.15]) (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 A431B36D for ; Fri, 24 May 2024 01:11:10 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=198.175.65.15 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1716513073; cv=none; b=b+52HBsGvgbKYASEHxKAP5qsj5Fb5ImoxkuA8abUWaf5M6+629lNPTKvlpkuJmOKVdoz8dtspUVKIDMx8tMMfbNNr4Cnpk1itFWd+psjUR2FWbX/94kPw6F0EhYGRCBfJNhx1cQ8H/aan8JSJz0kLwhFWTfy+Y8oivwjxBlCsjk= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1716513073; c=relaxed/simple; bh=7eD2UmuhPW/+ApwIW9GMlhMuZIHesbvVW8A7NKI8QOY=; h=Message-ID:Date:MIME-Version:Cc:Subject:To:References:From: In-Reply-To:Content-Type; b=jF8afSzPkskPTYaVUo1pWu1OnkWBwuaQZqwWuCP2wwtHbNWXDXeseR4eVhF0Syauj0qnPq4W0ZFt7/P7xjpUcXCumZZdZUgHkfXdbnXEjnKWJiY5ba4DgcG2JARpJERQgZEVgGAjohcPQozsFOADQaMO3UT0AaVXwCttV8se5Ms= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linux.intel.com; spf=none smtp.mailfrom=linux.intel.com; dkim=pass (2048-bit key) header.d=intel.com header.i=@intel.com header.b=nV1a2LlW; arc=none smtp.client-ip=198.175.65.15 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linux.intel.com Authentication-Results: smtp.subspace.kernel.org; spf=none smtp.mailfrom=linux.intel.com DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1716513070; x=1748049070; h=message-id:date:mime-version:cc:subject:to:references: from:in-reply-to:content-transfer-encoding; bh=7eD2UmuhPW/+ApwIW9GMlhMuZIHesbvVW8A7NKI8QOY=; b=nV1a2LlWGpJYj7L36YCtBK1+fxPjG5U+6d0zdM+CZtndyOwrnn7/VulQ alkpc6BMrEpO607gRzVU5G9yAstkwBnsVVvsZtm+RylxgFWAq+5Svc89h Nkj6jN16Pmf7EuNpGWi2rmZllMZebZTA9DQvmGiPDNcWR0QIhFCuqJJkW 9CexgF3f6iqHIikFqTMRMKbo5b5Jbo8rhdTqCgYnmhhId9JfPk3sM8otm yRg+a4PB/we/Yx2NfVzyLleuN0q8G6py8JCraY2n5WBSPsVizOpLWil+F CYenarS7ImJ5jnuyB+b49fsYZVgnEqNxaQV0+p2zHTwe43B3gfFfW4ly1 A==; X-CSE-ConnectionGUID: n6CurlpvSeS6SzWXDcQOBA== X-CSE-MsgGUID: NXz1JHeVQiigp/KvK30x7A== X-IronPort-AV: E=McAfee;i="6600,9927,11081"; a="16662317" X-IronPort-AV: E=Sophos;i="6.08,184,1712646000"; d="scan'208";a="16662317" Received: from fmviesa001.fm.intel.com ([10.60.135.141]) by orvoesa107.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 23 May 2024 18:11:10 -0700 X-CSE-ConnectionGUID: TP+9MNGVSm+rgXGYip3/Yg== X-CSE-MsgGUID: eaiXLBj7TkqBRQcgNjeoGw== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="6.08,184,1712646000"; d="scan'208";a="65065360" Received: from unknown (HELO [10.239.159.127]) ([10.239.159.127]) by fmviesa001.fm.intel.com with ESMTP; 23 May 2024 18:11:08 -0700 Message-ID: <44d4013d-5c25-40ba-a599-91eee6d50a8c@linux.intel.com> Date: Fri, 24 May 2024 09:09:11 +0800 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Cc: baolu.lu@linux.intel.com, David Woodhouse , Joerg Roedel , Will Deacon , Robin Murphy Subject: Re: [PATCH 2/3] iommu/vt-d: Use try_cmpxchg64() in intel_pasid_get_entry() To: Uros Bizjak , iommu@lists.linux.dev, linux-kernel@vger.kernel.org References: <20240522082729.971123-1-ubizjak@gmail.com> <20240522082729.971123-2-ubizjak@gmail.com> Content-Language: en-US From: Baolu Lu In-Reply-To: <20240522082729.971123-2-ubizjak@gmail.com> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit On 5/22/24 4:26 PM, Uros Bizjak wrote: > Use try_cmpxchg64() instead of cmpxchg64 (*ptr, old, new) != old in > intel_pasid_get_entry(). cmpxchg returns success in ZF flag, so > this change saves a compare after cmpxchg (and related move > instruction in front of cmpxchg). > > Signed-off-by: Uros Bizjak > Cc: David Woodhouse > Cc: Lu Baolu > Cc: Joerg Roedel > Cc: Will Deacon > Cc: Robin Murphy > --- > drivers/iommu/intel/pasid.c | 7 +++++-- > 1 file changed, 5 insertions(+), 2 deletions(-) Reviewed-by: Lu Baolu Best regards, baolu