hw/s390x/s390-skeys: lazy storage key enablement under TCG
commitc35622387efe39214ccd14fab0f280b6c53f1654
authorDavid Hildenbrand <david@redhat.com>
Fri, 3 Sep 2021 15:55:14 +0000 (3 17:55 +0200)
committerThomas Huth <thuth@redhat.com>
Mon, 6 Sep 2021 14:24:05 +0000 (6 16:24 +0200)
tree1a905cc0ac9aac87728937fe53efff4f41b61ed1
parent5227b3260144657b48c2e215f1b38f0a5a7fbcac
hw/s390x/s390-skeys: lazy storage key enablement under TCG

Let's enable storage keys lazily under TCG, just as we do under KVM.
Only fairly old Linux versions actually make use of storage keys, so it
can be kind of wasteful to allocate quite some memory and track
changes and references if nobody cares.

We have to make sure to flush the TLB when enabling storage keys after
the VM was already running: otherwise it might happen that we don't
catch references or modifications afterwards.

Add proper documentation to all callbacks.

The kvm-unit-tests skey tests keeps on working with this change.

Signed-off-by: David Hildenbrand <david@redhat.com>
Reviewed-by: Thomas Huth <thuth@redhat.com>
Message-Id: <20210903155514.44772-14-david@redhat.com>
Signed-off-by: Thomas Huth <thuth@redhat.com>
hw/s390x/s390-skeys.c
include/hw/s390x/storage-keys.h
target/s390x/mmu_helper.c
target/s390x/tcg/mem_helper.c