All of lore.kernel.org
 help / color / mirror / Atom feed
From: Jason Wang <jasowang@redhat.com>
To: "Michael S. Tsirkin" <mst@redhat.com>
Cc: kvm@vger.kernel.org, virtualization@lists.linux-foundation.org,
	netdev@vger.kernel.org, linux-kernel@vger.kernel.org,
	Jintack Lim <jintack@cs.columbia.edu>
Subject: Re: [PATCH net V2 4/4] vhost: log dirty page correctly
Date: Mon, 24 Dec 2018 11:43:31 +0800	[thread overview]
Message-ID: <55b3d55a-950f-eeaf-1908-bed78a1a9200@redhat.com> (raw)
In-Reply-To: <20181214081821-mutt-send-email-mst@kernel.org>


On 2018/12/14 下午9:20, Michael S. Tsirkin wrote:
> On Fri, Dec 14, 2018 at 10:43:03AM +0800, Jason Wang wrote:
>> On 2018/12/13 下午10:31, Michael S. Tsirkin wrote:
>>>> Just to make sure I understand this. It looks to me we should:
>>>>
>>>> - allow passing GIOVA->GPA through UAPI
>>>>
>>>> - cache GIOVA->GPA somewhere but still use GIOVA->HVA in device IOTLB for
>>>> performance
>>>>
>>>> Is this what you suggest?
>>>>
>>>> Thanks
>>> Not really. We already have GPA->HVA, so I suggested a flag to pass
>>> GIOVA->GPA in the IOTLB.
>>>
>>> This has advantages for security since a single table needs
>>> then to be validated to ensure guest does not corrupt
>>> QEMU memory.
>>>
>> I wonder how much we can gain through this. Currently, qemu IOMMU gives
>> GIOVA->GPA mapping, and qemu vhost code will translate GPA to HVA then pass
>> GIOVA->HVA to vhost. It looks no difference to me.
>>
>> Thanks
> The difference is in security not in performance.  Getting a bad HVA
> corrupts QEMU memory and it might be guest controlled. Very risky.


How can this be controlled by guest? HVA was generated from qemu ram 
blocks which is totally under the control of qemu memory core instead of 
guest.


Thanks


>   If
> translations to HVA are done in a single place through a single table
> it's safer as there's a single risky place.
>

WARNING: multiple messages have this Message-ID (diff)
From: Jason Wang <jasowang@redhat.com>
To: "Michael S. Tsirkin" <mst@redhat.com>
Cc: Jintack Lim <jintack@cs.columbia.edu>,
	netdev@vger.kernel.org, linux-kernel@vger.kernel.org,
	kvm@vger.kernel.org, virtualization@lists.linux-foundation.org
Subject: Re: [PATCH net V2 4/4] vhost: log dirty page correctly
Date: Mon, 24 Dec 2018 11:43:31 +0800	[thread overview]
Message-ID: <55b3d55a-950f-eeaf-1908-bed78a1a9200@redhat.com> (raw)
In-Reply-To: <20181214081821-mutt-send-email-mst@kernel.org>


On 2018/12/14 下午9:20, Michael S. Tsirkin wrote:
> On Fri, Dec 14, 2018 at 10:43:03AM +0800, Jason Wang wrote:
>> On 2018/12/13 下午10:31, Michael S. Tsirkin wrote:
>>>> Just to make sure I understand this. It looks to me we should:
>>>>
>>>> - allow passing GIOVA->GPA through UAPI
>>>>
>>>> - cache GIOVA->GPA somewhere but still use GIOVA->HVA in device IOTLB for
>>>> performance
>>>>
>>>> Is this what you suggest?
>>>>
>>>> Thanks
>>> Not really. We already have GPA->HVA, so I suggested a flag to pass
>>> GIOVA->GPA in the IOTLB.
>>>
>>> This has advantages for security since a single table needs
>>> then to be validated to ensure guest does not corrupt
>>> QEMU memory.
>>>
>> I wonder how much we can gain through this. Currently, qemu IOMMU gives
>> GIOVA->GPA mapping, and qemu vhost code will translate GPA to HVA then pass
>> GIOVA->HVA to vhost. It looks no difference to me.
>>
>> Thanks
> The difference is in security not in performance.  Getting a bad HVA
> corrupts QEMU memory and it might be guest controlled. Very risky.


How can this be controlled by guest? HVA was generated from qemu ram 
blocks which is totally under the control of qemu memory core instead of 
guest.


Thanks


>   If
> translations to HVA are done in a single place through a single table
> it's safer as there's a single risky place.
>
_______________________________________________
Virtualization mailing list
Virtualization@lists.linux-foundation.org
https://lists.linuxfoundation.org/mailman/listinfo/virtualization

  reply	other threads:[~2018-12-24  3:43 UTC|newest]

Thread overview: 45+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-12-12 10:08 [PATCH net V2 0/4] Fix various issue of vhost Jason Wang
2018-12-12 10:08 ` [PATCH net V2 1/4] vhost: make sure used idx is seen before log in vhost_add_used_n() Jason Wang
2018-12-12 10:08 ` Jason Wang
2018-12-12 14:33   ` Michael S. Tsirkin
2018-12-12 14:33   ` Michael S. Tsirkin
2018-12-12 10:08 ` [PATCH net V2 2/4] vhost_net: switch to use mutex_trylock() in vhost_net_busy_poll() Jason Wang
2018-12-12 10:08 ` Jason Wang
2018-12-12 14:20   ` Michael S. Tsirkin
2018-12-12 14:20   ` Michael S. Tsirkin
2018-12-12 10:08 ` [PATCH net V2 3/4] Revert "net: vhost: lock the vqs one by one" Jason Wang
2018-12-12 14:24   ` Michael S. Tsirkin
2018-12-12 14:24   ` Michael S. Tsirkin
2018-12-13  2:27     ` Jason Wang
2018-12-13  2:27     ` Jason Wang
2018-12-12 10:08 ` Jason Wang
2018-12-12 10:08 ` [PATCH net V2 4/4] vhost: log dirty page correctly Jason Wang
2018-12-12 14:32   ` Michael S. Tsirkin
2018-12-13  2:39     ` Jason Wang
2018-12-13 14:31       ` Michael S. Tsirkin
2018-12-13 14:31       ` Michael S. Tsirkin
2018-12-14  2:43         ` Jason Wang
2018-12-14 13:20           ` Michael S. Tsirkin
2018-12-14 13:20           ` Michael S. Tsirkin
2018-12-24  3:43             ` Jason Wang [this message]
2018-12-24  3:43               ` Jason Wang
2018-12-24 17:41               ` Michael S. Tsirkin
2018-12-25  9:43                 ` Jason Wang
2018-12-25 16:25                   ` Michael S. Tsirkin
2018-12-25 16:25                     ` Michael S. Tsirkin
2018-12-26  5:43                     ` Jason Wang
2018-12-26  5:43                       ` Jason Wang
2018-12-26 13:46                       ` Michael S. Tsirkin
2018-12-26 13:46                       ` Michael S. Tsirkin
2018-12-27  9:32                         ` Jason Wang
2018-12-27  9:32                         ` Jason Wang
2018-12-25  9:43                 ` Jason Wang
2018-12-24 17:41               ` Michael S. Tsirkin
2018-12-14  2:43         ` Jason Wang
2018-12-13  2:39     ` Jason Wang
2018-12-12 14:32   ` Michael S. Tsirkin
2018-12-12 10:08 ` Jason Wang
2018-12-12 23:31 ` [PATCH net V2 0/4] Fix various issue of vhost David Miller
2018-12-12 23:31 ` David Miller
2018-12-13  2:42   ` Jason Wang
2018-12-13  2:42   ` Jason Wang

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=55b3d55a-950f-eeaf-1908-bed78a1a9200@redhat.com \
    --to=jasowang@redhat.com \
    --cc=jintack@cs.columbia.edu \
    --cc=kvm@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mst@redhat.com \
    --cc=netdev@vger.kernel.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.