From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-2.8 required=3.0 tests=HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,SPF_PASS,USER_AGENT_NEOMUTT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 8ABA8C4646A for ; Wed, 12 Sep 2018 07:25:47 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 3340F20866 for ; Wed, 12 Sep 2018 07:25:47 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 3340F20866 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=redhat.com Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726792AbeILM25 (ORCPT ); Wed, 12 Sep 2018 08:28:57 -0400 Received: from mx3-rdu2.redhat.com ([66.187.233.73]:33910 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1726412AbeILM25 (ORCPT ); Wed, 12 Sep 2018 08:28:57 -0400 Received: from smtp.corp.redhat.com (int-mx04.intmail.prod.int.rdu2.redhat.com [10.11.54.4]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 19555402333A; Wed, 12 Sep 2018 07:25:44 +0000 (UTC) Received: from sirius.home.kraxel.org (ovpn-116-66.ams2.redhat.com [10.36.116.66]) by smtp.corp.redhat.com (Postfix) with ESMTP id 79DEB2023416; Wed, 12 Sep 2018 07:25:42 +0000 (UTC) Received: by sirius.home.kraxel.org (Postfix, from userid 1000) id B846F11AB7; Wed, 12 Sep 2018 09:25:41 +0200 (CEST) Date: Wed, 12 Sep 2018 09:25:41 +0200 From: Gerd Hoffmann To: Jiandi An Cc: Dave Airlie , dri-devel , virtio-dev@lists.oasis-open.org, Dave Airlie , "open list:VIRTIO CORE, NET..." , LKML Subject: Re: [virtio-dev] [PATCH 2/2] drm/virtio: add iommu support. Message-ID: <20180912072541.nagfrr2dgy34szcx@sirius.home.kraxel.org> References: <20180829122026.27012-1-kraxel@redhat.com> <20180829122026.27012-3-kraxel@redhat.com> <9bf20fa1-3752-edd1-588c-e38cd166c3af@amd.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <9bf20fa1-3752-edd1-588c-e38cd166c3af@amd.com> User-Agent: NeoMutt/20180716 X-Scanned-By: MIMEDefang 2.78 on 10.11.54.4 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.11.55.6]); Wed, 12 Sep 2018 07:25:44 +0000 (UTC) X-Greylist: inspected by milter-greylist-4.5.16 (mx1.redhat.com [10.11.55.6]); Wed, 12 Sep 2018 07:25:44 +0000 (UTC) for IP:'10.11.54.4' DOMAIN:'int-mx04.intmail.prod.int.rdu2.redhat.com' HELO:'smtp.corp.redhat.com' FROM:'kraxel@redhat.com' RCPT:'' Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi, > I attempted to fix it in the ttm layer and here is the discussion > https://lore.kernel.org/lkml/b44280d7-eb13-0996-71f5-3fbdeb466801@amd.com/ > > The ttm maintainer Christian is suggesting to map and set ttm->pages as decrypted > right after ttm->pages are allocated. > > Just checking with you guys maybe there is a better way to handle this in > the virtio gpu layer instead of the common ttm layer. Could you guys shine some > light on this? Thanks. I think the tty layer is the right place to fix this. virtio just calls down to ttm for mappings. I think virtio should just hint to ttm using a flag in some struct, probably ttm_buffer_object or ttm_mem_type_manager, that the objects need decrypted mappings. cheers, Gerd