Thread (11 messages) flat view 11 messages, 5 authors, 2007-07-20

Re: [PATCH] Treat ISI faults as read faults on classic 32-bit PowerPC

From: Segher Boessenkool <hidden>
Date: 2007-07-19 18:46:10

Hmmm.  The dangling else clauses are pretty gross,
I hoped you wouldn't notice.  I guess I shouldn't have
commented them :-)

"It was the cleanest thing I could come up with".  Every
other thing I tried ended up as a maze of #ifdefs or some
incomprehensible cross-jumping mess; and I was aiming for
a minimal fix, too.

Or, perhaps, it was just a ploy to trick you into writing
a patch yourself.
and in fact we have
the same problem on POWER3 and RS64 processors
Right.  Too bad there is no public documentation for either :-/
(to be fair, we had
the problem before and didn't notice, but we should still fix it).
Yeah.
How about this instead?
It's the better way forward, consider my patch withdrawn :-)
-		if (!(vma->vm_flags & VM_EXEC))
+		/*
+		 * Allow execution from readable areas if the MMU does not
+		 * provide separate controls over reading and executing.
+		 */
+		if (!(vma->vm_flags & VM_EXEC) &&
+		    (cpu_has_feature(CPU_FTR_NOEXECUTE) ||
+		     !(vma->vm_flags & (VM_READ | VM_WRITE))))
 			goto bad_area;
Should you really be testing VM_READ|VM_WRITE, or should it just
be VM_READ?

Oh, and that conditional might benefit from being split into
two separate "if" statements, it's a bit hard to read this way.


Segher
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help