Skip to contentSkip to conversation

x86-64 linux: another adjustment to vmalloc fault handling

PATCH In review Jan Beulich 2 participants 3 messages Feb 17, 2006

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 x86-64 linux: another adjustment to vmalloc fault handling

Changeset 8847 improved things, but doesn't generally work. We namely experienced problems (when we originally tried the same change) with accesses to machine_to_phys_mapping, which (in mfn_to_pfn) is specifically allowed to fault. Hence there should not be attempts to fix up faults within the hypervisor range (as for any page table entries obtained there no m2p translation exists for the guest, resulting in bogus physical addresses getting used for further fault processing, frequently leading to nested faults).

Jan

linux-2.6-xen-sparse/arch/x86_64/mm/fault-xen.c +1 -1
@@ -371,7 +371,7 @@ asmlinkage void __kprobes do_page_fault(
 		 * entries.
 		 */
 		if (!(error_code & (PF_RSVD|PF_USER|PF_PROT)) &&
-		    address >= PAGE_OFFSET) {
+		    address >= HYPERVISOR_VIRT_END) {
 			if (vmalloc_fault(address) < 0)
 				goto bad_area_nosemaphore;
 			return;

_______________________________________________
Xen-devel mailing list
[email protected]
http://lists.xensource.com/xen-devel

#1 lore raw
Quoted 5 lines · Jan Beulich

Changeset 8847 improved things, but doesn't generally work. We namely experienced problems (when we originally tried the same change) with accesses to machine_to_phys_mapping, which (in mfn_to_pfn) is specifically allowed to fault. Hence there should not be attempts to fix up faults within the hypervisor range (as for any page table entries obtained there no m2p translation exists for the guest, resulting in bogus physical addresses getting used for further fault processing, frequently leading to nested faults).

But machine_to_phys_mapping == 0xffff800000000000 while PAGE_OFFSET == HYPERVISOR_VIRT_END == 0xffff880000000000.

So the patch doesn't really change anything, and machine_to_phys_mapping lives below both PAGE_OFFSET and HYPERVISOR_VIRT_END anyway.

-- Keir

#2 lore raw
Quoted 14 lines
Quoted 1 line
Quoted 1 line

Keir Fraser <[email protected]> 17.02.06 12:05:13 >>>

Quoted 9 lines · Jan Beulich

Changeset 8847 improved things, but doesn't generally work. We namely experienced problems (when we originally tried the
same change) with accesses to machine_to_phys_mapping, which (in mfn_to_pfn) is specifically allowed to fault. Hence
there should not be attempts to fix up faults within the hypervisor range (as for any page table entries obtained there
no m2p translation exists for the guest, resulting in bogus physical addresses getting used for further fault
processing, frequently leading to nested faults).

Quoted 6 lines

But machine_to_phys_mapping == 0xffff800000000000 while PAGE_OFFSET == HYPERVISOR_VIRT_END == 0xffff880000000000.

So the patch doesn't really change anything, and machine_to_phys_mapping lives below both PAGE_OFFSET and HYPERVISOR_VIRT_END anyway.

Oh, I'm sorry, I mixed up TASK_SIZE64 and PAGE_OFFSET (we had used the former initially, because it's being done similarly on i386). Between PAGE_OFFSET and HYPERVISOR_VIRT_END I just found using the latter here more correct, as PAGE_OFFSET is not required to live at HYPERVISOR_VIRT_END, but that should always be the boundary for checking.

Jan