On 12.02.20 14:42, Cornelia Huck wrote: > On Fri, 7 Feb 2020 06:39:28 -0500 > Christian Borntraeger <borntraeger@xxxxxxxxxx> wrote: > >> From: Claudio Imbrenda <imbrenda@xxxxxxxxxxxxx> >> >> This provides the basic ultravisor calls and page table handling to cope >> with secure guests: >> - provide arch_make_page_accessible >> - make pages accessible after unmapping of secure guests >> - provide the ultravisor commands convert to/from secure >> - provide the ultravisor commands pin/unpin shared >> - provide callbacks to make pages secure (inacccessible) >> - we check for the expected pin count to only make pages secure if the >> host is not accessing them >> - we fence hugetlbfs for secure pages >> >> Co-developed-by: Ulrich Weigand <Ulrich.Weigand@xxxxxxxxxx> >> Signed-off-by: Ulrich Weigand <Ulrich.Weigand@xxxxxxxxxx> >> Signed-off-by: Claudio Imbrenda <imbrenda@xxxxxxxxxxxxx> >> [borntraeger@xxxxxxxxxx: patch merging, splitting, fixing] >> Signed-off-by: Christian Borntraeger <borntraeger@xxxxxxxxxx> >> --- >> arch/s390/include/asm/gmap.h | 2 + >> arch/s390/include/asm/mmu.h | 2 + >> arch/s390/include/asm/mmu_context.h | 1 + >> arch/s390/include/asm/page.h | 5 + >> arch/s390/include/asm/pgtable.h | 34 +++++- >> arch/s390/include/asm/uv.h | 52 +++++++++ >> arch/s390/kernel/uv.c | 172 ++++++++++++++++++++++++++++ >> 7 files changed, 263 insertions(+), 5 deletions(-) > > (...) > >> +/* >> + * Requests the Ultravisor to encrypt a guest page and make it >> + * accessible to the host for paging (export). >> + * >> + * @paddr: Absolute host address of page to be exported >> + */ >> +int uv_convert_from_secure(unsigned long paddr) >> +{ >> + struct uv_cb_cfs uvcb = { >> + .header.cmd = UVC_CMD_CONV_FROM_SEC_STOR, >> + .header.len = sizeof(uvcb), >> + .paddr = paddr >> + }; >> + >> + uv_call(0, (u64)&uvcb); >> + >> + if (uvcb.header.rc == 1 || uvcb.header.rc == 0x107) > > I think this either wants a comment or some speaking #defines. Yes. We will improve some other aspects of this patch, but I will add /* Return on success or if this page was already exported */ > >> + return 0; >> + return -EINVAL; >> +} > > (...) >