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=-13.3 required=3.0 tests=BAYES_00,DKIMWL_WL_MED, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,USER_IN_DEF_DKIM_WL 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 72AB4C433ED for ; Fri, 9 Apr 2021 20:25:00 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 4304A610A8 for ; Fri, 9 Apr 2021 20:25:00 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234068AbhDIUZC (ORCPT ); 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-Google-Smtp-Source: ABdhPJwU/0efdeCg18merwiu9BwHt5WAPMlkmFgvshdnzNmAe42X3Cc0ucddlzeVpenW3Xh1h38+kcrqcMrv/kRW6nM= 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. >