Skip to content

Commit 36811f8

Browse files
committed
Merge: [s390] s390/uv: KVM: Display available host key hashes for Secure Execution + Support retrievable secrets in Secure Execution guests
MR: https://gitlab.com/redhat/centos-stream/src/kernel/centos-stream-9/-/merge_requests/5880 JIRA: https://issues.redhat.com/browse/RHEL-50752 JIRA: https://issues.redhat.com/browse/RHEL-50754 Tested: by IBM Build-Info: https://brewweb.engineering.redhat.com/brew/taskinfo?taskID=66103044 Commits: ``` 6dc2e98 bb4ad73 28a51ee da59c71 7c9137a 9996159 d356137 f00469a 3fad3bd ``` Signed-off-by: Mete Durlu <mdurlu@redhat.com> Approved-by: Steve Best <sbest@redhat.com> Approved-by: Thomas Huth <thuth@redhat.com> Approved-by: CKI KWF Bot <cki-ci-bot+kwf-gitlab-com@redhat.com> Merged-by: Rado Vrbovsky <rvrbovsk@redhat.com>
2 parents dfdbeb3 + 776e707 commit 36811f8

File tree

13 files changed

+548
-147
lines changed

13 files changed

+548
-147
lines changed

arch/s390/Kconfig

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

769769
menu "Virtualization"
770770

771-
config PROTECTED_VIRTUALIZATION_GUEST
772-
def_bool n
773-
prompt "Protected virtualization guest support"
774-
help
775-
Select this option, if you want to be able to run this
776-
kernel as a protected virtualization KVM guest.
777-
Protected virtualization capable machines have a mini hypervisor
778-
located at machine level (an ultravisor). With help of the
779-
Ultravisor, KVM will be able to run "protected" VMs, special
780-
VMs whose memory and management data are unavailable to KVM.
781-
782771
config PFAULT
783772
def_bool y
784773
prompt "Pseudo page fault support"

arch/s390/boot/Makefile

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

3838
obj-y := head.o als.o startup.o physmem_info.o ipl_parm.o ipl_report.o vmem.o
3939
obj-y += string.o ebcdic.o sclp_early_core.o mem.o ipl_vmparm.o cmdline.o
40-
obj-y += version.o pgm_check_info.o ctype.o ipl_data.o machine_kexec_reloc.o
41-
obj-$(findstring y, $(CONFIG_PROTECTED_VIRTUALIZATION_GUEST) $(CONFIG_PGSTE)) += uv.o
40+
obj-y += version.o pgm_check_info.o ctype.o ipl_data.o machine_kexec_reloc.o uv.o
4241
obj-$(CONFIG_RANDOMIZE_BASE) += kaslr.o
4342
obj-y += $(if $(CONFIG_KERNEL_UNCOMPRESSED),,decompressor.o) info.o
4443
obj-$(CONFIG_KERNEL_ZSTD) += clz_ctz.o

arch/s390/boot/uv.c

Lines changed: 4 additions & 11 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)
@@ -26,8 +22,8 @@ void uv_query_info(void)
2622
if (!test_facility(158))
2723
return;
2824

29-
/* rc==0x100 means that there is additional data we do not process */
30-
if (uv_call(0, (uint64_t)&uvcb) && uvcb.header.rc != 0x100)
25+
/* Ignore that there might be more data we do not process */
26+
if (uv_call(0, (uint64_t)&uvcb) && uvcb.header.rc != UVC_RC_MORE_DATA)
3127
return;
3228

3329
if (IS_ENABLED(CONFIG_KVM)) {
@@ -50,17 +46,15 @@ void uv_query_info(void)
5046
uv_info.supp_add_secret_req_ver = uvcb.supp_add_secret_req_ver;
5147
uv_info.supp_add_secret_pcf = uvcb.supp_add_secret_pcf;
5248
uv_info.supp_secret_types = uvcb.supp_secret_types;
53-
uv_info.max_secrets = uvcb.max_secrets;
49+
uv_info.max_assoc_secrets = uvcb.max_assoc_secrets;
50+
uv_info.max_retr_secrets = uvcb.max_retr_secrets;
5451
}
5552

56-
#ifdef CONFIG_PROTECTED_VIRTUALIZATION_GUEST
5753
if (test_bit_inv(BIT_UVC_CMD_SET_SHARED_ACCESS, (unsigned long *)uvcb.inst_calls_list) &&
5854
test_bit_inv(BIT_UVC_CMD_REMOVE_SHARED_ACCESS, (unsigned long *)uvcb.inst_calls_list))
5955
prot_virt_guest = 1;
60-
#endif
6156
}
6257

63-
#if IS_ENABLED(CONFIG_KVM)
6458
unsigned long adjust_to_uv_max(unsigned long limit)
6559
{
6660
if (is_prot_virt_host() && uv_info.max_sec_stor_addr)
@@ -92,4 +86,3 @@ void sanitize_prot_virt_host(void)
9286
{
9387
prot_virt_host = is_prot_virt_host_capable();
9488
}
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,10 +174,8 @@ 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_page_accessible(struct page *page);
179178
#define HAVE_ARCH_MAKE_PAGE_ACCESSIBLE
180-
#endif
181179

182180
#define __PAGE_OFFSET 0x0UL
183181
#define PAGE_OFFSET 0x0UL

0 commit comments

Comments
 (0)