Received: by 2002:ac0:a582:0:0:0:0:0 with SMTP id m2-v6csp2227447imm; Thu, 18 Oct 2018 11:02:00 -0700 (PDT) X-Google-Smtp-Source: ACcGV63Z+d+DxxMZkyprGCOU19PKQIDkImM0p20O/0Hl+V/asTKsHfUaOh4oiXFEXcYqMrbHMyrW X-Received: by 2002:a17:902:48:: with SMTP id 66-v6mr31052265pla.7.1539885720906; Thu, 18 Oct 2018 11:02:00 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1539885720; cv=none; d=google.com; s=arc-20160816; b=X/Oy8oIkd/2HDlpFS9bxgfNHiZky8pb94xmgMgcv2PVCDUFgD7KfgtEQXYfKnOc/Y2 83RsMqt5eYos4w4n0zzvj8swr8giQRnIMagX1hQPi12nUrJYf8yKVQ2C9yfHlUu5P2f2 NLw8hcuKgTh07oZ6csc3AbyWBTup/yW/wDZ7jwNMJg322WrbquqCP68GG4u6IaK/rzxa Rljlt85Ho/3OS/cvK9l4YL/tgkHY6spGhwrS0XZiT3bdEGA4LmJo7jTP3qBkdsXU9E9C 6s/eA/zxv9OwJSHYlMF8rem82lGng4oYTV9pdy+eG47barDFBsw15K8RXgoQsN0vGmb8 sK2w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=3RBlt0q7wlKOzD99qTMFlzd+nhlRqfgqmFVvBO3hC9Y=; b=fW79UqoEuprvyuVvj+1MSQNrSgqErynS5hPrhPiZNARllZOHuJjSuyq7eekq8DtJ0r N/qaD9Vy02evFKkNN7BHuNtySt/KycVWpk1uSNbhW1U1MdUOWuuVVdEr9z4KJ5Ft8i3b qRe1OdcKFysMF0gjoh+xxNUfxzvEfjUjp1CSBlyOEYUKkcACDvQ6HvnuB7SZnVl/vgad CH73T0N66NCKLvuqcWVSFZb4zv1Hj6tWSj/psUdZKObiTZ5M9WCIByNVlyhOoeoj3oSx rvt4GmHIb6JaC05tGJCqVoeJbJ8MCIB23ICYDvGNcfqOp7GpCI2aEun6W80ARF2FP2Z8 +2Ew== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=GcfCNg+d; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id 3-v6si20348679plx.33.2018.10.18.11.01.45; Thu, 18 Oct 2018 11:02:00 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=GcfCNg+d; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729213AbeJSCB3 (ORCPT + 99 others); Thu, 18 Oct 2018 22:01:29 -0400 Received: from mail.kernel.org ([198.145.29.99]:49122 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728438AbeJSCB2 (ORCPT ); Thu, 18 Oct 2018 22:01:28 -0400 Received: from localhost (ip-213-127-77-176.ip.prioritytelecom.net [213.127.77.176]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id D909D21476; Thu, 18 Oct 2018 17:59:21 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1539885562; bh=tOidYsrbvzWGdohuUBvwktXVtb9jaquL69Ey8pG/YbQ=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=GcfCNg+dY1MLA9KXDbkH5xyEbc3vh3HuwuROjn/AVVJjmXuJd8SHqHanFMfiv9cdb rpkeTWwTL3i3iIswLdxJjGtxcKqv+QQy9xXgY9Mk9GdewzpWyFHBO/jIyFf+o+Do+z W9ar0E7NUQYMqUWltJaHRGxinKhFhvP8Gbzd/T2I= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Arindam Nath , Joerg Roedel , Sasha Levin Subject: [PATCH 4.18 48/53] iommu/amd: Return devid as alias for ACPI HID devices Date: Thu, 18 Oct 2018 19:54:41 +0200 Message-Id: <20181018175424.840403669@linuxfoundation.org> X-Mailer: git-send-email 2.19.1 In-Reply-To: <20181018175416.561567978@linuxfoundation.org> References: <20181018175416.561567978@linuxfoundation.org> User-Agent: quilt/0.65 X-stable: review MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 4.18-stable review patch. If anyone has any objections, please let me know. ------------------ From: Arindam Nath [ Upstream commit 5ebb1bc2d63d90dd204169e21fd7a0b4bb8c776e ] ACPI HID devices do not actually have an alias for them in the IVRS. But dev_data->alias is still used for indexing into the IOMMU device table for devices being handled by the IOMMU. So for ACPI HID devices, we simply return the corresponding devid as an alias, as parsed from IVRS table. Signed-off-by: Arindam Nath Fixes: 2bf9a0a12749 ('iommu/amd: Add iommu support for ACPI HID devices') Signed-off-by: Joerg Roedel Signed-off-by: Sasha Levin Signed-off-by: Greg Kroah-Hartman --- drivers/iommu/amd_iommu.c | 6 ++++++ 1 file changed, 6 insertions(+) --- a/drivers/iommu/amd_iommu.c +++ b/drivers/iommu/amd_iommu.c @@ -246,7 +246,13 @@ static u16 get_alias(struct device *dev) /* The callers make sure that get_device_id() does not fail here */ devid = get_device_id(dev); + + /* For ACPI HID devices, we simply return the devid as such */ + if (!dev_is_pci(dev)) + return devid; + ivrs_alias = amd_iommu_alias_table[devid]; + pci_for_each_dma_alias(pdev, __last_alias, &pci_alias); if (ivrs_alias == pci_alias)