From mboxrd@z Thu Jan 1 00:00:00 1970 From: Steven Rostedt Subject: Re: Re: [PATCH] Fix >4G i386 PAE grant table interface Date: Sat, 04 Nov 2006 09:25:38 -0500 Message-ID: <454CA2E2.6060606@redhat.com> References: Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Return-path: In-Reply-To: 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: xen-devel@lists.xensource.com, Jan Beulich List-Id: xen-devel@lists.xenproject.org Keir Fraser wrote: > On 3/11/06 10:46 pm, "Steven Rostedt" wrote: > >> It's much worst than that! >> >> Without this patch, my patch is still broken. In the hypervisor this >> flag is checked, and will go down the wrong path when it is missing: > > The hypervisor remembers the flags for itself, so the kernel can only > confuse itself. Still, it was a bug. > Well the flag for the application map isn't the problem. But I do see missing the flag for contains pte is a problem. > int create_grant_host_mapping( u64 addr, unsigned long frame, unsigned int flags) { l1_pgentry_t pte = l1e_from_pfn(frame, GRANT_PTE_FLAGS); if ( (flags & GNTMAP_application_map) ) l1e_add_flags(pte,_PAGE_USER); if ( !(flags & GNTMAP_readonly) ) l1e_add_flags(pte,_PAGE_RW); if ( flags & GNTMAP_contains_pte ) return create_grant_pte_mapping(addr, pte, current); return create_grant_va_mapping(addr, pte, current); } int destroy_grant_host_mapping( u64 addr, unsigned long frame, unsigned int flags) { if ( flags & GNTMAP_contains_pte ) return destroy_grant_pte_mapping(addr, frame, current->domain); return destroy_grant_va_mapping(addr, frame, current); } So is there a difference between create_grant_pte_mapping and create_grant_va_mapping. As well as destroy_grant_pte_mapping and destroy_grant_va_mapping. So calling pte create, and then va destroy on the same mapping is not a bug? -- Steve