qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
* [Qemu-devel] outlined TLB lookup on x86
@ 2013-11-27  7:41 Xin Tong
  2013-11-27 13:12 ` Lluís Vilanova
  2013-11-28  2:12 ` Richard Henderson
  0 siblings, 2 replies; 21+ messages in thread
From: Xin Tong @ 2013-11-27  7:41 UTC (permalink / raw)
  To: qemu-devel

[-- Attachment #1: Type: text/plain, Size: 1490 bytes --]

I am trying to implement a out-of-line TLB lookup for QEMU softmmu-x86-64
on x86-64 machine, potentially for better instruction cache performance, I
have a few  questions.

1. I see that tcg_out_qemu_ld_slow_path/tcg_out_qemu_st_slow_path are
generated when tcg_out_tb_finalize is called. And when a TLB lookup misses,
it jumps to the generated slow path and slow path refills the TLB, then
load/store and jumps to the next emulated instruction. I am wondering is it
easy to outline the code for the slow path. I am thinking when a TLB
misses, the outlined TLB lookup code should generate a call out to
the qemu_ld/st_helpers[opc & ~MO_SIGN] and rewalk the TLB after its
refilled ? This code is off the critical path, so its not as important as
the code when TLB hits.
2. why not use a TLB or bigger size?  currently the TLB has 1<<8 entries.
the TLB lookup is 10 x86 instructions , but every miss needs ~450
instructions, i measured this using Intel PIN. so even the miss rate is low
(say 3%) the overall time spent in the cpu_x86_handle_mmu_fault is still
signifcant.  I am thinking the tlb may need to be organized in a set
associative fashion to reduce conflict miss, e.g. 2 way set associative to
reduce the miss rate. or have a victim tlb that is 4 way associative and
use x86 simd instructions to do the lookup once the direct-mapped tlb
misses. Has anybody done any work on this front ?
3. what are some of the drawbacks of using a superlarge TLB, i.e. a TLB
with 4K entries ?

Xin

[-- Attachment #2: Type: text/html, Size: 2127 bytes --]

^ permalink raw reply	[flat|nested] 21+ messages in thread

end of thread, other threads:[~2014-01-22 17:56 UTC | newest]

Thread overview: 21+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-11-27  7:41 [Qemu-devel] outlined TLB lookup on x86 Xin Tong
2013-11-27 13:12 ` Lluís Vilanova
2013-11-28  1:58   ` Xin Tong
2013-11-28 16:12     ` Lluís Vilanova
2013-12-08 10:54       ` Xin Tong
2013-12-17 13:52         ` Xin Tong
2013-12-18  2:22           ` Xin Tong
2014-01-21 14:22             ` Xin Tong
2014-01-21 14:28               ` Peter Maydell
2013-12-09 12:18       ` Xin Tong
2013-12-09 15:31         ` Lluís Vilanova
2013-11-28  2:12 ` Richard Henderson
2013-11-28  3:56   ` Xin Tong
2013-12-08 11:19   ` Avi Kivity
2014-01-22 15:28   ` Xin Tong
2014-01-22 16:34     ` Richard Henderson
2014-01-22 16:55     ` Peter Maydell
2014-01-22 17:32       ` Richard Henderson
2014-01-22 17:35         ` Peter Maydell
2014-01-22 17:45           ` Richard Henderson
2014-01-22 17:56             ` Xin Tong

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).