qemu/target-xtensa
Max Filippov 659f807c0a target-xtensa: fix ITLB/DTLB page protection flags
With MMU option xtensa architecture has two TLBs: ITLB and DTLB. ITLB is
only used for code access, DTLB is only for data. However TLB entries in
both TLBs have attribute field controlling write and exec access. These
bits need to be properly masked off depending on TLB type before being
used as tlb_set_page prot argument. Otherwise the following happens:

(1) ITLB entry for some PFN gets invalidated
(2) DTLB entry for the same PFN gets updated, attributes allow code
    execution
(3) code at the page with that PFN is executed (possible due to step 2),
    entry for the TB is written into the jump cache
(4) QEMU TLB entry for the PFN gets replaced with an entry for some
    other PFN
(5) code in the TB from step 3 is executed (possible due to jump cache)
    and it accesses data, for which there's no DTLB entry, causing DTLB
    miss exception
(6) re-translation of the TB from step 5 is attempted, but there's no
    QEMU TLB entry nor xtensa ITLB entry for that PFN, which causes ITLB
    miss exception at the TB start address
(7) ITLB miss exception is handled by the guest, but execution is
    resumed from the beginning of the faulting TB (the point where ITLB
    miss occured), not from the point where DTLB miss occured, which is
    wrong.

With that fix the above scenario causes ITLB miss exception (that used
to be step 7) at step 3, right at the beginning of the TB.

Signed-off-by: Max Filippov <jcmvbkbc@gmail.com>
Cc: qemu-stable@nongnu.org
Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
2012-12-15 08:39:00 +00:00
..
core-dc232b
core-dc233c target-xtensa: add dc233c core 2012-04-15 17:43:16 +00:00
core-fsf
core-dc232b.c target-xtensa: add license to core-dc232b.c 2012-04-15 17:43:28 +00:00
core-dc233c.c target-xtensa: add dc233c core 2012-04-15 17:43:16 +00:00
core-fsf.c target-xtensa: add license to core-fsf.c 2012-04-15 17:43:43 +00:00
cpu-qom.h target-xtensa: QOM'ify CPU 2012-04-14 03:48:08 +04:00
cpu.c target-xtensa: implement CACHEATTR SR 2012-12-08 18:48:26 +00:00
cpu.h target-xtensa: implement MISC SR 2012-12-08 18:48:26 +00:00
helper.c target-xtensa: fix ITLB/DTLB page protection flags 2012-12-15 08:39:00 +00:00
helper.h target-xtensa: implement ATOMCTL SR 2012-12-08 18:48:26 +00:00
machine.c
Makefile.objs target-xtensa: switch to AREG0-free mode 2012-06-10 20:09:22 +00:00
op_helper.c target-xtensa: implement ATOMCTL SR 2012-12-08 18:48:26 +00:00
overlay_tool.h target-xtensa: implement MISC SR 2012-12-08 18:48:26 +00:00
translate.c target-xtensa: use movcond where possible 2012-12-08 18:48:26 +00:00
xtensa-semi.c Rename target_phys_addr_t to hwaddr 2012-10-23 08:58:25 -05:00