]> Git Repo - qemu.git/commit - target-ppc/helper.h
ppc: Do some batching of TCG tlb flushes
authorBenjamin Herrenschmidt <[email protected]>
Tue, 3 May 2016 16:03:25 +0000 (18:03 +0200)
committerDavid Gibson <[email protected]>
Mon, 30 May 2016 03:20:04 +0000 (13:20 +1000)
commitcd0c6f473532bfaf20a095bc90a18e45162981b5
tree5723605dda03135e114ce08b3d19f71574fbad5b
parent9fb044911444fdd09f5f072ad0ca269d7f8b841d
ppc: Do some batching of TCG tlb flushes

On ppc64 especially, we flush the tlb on any slbie or tlbie instruction.

However, those instructions often come in bursts of 3 or more (context
switch will favor a series of slbie's for example to an slbia if the
SLB has less than a certain number of entries in it, and tlbie's can
happen in a series, with PAPR, H_BULK_REMOVE can remove up to 4 entries
at a time.

Doing a tlb_flush() each time is a waste of time. We end up doing a memset
of the whole TLB, reloading it for the next instruction, memset'ing again,
etc...

Those instructions don't have to take effect immediately. For slbie, they
can wait for the next context synchronizing event. For tlbie, the next
tlbsync.

This implements batching by keeping a flag that indicates that we have a
TLB in need of flushing. We check it on interrupts, rfi's, isync's and
tlbsync and flush the TLB if needed.

This reduces the number of tlb_flush() on a boot to a ubuntu installer
first dialog screen from roughly 360K down to 36K.

Signed-off-by: Benjamin Herrenschmidt <[email protected]>
[clg: added a 'CPUPPCState *' variable in h_remove() and
      h_bulk_remove() ]
Signed-off-by: Cédric Le Goater <[email protected]>
[dwg: removed spurious whitespace change, use 0/1 not true/false
      consistently, since tlb_need_flush has int type]
Signed-off-by: David Gibson <[email protected]>
hw/ppc/spapr_hcall.c
target-ppc/cpu.h
target-ppc/excp_helper.c
target-ppc/helper.h
target-ppc/helper_regs.h
target-ppc/mmu-hash64.c
target-ppc/mmu_helper.c
target-ppc/translate.c
This page took 0.026518 seconds and 4 git commands to generate.