aboutsummaryrefslogtreecommitdiff
path: root/target-xtensa/op_helper.c
diff options
context:
space:
mode:
authorAvi Kivity <avi@redhat.com>2012-07-16 10:52:03 +0300
committerAvi Kivity <avi@redhat.com>2012-07-16 10:52:03 +0300
commit7fa12eb15f95c269f488fce4096093c96dbaffab (patch)
tree8ca766bebdead1ae21819bdc691b1097008ae834 /target-xtensa/op_helper.c
parent6f82a5ea52302bab33287b0191538be6f9138637 (diff)
parent785adb09b9fd0d4df6707f00247ec519c42fcfc6 (diff)
Merge tag 'v1.1.1' into stable-1.1qemu-kvm-1.1.1
* tag 'v1.1.1': (34 commits) update VERSION for v1.1.1 s390x: fix s390 virtio aliases rtl8139: validate rx ring before receiving packets ahci: SATA FIS is 20 bytes, not 0x20 qemu-img: document qed format on qemu-img man page virtio: Fix compiler warning for non Linux hosts sheepdog: fix return value of do_load_save_vm_state qemu/xendisk: set maximum number of grants to be used build: install qmp-commands.txt fdc: fix implied seek while there is no media in drive qcow2: fix autoclear image header update Prevent disk data loss when closing qemu qcow2: fix endianness conversion pci_bridge_dev: fix error path in pci_bridge_dev_initfn() qdev: release parent properties on dc->init failure intel-hda: Fix reset of MSI function ahci: Fix reset of MSI function rtl8139: honor RxOverflow flag in can_receive method configure: Fix build for some versions of glibc (9pfs) monitor: Fix memory leak with readline completion ... Signed-off-by: Avi Kivity <avi@redhat.com>
Diffstat (limited to 'target-xtensa/op_helper.c')
-rw-r--r--target-xtensa/op_helper.c20
1 files changed, 14 insertions, 6 deletions
diff --git a/target-xtensa/op_helper.c b/target-xtensa/op_helper.c
index 364dc19bc..41107ff64 100644
--- a/target-xtensa/op_helper.c
+++ b/target-xtensa/op_helper.c
@@ -79,7 +79,7 @@ void tlb_fill(CPUXtensaState *env1, target_ulong vaddr, int is_write, int mmu_id
uint32_t paddr;
uint32_t page_size;
unsigned access;
- int ret = xtensa_get_physical_addr(env, vaddr, is_write, mmu_idx,
+ int ret = xtensa_get_physical_addr(env, true, vaddr, is_write, mmu_idx,
&paddr, &page_size, &access);
qemu_log("%s(%08x, %d, %d) -> %08x, ret = %d\n", __func__,
@@ -103,7 +103,7 @@ static void tb_invalidate_virtual_addr(CPUXtensaState *env, uint32_t vaddr)
uint32_t paddr;
uint32_t page_size;
unsigned access;
- int ret = xtensa_get_physical_addr(env, vaddr, 2, 0,
+ int ret = xtensa_get_physical_addr(env, false, vaddr, 2, 0,
&paddr, &page_size, &access);
if (ret == 0) {
tb_invalidate_phys_addr(paddr);
@@ -655,6 +655,16 @@ uint32_t HELPER(ptlb)(uint32_t v, uint32_t dtlb)
}
}
+void xtensa_tlb_set_entry_mmu(const CPUXtensaState *env,
+ xtensa_tlb_entry *entry, bool dtlb,
+ unsigned wi, unsigned ei, uint32_t vpn, uint32_t pte)
+{
+ entry->vaddr = vpn;
+ entry->paddr = pte & xtensa_tlb_get_addr_mask(env, dtlb, wi);
+ entry->asid = (env->sregs[RASID] >> ((pte >> 1) & 0x18)) & 0xff;
+ entry->attr = pte & 0xf;
+}
+
void xtensa_tlb_set_entry(CPUXtensaState *env, bool dtlb,
unsigned wi, unsigned ei, uint32_t vpn, uint32_t pte)
{
@@ -665,10 +675,8 @@ void xtensa_tlb_set_entry(CPUXtensaState *env, bool dtlb,
if (entry->asid) {
tlb_flush_page(env, entry->vaddr);
}
- entry->vaddr = vpn;
- entry->paddr = pte & xtensa_tlb_get_addr_mask(env, dtlb, wi);
- entry->asid = (env->sregs[RASID] >> ((pte >> 1) & 0x18)) & 0xff;
- entry->attr = pte & 0xf;
+ xtensa_tlb_set_entry_mmu(env, entry, dtlb, wi, ei, vpn, pte);
+ tlb_flush_page(env, entry->vaddr);
} else {
qemu_log("%s %d, %d, %d trying to set immutable entry\n",
__func__, dtlb, wi, ei);