From mboxrd@z Thu Jan 1 00:00:00 1970 From: Avi Kivity Subject: Re: [PATCH 0/6] MTRR/PAT support for EPT (v3) Date: Sun, 12 Oct 2008 11:47:05 +0200 Message-ID: <48F1C799.2080308@redhat.com> References: <1223539317-32379-1-git-send-email-sheng@linux.intel.com> <200810101046.48480.sheng@linux.intel.com> <48EEFAE9.4010606@redhat.com> <200810101516.06057.sheng@linux.intel.com> Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit Cc: kvm@vger.kernel.org To: Sheng Yang Return-path: Received: from mx2.redhat.com ([66.187.237.31]:57643 "EHLO mx2.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752122AbYJLJrJ (ORCPT ); Sun, 12 Oct 2008 05:47:09 -0400 In-Reply-To: <200810101516.06057.sheng@linux.intel.com> Sender: kvm-owner@vger.kernel.org List-ID: Sheng Yang wrote: > Yes... But it's easy to do with assigned devices' mmio, but what if guest > specific some non-mmio memory's memory type? E.g. we have met one issue in > Xen, that a assigned-device's XP driver specific one memory region as buffer, > and modify the memory type then do DMA. > > Only map MMIO space can be first step, but I guess we can modify assigned > memory region memory type follow guest's? > With ept/npt, we can't, since the memory type is in the guest's pagetable entries, and these are not accessible. Looks like a conflict between the requirements of a hypervisor supporting device assignment, and the memory type constraints of mapping everything with the same memory type. As far as I can see, the only solution is not to map guest memory in the hypervisor, and do all accesses via dma. This is easy for virtual disk, somewhat harder for virtual networking (need a dma engine or a multiqueue device). Since qemu will only access memory on demand, we don't actually have to unmap guest memory, only to ensure that qemu doesn't touch it. Things like live migration and page sharing won't work, but they aren't expected to with device assignment anyway. -- error compiling committee.c: too many arguments to function