Received: by 2002:a25:1985:0:0:0:0:0 with SMTP id 127csp1675811ybz; Thu, 30 Apr 2020 03:37:02 -0700 (PDT) X-Google-Smtp-Source: APiQypLbchWDgPiWWBKTyYTlms0nTwW1Zxekve7n09WnXocwfsKzI17pmmFWwkkxhg6theZp5fc0 X-Received: by 2002:a17:906:ecb8:: with SMTP id qh24mr1981562ejb.299.1588243022531; Thu, 30 Apr 2020 03:37:02 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1588243022; cv=none; d=google.com; s=arc-20160816; b=ECdG8/CC4X+qrYqyylHWuJTSOMJesdo23pZd4+BpReIprxa8GluLMvFSO+6OtMzAks Wm/MqdeIN/yV6XikYPrIURtO/1k0aQ2CxPWquOVxFcx+zqjcUo++WF90IlYiEJ3VJ220 /TO9iIQ91N4fexUQ9O10vHj8XtZp21Vkrne3bMP2pplRyDZToN4RaDAe/8uXeGrs8Pq6 SWARhD9yJ7DMPbWjW761fIZQZ7FsMtYYXYQZV80ftdxbwtXmciYUnQOTNtJ7MTb09dKI 5Iyfk01SaK2YVIjjK2mrlqinXCpCGvht0Y3e34Oz2RprtR7ClJT5yYp04Y75rCTkGT17 jx3A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding :content-language:in-reply-to:mime-version:user-agent:date :message-id:from:references:cc:to:subject:dkim-signature; bh=O6Ku2Z3+7Gg0z8xz3T+AzovdxSe8hvidTw18x0PtX7U=; b=a7m+Nsz57dH1nbmI+FUJUsExg6pGXfnRaYFc1Qj0Jk9YhHlgYUX8cpgoZF0XHMfHGp wzHQ2TL+1CIOB8Z0dxhJ/5NOjhxsmIzeVO1yZcI/z2Q1nNXUaWfzejbfdRScDYBQ82Ws xYoJWXkdnDe1xv6c96iDjgwg/ZEj1b8S/vvA08kI4wqja2S5lRv4qzFwVzKHuGpMsIaF DSFFKcEs/LIFTwgi1nEk+y8SmNut8UTCVpiNchj3m7j4TOcW1thd8xX+emAJrnOwVRrp exv/PXhJU386S7XAoAqrFXVnmbx4q5kEIZ7Qz5GoKL0yYha0rhTF4Kxy9oeDSA6nb267 IYoA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=WrG3sTnN; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id m26si7466499edj.197.2020.04.30.03.36.38; Thu, 30 Apr 2020 03:37:02 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=WrG3sTnN; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726766AbgD3KeT (ORCPT + 99 others); Thu, 30 Apr 2020 06:34:19 -0400 Received: from us-smtp-2.mimecast.com ([207.211.31.81]:52785 "EHLO us-smtp-delivery-1.mimecast.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1725280AbgD3KeS (ORCPT ); Thu, 30 Apr 2020 06:34:18 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1588242857; 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=O6Ku2Z3+7Gg0z8xz3T+AzovdxSe8hvidTw18x0PtX7U=; b=WrG3sTnNjgquDP/5Wo8Rk0EOd2bDn5X6o79hO6JNT2uKWJ1KLHFG4NmUE5G6oU0lzzAak5 yq+zSHMSpvnaXM4a2nYl4PvZtgODtfu4vwpE927FPakk/LD6IFH148SdjFbxramjK63oc+ EpE0UH4entWQgV3I0FzQsVFi7TDc6Os= Received: from mail-wr1-f71.google.com (mail-wr1-f71.google.com [209.85.221.71]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-377-40pVYTubOYql3QZcJuO05A-1; Thu, 30 Apr 2020 06:34:13 -0400 X-MC-Unique: 40pVYTubOYql3QZcJuO05A-1 Received: by mail-wr1-f71.google.com with SMTP id v9so3637376wrt.7 for ; Thu, 30 Apr 2020 03:34:13 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:subject:to:cc:references:from:message-id:date :user-agent:mime-version:in-reply-to:content-language :content-transfer-encoding; bh=O6Ku2Z3+7Gg0z8xz3T+AzovdxSe8hvidTw18x0PtX7U=; b=JHq3zcFUEPksgOoJvmmdx2N67qnP1OEoVc2ZprRu9QrwOfQQ6DKLV/bnYeLU/0rK+j sVNslBQ4sbs+WNwPzRStDLEXfmUPgrvH42TEyvqoFXdUO+h9UofHtNogcy7+5rwM7kvS t1AruZWFHqGXAISsuLNAVbcxqfm/klq82qE7AS7ISDTJx5Ty0iRz0jJaO+2gaMBtMTab gXBoJAaDXhcWaTeesaWAtieV5YnDx1hJnQN8GTjNoBF2U6+2Ir5ewVRG2Wb9jECFg1Qa NJ5+qqpRD+yVJ4K0C1aKCTxwZ7m254pss8sh7vd8kW4peFK75/kPkxHuLP++CYtfEF/t Bagg== X-Gm-Message-State: AGi0Pub7qTJy4Wo59h851HHB7ZCkM9A3iR9inSTiyjkAbvaI2x8x5O5R vCdLB1E8ldmpN+Q2wV8IiciCbc92i9cFbMcxfQc0Lz3ZhGw0a3VrerGtZXKmhFewJVXIB1FZ+Nv FeeBmFvPp4ma+QvLB+G1oAlub X-Received: by 2002:a1c:2dc7:: with SMTP id t190mr2134813wmt.129.1588242852576; Thu, 30 Apr 2020 03:34:12 -0700 (PDT) X-Received: by 2002:a1c:2dc7:: with SMTP id t190mr2134792wmt.129.1588242852364; Thu, 30 Apr 2020 03:34:12 -0700 (PDT) Received: from ?IPv6:2001:b07:6468:f312:ac19:d1fb:3f5f:d54f? ([2001:b07:6468:f312:ac19:d1fb:3f5f:d54f]) by smtp.gmail.com with ESMTPSA id z22sm11673533wma.20.2020.04.30.03.34.10 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Thu, 30 Apr 2020 03:34:11 -0700 (PDT) Subject: Re: [PATCH v1 00/15] Add support for Nitro Enclaves To: Alexander Graf , "Paraschiv, Andra-Irina" , linux-kernel@vger.kernel.org Cc: Anthony Liguori , Benjamin Herrenschmidt , Colm MacCarthaigh , Bjoern Doebel , David Woodhouse , Frank van der Linden , Martin Pohlack , Matt Wilson , Balbir Singh , Stewart Smith , Uwe Dannowski , kvm@vger.kernel.org, ne-devel-upstream@amazon.com References: <20200421184150.68011-1-andraprs@amazon.com> <18406322-dc58-9b59-3f94-88e6b638fe65@redhat.com> <2a4a15c5-7adb-c574-d558-7540b95e2139@redhat.com> <1ee5958d-e13e-5175-faf7-a1074bd9846d@amazon.com> <80489572-72a1-dbe7-5306-60799711dae0@amazon.com> <0467ce02-92f3-8456-2727-c4905c98c307@redhat.com> <5f8de7da-9d5c-0115-04b5-9f08be0b34b0@amazon.com> <095e3e9d-c9e5-61d0-cdfc-2bb099f02932@redhat.com> <602565db-d9a6-149a-0e1a-fe9c14a90ce7@amazon.com> <0a4c7a95-af86-270f-6770-0a283cec30df@amazon.com> From: Paolo Bonzini Message-ID: <0c919928-00ed-beda-e984-35f7b6ca42fb@redhat.com> Date: Thu, 30 Apr 2020 12:34:10 +0200 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.6.0 MIME-Version: 1.0 In-Reply-To: <0a4c7a95-af86-270f-6770-0a283cec30df@amazon.com> Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 28/04/20 17:07, Alexander Graf wrote: > > Why don't we build something like the following instead? > >   vm = ne_create(vcpus = 4) >   ne_set_memory(vm, hva, len) >   ne_load_image(vm, addr, len) >   ne_start(vm) > > That way we would get the EIF loading into kernel space. "LOAD_IMAGE" > would only be available in the time window between set_memory and start. > It basically implements a memcpy(), but it would completely hide the > hidden semantics of where an EIF has to go, so future device versions > (or even other enclave implementers) could change the logic. Can we add a file format argument and flags to ne_load_image, to avoid having a v2 ioctl later? Also, would you consider a mode where ne_load_image is not invoked and the enclave starts in real mode at 0xffffff0? Thanks, Paolo