From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-3.9 required=3.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI, SIGNED_OFF_BY,SPF_HELO_NONE,SPF_PASS autolearn=no autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 45FA0C2BA83 for ; Wed, 12 Feb 2020 13:42:28 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 1CA6820724 for ; Wed, 12 Feb 2020 13:42:28 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (1024-bit key) header.d=redhat.com header.i=@redhat.com header.b="OoNc/+fy" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727548AbgBLNm1 (ORCPT ); Wed, 12 Feb 2020 08:42:27 -0500 Received: from us-smtp-2.mimecast.com ([207.211.31.81]:27548 "EHLO us-smtp-delivery-1.mimecast.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1725887AbgBLNm1 (ORCPT ); Wed, 12 Feb 2020 08:42:27 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1581514945; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=nFMErzcYo936qHssc4z4QLiG0wmanvB4MUFteWMjHSM=; b=OoNc/+fy8lGdhhAOSd763MzSF1u+6KUkol9t0yXZkx0PxgpPNNwAQ5UnYF+1HVkqQPjmYd twbVyQCAizjuMANoX8QBbSvuLn3cmD8eR7W0mQBWqLVGsv6SPNqFJMF032KG9/CHy3K3SI N1OTLeRvWsy5y2e2HWDY1ZycsCJA3c4= Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-277-QmzSa1izPQO5kZWa0W24hA-1; Wed, 12 Feb 2020 08:42:22 -0500 X-MC-Unique: QmzSa1izPQO5kZWa0W24hA-1 Received: from smtp.corp.redhat.com (int-mx06.intmail.prod.int.phx2.redhat.com [10.5.11.16]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 163E4190D343; Wed, 12 Feb 2020 13:42:20 +0000 (UTC) Received: from gondolin (dhcp-192-195.str.redhat.com [10.33.192.195]) by smtp.corp.redhat.com (Postfix) with ESMTP id BD90D5C1B0; Wed, 12 Feb 2020 13:42:14 +0000 (UTC) Date: Wed, 12 Feb 2020 14:42:12 +0100 From: Cornelia Huck To: Christian Borntraeger Cc: Janosch Frank , KVM , David Hildenbrand , Thomas Huth , Ulrich Weigand , Claudio Imbrenda , Andrea Arcangeli , linux-s390 , Michael Mueller , Vasily Gorbik , linux-mm@kvack.org, Andrew Morton Subject: Re: [PATCH 05/35] s390/mm: provide memory management functions for protected KVM guests Message-ID: <20200212144212.1d0b4226.cohuck@redhat.com> In-Reply-To: <20200207113958.7320-6-borntraeger@de.ibm.com> References: <20200207113958.7320-1-borntraeger@de.ibm.com> <20200207113958.7320-6-borntraeger@de.ibm.com> Organization: Red Hat GmbH MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-Scanned-By: MIMEDefang 2.79 on 10.5.11.16 Sender: kvm-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: kvm@vger.kernel.org On Fri, 7 Feb 2020 06:39:28 -0500 Christian Borntraeger wrote: > From: Claudio Imbrenda > > 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 > Signed-off-by: Ulrich Weigand > Signed-off-by: Claudio Imbrenda > [borntraeger@de.ibm.com: patch merging, splitting, fixing] > Signed-off-by: Christian Borntraeger > --- > 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. > + return 0; > + return -EINVAL; > +} (...)