Skip to contentSkip to conversation

Correction of the TLB handling of the OpenRISC target

GIT PULL Jia Liu 2 participants 6 messages Oct 3, 2013 – Oct 14, 2013

lore
Share & tools
lore

Jia Liu

author
#0 lore raw

Hi Anthony,

This is my OpenRISC patch queue. It originally come from Sebastian Macke, split by me, and I used some comment come from Stefan Kristiansson.

Please pull.

This patch set correct two problems. The first one corrects one obvious bug concerning the handling of page faults while reading from a page. The second part removes a non-conforming behavior for the first page of the memory.

Sebastian have tested this patch with the newest Linux kernel and compared the output with or1ksim.

The following changes since commit a684f3cf9b9b9c3cb82be87aafc463de8974610c:

Merge remote-tracking branch 'kraxel/seabios-1.7.3.2' into staging (2013-09-30 17:15:27 -0500)

are available in the git repository at:

git://github.com/J-Liu/qemu.git or32

for you to fetch changes up to 6ef8263ead779e1eecfaf1e0388f4c3941ea7ec3:

target-openrisc: Removes a non-conforming behavior for the first page of the memory (2013-10-03 16:24:44 +0800)

----------------------------------------------------------------
Sebastian Macke (2):
target-openrisc: Correct handling of page faults.
target-openrisc: Removes a non-conforming behavior for the first page of the memory

 target-openrisc/mmu.c | 9 +--------
 1 file changed, 1 insertion(+), 8 deletions(-)
author
#1 lore raw

[Qemu-devel] [PULL 1/2] target-openrisc: Correct handling of page faults.

From: Sebastian Macke <[email protected]>

The result of (rw & 0) is always zero and therefore a logic false. The whole comparison will therefore never be executed, it is a obvious bug, we should use !(rw & 1) here.

---
 target-openrisc/mmu.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
target-openrisc/mmu.c +1 -1
index 57f5616..323a173 100644
@@ -102,7 +102,7 @@ int cpu_openrisc_get_phys_data(OpenRISCCPU *cpu,
         }
     }
 
-    if ((rw & 0) && ((right & PAGE_READ) == 0)) {
+    if (!(rw & 1) && ((right & PAGE_READ) == 0)) {
         return TLBRET_BADADDR;
     }
     if ((rw & 1) && ((right & PAGE_WRITE) == 0)) {
Signature · 1 line
1.7.12.4 (Apple Git-37)
author
#2 lore raw

[Qemu-devel] [PULL 2/2] target-openrisc: Removes a non-conforming behavior for the first page of the memory

In reply to Jia Liu

From: Sebastian Macke <[email protected]>

Where *software* leaves 0x0000 - 0x2000 unmapped, the hardware should still allow for this area to be mapped.

---
 target-openrisc/mmu.c | 7 -------
 1 file changed, 7 deletions(-)
target-openrisc/mmu.c +0 -7
index 323a173..22d7cbe 100644
@@ -122,13 +122,6 @@ static int cpu_openrisc_get_phys_addr(OpenRISCCPU *cpu,
 {
     int ret = TLBRET_MATCH;
 
-    /* [0x0000--0x2000]: unmapped */
-    if (address < 0x2000 && (cpu->env.sr & SR_SM)) {
-        *physical = address;
-        *prot = PAGE_READ | PAGE_WRITE;
-        return ret;
-    }
-
     if (rw == 2) {    /* ITLB */
        *physical = 0;
         ret = cpu->env.tlb->cpu_openrisc_map_address_code(cpu, physical,
Signature · 1 line
1.7.12.4 (Apple Git-37)
#3 lore raw
In reply to Jia Liu
Quoted 6 lines · Jia Liu

Hi Anthony,

This is my OpenRISC patch queue. It originally come from Sebastian Macke, split by me, and I used some comment come from Stefan Kristiansson.

Please pull.

As this is a pull request, the patches in it need your Signed-off-by, not just Reviewed-by.

thanks
-- PMM

author
#4 lore raw

Hi Peter,

Quoted 10 lines · Peter Maydell
Quoted 6 lines · Jia Liu

Hi Anthony,

This is my OpenRISC patch queue. It originally come from Sebastian Macke, split by me, and I used some comment come from Stefan Kristiansson.

Please pull.

As this is a pull request, the patches in it need your Signed-off-by, not just Reviewed-by.

Thank you for mention.

Quoted 3 lines

thanks
-- PMM

Regards,
Jia

author
#5 lore raw
In reply to Peter Maydell

Hi Anthony,
Hi Peter,

Quoted 10 lines · Peter Maydell
Quoted 6 lines · Jia Liu

Hi Anthony,

This is my OpenRISC patch queue. It originally come from Sebastian Macke, split by me, and I used some comment come from Stefan Kristiansson.

Please pull.

As this is a pull request, the patches in it need your Signed-off-by, not just Reviewed-by.

Need I resend this pull request?

Quoted 3 lines

thanks
-- PMM

Regards,
Jia