Received: by 2002:a05:6902:102b:0:0:0:0 with SMTP id x11csp3673873ybt; Tue, 23 Jun 2020 08:07:22 -0700 (PDT) X-Google-Smtp-Source: ABdhPJynBBz7pqb1BAkfkvYlaZ2NvnA2z7earT6OezmNpxVrV4svP8+ms2wREa91gq4hoikm1GJX X-Received: by 2002:aa7:c14e:: with SMTP id r14mr16477110edp.0.1592924842362; Tue, 23 Jun 2020 08:07:22 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1592924842; cv=none; d=google.com; s=arc-20160816; b=kpMYvxMaIn944CiqbzcNOMVqJZNpJz5Ri6UR2nGO6CkHAiO+fTcCknXChvox1JjJj3 1EiKzyYfGbrUJqTudH5yPVTNsgH69DG2A2YKxAA1MjINsoM9SIx8GqIE/8ooHimSynAI bbLlO0Otgi2iAnmTPGqECZGgyhbM8Q6y+5tWyBK2sYL2dEnnyVHfHXPLk4J1dlVcu3AT pZGJY2TgJ70dv6V6O4vCK4d9US3iwLS6Td0ILSfbNLQY4B5VKpiFyaYOoxgUGi50P3pA NMfK7gyDOKxcgEF9wqnn0GaR8GXisQ7Ztfbwi+PYu3kFCH0EXNXDT0Fsjan9CpPQj42F MCdQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:in-reply-to:content-transfer-encoding :content-disposition:mime-version:message-id:subject:cc:to:from:date :dkim-signature; bh=bsfQ52FlJ6oZZDlXeYLKQzTdhMn8a+oCb2wQ0IQYsKA=; b=y0mVMpoU86ndg6IO2NeHVGeTjZl30R5OGRQFuFnhKhBTTCbmn3GnpqUY0t0njEJ+Qu Ijl2XZNfURs+7IZs3hgcaf+JgTXHdneIYJc2SgX2aGUMYN2mRM2hwuTB4pF60l1S+1fK SGko46E219EbMXWeYJ58l76/UaYva21ftyAyUs5ZDg83rmtLABuTEdfFTqCETu3AlZeC qtkmNid8znfMmfKsSrxtGivfZsOnP5OJIDai+6GPHCwrxxMGW0e/yR/NIpIs7pXFW+C/ PiRnEgnPNFAQM8kGflIwY6zqd/hv2jxhDQMO7Yz/7Vsd4V+Fek9sJXEmCTyFmzmjWOla wH1Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=uyCRgzzn; 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 o11si11709332ejc.714.2020.06.23.08.06.57; Tue, 23 Jun 2020 08:07:22 -0700 (PDT) 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=default header.b=uyCRgzzn; 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 S1733004AbgFWPEa (ORCPT + 99 others); Tue, 23 Jun 2020 11:04:30 -0400 Received: from mail.kernel.org ([198.145.29.99]:41322 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1732946AbgFWPE3 (ORCPT ); Tue, 23 Jun 2020 11:04:29 -0400 Received: from localhost (mobile-166-170-222-206.mycingular.net [166.170.222.206]) (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 94EC420723; Tue, 23 Jun 2020 15:04:28 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1592924669; bh=pYSmEX90OpGgB4bw3JQlLwOPKGPZt8zcCg2Jw+YWJhM=; h=Date:From:To:Cc:Subject:In-Reply-To:From; b=uyCRgzznNIaGzwTA5WSAD0mfkUx7PWjjDA0xuNRfK8wdFyqid6COQmfVRcULXo7eB x6r9H+xRROcynvqijhjGKwufYcigaaHtOMvN1NklZTodXP7DkrU83liurSsGCNLFtO sRrkKEDXRbWwc9kz0no38z13LtKl0kt/Ne0JEuNE= Date: Tue, 23 Jun 2020 10:04:27 -0500 From: Bjorn Helgaas To: Zhangfei Gao Cc: 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, Wangzhou , "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: <20200623150427.GA2403606@bjorn-Precision-5520> MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: Sender: linux-crypto-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-crypto@vger.kernel.org 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. - 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.