linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Jiandi An <jiandi@amd.com>
To: Gerd Hoffmann <kraxel@redhat.com>
Cc: Dave Airlie <airlied@gmail.com>,
	dri-devel <dri-devel@lists.freedesktop.org>,
	"virtio-dev@lists.oasis-open.org"
	<virtio-dev@lists.oasis-open.org>, Dave Airlie <airlied@linux.ie>,
	"open list:VIRTIO CORE,
	NET..."  <virtualization@lists.linux-foundation.org>,
	LKML <linux-kernel@vger.kernel.org>,
	"Lendacky, Thomas" <Thomas.Lendacky@amd.com>,
	"Singh, Brijesh" <brijesh.singh@amd.com>
Subject: Re: [virtio-dev] [PATCH 2/2] drm/virtio: add iommu support.
Date: Tue, 18 Sep 2018 17:51:28 +0000	[thread overview]
Message-ID: <5684a3fc-3605-7bb0-b0be-418c2ae702b5@amd.com> (raw)
In-Reply-To: <20180912072541.nagfrr2dgy34szcx@sirius.home.kraxel.org>



On 09/12/2018 02:25 AM, Gerd Hoffmann wrote:
>   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
> 

I tested this patch with non SEV guest.  It gives a blank black screen if booting
with swiotlb=force.  dma_sync is missing if dma op uses swiotlb as bounce
buffer.  I tried to put a dma_sync_sg_for_device() on virtio_gpu_object obj->pages-sgl
before VIRTIO_GPU_CMD_TRANSFER_TO_HOST_2D is sent.  This fixes the kernel console path.
Once display manger is kicked off for example (sudo systemctl start lightdm.service) and
resource id 3 gets created from user space down, it still gives a blank black screen.

In addition, I added dma_sync_sg_for_device() before sending VIRTIO_GPU_CMD_RESOURCE_FLUSH
and VIRTIO_GPU_CMD_SET_SCANOUT, still blank black screen after display manger is kicked off.

Do you know which path I'm still missing as far as VIRTIO_GPU_CMD goes?

Thanks
- Jiandi

  reply	other threads:[~2018-09-18 17:51 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <20180829122026.27012-1-kraxel@redhat.com>
2018-08-29 12:20 ` [PATCH 1/2] drm/virtio: add virtio_gpu_object_detach() function Gerd Hoffmann
2018-08-29 12:20 ` [PATCH 2/2] drm/virtio: add iommu support Gerd Hoffmann
2018-09-03 23:50   ` [virtio-dev] " Dave Airlie
2018-09-12  6:52     ` Jiandi An
2018-09-12  7:25       ` Gerd Hoffmann
2018-09-18 17:51         ` Jiandi An [this message]
2018-09-19  4:46           ` Gerd Hoffmann
2018-09-19  7:15             ` Jiandi An
2018-09-19 11:38               ` Gerd Hoffmann
2018-09-19 22:06                 ` Jiandi An
2018-09-20  6:32                   ` Gerd Hoffmann
2018-09-21  4:58                     ` Jiandi An
2018-09-21  5:47                       ` Gerd Hoffmann

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=5684a3fc-3605-7bb0-b0be-418c2ae702b5@amd.com \
    --to=jiandi@amd.com \
    --cc=Thomas.Lendacky@amd.com \
    --cc=airlied@gmail.com \
    --cc=airlied@linux.ie \
    --cc=brijesh.singh@amd.com \
    --cc=dri-devel@lists.freedesktop.org \
    --cc=kraxel@redhat.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=virtio-dev@lists.oasis-open.org \
    --cc=virtualization@lists.linux-foundation.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).