]> www.infradead.org Git - users/hch/block.git/commitdiff
s390: Remove protvirt and kvm config guards for uv code
authorJanosch Frank <frankja@linux.ibm.com>
Thu, 4 Jul 2024 11:02:46 +0000 (11:02 +0000)
committerVasily Gorbik <gor@linux.ibm.com>
Tue, 23 Jul 2024 14:02:33 +0000 (16:02 +0200)
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 <frankja@linux.ibm.com>
Acked-by: Christian Borntraeger <borntraeger@linux.ibm.com>
Acked-by: Heiko Carstens <hca@linux.ibm.com>
Signed-off-by: Vasily Gorbik <gor@linux.ibm.com>
arch/s390/Kconfig
arch/s390/boot/Makefile
arch/s390/boot/uv.c
arch/s390/boot/uv.h
arch/s390/configs/debug_defconfig
arch/s390/configs/defconfig
arch/s390/include/asm/page.h
arch/s390/include/asm/uv.h
arch/s390/kernel/Makefile
arch/s390/kernel/uv.c
drivers/s390/char/Kconfig

index 59e0d861e26ffcbda3ea32d0c538e97f9fba204a..a822f952f64a9c6cafadd3e8b96f905edfcc5829 100644 (file)
@@ -799,17 +799,6 @@ config HAVE_PNETID
 
 menu "Virtualization"
 
-config PROTECTED_VIRTUALIZATION_GUEST
-       def_bool n
-       prompt "Protected virtualization guest support"
-       help
-         Select this option, if you want to be able to run this
-         kernel as a protected virtualization KVM guest.
-         Protected virtualization capable machines have a mini hypervisor
-         located at machine level (an ultravisor). With help of the
-         Ultravisor, KVM will be able to run "protected" VMs, special
-         VMs whose memory and management data are unavailable to KVM.
-
 config PFAULT
        def_bool y
        prompt "Pseudo page fault support"
index 5d8cb7e3b096323871cd02cfbe45ab13564d6486..4f476884d340442a995d85d2a5ff18dfd87fdf2c 100644 (file)
@@ -39,8 +39,7 @@ CFLAGS_sclp_early_core.o += -I$(srctree)/drivers/s390/char
 
 obj-y  := head.o als.o startup.o physmem_info.o ipl_parm.o ipl_report.o vmem.o
 obj-y  += string.o ebcdic.o sclp_early_core.o mem.o ipl_vmparm.o cmdline.o
-obj-y  += version.o pgm_check_info.o ctype.o ipl_data.o relocs.o alternative.o
-obj-$(findstring y, $(CONFIG_PROTECTED_VIRTUALIZATION_GUEST) $(CONFIG_PGSTE))  += uv.o
+obj-y  += version.o pgm_check_info.o ctype.o ipl_data.o relocs.o alternative.o uv.o
 obj-$(CONFIG_RANDOMIZE_BASE)   += kaslr.o
 obj-y  += $(if $(CONFIG_KERNEL_UNCOMPRESSED),,decompressor.o) info.o
 obj-$(CONFIG_KERNEL_ZSTD) += clz_ctz.o
index 1e66d2cbb0965a145730d08bf70e79d48ba1e1a9..318e6ba95bfd27b266b2c720392fa8eaf0b045af 100644 (file)
@@ -8,12 +8,8 @@
 #include "uv.h"
 
 /* will be used in arch/s390/kernel/uv.c */
-#ifdef CONFIG_PROTECTED_VIRTUALIZATION_GUEST
 int __bootdata_preserved(prot_virt_guest);
-#endif
-#if IS_ENABLED(CONFIG_KVM)
 int __bootdata_preserved(prot_virt_host);
-#endif
 struct uv_info __bootdata_preserved(uv_info);
 
 void uv_query_info(void)
@@ -53,14 +49,11 @@ void uv_query_info(void)
                uv_info.max_secrets = uvcb.max_secrets;
        }
 
-#ifdef CONFIG_PROTECTED_VIRTUALIZATION_GUEST
        if (test_bit_inv(BIT_UVC_CMD_SET_SHARED_ACCESS, (unsigned long *)uvcb.inst_calls_list) &&
            test_bit_inv(BIT_UVC_CMD_REMOVE_SHARED_ACCESS, (unsigned long *)uvcb.inst_calls_list))
                prot_virt_guest = 1;
-#endif
 }
 
-#if IS_ENABLED(CONFIG_KVM)
 unsigned long adjust_to_uv_max(unsigned long limit)
 {
        if (is_prot_virt_host() && uv_info.max_sec_stor_addr)
@@ -92,4 +85,3 @@ void sanitize_prot_virt_host(void)
 {
        prot_virt_host = is_prot_virt_host_capable();
 }
-#endif
index 0f3070856f8dca909ee500b1b04100bc4fedf31e..da4a4a8d48e0aa7386657894542b2f2d6eda98cc 100644 (file)
@@ -2,21 +2,8 @@
 #ifndef BOOT_UV_H
 #define BOOT_UV_H
 
-#if IS_ENABLED(CONFIG_KVM)
 unsigned long adjust_to_uv_max(unsigned long limit);
 void sanitize_prot_virt_host(void);
-#else
-static inline unsigned long adjust_to_uv_max(unsigned long limit)
-{
-       return limit;
-}
-static inline void sanitize_prot_virt_host(void) {}
-#endif
-
-#if defined(CONFIG_PROTECTED_VIRTUALIZATION_GUEST) || IS_ENABLED(CONFIG_KVM)
 void uv_query_info(void);
-#else
-static inline void uv_query_info(void) {}
-#endif
 
 #endif /* BOOT_UV_H */
index f3602414a9614f9d0aa7f1b8f2377c69a8181098..ea63a7342f5ff278a346425f84fb112951354f25 100644 (file)
@@ -55,7 +55,6 @@ CONFIG_EXPOLINE_AUTO=y
 CONFIG_CHSC_SCH=y
 CONFIG_VFIO_CCW=m
 CONFIG_VFIO_AP=m
-CONFIG_PROTECTED_VIRTUALIZATION_GUEST=y
 CONFIG_CMM=m
 CONFIG_APPLDATA_BASE=y
 CONFIG_S390_HYPFS_FS=y
index d0d8925fdf09f091c2a269bd7c3d2dd31d9ca7db..d8b28ff8ff451e91b79b9caeca3c1e6977e44be5 100644 (file)
@@ -53,7 +53,6 @@ CONFIG_EXPOLINE_AUTO=y
 CONFIG_CHSC_SCH=y
 CONFIG_VFIO_CCW=m
 CONFIG_VFIO_AP=m
-CONFIG_PROTECTED_VIRTUALIZATION_GUEST=y
 CONFIG_CMM=m
 CONFIG_APPLDATA_BASE=y
 CONFIG_S390_HYPFS_FS=y
index 5ec41ec3d761e3fa6b603da90c35280ab34d8a50..06416b3f94f595d26ca6687ebf4cfc1e6a2a7758 100644 (file)
@@ -174,12 +174,10 @@ static inline int devmem_is_allowed(unsigned long pfn)
 #define HAVE_ARCH_FREE_PAGE
 #define HAVE_ARCH_ALLOC_PAGE
 
-#if IS_ENABLED(CONFIG_PGSTE)
 int arch_make_folio_accessible(struct folio *folio);
 #define HAVE_ARCH_MAKE_FOLIO_ACCESSIBLE
 int arch_make_page_accessible(struct page *page);
 #define HAVE_ARCH_MAKE_PAGE_ACCESSIBLE
-#endif
 
 struct vm_layout {
        unsigned long kaslr_offset;
index 0679445cac0be8ea9f76e35588d720192b3c77f0..0b5f8f3e84f126dc9225e0f81c658062139894cb 100644 (file)
@@ -414,7 +414,6 @@ static inline bool uv_has_feature(u8 feature_bit)
        return test_bit_inv(feature_bit, &uv_info.uv_feature_indications);
 }
 
-#ifdef CONFIG_PROTECTED_VIRTUALIZATION_GUEST
 extern int prot_virt_guest;
 
 static inline int is_prot_virt_guest(void)
@@ -466,13 +465,6 @@ static inline int uv_remove_shared(unsigned long addr)
        return share(addr, UVC_CMD_REMOVE_SHARED_ACCESS);
 }
 
-#else
-#define is_prot_virt_guest() 0
-static inline int uv_set_shared(unsigned long addr) { return 0; }
-static inline int uv_remove_shared(unsigned long addr) { return 0; }
-#endif
-
-#if IS_ENABLED(CONFIG_KVM)
 extern int prot_virt_host;
 
 static inline int is_prot_virt_host(void)
@@ -489,29 +481,5 @@ int uv_convert_from_secure_pte(pte_t pte);
 int gmap_convert_to_secure(struct gmap *gmap, unsigned long gaddr);
 
 void setup_uv(void);
-#else
-#define is_prot_virt_host() 0
-static inline void setup_uv(void) {}
-
-static inline int uv_pin_shared(unsigned long paddr)
-{
-       return 0;
-}
-
-static inline int uv_destroy_folio(struct folio *folio)
-{
-       return 0;
-}
-
-static inline int uv_destroy_pte(pte_t pte)
-{
-       return 0;
-}
-
-static inline int uv_convert_from_secure_pte(pte_t pte)
-{
-       return 0;
-}
-#endif
 
 #endif /* _ASM_S390_UV_H */
index 7241fa194709208d0feacd64fc89e91691e70746..e47a4be54ff8e2ab2ca26bc2c73c0554c6027122 100644 (file)
@@ -43,7 +43,7 @@ obj-y += sysinfo.o lgr.o os_info.o ctlreg.o
 obj-y  += runtime_instr.o cache.o fpu.o dumpstack.o guarded_storage.o sthyi.o
 obj-y  += entry.o reipl.o kdebugfs.o alternative.o
 obj-y  += nospec-branch.o ipl_vmparm.o machine_kexec_reloc.o unwind_bc.o
-obj-y  += smp.o text_amode31.o stacktrace.o abs_lowcore.o facility.o
+obj-y  += smp.o text_amode31.o stacktrace.o abs_lowcore.o facility.o uv.o
 
 extra-y                                += vmlinux.lds
 
@@ -80,7 +80,6 @@ obj-$(CONFIG_PERF_EVENTS)     += perf_cpum_cf_events.o perf_regs.o
 obj-$(CONFIG_PERF_EVENTS)      += perf_pai_crypto.o perf_pai_ext.o
 
 obj-$(CONFIG_TRACEPOINTS)      += trace.o
-obj-$(findstring y, $(CONFIG_PROTECTED_VIRTUALIZATION_GUEST) $(CONFIG_PGSTE))  += uv.o
 
 # vdso
 obj-y                          += vdso64/
index fa62fa0e369f2736216d3509f51c35d50c32a1c0..36db065c7cf75fddfac665072a273236f95639b3 100644 (file)
 #include <asm/sections.h>
 #include <asm/uv.h>
 
+#if !IS_ENABLED(CONFIG_KVM)
+unsigned long __gmap_translate(struct gmap *gmap, unsigned long gaddr)
+{
+       return 0;
+}
+
+int gmap_fault(struct gmap *gmap, unsigned long gaddr,
+              unsigned int fault_flags)
+{
+       return 0;
+}
+#endif
+
 /* the bootdata_preserved fields come from ones in arch/s390/boot/uv.c */
-#ifdef CONFIG_PROTECTED_VIRTUALIZATION_GUEST
 int __bootdata_preserved(prot_virt_guest);
 EXPORT_SYMBOL(prot_virt_guest);
-#endif
 
 /*
  * uv_info contains both host and guest information but it's currently only
@@ -35,7 +46,6 @@ EXPORT_SYMBOL(prot_virt_guest);
 struct uv_info __bootdata_preserved(uv_info);
 EXPORT_SYMBOL(uv_info);
 
-#if IS_ENABLED(CONFIG_KVM)
 int __bootdata_preserved(prot_virt_host);
 EXPORT_SYMBOL(prot_virt_host);
 
@@ -543,9 +553,6 @@ int arch_make_page_accessible(struct page *page)
        return arch_make_folio_accessible(page_folio(page));
 }
 EXPORT_SYMBOL_GPL(arch_make_page_accessible);
-#endif
-
-#if defined(CONFIG_PROTECTED_VIRTUALIZATION_GUEST) || IS_ENABLED(CONFIG_KVM)
 static ssize_t uv_query_facilities(struct kobject *kobj,
                                   struct kobj_attribute *attr, char *buf)
 {
@@ -721,24 +728,13 @@ static struct attribute_group uv_query_attr_group = {
 static ssize_t uv_is_prot_virt_guest(struct kobject *kobj,
                                     struct kobj_attribute *attr, char *buf)
 {
-       int val = 0;
-
-#ifdef CONFIG_PROTECTED_VIRTUALIZATION_GUEST
-       val = prot_virt_guest;
-#endif
-       return sysfs_emit(buf, "%d\n", val);
+       return sysfs_emit(buf, "%d\n", prot_virt_guest);
 }
 
 static ssize_t uv_is_prot_virt_host(struct kobject *kobj,
                                    struct kobj_attribute *attr, char *buf)
 {
-       int val = 0;
-
-#if IS_ENABLED(CONFIG_KVM)
-       val = prot_virt_host;
-#endif
-
-       return sysfs_emit(buf, "%d\n", val);
+       return sysfs_emit(buf, "%d\n", prot_virt_host);
 }
 
 static struct kobj_attribute uv_prot_virt_guest =
@@ -790,4 +786,3 @@ out_kobj:
        return rc;
 }
 device_initcall(uv_info_init);
-#endif
index 8a03af5ee5b30015aa60e658c70e663776dd6478..80c4e5101c9712f2421e6ebec01b91153ebeaa82 100644 (file)
@@ -96,7 +96,7 @@ config SCLP_OFB
 config S390_UV_UAPI
        def_tristate m
        prompt "Ultravisor userspace API"
-       depends on S390 && (KVM || PROTECTED_VIRTUALIZATION_GUEST)
+       depends on S390
        help
          Selecting exposes parts of the UV interface to userspace
          by providing a misc character device at /dev/uv.