Received: by 2002:a05:6a10:f347:0:0:0:0 with SMTP id d7csp1549742pxu; Thu, 17 Dec 2020 12:39:45 -0800 (PST) X-Google-Smtp-Source: ABdhPJwZEv/eFZhcSPL7AD4lUJxNK1ZZnId7Exc00PB3PL9Z+357TpxgvZ7B47Ag8udZ95TB73Yr X-Received: by 2002:a50:9991:: with SMTP id m17mr1221056edb.48.1608237585401; Thu, 17 Dec 2020 12:39:45 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1608237585; cv=none; d=google.com; s=arc-20160816; b=P9LZKmty90lpNE5IqWw2LFPUOH+soMA/fG96opvj+1MTGXGqvE9HiOJPPQrCMSPIIx KmpcOPI0GtkaGm0ZuOu1oAkHQqQjxgCULJnDdr6IFDi52s5Om/WvAmdnPn3BLSQYlKU3 udCTP7/gCJdw2/CuPcy91IgIBtuM67V8Z+/8ErMGX686luihbEkjZdWi7pK9U5eoA6yb s6D+l/hlsOUoHEK65s1KAkQOF6v8Wj+icHvKji54w5QPIT+cv5U2AmblXDJpWP77TeeH yJqUKkaT9pL/UXeega3+mFUmAeCQKXnTL+1w8efWOTOhm4TJZDs5LcaawF+S/btHlE88 os3Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :message-id:subject:cc:to:from:dkim-signature:date; bh=cXku8eDapj/Oe+kj1oeUc4pzJjd8chJ3dA3663OeJ60=; b=YmBhSioY0VNpt9g7S97lYhY9btH8M3Mak6YllfJu7tnkkux+F0oo7//VI29G+BibF9 rVUKPH+/oI9pRQJbqe3Gu73+S8Scp61clMBMdiTmUWZDJJBNzMTdxUWwqf2v/TOOGiET pIretZA1dIqBNZScQvNjHAk8APhR8MKcVn7KZYzMINCA+mu0DIV1TnvJ8ckL2uoZYeHV tKMhx3UG+HDU7IiBbT7rKpicI0oVvIc73vsJQBTS0C1r3lXgAMX/KJMmOhIIKtXXmVdR h4XF8xQ8tJDarsI6NFiky/vTVJ7fp4j7NCeez/Rd/puCTw5IwKsPma4n+djpIgbrW5y7 sqZg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=KqE949u4; spf=pass (google.com: domain of linux-crypto-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-crypto-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id n11si3473988ejg.660.2020.12.17.12.39.24; Thu, 17 Dec 2020 12:39:45 -0800 (PST) Received-SPF: pass (google.com: domain of linux-crypto-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=KqE949u4; spf=pass (google.com: domain of linux-crypto-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-crypto-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726988AbgLQUit (ORCPT + 99 others); Thu, 17 Dec 2020 15:38:49 -0500 Received: from mail.kernel.org ([198.145.29.99]:38340 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726951AbgLQUit (ORCPT ); Thu, 17 Dec 2020 15:38:49 -0500 Date: Thu, 17 Dec 2020 14:38:06 -0600 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1608237488; bh=Rpq08eYW+DA58q5pcS/wXU0VbVBc1vYow6lIlzk55rU=; h=From:To:Cc:Subject:In-Reply-To:From; b=KqE949u41Nqk8wZdC73imrPNhV6iDujEFjRfkVjZScfGg5NLARgNksvDkk54oZI9i mv/u6l2got64jOQ5WYUtngu2q9vI6xjHII+Jcy+PrjjE2gs1K6xgdwztx+nAvI4G2p D/IUTUhGXYUo0T11xN0y5dzNNoaIntqhsq2soJ1qJZmtzmxSv5ozHe2eIvw5XczDhw 7imXx7N9zkX5LZaNE/XBXWbLBfgxWdq6WNk63Vd9f31kXpIWOfBj6C4mP+2GZruhTz M32DBRPOd7HuNC1U2xW9CiDgiKPo9i9u/PExMcMNgvaVJ1cxp2OOgAAkXwohRF2CCU mV7YA0/SGEecA== From: Bjorn Helgaas To: Zhou Wang Cc: Zhangfei Gao , Arnd Bergmann , Joerg Roedel , Bjorn Helgaas , Lorenzo Pieralisi , Hanjun Guo , Sudeep Holla , "Rafael J. Wysocki" , Len Brown , jean-philippe , Greg Kroah-Hartman , Herbert Xu , kenneth-lee-2012@foxmail.com, "linux-kernel@vger.kernel.org" , "open list:HARDWARE RANDOM NUMBER GENERATOR CORE" , "open list:IOMMU DRIVERS" , ACPI Devel Maling List , Linux ARM , linux-pci , Thanu Rangarajan , Souvik Chakravarty , wanghuiqiang Subject: Re: [PATCH 0/2] Introduce PCI_FIXUP_IOMMU Message-ID: <20201217203806.GA20785@bjorn-Precision-5520> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <5FD9EE6E.1040505@hisilicon.com> Precedence: bulk List-ID: X-Mailing-List: linux-crypto@vger.kernel.org On Wed, Dec 16, 2020 at 07:24:30PM +0800, Zhou Wang wrote: > On 2020/6/23 23:04, Bjorn Helgaas wrote: > > On Fri, Jun 19, 2020 at 10:26:54AM +0800, Zhangfei Gao wrote: > >> Have studied _DSM method, two issues we met comparing using quirk. > >> > >> 1. Need change definition of either pci_host_bridge or pci_dev, like adding > >> member can_stall, > >> while pci system does not know stall now. > >> > >> a, pci devices do not have uuid: uuid need be described in dsdt, while pci > >> devices are not defined in dsdt. > >> so we have to use host bridge. > > > > PCI devices *can* be described in the DSDT. IIUC these particular > > devices are hardwired (not plug-in cards), so platform firmware can > > know about them and could describe them in the DSDT. > > > >> b, Parsing dsdt is in in pci subsystem. > >> Like drivers/acpi/pci_root.c: > >> obj = acpi_evaluate_dsm(ACPI_HANDLE(bus->bridge), &pci_acpi_dsm_guid, > >> 1, > >> IGNORE_PCI_BOOT_CONFIG_DSM, NULL); > >> > >> After parsing DSM in pci, we need record this info. > >> Currently, can_stall info is recorded in iommu_fwspec, > >> which is allocated in iommu_fwspec_init and called by iort_iommu_configure > >> for uefi. > > > > You can look for a _DSM wherever it is convenient for you. It could > > be in an AMBA shim layer. > > > >> 2. Guest kernel also need support sva. > >> Using quirk, the guest can boot with sva enabled, since quirk is > >> self-contained by kernel. > >> If using _DSM, a specific uefi or dtb has to be provided, > >> currently we can useQEMU_EFI.fd from apt install qemu-efi > > > > I don't quite understand what this means, but as I mentioned before, a > > quirk for a *limited* number of devices is OK, as long as there is a > > plan that removes the need for a quirk for future devices. > > > > E.g., if the next platform version ships with a DTB or firmware with a > > _DSM or other mechanism that enables the kernel to discover this > > information without a kernel change, it's fine to use a quirk to cover > > the early platform. > > > > The principles are: > > > > - I don't want to have to update a quirk for every new Device ID > > that needs this. > > Hi Bjorn and Zhangfei, > > We plan to use ATS/PRI to support SVA in future PCI devices. However, for > current devices, we need to add limited number of quirk to let them > work. The device IDs of current quirk needed devices are ZIP engine(0xa250, 0xa251), > SEC engine(0xa255, 0xa256), HPRE engine(0xa258, 0xa259), revision id are > 0x21 and 0x30. > > Let's continue to upstream these quirks! Please post the patches you propose. I don't think the previous ones are in my queue. Please include the lore URL for the previous posting(s) in the cover letter so we can connect the discussion. > > - I don't really want to have to manage non-PCI information in the > > struct pci_dev. If this is AMBA- or IOMMU-related, it should be > > stored in a structure related to AMBA or the IOMMU. > > . > >