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 346DDC2BA83 for ; Thu, 13 Feb 2020 08:45:06 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id D238E218AC for ; Thu, 13 Feb 2020 08:45:05 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (1024-bit key) header.d=redhat.com header.i=@redhat.com header.b="hjKSdjeI" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org D238E218AC 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 53B5E6B0125; Thu, 13 Feb 2020 03:45:04 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id 4EAEC6B0173; Thu, 13 Feb 2020 03:45:04 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 428CC6B0326; Thu, 13 Feb 2020 03:45:04 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0187.hostedemail.com [216.40.44.187]) by kanga.kvack.org (Postfix) with ESMTP id 296896B0125 for ; Thu, 13 Feb 2020 03:45:04 -0500 (EST) Received: from smtpin11.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay04.hostedemail.com (Postfix) with ESMTP id C41E14995ED for ; Thu, 13 Feb 2020 08:45:03 +0000 (UTC) X-FDA: 76484468886.11.veil23_49309c1ac8a63 X-HE-Tag: veil23_49309c1ac8a63 X-Filterd-Recvd-Size: 5257 Received: from us-smtp-1.mimecast.com (us-smtp-delivery-1.mimecast.com [207.211.31.120]) by imf22.hostedemail.com (Postfix) with ESMTP for ; Thu, 13 Feb 2020 08:45:02 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1581583502; 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=Hn3WrUa+llk/toxacuv4ppNzSqH2ai2ii21rs8gjazk=; b=hjKSdjeIVaPIlWgksKpmlT9grtc/R6Z5XJ+cBzRsxYdnkuww9mJwvwwOg83OsJfvsS9wwO SFsDAW9mx3Wyi944whLlLbiv5KzZZm3UjXnmdrKMIkxlUds+n3SZ2i3ljBsFfglOqcWR2N tvIFvqvGW0NP8N9LgfBLccB5sPlLaXY= 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-67-oIWsehGWOHumwd_1Tred8Q-1; Thu, 13 Feb 2020 03:44:56 -0500 X-MC-Unique: oIWsehGWOHumwd_1Tred8Q-1 Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.phx2.redhat.com [10.5.11.15]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 255E08017DF; Thu, 13 Feb 2020 08:44:55 +0000 (UTC) Received: from gondolin (ovpn-117-87.ams2.redhat.com [10.36.117.87]) by smtp.corp.redhat.com (Postfix) with ESMTP id 062785C13E; Thu, 13 Feb 2020 08:44:49 +0000 (UTC) Date: Thu, 13 Feb 2020 09:44:38 +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: <20200213094438.21204b84.cohuck@redhat.com> In-Reply-To: References: <20200207113958.7320-1-borntraeger@de.ibm.com> <20200207113958.7320-6-borntraeger@de.ibm.com> <20200212144212.1d0b4226.cohuck@redhat.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.15 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 Thu, 13 Feb 2020 08:43:33 +0100 Christian Borntraeger wrote: > On 12.02.20 14:42, Cornelia Huck wrote: > > 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. > > Yes. We will improve some other aspects of this patch, but I will add > > /* Return on success or if this page was already exported */ Sounds good. > > > >> + return 0; > >> + return -EINVAL; > >> +} > > > > (...) > > >