Skip to content

Commit 6dc2e98

Browse files
frankjaaVasily Gorbik
authored andcommitted
s390: Remove protvirt and kvm config guards for uv code
Removing the CONFIG_PROTECTED_VIRTUALIZATION_GUEST ifdefs and config option as well as CONFIG_KVM ifdefs in uv files. Having this configurable has been more of a pain than a help. It's time to remove the ifdefs and the config option. Signed-off-by: Janosch Frank <[email protected]> Acked-by: Christian Borntraeger <[email protected]> Acked-by: Heiko Carstens <[email protected]> Signed-off-by: Vasily Gorbik <[email protected]>
1 parent 8f1e70a commit 6dc2e98

File tree

11 files changed

+18
-93
lines changed

11 files changed

+18
-93
lines changed

arch/s390/Kconfig

Lines changed: 0 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -799,17 +799,6 @@ config HAVE_PNETID
799799

800800
menu "Virtualization"
801801

802-
config PROTECTED_VIRTUALIZATION_GUEST
803-
def_bool n
804-
prompt "Protected virtualization guest support"
805-
help
806-
Select this option, if you want to be able to run this
807-
kernel as a protected virtualization KVM guest.
808-
Protected virtualization capable machines have a mini hypervisor
809-
located at machine level (an ultravisor). With help of the
810-
Ultravisor, KVM will be able to run "protected" VMs, special
811-
VMs whose memory and management data are unavailable to KVM.
812-
813802
config PFAULT
814803
def_bool y
815804
prompt "Pseudo page fault support"

arch/s390/boot/Makefile

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -39,8 +39,7 @@ CFLAGS_sclp_early_core.o += -I$(srctree)/drivers/s390/char
3939

4040
obj-y := head.o als.o startup.o physmem_info.o ipl_parm.o ipl_report.o vmem.o
4141
obj-y += string.o ebcdic.o sclp_early_core.o mem.o ipl_vmparm.o cmdline.o
42-
obj-y += version.o pgm_check_info.o ctype.o ipl_data.o relocs.o alternative.o
43-
obj-$(findstring y, $(CONFIG_PROTECTED_VIRTUALIZATION_GUEST) $(CONFIG_PGSTE)) += uv.o
42+
obj-y += version.o pgm_check_info.o ctype.o ipl_data.o relocs.o alternative.o uv.o
4443
obj-$(CONFIG_RANDOMIZE_BASE) += kaslr.o
4544
obj-y += $(if $(CONFIG_KERNEL_UNCOMPRESSED),,decompressor.o) info.o
4645
obj-$(CONFIG_KERNEL_ZSTD) += clz_ctz.o

arch/s390/boot/uv.c

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -8,12 +8,8 @@
88
#include "uv.h"
99

1010
/* will be used in arch/s390/kernel/uv.c */
11-
#ifdef CONFIG_PROTECTED_VIRTUALIZATION_GUEST
1211
int __bootdata_preserved(prot_virt_guest);
13-
#endif
14-
#if IS_ENABLED(CONFIG_KVM)
1512
int __bootdata_preserved(prot_virt_host);
16-
#endif
1713
struct uv_info __bootdata_preserved(uv_info);
1814

1915
void uv_query_info(void)
@@ -53,14 +49,11 @@ void uv_query_info(void)
5349
uv_info.max_secrets = uvcb.max_secrets;
5450
}
5551

56-
#ifdef CONFIG_PROTECTED_VIRTUALIZATION_GUEST
5752
if (test_bit_inv(BIT_UVC_CMD_SET_SHARED_ACCESS, (unsigned long *)uvcb.inst_calls_list) &&
5853
test_bit_inv(BIT_UVC_CMD_REMOVE_SHARED_ACCESS, (unsigned long *)uvcb.inst_calls_list))
5954
prot_virt_guest = 1;
60-
#endif
6155
}
6256

63-
#if IS_ENABLED(CONFIG_KVM)
6457
unsigned long adjust_to_uv_max(unsigned long limit)
6558
{
6659
if (is_prot_virt_host() && uv_info.max_sec_stor_addr)
@@ -92,4 +85,3 @@ void sanitize_prot_virt_host(void)
9285
{
9386
prot_virt_host = is_prot_virt_host_capable();
9487
}
95-
#endif

arch/s390/boot/uv.h

Lines changed: 0 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -2,21 +2,8 @@
22
#ifndef BOOT_UV_H
33
#define BOOT_UV_H
44

5-
#if IS_ENABLED(CONFIG_KVM)
65
unsigned long adjust_to_uv_max(unsigned long limit);
76
void sanitize_prot_virt_host(void);
8-
#else
9-
static inline unsigned long adjust_to_uv_max(unsigned long limit)
10-
{
11-
return limit;
12-
}
13-
static inline void sanitize_prot_virt_host(void) {}
14-
#endif
15-
16-
#if defined(CONFIG_PROTECTED_VIRTUALIZATION_GUEST) || IS_ENABLED(CONFIG_KVM)
177
void uv_query_info(void);
18-
#else
19-
static inline void uv_query_info(void) {}
20-
#endif
218

229
#endif /* BOOT_UV_H */

arch/s390/configs/debug_defconfig

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,6 @@ CONFIG_EXPOLINE_AUTO=y
5555
CONFIG_CHSC_SCH=y
5656
CONFIG_VFIO_CCW=m
5757
CONFIG_VFIO_AP=m
58-
CONFIG_PROTECTED_VIRTUALIZATION_GUEST=y
5958
CONFIG_CMM=m
6059
CONFIG_APPLDATA_BASE=y
6160
CONFIG_S390_HYPFS_FS=y

arch/s390/configs/defconfig

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,6 @@ CONFIG_EXPOLINE_AUTO=y
5353
CONFIG_CHSC_SCH=y
5454
CONFIG_VFIO_CCW=m
5555
CONFIG_VFIO_AP=m
56-
CONFIG_PROTECTED_VIRTUALIZATION_GUEST=y
5756
CONFIG_CMM=m
5857
CONFIG_APPLDATA_BASE=y
5958
CONFIG_S390_HYPFS_FS=y

arch/s390/include/asm/page.h

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -174,12 +174,10 @@ static inline int devmem_is_allowed(unsigned long pfn)
174174
#define HAVE_ARCH_FREE_PAGE
175175
#define HAVE_ARCH_ALLOC_PAGE
176176

177-
#if IS_ENABLED(CONFIG_PGSTE)
178177
int arch_make_folio_accessible(struct folio *folio);
179178
#define HAVE_ARCH_MAKE_FOLIO_ACCESSIBLE
180179
int arch_make_page_accessible(struct page *page);
181180
#define HAVE_ARCH_MAKE_PAGE_ACCESSIBLE
182-
#endif
183181

184182
struct vm_layout {
185183
unsigned long kaslr_offset;

arch/s390/include/asm/uv.h

Lines changed: 0 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -414,7 +414,6 @@ static inline bool uv_has_feature(u8 feature_bit)
414414
return test_bit_inv(feature_bit, &uv_info.uv_feature_indications);
415415
}
416416

417-
#ifdef CONFIG_PROTECTED_VIRTUALIZATION_GUEST
418417
extern int prot_virt_guest;
419418

420419
static inline int is_prot_virt_guest(void)
@@ -466,13 +465,6 @@ static inline int uv_remove_shared(unsigned long addr)
466465
return share(addr, UVC_CMD_REMOVE_SHARED_ACCESS);
467466
}
468467

469-
#else
470-
#define is_prot_virt_guest() 0
471-
static inline int uv_set_shared(unsigned long addr) { return 0; }
472-
static inline int uv_remove_shared(unsigned long addr) { return 0; }
473-
#endif
474-
475-
#if IS_ENABLED(CONFIG_KVM)
476468
extern int prot_virt_host;
477469

478470
static inline int is_prot_virt_host(void)
@@ -489,29 +481,5 @@ int uv_convert_from_secure_pte(pte_t pte);
489481
int gmap_convert_to_secure(struct gmap *gmap, unsigned long gaddr);
490482

491483
void setup_uv(void);
492-
#else
493-
#define is_prot_virt_host() 0
494-
static inline void setup_uv(void) {}
495-
496-
static inline int uv_pin_shared(unsigned long paddr)
497-
{
498-
return 0;
499-
}
500-
501-
static inline int uv_destroy_folio(struct folio *folio)
502-
{
503-
return 0;
504-
}
505-
506-
static inline int uv_destroy_pte(pte_t pte)
507-
{
508-
return 0;
509-
}
510-
511-
static inline int uv_convert_from_secure_pte(pte_t pte)
512-
{
513-
return 0;
514-
}
515-
#endif
516484

517485
#endif /* _ASM_S390_UV_H */

arch/s390/kernel/Makefile

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ obj-y += sysinfo.o lgr.o os_info.o ctlreg.o
4343
obj-y += runtime_instr.o cache.o fpu.o dumpstack.o guarded_storage.o sthyi.o
4444
obj-y += entry.o reipl.o kdebugfs.o alternative.o
4545
obj-y += nospec-branch.o ipl_vmparm.o machine_kexec_reloc.o unwind_bc.o
46-
obj-y += smp.o text_amode31.o stacktrace.o abs_lowcore.o facility.o
46+
obj-y += smp.o text_amode31.o stacktrace.o abs_lowcore.o facility.o uv.o
4747

4848
extra-y += vmlinux.lds
4949

@@ -80,7 +80,6 @@ obj-$(CONFIG_PERF_EVENTS) += perf_cpum_cf_events.o perf_regs.o
8080
obj-$(CONFIG_PERF_EVENTS) += perf_pai_crypto.o perf_pai_ext.o
8181

8282
obj-$(CONFIG_TRACEPOINTS) += trace.o
83-
obj-$(findstring y, $(CONFIG_PROTECTED_VIRTUALIZATION_GUEST) $(CONFIG_PGSTE)) += uv.o
8483

8584
# vdso
8685
obj-y += vdso64/

arch/s390/kernel/uv.c

Lines changed: 15 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -18,11 +18,22 @@
1818
#include <asm/sections.h>
1919
#include <asm/uv.h>
2020

21+
#if !IS_ENABLED(CONFIG_KVM)
22+
unsigned long __gmap_translate(struct gmap *gmap, unsigned long gaddr)
23+
{
24+
return 0;
25+
}
26+
27+
int gmap_fault(struct gmap *gmap, unsigned long gaddr,
28+
unsigned int fault_flags)
29+
{
30+
return 0;
31+
}
32+
#endif
33+
2134
/* the bootdata_preserved fields come from ones in arch/s390/boot/uv.c */
22-
#ifdef CONFIG_PROTECTED_VIRTUALIZATION_GUEST
2335
int __bootdata_preserved(prot_virt_guest);
2436
EXPORT_SYMBOL(prot_virt_guest);
25-
#endif
2637

2738
/*
2839
* uv_info contains both host and guest information but it's currently only
@@ -35,7 +46,6 @@ EXPORT_SYMBOL(prot_virt_guest);
3546
struct uv_info __bootdata_preserved(uv_info);
3647
EXPORT_SYMBOL(uv_info);
3748

38-
#if IS_ENABLED(CONFIG_KVM)
3949
int __bootdata_preserved(prot_virt_host);
4050
EXPORT_SYMBOL(prot_virt_host);
4151

@@ -543,9 +553,6 @@ int arch_make_page_accessible(struct page *page)
543553
return arch_make_folio_accessible(page_folio(page));
544554
}
545555
EXPORT_SYMBOL_GPL(arch_make_page_accessible);
546-
#endif
547-
548-
#if defined(CONFIG_PROTECTED_VIRTUALIZATION_GUEST) || IS_ENABLED(CONFIG_KVM)
549556
static ssize_t uv_query_facilities(struct kobject *kobj,
550557
struct kobj_attribute *attr, char *buf)
551558
{
@@ -721,24 +728,13 @@ static struct attribute_group uv_query_attr_group = {
721728
static ssize_t uv_is_prot_virt_guest(struct kobject *kobj,
722729
struct kobj_attribute *attr, char *buf)
723730
{
724-
int val = 0;
725-
726-
#ifdef CONFIG_PROTECTED_VIRTUALIZATION_GUEST
727-
val = prot_virt_guest;
728-
#endif
729-
return sysfs_emit(buf, "%d\n", val);
731+
return sysfs_emit(buf, "%d\n", prot_virt_guest);
730732
}
731733

732734
static ssize_t uv_is_prot_virt_host(struct kobject *kobj,
733735
struct kobj_attribute *attr, char *buf)
734736
{
735-
int val = 0;
736-
737-
#if IS_ENABLED(CONFIG_KVM)
738-
val = prot_virt_host;
739-
#endif
740-
741-
return sysfs_emit(buf, "%d\n", val);
737+
return sysfs_emit(buf, "%d\n", prot_virt_host);
742738
}
743739

744740
static struct kobj_attribute uv_prot_virt_guest =
@@ -790,4 +786,3 @@ static int __init uv_info_init(void)
790786
return rc;
791787
}
792788
device_initcall(uv_info_init);
793-
#endif

0 commit comments

Comments
 (0)