From owner-freebsd-hackers@FreeBSD.ORG Sun Mar 30 19:43:24 2014 Return-Path: Delivered-To: freebsd-hackers@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id DA7AB513 for ; Sun, 30 Mar 2014 19:43:24 +0000 (UTC) Received: from mail-oa0-x22e.google.com (mail-oa0-x22e.google.com [IPv6:2607:f8b0:4003:c02::22e]) (using TLSv1 with cipher ECDHE-RSA-RC4-SHA (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 9EE8526B for ; Sun, 30 Mar 2014 19:43:24 +0000 (UTC) Received: by mail-oa0-f46.google.com with SMTP id i7so8392961oag.33 for ; Sun, 30 Mar 2014 12:43:24 -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=NiHssYvx55MqsAGHJQdrKniX0dWZErcXLhxxnIFy3PM=; b=edPue3XE7dMRmaUD0Cl38n8h+6E5OBkmnQ41gSf6OjN/xRitRj7dxBadiUVvu1/Cdm +w0nS3OKjAa8VkqSja5K4VAlUHbYmbYGbXCEryxzNyDh+81z5mAh7S7s8w8MohS6AAVo BhcHtRMTYQxHYI7F68+pnAoGrQFNUl1A2WDCFRaQmU7iN5TW5XbFC+XyHo8q/5xTsvf/ 2kM6YJBlgPkgwTj8XzWDu6uLTNkXFjFSkRChq5IVqoVB0ia29R1aRkQlVMocJh/LlzS4 3HLf3PMsEkEqCjOWYF527vPhOkEj5QmVR02C/ZLGBgguZDd5Z49ajFWBrW9Ot6RpsbP6 xVdg== MIME-Version: 1.0 X-Received: by 10.60.34.130 with SMTP id z2mr17931690oei.14.1396208603864; Sun, 30 Mar 2014 12:43:23 -0700 (PDT) Received: by 10.76.7.199 with HTTP; Sun, 30 Mar 2014 12:43:23 -0700 (PDT) In-Reply-To: <20140330142918.GF21331@kib.kiev.ua> References: <20140316141216.GA21331@kib.kiev.ua> <20140319140236.GM21331@kib.kiev.ua> <20140325211355.GG21331@kib.kiev.ua> <20140328133529.GV21331@kib.kiev.ua> <20140330142918.GF21331@kib.kiev.ua> Date: Sun, 30 Mar 2014 15:43:23 -0400 Message-ID: Subject: Re: [PATCH] Support PCIe Alternative RID Interpretation (ARI) From: Ryan Stone To: Konstantin Belousov Content-Type: text/plain; charset=ISO-8859-1 Cc: "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: Sun, 30 Mar 2014 19:43:24 -0000 On Sun, Mar 30, 2014 at 10:29 AM, Konstantin Belousov wrote: >> http://people.freebsd.org/~rstone/patches/ari/0002-Re-implement-the-DMAR-I-O-MMU-code-in-terms-of-PCI-R.patch > > I like this patch. > > One, trivial note, you do not need () there: > + ctxp += (ctx->rid & 0xff); > Done. Unfortunately I had to re-write it a bit to account for the changes in r263306. Mostly it was trivial, but there's one thing that I wasn't sure how best to handle. busdma_dmar.c currently calls dmar_bus_dma_is_dev_disabled with the bus/slot/function provided by dmar_get_requestor. That no longer works now that I've made the code be based on RIDs. What the patch currently does is use the bus/slot/function from the requester device. I think that's a little cleaner anyway because in one case the current code fakes up a slot and function. Using those values in the UI for forcing DMAR off for a device feels wrong to me (and difficult to document). However, my behaviour of forcing users to manually walk up the PCI tree to find the PCIe-PCI bridge is not really all that much better. If you have ideas here please let me know. The current version of the patch is in the same location.