Skip to contentSkip to conversation

Copy full soft PMD in fault handler

sparc32 Keith M Wesolowski 2 participants 2 messages Feb 2, 2004 SPARC + UltraSPARC (sparc/sparc64)

lore
Share & tools
lore
#0 lore raw

sparc_do_fault assumes that pmd_val(*pmd) = pmd_val(*pmd_k) will duplicate a PMD entry. With large soft-PMDs this doesn't work.

Is this ok? Specifically I'm wondering whether it's necessary to use swap here is in pmd_set. The comment in the i386 handler "Do _not_ use "tsk" here. We might be inside an interrupt in the middle of a task switch.." doesn't make me feel too good about this function's health and well-being either, since we use tsk.

# This is a BitKeeper generated patch for the following project:
# Project Name: Linux kernel tree
# This patch format is intended for GNU patch command version 2.5 or higher. # This patch includes the following deltas:
# ChangeSet 1.1551 -> 1.1552
# arch/sparc/mm/fault.c 1.15 -> 1.16
#
# The following is the BitKeeper ChangeSet Log
# --------------------------------------------
# 04/02/02 [email protected] 1.1552
# Copy all 16 sub-pmd-entries, not just the first one.
# --------------------------------------------
#

arch/sparc/mm/fault.c +1 -1
diff -Nru a/arch/sparc/mm/fault.c b/arch/sparc/mm/fault.c
@@ -392,7 +392,7 @@
 
 		if (pmd_present(*pmd) || !pmd_present(*pmd_k))
 			goto bad_area_nosemaphore;
-		pmd_val(*pmd) = pmd_val(*pmd_k);
+		*pmd = *pmd_k;
 		return;
 	}
 }
Signature · 1 line
Keith M Wesolowski
#1 lore raw
Quoted 4 lines · On Mon, 2 Feb 2004 01:43:47 -0800 Keith M Wesolowski <[email protected]>…

sparc_do_fault assumes that pmd_val(*pmd) = pmd_val(*pmd_k) will duplicate a PMD entry. With large soft-PMDs this doesn't work.

Is this ok?

I think this patch is just fine.

Quoted 4 lines

The comment in the i386 handler "Do _not_
use "tsk" here. We might be inside an interrupt in the middle of a task switch.." doesn't make me feel too good about this function's health and well-being either, since we use tsk.

I think it does not apply to sparc, on sparc we disable interrupts during the context switch so that it "appears" atomic. But actually you should change it over to use init_mm.pgd just like other platforms merely for consistency.