Xtensa fixes queue 2014-05-26:
- fix cross-page jumps/calls at the end of TB; - add tests for TBs and instructions crossing page boundary. -----BEGIN PGP SIGNATURE----- Version: GnuPG v1 iQIcBAABAgAGBQJTgv1TAAoJEFH5zJH4P6BEiqkQAJMYDOMjp0b8tPMfo1STNLD+ 1QwPEGM55wE8poIYIAiop6xXGEkBihQD9G02xjWJrBgqxQUBgejysfgY7yv+k4Wz X5jf518EmLSwv27fuVRy8d05l2WXF+jIe6PzxRBX7o/YZQyjwC6w3KaDbVPr4JiX M5rgz0OQev8N0bJ7sKI50wCDSKdV38kfecMGfvz28CoOqh7aSonnpbJv3Eod8zQH +CRZnPc9i4gA+J97EhJiSbJ31SDTR4WjyHpCOahoyvIvtF+ilbVyGZzkdu892IJ2 pRsNDiJIe3bNY+dcMvr/fv5zTdEGWwwEFXLmSyvcHjM/SE4d2q1wGg7HFodQh+4p hZtMW8BgLXeIkZXNWoZEVEDdqkYIO/guA/r75HuwrRFTmzWGJdz9dxIJ+nLCFgru KPF9+nesE47UMDtaJJsUa/jhaVrnzb+RHQAgc7sf2F8vgGiSdQdTyv/Cl7H2Djqf lUGOpfE9pVIOcomMcRUjx83l1zacmJjmH5/vkVwACBUieZ4zQOZn8/RfaJtCqrNa Hj/BXyWcrUi62/O8RAIcW2De7I0CrO8joN8EHeddCIvNsJRK/OFPXtRWJLliwpF8 oQKNqMQXxf46pjoIV633zShLaS6fhgnSulcugYfEZDfpGLc/pGzJO6kJBoVbt0U8 NKlrnc9x2wlqQejzHm6l =4dqX -----END PGP SIGNATURE----- Merge remote-tracking branch 'remotes/xtensa/tags/20140526-xtensa' into staging Xtensa fixes queue 2014-05-26: - fix cross-page jumps/calls at the end of TB; - add tests for TBs and instructions crossing page boundary. # gpg: Signature made Mon 26 May 2014 09:37:39 BST using RSA key ID F83FA044 # gpg: Can't check signature: public key not found * remotes/xtensa/tags/20140526-xtensa: target-xtensa: add tests for cross-page TB target-xtensa: completely clean TLB between MMU tests target-xtensa: fix cross-page jumps/calls at the end of TB Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
This commit is contained in:
		
						commit
						adbfc34103
					
				@ -419,7 +419,7 @@ static void gen_jump(DisasContext *dc, TCGv dest)
 | 
			
		||||
static void gen_jumpi(DisasContext *dc, uint32_t dest, int slot)
 | 
			
		||||
{
 | 
			
		||||
    TCGv_i32 tmp = tcg_const_i32(dest);
 | 
			
		||||
    if (((dc->pc ^ dest) & TARGET_PAGE_MASK) != 0) {
 | 
			
		||||
    if (((dc->tb->pc ^ dest) & TARGET_PAGE_MASK) != 0) {
 | 
			
		||||
        slot = -1;
 | 
			
		||||
    }
 | 
			
		||||
    gen_jump_slot(dc, tmp, slot);
 | 
			
		||||
@ -447,7 +447,7 @@ static void gen_callw(DisasContext *dc, int callinc, TCGv_i32 dest)
 | 
			
		||||
static void gen_callwi(DisasContext *dc, int callinc, uint32_t dest, int slot)
 | 
			
		||||
{
 | 
			
		||||
    TCGv_i32 tmp = tcg_const_i32(dest);
 | 
			
		||||
    if (((dc->pc ^ dest) & TARGET_PAGE_MASK) != 0) {
 | 
			
		||||
    if (((dc->tb->pc ^ dest) & TARGET_PAGE_MASK) != 0) {
 | 
			
		||||
        slot = -1;
 | 
			
		||||
    }
 | 
			
		||||
    gen_callw_slot(dc, callinc, tmp, slot);
 | 
			
		||||
 | 
			
		||||
@ -4,17 +4,29 @@ test_suite mmu
 | 
			
		||||
 | 
			
		||||
.purgem test_init
 | 
			
		||||
 | 
			
		||||
.macro clean_tlb_way way, page_size, n_entries
 | 
			
		||||
    movi    a2, \way
 | 
			
		||||
    movi    a3, \page_size
 | 
			
		||||
    movi    a4, \n_entries
 | 
			
		||||
    loop    a4, 1f
 | 
			
		||||
    idtlb   a2
 | 
			
		||||
    iitlb   a2
 | 
			
		||||
    add     a2, a2, a3
 | 
			
		||||
1:
 | 
			
		||||
.endm
 | 
			
		||||
 | 
			
		||||
.macro test_init
 | 
			
		||||
    movi    a2, 0x00000004
 | 
			
		||||
    idtlb   a2
 | 
			
		||||
    movi    a2, 0x00100004
 | 
			
		||||
    idtlb   a2
 | 
			
		||||
    movi    a2, 0x00200004
 | 
			
		||||
    idtlb   a2
 | 
			
		||||
    movi    a2, 0x00300004
 | 
			
		||||
    idtlb   a2
 | 
			
		||||
    clean_tlb_way 0, 0x00001000, 4
 | 
			
		||||
    clean_tlb_way 1, 0x00001000, 4
 | 
			
		||||
    clean_tlb_way 2, 0x00001000, 4
 | 
			
		||||
    clean_tlb_way 3, 0x00001000, 4
 | 
			
		||||
    clean_tlb_way 4, 0x00100000, 4
 | 
			
		||||
    movi    a2, 0x00000007
 | 
			
		||||
    idtlb   a2
 | 
			
		||||
    movi    a2, 0x00000008
 | 
			
		||||
    idtlb   a2
 | 
			
		||||
    movi    a2, 0x00000009
 | 
			
		||||
    idtlb   a2
 | 
			
		||||
.endm
 | 
			
		||||
 | 
			
		||||
test tlb_group
 | 
			
		||||
@ -508,4 +520,224 @@ test autoload_3_level_pt
 | 
			
		||||
    assert_sr exccause, 24
 | 
			
		||||
test_end
 | 
			
		||||
 | 
			
		||||
test cross_page_insn
 | 
			
		||||
    set_vector kernel, 2f
 | 
			
		||||
 | 
			
		||||
    movi    a2, 0x04000003 /* PPN */
 | 
			
		||||
    movi    a3, 0x00007000 /* VPN */
 | 
			
		||||
    witlb   a2, a3
 | 
			
		||||
    wdtlb   a2, a3
 | 
			
		||||
    movi    a3, 0x00008000 /* VPN */
 | 
			
		||||
    witlb   a2, a3
 | 
			
		||||
    wdtlb   a2, a3
 | 
			
		||||
 | 
			
		||||
    movi    a2, 0x00007fff
 | 
			
		||||
    movi    a3, 20f
 | 
			
		||||
    movi    a4, 21f
 | 
			
		||||
    sub     a4, a4, a3
 | 
			
		||||
    loop    a4, 1f
 | 
			
		||||
    l8ui    a5, a3, 0
 | 
			
		||||
    s8i     a5, a2, 0
 | 
			
		||||
    addi    a2, a2, 1
 | 
			
		||||
    addi    a3, a3, 1
 | 
			
		||||
1:
 | 
			
		||||
    movi    a2, 0x00007fff
 | 
			
		||||
    movi    a3, 0x00008000
 | 
			
		||||
    /* DTLB: OK, ITLB: OK */
 | 
			
		||||
    jx      a2
 | 
			
		||||
 | 
			
		||||
    .begin  no-transform
 | 
			
		||||
20:
 | 
			
		||||
    l32i    a2, a3, 0
 | 
			
		||||
    syscall
 | 
			
		||||
21:
 | 
			
		||||
    .end    no-transform
 | 
			
		||||
 | 
			
		||||
2:
 | 
			
		||||
    rsr     a2, exccause
 | 
			
		||||
    movi    a3, 1
 | 
			
		||||
    assert  eq, a2, a3
 | 
			
		||||
    rsr     a2, epc1
 | 
			
		||||
    movi    a3, 0x8002
 | 
			
		||||
    assert  eq, a2, a3
 | 
			
		||||
    rsr     a2, excsave1
 | 
			
		||||
    movi    a3, 0x00007fff
 | 
			
		||||
    assert  ne, a2, a3
 | 
			
		||||
 | 
			
		||||
    reset_ps
 | 
			
		||||
    set_vector kernel, 3f
 | 
			
		||||
 | 
			
		||||
    movi    a2, 0x0400000c /* PPN */
 | 
			
		||||
    movi    a3, 0x00008000 /* VPN */
 | 
			
		||||
    wdtlb   a2, a3
 | 
			
		||||
    movi    a2, 0x00007fff
 | 
			
		||||
    movi    a3, 0x00008000
 | 
			
		||||
    /* DTLB: FAIL, ITLB: OK */
 | 
			
		||||
    jx      a2
 | 
			
		||||
3:
 | 
			
		||||
    rsr     a2, exccause
 | 
			
		||||
    movi    a3, 28
 | 
			
		||||
    assert  eq, a2, a3
 | 
			
		||||
    rsr     a2, epc1
 | 
			
		||||
    movi    a3, 0x7fff
 | 
			
		||||
    assert  eq, a2, a3
 | 
			
		||||
    rsr     a2, excsave1
 | 
			
		||||
    movi    a3, 0x00007fff
 | 
			
		||||
    assert  eq, a2, a3
 | 
			
		||||
 | 
			
		||||
    reset_ps
 | 
			
		||||
    set_vector kernel, 4f
 | 
			
		||||
 | 
			
		||||
    movi    a2, 0x0400000c /* PPN */
 | 
			
		||||
    movi    a3, 0x00008000 /* VPN */
 | 
			
		||||
    witlb   a2, a3
 | 
			
		||||
    movi    a2, 0x04000003 /* PPN */
 | 
			
		||||
    wdtlb   a2, a3
 | 
			
		||||
    movi    a2, 0x00007fff
 | 
			
		||||
    movi    a3, 0x00008000
 | 
			
		||||
    /* DTLB: OK, ITLB: FAIL */
 | 
			
		||||
    jx      a2
 | 
			
		||||
4:
 | 
			
		||||
    rsr     a2, exccause
 | 
			
		||||
    movi    a3, 20
 | 
			
		||||
    assert  eq, a2, a3
 | 
			
		||||
    rsr     a2, epc1
 | 
			
		||||
    movi    a3, 0x7fff
 | 
			
		||||
    assert  eq, a2, a3
 | 
			
		||||
    rsr     a2, excsave1
 | 
			
		||||
    movi    a3, 0x00007fff
 | 
			
		||||
    assert  eq, a2, a3
 | 
			
		||||
 | 
			
		||||
    reset_ps
 | 
			
		||||
    set_vector kernel, 5f
 | 
			
		||||
 | 
			
		||||
    movi    a2, 0x0400000c /* PPN */
 | 
			
		||||
    movi    a3, 0x00008000 /* VPN */
 | 
			
		||||
    wdtlb   a2, a3
 | 
			
		||||
    movi    a2, 0x00007fff
 | 
			
		||||
    movi    a3, 0x00008000
 | 
			
		||||
    /* DTLB: FAIL, ITLB: FAIL */
 | 
			
		||||
    jx      a2
 | 
			
		||||
5:
 | 
			
		||||
    rsr     a2, exccause
 | 
			
		||||
    movi    a3, 20
 | 
			
		||||
    assert  eq, a2, a3
 | 
			
		||||
    rsr     a2, epc1
 | 
			
		||||
    movi    a3, 0x7fff
 | 
			
		||||
    assert  eq, a2, a3
 | 
			
		||||
    rsr     a2, excsave1
 | 
			
		||||
    movi    a3, 0x00007fff
 | 
			
		||||
    assert  eq, a2, a3
 | 
			
		||||
test_end
 | 
			
		||||
 | 
			
		||||
test cross_page_tb
 | 
			
		||||
    set_vector kernel, 2f
 | 
			
		||||
 | 
			
		||||
    movi    a2, 0x04000003 /* PPN */
 | 
			
		||||
    movi    a3, 0x00007000 /* VPN */
 | 
			
		||||
    witlb   a2, a3
 | 
			
		||||
    wdtlb   a2, a3
 | 
			
		||||
    movi    a3, 0x00008000 /* VPN */
 | 
			
		||||
    witlb   a2, a3
 | 
			
		||||
    wdtlb   a2, a3
 | 
			
		||||
 | 
			
		||||
    movi    a2, 0x00007ffd
 | 
			
		||||
    movi    a3, 20f
 | 
			
		||||
    movi    a4, 21f
 | 
			
		||||
    sub     a4, a4, a3
 | 
			
		||||
    loop    a4, 1f
 | 
			
		||||
    l8ui    a5, a3, 0
 | 
			
		||||
    s8i     a5, a2, 0
 | 
			
		||||
    addi    a2, a2, 1
 | 
			
		||||
    addi    a3, a3, 1
 | 
			
		||||
1:
 | 
			
		||||
    movi    a2, 0x00007ffd
 | 
			
		||||
    movi    a3, 0x00008000
 | 
			
		||||
    /* DTLB: OK, ITLB: OK */
 | 
			
		||||
    jx      a2
 | 
			
		||||
 | 
			
		||||
    .begin  no-transform
 | 
			
		||||
20:
 | 
			
		||||
    l32i    a2, a3, 0
 | 
			
		||||
    syscall
 | 
			
		||||
21:
 | 
			
		||||
    .end    no-transform
 | 
			
		||||
 | 
			
		||||
2:
 | 
			
		||||
    rsr     a2, exccause
 | 
			
		||||
    movi    a3, 1
 | 
			
		||||
    assert  eq, a2, a3
 | 
			
		||||
    rsr     a2, epc1
 | 
			
		||||
    movi    a3, 0x8000
 | 
			
		||||
    assert  eq, a2, a3
 | 
			
		||||
    rsr     a2, excsave1
 | 
			
		||||
    movi    a3, 0x00007ffd
 | 
			
		||||
    assert  ne, a2, a3
 | 
			
		||||
 | 
			
		||||
    reset_ps
 | 
			
		||||
    set_vector kernel, 3f
 | 
			
		||||
 | 
			
		||||
    movi    a2, 0x0400000c /* PPN */
 | 
			
		||||
    movi    a3, 0x00008000 /* VPN */
 | 
			
		||||
    wdtlb   a2, a3
 | 
			
		||||
    movi    a2, 0x00007ffd
 | 
			
		||||
    movi    a3, 0x00008000
 | 
			
		||||
    /* DTLB: FAIL, ITLB: OK */
 | 
			
		||||
    jx      a2
 | 
			
		||||
3:
 | 
			
		||||
    rsr     a2, exccause
 | 
			
		||||
    movi    a3, 28
 | 
			
		||||
    assert  eq, a2, a3
 | 
			
		||||
    rsr     a2, epc1
 | 
			
		||||
    movi    a3, 0x7ffd
 | 
			
		||||
    assert  eq, a2, a3
 | 
			
		||||
    rsr     a2, excsave1
 | 
			
		||||
    movi    a3, 0x00007ffd
 | 
			
		||||
    assert  eq, a2, a3
 | 
			
		||||
 | 
			
		||||
    reset_ps
 | 
			
		||||
    set_vector kernel, 4f
 | 
			
		||||
 | 
			
		||||
    movi    a2, 0x0400000c /* PPN */
 | 
			
		||||
    movi    a3, 0x00008000 /* VPN */
 | 
			
		||||
    witlb   a2, a3
 | 
			
		||||
    movi    a2, 0x04000003 /* PPN */
 | 
			
		||||
    wdtlb   a2, a3
 | 
			
		||||
    movi    a2, 0x00007ffd
 | 
			
		||||
    movi    a3, 0x00008000
 | 
			
		||||
    /* DTLB: OK, ITLB: FAIL */
 | 
			
		||||
    jx      a2
 | 
			
		||||
4:
 | 
			
		||||
    rsr     a2, exccause
 | 
			
		||||
    movi    a3, 20
 | 
			
		||||
    assert  eq, a2, a3
 | 
			
		||||
    rsr     a2, epc1
 | 
			
		||||
    movi    a3, 0x8000
 | 
			
		||||
    assert  eq, a2, a3
 | 
			
		||||
    rsr     a2, excsave1
 | 
			
		||||
    movi    a3, 0x00007ffd
 | 
			
		||||
    assert  ne, a2, a3
 | 
			
		||||
 | 
			
		||||
    reset_ps
 | 
			
		||||
    set_vector kernel, 5f
 | 
			
		||||
 | 
			
		||||
    movi    a2, 0x0400000c /* PPN */
 | 
			
		||||
    movi    a3, 0x00008000 /* VPN */
 | 
			
		||||
    wdtlb   a2, a3
 | 
			
		||||
    movi    a2, 0x00007ffd
 | 
			
		||||
    movi    a3, 0x00008000
 | 
			
		||||
    /* DTLB: FAIL, ITLB: FAIL */
 | 
			
		||||
    jx      a2
 | 
			
		||||
5:
 | 
			
		||||
    rsr     a2, exccause
 | 
			
		||||
    movi    a3, 28
 | 
			
		||||
    assert  eq, a2, a3
 | 
			
		||||
    rsr     a2, epc1
 | 
			
		||||
    movi    a3, 0x7ffd
 | 
			
		||||
    assert  eq, a2, a3
 | 
			
		||||
    rsr     a2, excsave1
 | 
			
		||||
    movi    a3, 0x00007ffd
 | 
			
		||||
    assert  eq, a2, a3
 | 
			
		||||
test_end
 | 
			
		||||
 | 
			
		||||
test_suite_end
 | 
			
		||||
 | 
			
		||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user