From mboxrd@z Thu Jan 1 00:00:00 1970 From: Xiaofeng Ling Subject: Re: [PATCH]blkfront change to support unmodified linux Date: Mon, 05 Sep 2005 17:02:12 +0800 Message-ID: <431C0994.1040809@intel.com> References: <431BDA77.4020205@intel.com> <2cae6cf4b5de67a507637b24023d79b9@cl.cam.ac.uk> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit Return-path: In-Reply-To: <2cae6cf4b5de67a507637b24023d79b9@cl.cam.ac.uk> List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xensource.com Errors-To: xen-devel-bounces@lists.xensource.com To: Keir Fraser Cc: Ian Pratt , xen-devel List-Id: xen-devel@lists.xenproject.org Keir Fraser wrote: > > On 5 Sep 2005, at 06:41, Xiaofeng Ling wrote: > >> This patch is to make blkfront can work both in xen-linux and in >> unmodified guest which is shadow_model_translate enabled. > > > phys == machine from the p.o.v. of a shadow-translated guest, so why not > modify virt_to_mfn and friends appropriately? Sorry, I don't catch your meaning. vmx guest is in shadow-translate mode, and gpfn need to translate to mfn in hypervisor. see the macro: #define __gpfn_to_mfn(_d, gpfn) \ ({ \ ASSERT(current->domain == (_d)); \ (shadow_mode_translate(_d)) \ ? get_mfn_from_pfn(gpfn) \ : (gpfn); \ }) #define __gpfn_to_mfn_foreign(_d, gpfn) \ ( (shadow_mode_translate(_d)) \ ? gpfn_to_mfn_foreign(_d, gpfn) \ : (gpfn) ) So I rename virt_to_mfn to virt_to_xfn which means if not in shadow translate mode, it will do translate in guest. for vmx guest, don't need the translation in guest. What is your suggestion?