From mboxrd@z Thu Jan 1 00:00:00 1970 From: Muli Ben-Yehuda Subject: Re: [PATCH 4/4][VTD] vt-d specific files in KVM Date: Tue, 10 Jun 2008 17:56:38 +0300 Message-ID: <20080610145638.GF6702@il.ibm.com> References: <1FE6DD409037234FAB833C420AA843EC018831D5@orsmsx424.amr.corp.intel.com> <20080610102759.GG7307@il.ibm.com> <484E8EFC.10007@codemonkey.ws> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Cc: "Kay, Allen M" , kvm@vger.kernel.org, Amit Shah , Ben-Ami Yassour1 , Avi Kivity , Chris Wright , "Han, Weidong" To: Anthony Liguori Return-path: Received: from mtagate2.uk.ibm.com ([195.212.29.135]:16286 "EHLO mtagate2.uk.ibm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752682AbYFJO4r (ORCPT ); Tue, 10 Jun 2008 10:56:47 -0400 Received: from d06nrmr1407.portsmouth.uk.ibm.com (d06nrmr1407.portsmouth.uk.ibm.com [9.149.38.185]) by mtagate2.uk.ibm.com (8.13.8/8.13.8) with ESMTP id m5AEukOa134854 for ; Tue, 10 Jun 2008 14:56:46 GMT Received: from d06av02.portsmouth.uk.ibm.com (d06av02.portsmouth.uk.ibm.com [9.149.37.228]) by d06nrmr1407.portsmouth.uk.ibm.com (8.13.8/8.13.8/NCO v9.0) with ESMTP id m5AEujAh917652 for ; Tue, 10 Jun 2008 15:56:45 +0100 Received: from d06av02.portsmouth.uk.ibm.com (loopback [127.0.0.1]) by d06av02.portsmouth.uk.ibm.com (8.12.11.20060308/8.13.3) with ESMTP id m5AEuimB017913 for ; Tue, 10 Jun 2008 15:56:45 +0100 Content-Disposition: inline In-Reply-To: <484E8EFC.10007@codemonkey.ws> Sender: kvm-owner@vger.kernel.org List-ID: On Tue, Jun 10, 2008 at 09:26:04AM -0500, Anthony Liguori wrote: >> Checking against pfn_valid() isn't enough to differentiate between >> RAM and MMIO areas. I think the consensus was that we also need to >> check PageReserved(), i.e., >> >> if (pfn_valid(pfn) && !PageReserved(pfn_to_page(pfn))) ... >> > > When checking the error return of gfn_to_pfn(), you should use > is_error_pfn(). There's no need to differentiate mmio/ram pages in > the code, the goal is just error checking. I'd have to check the exact semantics of is_error_pfn() to see if it fits, since strictly speaking what we are doing is not checking pfn_to_page() for errors. We need to differentiate between gfns which represent RAM (which needs to be mapped into the VT-d page tables) and gfns which don't (e.g, slots which represent an MMIO region), which should not be mapped in the VT-d page tables. Cheers, Muli