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 0E433C352A4 for ; Wed, 12 Feb 2020 13:42:28 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id C6FBB20659 for ; Wed, 12 Feb 2020 13:42:27 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (1024-bit key) header.d=redhat.com header.i=@redhat.com header.b="OoNc/+fy" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org C6FBB20659 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=redhat.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=owner-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix) id 426B06B044F; Wed, 12 Feb 2020 08:42:27 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id 3D7056B0451; Wed, 12 Feb 2020 08:42:27 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 2EC856B0452; Wed, 12 Feb 2020 08:42:27 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0071.hostedemail.com [216.40.44.71]) by kanga.kvack.org (Postfix) with ESMTP id 148876B044F for ; Wed, 12 Feb 2020 08:42:27 -0500 (EST) Received: from smtpin27.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay03.hostedemail.com (Postfix) with ESMTP id 93CBA8248076 for ; Wed, 12 Feb 2020 13:42:26 +0000 (UTC) X-FDA: 76481589492.27.hook62_89ae9328c7953 X-HE-Tag: hook62_89ae9328c7953 X-Filterd-Recvd-Size: 4650 Received: from us-smtp-1.mimecast.com (us-smtp-delivery-1.mimecast.com [207.211.31.120]) by imf13.hostedemail.com (Postfix) with ESMTP for ; Wed, 12 Feb 2020 13:42:25 +0000 (UTC) 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 X-Bogosity: Ham, tests=bogofilter, spamicity=0.000000, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: 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; > +} (...)