From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751908AbcBWMN3 (ORCPT ); Tue, 23 Feb 2016 07:13:29 -0500 Received: from mail-wm0-f54.google.com ([74.125.82.54]:34561 "EHLO mail-wm0-f54.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751141AbcBWMN1 (ORCPT ); Tue, 23 Feb 2016 07:13:27 -0500 Subject: Re: [PATCH v3 00/11] KVM: x86: track guest page access To: "Tian, Kevin" , "Song, Jike" , Xiao Guangrong References: <1455449503-20993-1-git-send-email-guangrong.xiao@linux.intel.com> <56C703C3.5070201@redhat.com> <56CADD6D.2040603@linux.intel.com> <56CBCBC1.8050902@intel.com> Cc: "gleb@kernel.org" , "mtosatti@redhat.com" , "kvm@vger.kernel.org" , "linux-kernel@vger.kernel.org" , "kai.huang@linux.intel.com" , Andrea Arcangeli , "Alex Williamson (alex.williamson@redhat.com)" From: Paolo Bonzini Message-ID: <56CC4CE2.1020209@redhat.com> Date: Tue, 23 Feb 2016 13:13:22 +0100 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:38.0) Gecko/20100101 Thunderbird/38.5.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 23/02/2016 06:44, Tian, Kevin wrote: >> From: Song, Jike >> Sent: Tuesday, February 23, 2016 11:02 AM >> >> +Kevin >> >> On 02/22/2016 06:05 PM, Xiao Guangrong wrote: >>> >>> On 02/19/2016 08:00 PM, Paolo Bonzini wrote: >>>> >>>> I still have a doubt: how are you going to handle invalidation of GPU >>>> shadow page tables if a device (emulated in QEMU or even vhost) does DMA >>>> to the PPGTT? >>> >>> I think Jike is the better one to answer this question, Jike, could you >>> please clarify it? :) >>> >> >> Sure :) >> >> Actually in guest PPGTT is manipulated by CPU rather than GPU. The >> PPGTT page table itself are plain memory, composed & modified by the >> GPU driver, i.e. by CPU in Non-Root mode. >> >> Given that, we write-protected guest PPGTT, when VM writes PPGTT, EPT >> violation rather than DMA fault happens. > > 'DMA to PPGTT' is NOT SUPPORTED on our vGPU device model. Today > Intel gfx driver doesn't use this method, and we explicitly list it as a > guest driver requirement to support a vGPU. If a malicious driver does > program DMA to modify PPGTT, it can only modify guest PPGTT instead > of shadow PPGTT (being guest invisible). So there is no security issue > either. Ok, thanks for confirming. Paolo