Skip to contentSkip to conversation

Handle sparc-leon SRMMU specific bug

PATCH In review Konrad Eisele 2 participants 3 messages Jun 9, 2009 – Jun 10, 2009 SPARC + UltraSPARC (sparc/sparc64)

lore
Share & tools
lore
#0 lore raw

PATCH 6/7 Handle sparc-leon SRMMU specific bug

From f95779d3a4d478d9df1070cc54a42163993f3b97 Mon Sep 17 00:00:00 2001
From: Konrad Eisele <[email protected]>
Date: Tue, 9 Jun 2009 13:05:17 +0200
Subject: [PATCH 6/7] Handle sparc-leon SRMMU specific bug. Shielded by CONFIG_LEON.

---
 arch/sparc/mm/fault_32.c |    6 +++++-
 1 files changed, 5 insertions(+), 1 deletions(-)
arch/sparc/mm/fault_32.c +5 -1
index 12e447f..602eb82 100644
@@ -227,7 +227,11 @@ asmlinkage void do_sparc_fault(struct pt
 	 */
 good_area:
 	info.si_code = SEGV_ACCERR;
-	if(write) {
+	if (write
+#ifdef CONFIG_LEON
+	   && !text_fault
+#endif
+	   ) {
 		if(!(vma->vm_flags & VM_WRITE))
 			goto bad_area;
 	} else {
Signature · 1 line
1.4.2.1

From f95779d3a4d478d9df1070cc54a42163993f3b97 Mon Sep 17 00:00:00 2001
From: Konrad Eisele <[email protected]>
Date: Tue, 9 Jun 2009 13:05:17 +0200
Subject: [PATCH 6/7] Handle sparc-leon SRMMU specific bug. Shielded by CONFIG_LEON.

---
 arch/sparc/mm/fault_32.c |    6 +++++-
 1 files changed, 5 insertions(+), 1 deletions(-)
arch/sparc/mm/fault_32.c +5 -1
index 12e447f..602eb82 100644
@@ -227,7 +227,11 @@ asmlinkage void do_sparc_fault(struct pt
 	 */
 good_area:
 	info.si_code = SEGV_ACCERR;
-	if(write) {
+	if (write
+#ifdef CONFIG_LEON
+	   && !text_fault
+#endif
+	   ) {
 		if(!(vma->vm_flags & VM_WRITE))
 			goto bad_area;
 	} else {
Signature · 1 line
1.4.2.1
#1 lore raw
Quoted 18 lines · Konrad Eisele

From f95779d3a4d478d9df1070cc54a42163993f3b97 Mon Sep 17 00:00:00 2001
From: Konrad Eisele <[email protected]>
Date: Tue, 9 Jun 2009 13:05:17 +0200
Subject: [PATCH 6/7] Handle sparc-leon SRMMU specific bug. Shielded by CONFIG_LEON.

---
 arch/sparc/mm/fault_32.c |    6 +++++-
 1 files changed, 5 insertions(+), 1 deletions(-)
arch/sparc/mm/fault_32.c +0 -0
index 12e447f..602eb82 100644
@@ -227,7 +227,11 @@ asmlinkage void do_sparc_fault(struct pt
 	 */
 good_area:

arch/sparc/mm/fault_32.c asmlinkage void do_sparc_fault(struct pt · line 237

Quoted 10 lines
arch/sparc/mm/fault_32.c +5 -1
 	info.si_code = SEGV_ACCERR;
-	if(write) {
+	if (write
+#ifdef CONFIG_LEON
+	   && !text_fault
+#endif
+	   ) {
 		if(!(vma->vm_flags & VM_WRITE))
 			goto bad_area;
 	} else {

We do not break up an if like this.
And you need to comment on this.
Consider using an inline helper function or similar to avoid obscufating the code.

Sam

#2 lore raw

PATCH 6/7 Handle sparc-leon SRMMU specific bug. Shielded by CONFIG_SPARC_LEON.

In reply to Konrad Eisele

From: Konrad Eisele <[email protected]>

Quoted 4 lines
Quoted 4 lines
(quoted diff) +4 -0
+#ifdef CONFIG_LEON
+	   && !text_fault
+#endif
+	   ) {
Quoted 9 lines

Review

Quoted 3 lines
(quoted diff) +0 -0
 		if(!(vma->vm_flags & VM_WRITE))
 			goto bad_area;
 	} else {

We do not break up an if like this.
And you need to comment on this.
Consider using an inline helper function or similar to avoid obscufating the code.

I added a additional comment.

---
 arch/sparc/mm/fault_32.c |    9 ++++++++-
 1 files changed, 8 insertions(+), 1 deletions(-)
arch/sparc/mm/fault_32.c +8 -1
index 12e447f..99c1e29 100644
@@ -227,7 +227,14 @@ asmlinkage void do_sparc_fault(struct pt
 	 */
 good_area:
 	info.si_code = SEGV_ACCERR;
-	if(write) {
+	if (write
+#ifdef CONFIG_SPARC_LEON
+	    /* a hardware bug in the sparc-leon SRMMU makes icache
+	       text_fault look as if writing in certain sparc-leon
+	       versions */
+	   && !text_fault
+#endif
+	   ) {
 		if(!(vma->vm_flags & VM_WRITE))
 			goto bad_area;
 	} else {
Signature · 1 line
1.4.2.1