From owner-freebsd-hackers@FreeBSD.ORG Mon Mar 17 21:20:01 2014 Return-Path: Delivered-To: freebsd-hackers@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 5853711F for ; Mon, 17 Mar 2014 21:20:01 +0000 (UTC) Received: from mail-qa0-x22b.google.com (mail-qa0-x22b.google.com [IPv6:2607:f8b0:400d:c00::22b]) (using TLSv1 with cipher ECDHE-RSA-RC4-SHA (128/128 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 17C8CB0A for ; Mon, 17 Mar 2014 21:20:01 +0000 (UTC) Received: by mail-qa0-f43.google.com with SMTP id j15so5941329qaq.2 for ; Mon, 17 Mar 2014 14:20:00 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type; bh=3LLvbbCUOXiNvPh3IOP3f2gjQtPuj2xHvoD6mw8SS2Y=; b=dBqfY7EKIltWjbTINYatwahuzKDqIk25v4y+XAaHayI8bJbPHoRYralChABIrqZCSw 0ccUdyfInfEXJOLA/hCe+NrHIW/dax3zX0n0aFEPniZXcP1bt/jsfp1H9gTzTufL0OYP P4upHzLGOTEKhdUHlwKL1J+qwXbAYRzQuh3pM5v2rrFupTiHoXki4+jY9zmxL6pum6Lp 3HRmPAp7YFuTnK7SA3p+ZQUjdV6p1/RvZjT9sj/6R3uNQbK/DQF3RcXx93T/F5wgP20X fsED8+bH0wLkoAWASRlTm8CkzWkbH7tLFckOiNswZZPGBMinOghmx6rSLNa02GyTxDBM Q5AQ== MIME-Version: 1.0 X-Received: by 10.140.81.198 with SMTP id f64mr29208897qgd.38.1395091200306; Mon, 17 Mar 2014 14:20:00 -0700 (PDT) Received: by 10.140.87.74 with HTTP; Mon, 17 Mar 2014 14:20:00 -0700 (PDT) In-Reply-To: References: <20140316141216.GA21331@kib.kiev.ua> Date: Mon, 17 Mar 2014 14:20:00 -0700 Message-ID: Subject: Re: [PATCH] Support PCIe Alternative RID Interpretation (ARI) From: Neel Natu To: Ryan Stone Content-Type: text/plain; charset=ISO-8859-1 Cc: Konstantin Belousov , "freebsd-hackers@freebsd.org" X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 17 Mar 2014 21:20:01 -0000 Hi Ryan, On Sun, Mar 16, 2014 at 8:05 AM, Ryan Stone wrote: > On Sun, Mar 16, 2014 at 10:12 AM, Konstantin Belousov > wrote: >> This is expected, but it would break VT-d busdma, I think. >> >> This is not said in the VT-d spec about ARI, but I believe that >> DMAR would split the function number by 7-3/2-0 bits, same as for >> the non-ARI devices. Then the transactions will be translated by >> the wrong context. > > Ah, good catch. I took a quick look at the spec and the code, and I > believe that I see the problem. I think that the proper solution is > to add a new method, pcib_get_rid(), that returns (bus << 8) | (slot > << 5) | func for non-ARI devices and (bus << 8) | func for ARI > devices. Then we could add a pci_get_rid() that just calls the pcib > method, and the DMAR code could be changed to work in terms of the RID > instead of bus/slot/function. My reading of the spec is that VT-d is > really implemented in terms of the RID anyway, but the spec authors > took pains to give examples in terms of bus/slot/function because > that's how the software developers understand things. > > Do you know if bhyve's pci passthrough code uses the same code to add > DMAR entries as the busdma code? If not I'll have to track down how > bhyve does it because it would likely have the same problem. > bhyve has a different implementation of the VT-d driver although transitioning to x86/iommu is long overdue. In any case it seems that the VT-d implementation in bhyve will work fine with ARI enabled devices. best Neel >> From other minor notes, having additional line for "ARI enabled" >> message under bootverbose would make already excessive PCI config >> dump even more problematic. > > I can remove it. At the time I wanted some kind of indication that > ARI was being used, but pciconf can tell you that now so it's not > really necessary. > _______________________________________________ > freebsd-hackers@freebsd.org mailing list > http://lists.freebsd.org/mailman/listinfo/freebsd-hackers > To unsubscribe, send any mail to "freebsd-hackers-unsubscribe@freebsd.org"