Skip to content

Commit 564429a

Browse files
committed
KVM: rename CONFIG_HAVE_KVM_GMEM_* to CONFIG_HAVE_KVM_ARCH_GMEM_*
Add "ARCH" to the symbols; shortly, the "prepare" phase will include both the arch-independent step to clear out contents left in the page by the host, and the arch-dependent step enabled by CONFIG_HAVE_KVM_GMEM_PREPARE. For consistency do the same for CONFIG_HAVE_KVM_GMEM_INVALIDATE as well. Reviewed-by: Michael Roth <[email protected]> Signed-off-by: Paolo Bonzini <[email protected]>
1 parent 7fbdda3 commit 564429a

File tree

5 files changed

+11
-11
lines changed

5 files changed

+11
-11
lines changed

arch/x86/kvm/Kconfig

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -141,8 +141,8 @@ config KVM_AMD_SEV
141141
depends on CRYPTO_DEV_SP_PSP && !(KVM_AMD=y && CRYPTO_DEV_CCP_DD=m)
142142
select ARCH_HAS_CC_PLATFORM
143143
select KVM_GENERIC_PRIVATE_MEM
144-
select HAVE_KVM_GMEM_PREPARE
145-
select HAVE_KVM_GMEM_INVALIDATE
144+
select HAVE_KVM_ARCH_GMEM_PREPARE
145+
select HAVE_KVM_ARCH_GMEM_INVALIDATE
146146
help
147147
Provides support for launching Encrypted VMs (SEV) and Encrypted VMs
148148
with Encrypted State (SEV-ES) on AMD processors.

arch/x86/kvm/x86.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13644,7 +13644,7 @@ bool kvm_arch_no_poll(struct kvm_vcpu *vcpu)
1364413644
}
1364513645
EXPORT_SYMBOL_GPL(kvm_arch_no_poll);
1364613646

13647-
#ifdef CONFIG_HAVE_KVM_GMEM_PREPARE
13647+
#ifdef CONFIG_HAVE_KVM_ARCH_GMEM_PREPARE
1364813648
bool kvm_arch_gmem_prepare_needed(struct kvm *kvm)
1364913649
{
1365013650
return kvm->arch.vm_type == KVM_X86_SNP_VM;
@@ -13656,7 +13656,7 @@ int kvm_arch_gmem_prepare(struct kvm *kvm, gfn_t gfn, kvm_pfn_t pfn, int max_ord
1365613656
}
1365713657
#endif
1365813658

13659-
#ifdef CONFIG_HAVE_KVM_GMEM_INVALIDATE
13659+
#ifdef CONFIG_HAVE_KVM_ARCH_GMEM_INVALIDATE
1366013660
void kvm_arch_gmem_invalidate(kvm_pfn_t start, kvm_pfn_t end)
1366113661
{
1366213662
kvm_x86_call(gmem_invalidate)(start, end);

include/linux/kvm_host.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2445,7 +2445,7 @@ static inline int kvm_gmem_get_pfn(struct kvm *kvm,
24452445
}
24462446
#endif /* CONFIG_KVM_PRIVATE_MEM */
24472447

2448-
#ifdef CONFIG_HAVE_KVM_GMEM_PREPARE
2448+
#ifdef CONFIG_HAVE_KVM_ARCH_GMEM_PREPARE
24492449
int kvm_arch_gmem_prepare(struct kvm *kvm, gfn_t gfn, kvm_pfn_t pfn, int max_order);
24502450
bool kvm_arch_gmem_prepare_needed(struct kvm *kvm);
24512451
#endif
@@ -2477,7 +2477,7 @@ typedef int (*kvm_gmem_populate_cb)(struct kvm *kvm, gfn_t gfn, kvm_pfn_t pfn,
24772477
long kvm_gmem_populate(struct kvm *kvm, gfn_t gfn, void __user *src, long npages,
24782478
kvm_gmem_populate_cb post_populate, void *opaque);
24792479

2480-
#ifdef CONFIG_HAVE_KVM_GMEM_INVALIDATE
2480+
#ifdef CONFIG_HAVE_KVM_ARCH_GMEM_INVALIDATE
24812481
void kvm_arch_gmem_invalidate(kvm_pfn_t start, kvm_pfn_t end);
24822482
#endif
24832483

virt/kvm/Kconfig

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -113,10 +113,10 @@ config KVM_GENERIC_PRIVATE_MEM
113113
select KVM_PRIVATE_MEM
114114
bool
115115

116-
config HAVE_KVM_GMEM_PREPARE
116+
config HAVE_KVM_ARCH_GMEM_PREPARE
117117
bool
118118
depends on KVM_PRIVATE_MEM
119119

120-
config HAVE_KVM_GMEM_INVALIDATE
120+
config HAVE_KVM_ARCH_GMEM_INVALIDATE
121121
bool
122122
depends on KVM_PRIVATE_MEM

virt/kvm/guest_memfd.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ static inline kvm_pfn_t folio_file_pfn(struct folio *folio, pgoff_t index)
2727

2828
static int kvm_gmem_prepare_folio(struct inode *inode, pgoff_t index, struct folio *folio)
2929
{
30-
#ifdef CONFIG_HAVE_KVM_GMEM_PREPARE
30+
#ifdef CONFIG_HAVE_KVM_ARCH_GMEM_PREPARE
3131
struct list_head *gmem_list = &inode->i_mapping->i_private_list;
3232
struct kvm_gmem *gmem;
3333

@@ -353,7 +353,7 @@ static int kvm_gmem_error_folio(struct address_space *mapping, struct folio *fol
353353
return MF_DELAYED;
354354
}
355355

356-
#ifdef CONFIG_HAVE_KVM_GMEM_INVALIDATE
356+
#ifdef CONFIG_HAVE_KVM_ARCH_GMEM_INVALIDATE
357357
static void kvm_gmem_free_folio(struct folio *folio)
358358
{
359359
struct page *page = folio_page(folio, 0);
@@ -368,7 +368,7 @@ static const struct address_space_operations kvm_gmem_aops = {
368368
.dirty_folio = noop_dirty_folio,
369369
.migrate_folio = kvm_gmem_migrate_folio,
370370
.error_remove_folio = kvm_gmem_error_folio,
371-
#ifdef CONFIG_HAVE_KVM_GMEM_INVALIDATE
371+
#ifdef CONFIG_HAVE_KVM_ARCH_GMEM_INVALIDATE
372372
.free_folio = kvm_gmem_free_folio,
373373
#endif
374374
};

0 commit comments

Comments
 (0)