Received: by 2002:ad5:4acb:0:0:0:0:0 with SMTP id n11csp4557842imw; Tue, 19 Jul 2022 08:47:56 -0700 (PDT) X-Google-Smtp-Source: AGRyM1tnm4g7/xwQRzpQGc/sKi2diEGmqV+v9xNNK2JFtk2s4SR7cA9OJcDlklDp3SaO5XH+zNuJ X-Received: by 2002:a17:907:a067:b0:72b:8f93:dff with SMTP id ia7-20020a170907a06700b0072b8f930dffmr30686389ejc.238.1658245675882; Tue, 19 Jul 2022 08:47:55 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1658245675; cv=none; d=google.com; s=arc-20160816; b=K3CnqQq61KV99M8WPQlNkvetcH79eW6HBLLK7Pl4uaiWp9DL5lLBdpNGUMpuQit9RX BPKPgSt9w2OWMPAb+TXhOzt0+/RYZtqNYuobg8Cre2eD/ROd8j3Lse+pxcNcw6SgyaRe yg4W5or9ASybSyGBhVqvnDdDXvcW1sefKvWcgK6DtqWkTYttN20MjzENbCbdX+uQaIr0 TLAUT0uZ0qoK9udG+9I6j3ueoevuHDm4TSXE3kWjSwx2W5F4sjdiLHpGCzPXmhDChE6F P2cTUCnIzLhR5o4qk8W3ubowUkMF/LgoTwDFeEHg4IX1lxWSSbmKc8ziEu3fxN2Fotdt dgFg== 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 :references:message-id:subject:cc:to:from:date:dkim-signature; bh=+kqnEGuwdGL/9ka9VI5SH5OR/R6+4E4AxuYZiFP6QOA=; b=czfKQg4jlN21NrD6vqJro8tWrFEZz2w9Wtki4AmHV+b53r7xAY9WSKrTaFXKlk5mjb M5wW+prtrqGXvEYlesdU3vYbL+mk1g6DJ0eRhCyIJ7dYcOMRAkGSOcH8Qnbf0qZOaL+f /26oGzN1gYUYIa/PJ1kN9u1B9uOOehz9Trg21+Tw+OJzdOUc37vO74urRKgqUGjI0vzN bC5z52eHHDE6m2Zf7iJUhUf/9AMpGOCdzf2hKHfNylR2lZ7e/crcceHQqn0YLyTqK2Pc HuxAM+dZ8ETXrmv6nyq+nUN3FH+UEe2RBvCs1V2nzqANSWDmd/M6hmEG3n03vx7OX4lY T7wg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@google.com header.s=20210112 header.b=DgwVaZAu; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id g14-20020a056402090e00b0043b92aaa91dsi2303746edz.540.2022.07.19.08.47.28; Tue, 19 Jul 2022 08:47:55 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@google.com header.s=20210112 header.b=DgwVaZAu; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S238442AbiGSPqS (ORCPT + 99 others); Tue, 19 Jul 2022 11:46:18 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:49018 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S238441AbiGSPqO (ORCPT ); Tue, 19 Jul 2022 11:46:14 -0400 Received: from mail-wm1-x32d.google.com (mail-wm1-x32d.google.com [IPv6:2a00:1450:4864:20::32d]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id D27A15466B for ; Tue, 19 Jul 2022 08:46:13 -0700 (PDT) Received: by mail-wm1-x32d.google.com with SMTP id h14-20020a1ccc0e000000b0039eff745c53so9421736wmb.5 for ; Tue, 19 Jul 2022 08:46:13 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20210112; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to; bh=+kqnEGuwdGL/9ka9VI5SH5OR/R6+4E4AxuYZiFP6QOA=; b=DgwVaZAuXJgpKNuo/mQO2VpGOFldoshJHhrRh5+WU47YO4bxB8XHgjPKF21snVQzEh AF0W9yap/1oEQ/9DrgFLEaueqzmGPcWUpTID9Brn4WnnglQsXQHTf5a93fYYNLyl/cco wg3vW0w2ovG5u9qiKjg5/P1kUCFlXbYrX5sXivV8yr2Ue/tucgeQGtRXM/7YmPYucGjw h/5BFS7p7tI8/NZ1Vjr15C1Hs6yQaKWwTrR8nzIygGECEEvjNC7tKwUAvNK9Cw1mEtYT cAzMdcxfh5L4mbcUvT6SkEEMR6ICELlFQ1AU48lFdG1uCq+FDDjaLySKsnG9b9mH7exM p2PQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to; bh=+kqnEGuwdGL/9ka9VI5SH5OR/R6+4E4AxuYZiFP6QOA=; b=wbmp0Wq2DWlQyTJBuICOEwkgOkTSB15Ib0DDMl5a8QDSqUVSN1qL1CpcwB965wGX5F qOs0Q4u0jn3KZ21ymzDF/uTCmDaJkjd/773yONTRYoVJTgVMJ2n2gYbC1IOX5r8Je403 RyCWgzpR+dFksZpohRT/X4Az98dVcsh0HFgQUkE5E7GnnfjdjuwI0/tJ2OHDUmx18HaE wr/UCSWYH8YI44+BgfGVOAxZj/KMD23HypknQ2TvzFC8Ld1GUd4dK8zkELF9fSktySbM 9l9RSH21plOClu5hlUKlbhN0Z41qK1bCMJUDIicHIzBp0Dal9o037fqsLX6wbNv3qypQ wfXQ== X-Gm-Message-State: AJIora+4ikLHDQ9Kf1hiHKNTyY7EppHWnZQp1W/lA1OWBpxf0sbv+dvE vN8LsT/CSXo5R0rz26f157U9EQ== X-Received: by 2002:a05:600c:190d:b0:3a0:585a:256 with SMTP id j13-20020a05600c190d00b003a0585a0256mr29780283wmq.54.1658245572362; Tue, 19 Jul 2022 08:46:12 -0700 (PDT) Received: from google.com (88.140.78.34.bc.googleusercontent.com. [34.78.140.88]) by smtp.gmail.com with ESMTPSA id t4-20020a1c7704000000b003a308e9a192sm16733494wmi.30.2022.07.19.08.46.11 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 19 Jul 2022 08:46:11 -0700 (PDT) Date: Tue, 19 Jul 2022 15:46:08 +0000 From: Keir Fraser To: Christoph Hellwig Cc: "Michael S. Tsirkin" , Jason Wang , kernel-team@android.com, virtualization@lists.linux-foundation.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH] virtio: Force DMA restricted devices through DMA API Message-ID: References: <20220719100256.419780-1-keirf@google.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: X-Spam-Status: No, score=-17.6 required=5.0 tests=BAYES_00,DKIMWL_WL_MED, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF, ENV_AND_HDR_SPF_MATCH,RCVD_IN_DNSWL_NONE,SPF_HELO_NONE,SPF_PASS, USER_IN_DEF_DKIM_WL,USER_IN_DEF_SPF_WL autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, Jul 19, 2022 at 08:23:28AM -0700, Christoph Hellwig wrote: > On Tue, Jul 19, 2022 at 10:02:56AM +0000, Keir Fraser wrote: > > +#include > > Drivers must never use this header. We have a few pre-existing abuses > in the drm code, but they will go away. > Ok fair enough, and I'll admit I don't like my use of swiotlb_for_alloc() a lot either. However, if the general idea at least is acceptable, would the implementation be acceptable if I add an explicit API for this to the DMA subsystem, and hide the detail there? Or a completely different approach would be to revert the patch e41b1355508d which clears VIRTIO_F_ACCESS_PLATFORM in the balloon driver. MST: That's back in your court, as it's your patch!