xen/arm: Track page accessed between batch of Set/Way operations
authorJulien Grall <julien.grall@arm.com>
Tue, 18 Dec 2018 18:04:17 +0000 (18:04 +0000)
committerStefano Stabellini <sstabellini@kernel.org>
Tue, 18 Dec 2018 22:32:35 +0000 (14:32 -0800)
commit2148a125b73bf6d0e777ad37840690a524eb8a44
tree8d7d6e9f8a173c72846b626facc53ae1515add5b
parentf253e88bec120982dbbba610e3b874cdbb66db71
xen/arm: Track page accessed between batch of Set/Way operations

At the moment, the implementation of Set/Way operations will go through
all the entries of the guest P2M and flush them. However, this is very
expensive and may render unusable a guest OS using them.

For instance, Linux 32-bit will use Set/Way operations during secondary
CPU bring-up. As the implementation is really expensive, it may be possible
to hit the CPU bring-up timeout.

To limit the Set/Way impact, we track what pages has been of the guest
has been accessed between batch of Set/Way operations. This is done
using bit[0] (aka valid bit) of the P2M entry.

This patch adds a new per-arch helper is introduced to perform actions just
before the guest is first unpaused. This will be used to invalidate the
P2M to track access from the start of the guest.

Signed-off-by: Julien Grall <julien.grall@arm.com>
Reviewed-by: Jan Beulich <jbeulich@suse.com>
Reviewed-by: Stefano Stabellini <sstabellini@kernel.org>
xen/arch/arm/domain.c
xen/arch/arm/p2m.c
xen/arch/x86/domain.c
xen/common/domain.c
xen/include/asm-arm/p2m.h
xen/include/xen/domain.h