Received: by 2002:a05:6902:102b:0:0:0:0 with SMTP id x11csp367518ybt; Fri, 26 Jun 2020 01:10:14 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxa35WioGDDLaYaSMIawsQ1GKDy9UVTrWcfOLDkPQAqB9GlJPaUNhw9N19TW/+coozbRJ8W X-Received: by 2002:aa7:cf02:: with SMTP id a2mr2145253edy.263.1593159014537; Fri, 26 Jun 2020 01:10:14 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1593159014; cv=none; d=google.com; s=arc-20160816; b=owpHWZkR64W42FaYh/NnvXLr7QixhjelThCuh6ueMgY4NU168InFbIEV5U4qAI2tlp puPmXHea2+WqLOxE9vQGh1Tl4gt0X9Ei82gTGbKNssPJet/YyK3gxXiNta0t0ib68msV jjlJ9rUboRhzIWvKWEmJweg78OXykrR5Ky/mGQ976IxV+aDhA4LxCh9lp/Op8hXH/3xd f08zG04oxpEk3N0f2mWrKx8HM8y3P9cXi9vo2c/u9nPsbD2uTF+dfRhd1BDAIDog5/wt KHScnKReTF5XP47zR+6YyWIQyszLjM/TMzLhjSQQegeU6Lq2a2+zbp/yEWkC2urFKnAz XxDw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:message-id:date:subject:cc:to:from; bh=4f9XSAsYXvkqp3/s/zvLW2usCPELhtI0om5BdV/LCHU=; b=Au6N+FrYlA1YbhkT69FE0SfBPBuTQBS2uyG9GsvbmP2YfpEsYzt8esdB9shKIW3c0K n2yg34oQ3atuoCm0UrfhkN5cGIMiga1PrpB+uYSRBKimxCDpM8nAWmgN7tprAMwcQ/yt s2c/xm+8F3qGK38c82PXhYK9Zggvyy2aZcV8VyxrYWSzgIqSSntPU6MqDK6Spg9wuMJ5 K2UdFA48a32mNlEsUTkBBNkmfSoJVGoI1SgyJK0U97u4FjZF5zCHS+nC5Y48Qpyh+Ode fh4KZd4oVWW9NaG06/s3j+e1hXnCg/P562ijwwfan3uK/NgbBHxM1XqJ8LqZl0rF5ee9 kWBQ== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=8bytes.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id s11si3195407eja.266.2020.06.26.01.09.52; Fri, 26 Jun 2020 01:10:14 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=8bytes.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729573AbgFZIIh (ORCPT + 99 others); Fri, 26 Jun 2020 04:08:37 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:40686 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729148AbgFZIFt (ORCPT ); Fri, 26 Jun 2020 04:05:49 -0400 Received: from theia.8bytes.org (8bytes.org [IPv6:2a01:238:4383:600:38bc:a715:4b6d:a889]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 80A20C08C5C1 for ; Fri, 26 Jun 2020 01:05:49 -0700 (PDT) Received: by theia.8bytes.org (Postfix, from userid 1000) id 55391451; Fri, 26 Jun 2020 10:05:48 +0200 (CEST) From: Joerg Roedel To: Joerg Roedel Cc: iommu@lists.linux-foundation.org, linux-kernel@vger.kernel.org, Suravee Suthikulpanit , Qian Cai , Joerg Roedel Subject: [PATCH v2 0/2] iommu/amd: Don't use atomic64_t for domain->pt_root Date: Fri, 26 Jun 2020 10:05:45 +0200 Message-Id: <20200626080547.24865-1-joro@8bytes.org> X-Mailer: git-send-email 2.17.1 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Joerg Roedel Hi, a previous discussion pointed out that using atomic64_t for that purpose is a bit of overkill. This patch-set replaces it with unsigned long and introduces some helpers first to make the change more easy. Qian, can you please test these patches in your environment? You can trigger any race-condition there pretty reliably :) Other than that, please review and test. Regards, Joerg Changed to v1: - Addressed review comments from Qian. Joerg Roedel (2): iommu/amd: Add helper functions to update domain->pt_root iommu/amd: Use 'unsigned long' for domain->pt_root drivers/iommu/amd/amd_iommu_types.h | 2 +- drivers/iommu/amd/iommu.c | 44 +++++++++++++++++++++-------- 2 files changed, 33 insertions(+), 13 deletions(-) -- 2.27.0