Received: by 2002:a25:1985:0:0:0:0:0 with SMTP id 127csp1829685ybz; Thu, 23 Apr 2020 06:45:21 -0700 (PDT) X-Google-Smtp-Source: APiQypI8DsdhbwT/8HoBune/DY/A+zVXsO890xiSb4etw0boujTPiVTdhfXU1gBeyjXDFPpuBgZv X-Received: by 2002:a50:ea85:: with SMTP id d5mr2773583edo.380.1587649520927; Thu, 23 Apr 2020 06:45:20 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1587649520; cv=none; d=google.com; s=arc-20160816; b=KD9yK0+F/Fm5Sal8Kv7P5h0Uagajh7lxZnMNboGMmgK9arhYocA/nJ3dsPG1Ivtg2o 4iN6zBlRbGG5VJM9w7HTArjeOHicsrz7VfDBzIvx4x5Cr6ddkcsSz7YAYvTTcryJiYik d8kZK0aB62FEsUwn/vxW+/XbAirajIgC48zbW1DNMPsD8Au7IUch0h+bbKq89maKyMFz rZRUftL5Hi7MiHU6PbpteV7qyyKoboSWnFOlzjHDR0G06vkMRc4u8M5MJDmX25d/5Gep ooDuYmN2qLuGm3ued8GGmjIfEov1Nq3Wk1LMeJI9Z4/v4M1f8r18UeapHyV79GUqoIjJ z42g== 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=s8mY2rn/o5PgRqmzsKGuM2heOpca4pruWT3S//ZWM58=; b=S9heKpSE/GMyIMhnj4EPY0O+djhr/iur2rc43V6tPEkMI+Fj0d3gPY4uq7KD6jOAfC f6psPyVtfSKGnjgqI/3kdsYqOH+LKNQPLrpgfYX4q6OP4DECOcUz22N5VqGl5xNEIjNk cQVa5ZlZpouxwh7jC4otn1Z+QQWs0QMRu8dIAZEBqlDpNwHkrWcHTGrCNhksvI6i1Vp/ z9Zs+CSBnZZO1EzXE9J5GPNBBwDk/xIGfQW9dwR8ISTqoAEx+I2puNRStT7DKOr9qZNr ZyR1+iPXtaWlVl/8uLHIL5DJTWUbH/WDIiFtDOf8TT/422vgnH0F3Q68XrUmOCY7cter gb9Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=QhAYaITH; 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 dx23si1302295ejb.181.2020.04.23.06.44.56; Thu, 23 Apr 2020 06:45:20 -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=QhAYaITH; 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 S1728246AbgDWNms (ORCPT + 99 others); Thu, 23 Apr 2020 09:42:48 -0400 Received: from us-smtp-delivery-1.mimecast.com ([207.211.31.120]:32652 "EHLO us-smtp-1.mimecast.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1726224AbgDWNms (ORCPT ); Thu, 23 Apr 2020 09:42:48 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1587649366; 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=s8mY2rn/o5PgRqmzsKGuM2heOpca4pruWT3S//ZWM58=; b=QhAYaITHBN2PJIjhej5rsLaPuqOJO6VADneb/CsZf5ao5zHV4PioI4LQN1dxCDlLfR/mt7 lbTqB+AfkY4EDqXoQi16IET47wo9vgzzVRO0Mt4znwYlFbaGrAlAjaZBHhjE+c8lRq19r1 zfWpvvqU6DQ5/6AKOj44fhBBmpea7pg= Received: from mail-wr1-f70.google.com (mail-wr1-f70.google.com [209.85.221.70]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-487-OfvgsIWRNGCkuv9NxT3GTA-1; Thu, 23 Apr 2020 09:42:44 -0400 X-MC-Unique: OfvgsIWRNGCkuv9NxT3GTA-1 Received: by mail-wr1-f70.google.com with SMTP id f2so2875105wrm.9 for ; Thu, 23 Apr 2020 06:42:44 -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=s8mY2rn/o5PgRqmzsKGuM2heOpca4pruWT3S//ZWM58=; b=rSGNupb2dfQHRFr6VuJFbOX5IWj84qfIJNyAXF3OxjXBFnKaARuvLwpgy2EzESSvbV TQKESq4NH7Fh23nIq69nervEEdKT7/YWUl8ETeuGgPaV5Izog/HRIY6wDZ5WWKLtCdCd ngUBrhFQ2Cv/QOnM4wnOAY14Yh5sYYSi95mVX9g0KTH4RI+zk6HWHM0RbsApLtCvXwCj Lm67Hf2+HzDZx7WMnkbq+l6aCy7pvNJwhyrO0JGcaT9p3PA1AyICfLY9hqR7fofad0hy SjkaKYxNM0IAg1nHzA6OoK6v6un5nbdIEFTemTd2xFcrTqYGqxfi8wyZodj5o4VG7/m9 Cskw== X-Gm-Message-State: AGi0PuZlu3Mf3RWiqvY5UhLKK37BlYo8KFIJ6sG6I4A68+iA6ql1z5p9 Nf6IqPICv+SfK6ThZwWt1Y5Afv1QvYVo5LMUMz8C9Vz+HHtbbmXWDXpHy6d8jRmKvXK08hSmIMB EivqEweZ1WcznbMRePYvNpWmt X-Received: by 2002:a1c:4e06:: with SMTP id g6mr4207892wmh.186.1587649363522; Thu, 23 Apr 2020 06:42:43 -0700 (PDT) X-Received: by 2002:a1c:4e06:: with SMTP id g6mr4207865wmh.186.1587649363165; Thu, 23 Apr 2020 06:42:43 -0700 (PDT) Received: from [192.168.10.150] ([93.56.170.5]) by smtp.gmail.com with ESMTPSA id v1sm3953028wrv.19.2020.04.23.06.42.41 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Thu, 23 Apr 2020 06:42:42 -0700 (PDT) Subject: Re: [PATCH v1 00/15] Add support for Nitro Enclaves To: "Paraschiv, Andra-Irina" , linux-kernel@vger.kernel.org Cc: Anthony Liguori , Benjamin Herrenschmidt , Colm MacCarthaigh , Bjoern Doebel , David Woodhouse , Frank van der Linden , Alexander Graf , 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> From: Paolo Bonzini Message-ID: <2a4a15c5-7adb-c574-d558-7540b95e2139@redhat.com> Date: Thu, 23 Apr 2020 15:42:40 +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: Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 23/04/20 15:19, Paraschiv, Andra-Irina wrote: > 2. The enclave itself - a VM running on the same host as the primary VM > that spawned it. > > The enclave VM has no persistent storage or network interface attached, > it uses its own memory and CPUs + its virtio-vsock emulated device for > communication with the primary VM. > > The memory and CPUs are carved out of the primary VM, they are dedicated > for the enclave. The Nitro hypervisor running on the host ensures memory > and CPU isolation between the primary VM and the enclave VM. > > These two components need to reflect the same state e.g. when the > enclave abstraction process (1) is terminated, the enclave VM (2) is > terminated as well. > > With regard to the communication channel, the primary VM has its own > emulated virtio-vsock PCI device. The enclave VM has its own emulated > virtio-vsock device as well. This channel is used, for example, to fetch > data in the enclave and then process it. An application that sets up the > vsock socket and connects or listens, depending on the use case, is then > developed to use this channel; this happens on both ends - primary VM > and enclave VM. > > Let me know if further clarifications are needed. Thanks, this is all useful. However can you please clarify the low-level details here? >> - the initial CPU state: CPL0 vs. CPL3, initial program counter, etc. >> - the communication channel; does the enclave see the usual local APIC >> and IOAPIC interfaces in order to get interrupts from virtio-vsock, and >> where is the virtio-vsock device (virtio-mmio I suppose) placed in >> memory? >> - what the enclave is allowed to do: can it change privilege levels, >> what happens if the enclave performs an access to nonexistent memory, >> etc. >> - whether there are special hypercall interfaces for the enclave Thanks, Paolo