Skip to content

x86/HVM: implement memory read caching

Jan Beulich xen-devel 2 versions – In review

Get series with b4
b4 am [email protected]

Versions newest first · linked by author and title

  1. v5 Latest4 patches 14 repliesIn review
  2. v47 patches 14 repliesSuperseded

Patches in v5 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/4x86/HVM: cancel emulation when register state got alteredxen/arch/x86/domctl.c xen/arch/x86/hvm/domain.c xen/arch/x86/hvm/emulate.c +4 more+43 -77 replies
2/4x86/HVM: implement memory read caching for insn emulationxen/arch/x86/hvm/emulate.c xen/arch/x86/hvm/hvm.c xen/arch/x86/hvm/hypercall.c +6 more+249 -135 replies
3/4x86/mm: use cache in guest_walk_tables()xen/arch/x86/hvm/emulate.c xen/arch/x86/mm/guest_walk.c xen/arch/x86/mm/hap/guest_walk.c +3 more+81 -181 reply
4/4x86/HVM: __hvm_copy()'s size parameter is an unsigned quantityxen/arch/x86/hvm/hvm.c xen/include/asm-x86/hvm/guest_access.h xen/include/asm-x86/hvm/support.h+23 -251 reply

Reviews trailers per patch

3 of 4 patches have a Reviewed-by or Acked-by.

PatchPaul Durrant
1/4
2/4R-b
3/4R-b
4/4R-b

Trailers given in replies are filled; those carried in the patches from earlier versions are outlined with dashes.

Read the v5 thread

Cover letter [Xen-devel] [PATCH v5 0/4] x86/HVM: implement memory read caching

Emulation requiring device model assistance uses a form of instruction re-execution, assuming that the second (and any further) pass takes exactly the same path. This is a valid assumption as far as use of CPU registers goes (as those can't change without any other instruction executing in between), but is wrong for memory accesses. In particular it has been observed that Windows might page out buffers underneath an instruction currently under emulation (hitting between two passes). If the first pass translated a linear address successfully, any subsequent pass needs to do so too, yielding the exact same translation.

Introduce a cache to make sure above described assumption holds. This is a very simplistic implementation for now: Only exact matches are satisfied (no overlaps or partial reads or anything).

There's also some perhaps seemingly unrelated cleanup here which was found desirable on the way - the 3 initial patches are truly prereqs (at least in a contextual way), while the 2 last ones are just for things noticed along the way.

1: x86/HVM: cancel emulation when register state got altered 2: x86/HVM: implement memory read caching for insn emulation 3: x86/mm: use cache in guest_walk_tables()
4: x86/HVM: __hvm_copy()'s size parameter is an unsigned quantity

The main difference to v4 are the new first and last patches (with the latter being largely unrelated cleanup). For other changes see the individual patches.

Jan

_______________________________________________
Xen-devel mailing list
[email protected]
https://lists.xenproject.org/mailman/listinfo/xen-devel