mirror of
https://github.com/torvalds/linux.git
synced 2026-09-23 22:14:03 +02:00
KVM: s390: gmap: Make prefix handling optional
Guard guest prefix handling behind `KVM_S390_MANAGES_S390_GUEST`. This enables other KVM implementations to use gmap without implementing prefix handling. The prefix handling is integrated deeply in the gmap implementation. Therefore, provide safe default implementations for the guarded functions. No functional changes. Signed-off-by: Steffen Eiden <seiden@linux.ibm.com> Reviewed-by: Christian Borntraeger <borntraeger@linux.ibm.com> Signed-off-by: Christian Borntraeger <borntraeger@linux.ibm.com>
This commit is contained in:
parent
ce4bee6a91
commit
188a15cc7f
|
|
@ -1012,6 +1012,7 @@ bool dat_test_age_gfn(union asce asce, gfn_t start, gfn_t end)
|
|||
return _dat_walk_gfn_range(start, end, asce, &test_age_ops, 0, NULL) > 0;
|
||||
}
|
||||
|
||||
#if KVM_S390_MANAGES_S390_GUEST
|
||||
static long dat_set_pn_crste(union crste *crstep, gfn_t gfn, gfn_t next, struct dat_walk *walk)
|
||||
{
|
||||
union crste newcrste, oldcrste;
|
||||
|
|
@ -1060,7 +1061,6 @@ int dat_set_prefix_notif_bit(union asce asce, gfn_t gfn)
|
|||
return 0;
|
||||
}
|
||||
|
||||
#if KVM_S390_MANAGES_S390_GUEST
|
||||
/**
|
||||
* dat_perform_essa() - Perform ESSA actions on the PGSTE.
|
||||
* @asce: The asce to operate on.
|
||||
|
|
|
|||
|
|
@ -549,7 +549,16 @@ void dat_set_ptval(struct page_table *table, struct ptval_param param, unsigned
|
|||
|
||||
int dat_set_slot(struct kvm_s390_mmu_cache *mc, union asce asce, gfn_t start, gfn_t end,
|
||||
u16 type, u16 param);
|
||||
|
||||
#if KVM_S390_MANAGES_S390_GUEST
|
||||
int dat_set_prefix_notif_bit(union asce asce, gfn_t gfn);
|
||||
#else
|
||||
static inline int dat_set_prefix_notif_bit(union asce asce, gfn_t gfn)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
#endif /* KVM_S390_MANAGES_S390_GUEST */
|
||||
|
||||
bool dat_test_age_gfn(union asce asce, gfn_t start, gfn_t end);
|
||||
|
||||
#if KVM_S390_MANAGES_S390_GUEST
|
||||
|
|
|
|||
|
|
@ -24,11 +24,6 @@
|
|||
#include "s390.h"
|
||||
#include "faultin.h"
|
||||
|
||||
static inline bool kvm_s390_is_in_sie(struct kvm_vcpu *vcpu)
|
||||
{
|
||||
return vcpu->arch.sie_block->prog0c & PROG_IN_SIE;
|
||||
}
|
||||
|
||||
static int gmap_limit_to_type(gfn_t limit)
|
||||
{
|
||||
if (!limit)
|
||||
|
|
@ -256,6 +251,12 @@ int s390_replace_asce(struct gmap *gmap)
|
|||
return 0;
|
||||
}
|
||||
|
||||
#if KVM_S390_MANAGES_S390_GUEST
|
||||
static inline bool kvm_s390_is_in_sie(struct kvm_vcpu *vcpu)
|
||||
{
|
||||
return vcpu->arch.sie_block->prog0c & PROG_IN_SIE;
|
||||
}
|
||||
|
||||
bool _gmap_unmap_prefix(struct gmap *gmap, gfn_t gfn, gfn_t end, bool hint)
|
||||
{
|
||||
struct kvm *kvm = gmap->kvm;
|
||||
|
|
@ -278,6 +279,7 @@ bool _gmap_unmap_prefix(struct gmap *gmap, gfn_t gfn, gfn_t end, bool hint)
|
|||
}
|
||||
return true;
|
||||
}
|
||||
#endif /* KVM_S390_MANAGES_S390_GUEST */
|
||||
|
||||
struct clear_young_pte_priv {
|
||||
struct gmap *gmap;
|
||||
|
|
|
|||
|
|
@ -85,7 +85,6 @@ struct gmap_cache {
|
|||
for (pos = (head); n = pos ? pos->next : NULL, pos; pos = n)
|
||||
|
||||
int s390_replace_asce(struct gmap *gmap);
|
||||
bool _gmap_unmap_prefix(struct gmap *gmap, gfn_t gfn, gfn_t end, bool hint);
|
||||
bool gmap_age_gfn(struct gmap *gmap, gfn_t start, gfn_t end);
|
||||
bool gmap_unmap_gfn_range(struct gmap *gmap, struct kvm_memory_slot *slot, gfn_t start, gfn_t end);
|
||||
int gmap_try_fixup_minor(struct gmap *gmap, struct guest_fault *fault);
|
||||
|
|
@ -163,6 +162,14 @@ static inline void gmap_handle_vsie_unshadow_event(struct gmap *parent, gfn_t gf
|
|||
_gmap_handle_vsie_unshadow_event(parent, gfn);
|
||||
}
|
||||
|
||||
#if KVM_S390_MANAGES_S390_GUEST
|
||||
bool _gmap_unmap_prefix(struct gmap *gmap, gfn_t gfn, gfn_t end, bool hint);
|
||||
#else
|
||||
static inline bool _gmap_unmap_prefix(struct gmap *gmap, gfn_t gfn, gfn_t end, bool hint)
|
||||
{
|
||||
return true;
|
||||
}
|
||||
#endif /* KVM_S390_MANAGES_S390_GUEST */
|
||||
static inline bool gmap_mkold_prefix(struct gmap *gmap, gfn_t gfn, gfn_t end)
|
||||
{
|
||||
return _gmap_unmap_prefix(gmap, gfn, end, true);
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user