Skip to content

tcg-i386: merge 64-bit, guest_base improvement

Richard Henderson qemu-devel 1 version New

Get series with b4
b4 am [email protected]

Versions newest first

  1. v1 Latest0 of 2 patches 0 repliesNew

Patches in v1 No applies recorded yet

None of the 2 patches the cover letter announces are in this archive.

Reviews trailers per patch

No Reviewed-by, Acked-by or Tested-by trailers for v1 yet.

Read the v1 thread

Cover letter [Qemu-devel] [PATCH 0/2] tcg-i386: merge 64-bit, guest_base improvement

This patch series is dependent on the "tcg cleanups, part 4" patch series.

The first patch merges the 64-bit code generator with the cleaned-up 32-bit code generator. I think the result is going to be easier to maintain than the two generators separately. I've spot-checked the code for 32-bit at -O2; I think the compiler has done a good job compiling away the 64-bit parts.

The second patch uses the segmentation registers to implement GUEST_BASE. This is only a mild space-savings for 32-bit (3 bytes per guest access), but for 64-bit it can be very helpful. Consider the new -R option for reserving an address-space:

Reserved 0x80000000 bytes of guest address space
host mmap_min_addr=0x1000
guest_base 0x7fff74be1000

The area the OS reserved for us often turns out to be in high memory. Before this patch, we wind up emitting

movq $large,%rax
addq %addr,%rax

The reduction by using a segment register is 11 bytes (and 2 insns) per guest access.

r~

Richard Henderson (2):
tcg-i386: Merge 64-bit generation.
tcg-i386: Use segment registers to implement GUEST_BASE.

 configure               |    2 +
 tcg/i386/tcg-target.c   | 1276 ++++++++++++++++++++++++++++++-----------
 tcg/i386/tcg-target.h   |   61 ++-
 tcg/x86_64/tcg-target.c | 1445 -----------------------------------------------
 tcg/x86_64/tcg-target.h |  101 ----
 5 files changed, 996 insertions(+), 1889 deletions(-)
 delete mode 100644 tcg/x86_64/tcg-target.c
 delete mode 100644 tcg/x86_64/tcg-target.h