Received: by 2002:ac0:e34a:0:0:0:0:0 with SMTP id g10csp320541imn; Wed, 27 Jul 2022 07:12:33 -0700 (PDT) X-Google-Smtp-Source: AGRyM1ufXVcOTZ9UcSO51eoMNij7yfXqEnrGJ+dGArnqp9WphDDjs3gtYEgfBvi9UV1Ic34Ykhvs X-Received: by 2002:a17:907:2bd3:b0:72b:44ed:6d6b with SMTP id gv19-20020a1709072bd300b0072b44ed6d6bmr17838472ejc.632.1658931152926; Wed, 27 Jul 2022 07:12:32 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1658931152; cv=none; d=google.com; s=arc-20160816; b=HmEksXbC19stxLvwgZhb62hg1DPpnGVJPCr5Fr3POnVROrwaBkGiFJxjlvwCHI5boi QX32HAzBj36LzH2xjTJkAMrx2rW8ARUb2bZxtfI5rP7AQU1xqkehj52pZDyAOE/KCXCu G/42E0Pa/A6gQ2WYjqZGjyUIar+wQaFCLmpdDz9IypxH2nc2+50eurMGsY/ZafCz2rNc S0GaPt2IK+mLSK25MIcSC1K8R2/edaLPLh8S94Yg/ASyjRIH2yaU78BkcXQPJyaTNnwL seeYMUkrvIhHZTbzT+N40cY4DNgE1jcFjrsAkCPm9pOFl16uibffedyX1dw8Xfj+q5Zc R2zw== 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=pbXRFwb+6mnOqb4qko6w4MUz1iH8dRLuiEYG/yozVuU=; b=FMgnHQoyNZdqCRuPqyYLRASJWDfTtp5Ab8RgwDL+7ehpoAuqxn5OAZuBlXxECUkeR+ Z9Sz6gEu49z7cbhtgpO7NbCmbTMIwKu9SPJ7vzI/x+ttKxmmTMj5Mg8OJfLZh+3XWBBK uasKvshfEr68m+jSx4QEKtKghrKff59SnMTtZiVBVp9BVl8Vsvp+WmfjlIwAFE/rLVee vIysJxMByexZro37/zObXgftK5u84Fs+zzd4nB2lfP2+Mzz4Fjn9g1SQ5QnIyFFcrs/x qijtMl4NrQKrsdqx43Z3n7PWbqB16Aypt5m/rXzDqlG95M7kYXuPglNAheOfezvSULpc U5Bw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@google.com header.s=20210112 header.b=poGVkIjH; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 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 out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id b20-20020a170906151400b0072f4421550asi16247570ejd.297.2022.07.27.07.12.05; Wed, 27 Jul 2022 07:12:32 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@google.com header.s=20210112 header.b=poGVkIjH; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 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 S232563AbiG0OHX (ORCPT + 99 others); Wed, 27 Jul 2022 10:07:23 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:36342 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231266AbiG0OHV (ORCPT ); Wed, 27 Jul 2022 10:07:21 -0400 Received: from mail-lf1-x131.google.com (mail-lf1-x131.google.com [IPv6:2a00:1450:4864:20::131]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id E1E01255B2 for ; Wed, 27 Jul 2022 07:07:19 -0700 (PDT) Received: by mail-lf1-x131.google.com with SMTP id t17so15024906lfk.0 for ; Wed, 27 Jul 2022 07:07:19 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20210112; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=pbXRFwb+6mnOqb4qko6w4MUz1iH8dRLuiEYG/yozVuU=; b=poGVkIjHOsIvKU5OvFt21FuMAjEooxE4gTH04sm0jJ7bDQ6SCGqgdCc2jOwDEAaU9W 08Mq7crS4yYQkJlGle+naSbCagOYjrJtZu7TtqnAxJgtkkV8eEoithy3pgZZ9rVLkJAf uAA3uk2OfGbt0OKGthKgFxuMl+om4hR0ZqeO9r+v64FAGVfQSRxZMWQz3EtOvM8nAT7u ZaRCLIzrTXbexhh9PTF1eGzlsLvx8ddl6TrySxOJbWcmW6KQ9aUwgs9uvesIx5KAxJKh 9okHSFD+OyFvIaI6iAnbUaDDhXJ0pcGcSyP+CiWaUMRFAAe+vk2V/6i4NOUWF5/AetyH vqlg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=pbXRFwb+6mnOqb4qko6w4MUz1iH8dRLuiEYG/yozVuU=; b=lGgldiOroj8qr82/SqFUbctHf3nmnVjlLdTx6H7QHOSWidjVR+pQVRqVtQW/sp3vqp uwYxcOTNWUDE809Jb7KxiRtwChIV/V4bWg6SwXBbiKbH5nYnRZgvq7B3UeUIDc9eh3nB XqekMkKQF6qhnafj3yNH+Xh05WJ39O/t1YEPZJaDVrqtpE2YjdvsV108mrwmIsH4JAmf Dwr6jFyymPDhu0yx5Px9x6EURVnphoz2iR9816Ehvra04PKOOWXoXiW/Kvu1XUSYaH9i iuTWYbn00CjmzXnBnAuji4xVyY57dFPeE6+6oBTlFOzXgdDtVAb8FfnxvYr8KZWp5OCm kPhA== X-Gm-Message-State: AJIora/Ntcl6AgUpuDr8rfFqgCdDmxBGE4+xJKbL+h8cp4AKgpVRJ9kd uqr3BuxIej4f/NUCkIjdSE9XWCKIHTq1BUKCUoknOkeDABYA4w== X-Received: by 2002:a05:6512:21a7:b0:48a:a06e:1d21 with SMTP id c7-20020a05651221a700b0048aa06e1d21mr3099565lft.494.1658930837575; Wed, 27 Jul 2022 07:07:17 -0700 (PDT) MIME-Version: 1.0 References: <20220715192956.1873315-1-pgonda@google.com> <20220715192956.1873315-10-pgonda@google.com> <20220719154330.wnwnu23gagcya3o7@kamzik> <20220727135603.ld5torjrn4gatjb4@kamzik> In-Reply-To: <20220727135603.ld5torjrn4gatjb4@kamzik> From: Peter Gonda Date: Wed, 27 Jul 2022 08:07:05 -0600 Message-ID: Subject: Re: [RFC V1 08/10] KVM: selftests: Make ucall work with encrypted guests To: Andrew Jones Cc: kvm list , LKML , Marc Orr , Sean Christopherson , Michael Roth , "Lendacky, Thomas" , Joerg Roedel , Mingwei Zhang , Paolo Bonzini Content-Type: text/plain; charset="UTF-8" X-Spam-Status: No, score=-17.6 required=5.0 tests=BAYES_00,DKIMWL_WL_MED, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF, ENV_AND_HDR_SPF_MATCH,RCVD_IN_DNSWL_NONE,SPF_HELO_NONE,SPF_PASS, USER_IN_DEF_DKIM_WL,USER_IN_DEF_SPF_WL autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, Jul 27, 2022 at 7:56 AM Andrew Jones wrote: > > On Wed, Jul 27, 2022 at 07:38:29AM -0600, Peter Gonda wrote: > > On Tue, Jul 19, 2022 at 9:43 AM Andrew Jones wrote: > > > I'm not a big fan of mixing the concept of encrypted guests into ucalls. I > > > think we should have two types of ucalls, those have a uc pool in memory > > > shared with the host and those that don't. Encrypted guests pick the pool > > > version. > > > > Sean suggested this version where encrypted guests and normal guests > > used the same ucall macros/functions. I am fine with adding a second > > interface for encrypted VM ucall, do you think macros like > > ENCRYPTED_GUEST_SYNC, ENCRYPTED_GUEST_ASSERT, and > > get_encrypted_ucall() ? > > > > It's fine to add new functionality to ucall in order to keep the > interfaces the same, except for initializing with some sort of indication > that the "uc pool" version is needed. I just don't like all the references > to encrypted guests inside ucall. ucall should implement uc pools without > the current motivation for uc pools creeping into its implementation. Ah that makes sense. So maybe instead of checking for 'if (vm->memcrypt.enabled)' I should just add a new field in kvm_vm to select for use of the uc pool? Something like kvm_vm.enable_uc_pool? Thanks Drew!