Received: by 2002:a05:6a10:9848:0:0:0:0 with SMTP id x8csp1632715pxf; Fri, 9 Apr 2021 13:26:17 -0700 (PDT) X-Google-Smtp-Source: ABdhPJynRusw9OAM2gcpPnfd/cM3cIYX6jqIQfiSuzrn48py4VLK/vWLAWcaK8o/P2rR6YnOcAY2 X-Received: by 2002:a05:6402:6c1:: with SMTP id n1mr18964141edy.158.1617999977120; Fri, 09 Apr 2021 13:26:17 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1617999977; cv=none; d=google.com; s=arc-20160816; b=K3YoMiuRpewHNyPIkyOx223QehOHUniWfYt9xhxgT9lAn/4bWSd1fazFAZHIWxyuC3 DMWJCjnsmusgzJyiigkb8X5bVNdUac9QIOhNnIotDKbzZJEYXNKKWsn4spiZ1iT1wVvu lRnITzOweDCPSvIXbTWQ7IfyZCnOeUKZjC1BHFfD6oFQ5gvovuXam5glkcJ8pTbcuDqt aYn4IEKi3Qn/70A+q/ShsYvWgoO7YXJ3mYYxhH/oSLlqjveJPZB4/vvUF8e//1JWEP7Q RmQxisnshvxpsJbK0wjMBB1Xi0wy27h92X1PMxodvmxI08KpAxcc3flpqjCci8JTufKB l3Ng== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:subject:message-id:date:from:in-reply-to :references:mime-version:dkim-signature; bh=mB7kxR56sLSER8I5oyS023AqFo1fyl/hBCTPjDto6bI=; b=HPjgF8ptomu+YJaQcsFCAMp43AzCP1eHwf/N6vMRpLJyG7Pv14PIax8oqgNJ3vcWOq QGwGYfAShF5n4E5CVXmXWM6HBneVB0Ss8sVGgh8CznVOYomjhp9rCDCvfB77n+bn446L KtlVvrnkfk1NSAG9XqHR8LuF9z3S+BjU0GsEv+h89kH5le2pocngvD1hG66O0O1Tsea3 nWoNAfcOntYEPfRVDW+l/RTMrVoSlUAbEPn+o6+okTwagHrT9T7vJh4bgpil6hLxvwNX NrMZOyZ1R+A3uWSIvH4y+9MuI6NMFdOvCCZ6y4SZKGOVkc6vAUBylVHHZFTjSAYonkHx HqGw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@google.com header.s=20161025 header.b=j8Pjc2Kd; 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=REJECT sp=REJECT dis=NONE) header.from=google.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id fx8si2679828ejb.481.2021.04.09.13.25.45; Fri, 09 Apr 2021 13:26:17 -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=@google.com header.s=20161025 header.b=j8Pjc2Kd; 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=REJECT sp=REJECT dis=NONE) header.from=google.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233998AbhDIUZC (ORCPT + 99 others); Fri, 9 Apr 2021 16:25:02 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:50314 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231946AbhDIUZB (ORCPT ); Fri, 9 Apr 2021 16:25:01 -0400 Received: from mail-io1-xd2b.google.com (mail-io1-xd2b.google.com [IPv6:2607:f8b0:4864:20::d2b]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 07181C061762 for ; Fri, 9 Apr 2021 13:24:44 -0700 (PDT) Received: by mail-io1-xd2b.google.com with SMTP id b10so7195731iot.4 for ; Fri, 09 Apr 2021 13:24:44 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=mB7kxR56sLSER8I5oyS023AqFo1fyl/hBCTPjDto6bI=; b=j8Pjc2Kd72z72kc52//ILW4NWwnRjwF/pfUnWmlnQR/ykKiGz1xy9GHg5iYu7VyjmD j1JxTubGUrpBsEs17+U7BGm3rj8JPA8LeX2GG2Kz2cmZ+IJ7vioNX2b2DC1nSn4bfKBW 0Ho1VAN1shuQZ69Pr5VQBBA6D6JkXjhpg+LCM3RmzH+DHnrxrPxRzc/uEl2EEgdyv23Z KFn7TX1to39jk+byfwbeTVmibxJnAGZeLkUMAO8iXVraZy14b+GUlkrrlmltwwv7L8gG IvNiosr1cxIu7NefOiN9+F+grD6c8nyPlEJ+AN0h7ZbAr0U4yVjT2FIghdpFG+FIGRlR EzjQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=mB7kxR56sLSER8I5oyS023AqFo1fyl/hBCTPjDto6bI=; b=iIRZMHlDhLwbi7O8ZUPHvdQ9VwqIQViVYkfQLcOV/UqnW/36WUcuQEmOJfQLk0Rdjx zcVBJwQWzNvdcb4CcQv2RRhO0XA5yecfUyahlSM9MWFmhn5mHSRntiHggQKbV75CLgIt 2ktZybcSS9TASqEcpdtCy/26L2QQngWaREN9xWJn5KGRGHY9wsEhZVvZxur6xJrqWUS/ RuEFd4pQG6gNSacguKhHRIZmcmksEbFINXDhjECosBQDTj5kvkFAWJfSmxynQc3gFxEb X8B8rKDyddGyWRsBYwPDPxdliK3F74woC59RaH1g71fNA8lSbBvbkY9JbV23t5q8RB2c 3SSg== X-Gm-Message-State: AOAM532MhNlh/MHGYuwmELhvalfqmThb7GEBeeJbe5d7CGUCoR1BCRNf u6i2pCRywSjcSzhJ1ZGA+liHi6F9KRJQl/aw9CLcRg== X-Received: by 2002:a05:6638:3a8:: with SMTP id z8mr16413394jap.111.1617999883243; Fri, 09 Apr 2021 13:24:43 -0700 (PDT) MIME-Version: 1.0 References: <20210316014027.3116119-1-natet@google.com> <20210402115813.GB17630@ashkalra_ubuntu_server> <87bdd3a6-f5eb-91e4-9442-97dfef231640@redhat.com> <936fa1e7755687981bdbc3bad9ecf2354c748381.camel@linux.ibm.com> <75863fa3f1c93ffda61f1cddfef0965a0391ef60.camel@linux.ibm.com> In-Reply-To: From: Steve Rutherford Date: Fri, 9 Apr 2021 13:24:06 -0700 Message-ID: Subject: Re: [RFC v2] KVM: x86: Support KVM VMs sharing SEV context To: Paolo Bonzini Cc: jejb@linux.ibm.com, Ashish Kalra , Nathan Tempelman , Tom Lendacky , X86 ML , KVM list , LKML , Sean Christopherson , David Rientjes , Brijesh Singh , dovmurik@linux.vnet.ibm.com, lersek@redhat.com, frankeh@us.ibm.com Content-Type: text/plain; charset="UTF-8" Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Fri, Apr 9, 2021 at 1:14 AM Paolo Bonzini wrote: > > On 09/04/21 03:18, James Bottomley wrote: > > If you want to share ASIDs you have to share the firmware that the > > running VM has been attested to. Once the VM moves from LAUNCH to > > RUNNING, the PSP won't allow the VMM to inject any more firmware or do > > any more attestations. > > I think Steve is suggesting to just change the RIP of the mirror VM, > which would work for SEV but not SEV-ES (the RAM migration helper won't > *suffice* for SEV-ES, but perhaps you could use the PSP to migrate the > VMSA and the migration helper for the rest?). Exactly: you can use the existing PSP flows to migrate both the migration helper itself and the necessary VMSAs. > > If you want to use a single firmware binary, SEC does almost no I/O > accesses (the exception being the library constructor from > SourceLevelDebugPkg's SecPeiDebugAgentLib), so you probably can: > > - detect the migration helper hardware in PlatformPei, either from > fw_cfg or based on the lack of it > > - either divert execution to the migration helper through > gEfiEndOfPeiSignalPpiGuid, or if it's too late add a new boot mode and > PPI to DxeLoadCore. > > Paolo > > > What you mirror after this point can thus only > > contain what has already been measured or what the guest added. This > > is why we think there has to be a new entry path into the VM for the > > mirror vCPU. >