1 /* SPDX-License-Identifier: GPL-2.0 */
3 * KVM guest address space mapping code
5 * Copyright IBM Corp. 2007, 2016, 2025
10 #ifndef ARCH_KVM_S390_GMAP_H
11 #define ARCH_KVM_S390_GMAP_H
13 #define GMAP_SHADOW_FAKE_TABLE 1ULL
15 int gmap_make_secure(struct gmap *gmap, unsigned long gaddr, void *uvcb);
16 int gmap_convert_to_secure(struct gmap *gmap, unsigned long gaddr);
17 int gmap_destroy_page(struct gmap *gmap, unsigned long gaddr);
18 struct gmap *gmap_shadow(struct gmap *parent, unsigned long asce, int edat_level);
21 * gmap_shadow_valid - check if a shadow guest address space matches the
22 * given properties and is still valid
23 * @sg: pointer to the shadow guest address space structure
24 * @asce: ASCE for which the shadow table is requested
25 * @edat_level: edat level to be used for the shadow translation
27 * Returns 1 if the gmap shadow is still valid and matches the given
28 * properties, the caller can continue using it. Returns 0 otherwise, the
29 * caller has to request a new shadow gmap in this case.
32 static inline int gmap_shadow_valid(struct gmap *sg, unsigned long asce, int edat_level)
36 return sg->orig_asce == asce && sg->edat_level == edat_level;