Received: by 2002:a05:6359:c8b:b0:c7:702f:21d4 with SMTP id go11csp3196777rwb; Mon, 3 Oct 2022 11:04:07 -0700 (PDT) X-Google-Smtp-Source: AMsMyM56p7Wb3PDOC1vhgu8Ix8iGb05iQnuIANjyEe7aGSEvbZ8HNArz2vZloOQPFxzO/lisgOKD X-Received: by 2002:a17:907:2672:b0:734:a952:439a with SMTP id ci18-20020a170907267200b00734a952439amr15101971ejc.539.1664820246999; Mon, 03 Oct 2022 11:04:06 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1664820246; cv=none; d=google.com; s=arc-20160816; b=j2/4QsJ1ofsbDh10cd7tFMMRKqa1/HqWo3BanlEeBMBo+91HVProQJo80fJjQRUYfx cPTHFlofYDOYKVnLPA8V9sz3TV/0NtkV4Z2gWhLP6iryl/oHKrW9OQAJqOHRnbrZBzTJ y7h1BXUoiKsVoP8Al186trDZ41NJ0akeI/Kg7sP0592Jdnkevmq6WTauMK4FQCSWrwuP byEgN3jHezkXOmqHxKqmFyAp1754TVnBn9pAEMuchVtEC0GSeyTsILjTjcZPU7ZjGlR8 o0Qb458AvcaALjIaw/YO60SuA+W1ROr24XX/2er6wRDlUaGhCG2kQLXLHkVPAmT1M1gt FAJA== 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=D28XvKTv00teVfLwfyN9M9/AZIufFU4k2cieAlFfcPU=; b=lmo2teJmsxHB09fcZLiVxLY0mvQH59LR1U/G1nku9p8amM6Sv1AAMZLJgVmOYZhsU1 0jS+YSrGH41hiyVEkJPxN15qnJ+aJiC1oc2KdKImrXJqHFrTJ7HDClIBoywklIrxRA3i uNIeqRjQBPph0R8NKCHQBQJSosItRUhhtaifquQYFCfPO5xTlN0iWvRm9PXMuWUoIBpN ZFFwr3TYD9s+tbN3/aBsE4mSoQnRKYmI3jNcY5bO5HnDvGN8TW2Y64QugC2sQ/fL0lVl /DBOjq1fYGTHfpRmg83IlGfDk2jcntKiWoTOqDCLJlDJlxiZ5h7nUSa0wx8fUqSEB3/W 0ZPQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@google.com header.s=20210112 header.b=JcyhKWsg; spf=pass (google.com: domain of linux-crypto-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-crypto-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 m22-20020aa7c2d6000000b00458896ae248si7263080edp.474.2022.10.03.11.03.36; Mon, 03 Oct 2022 11:04:06 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-crypto-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=JcyhKWsg; spf=pass (google.com: domain of linux-crypto-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-crypto-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 S229797AbiJCSB5 (ORCPT + 99 others); Mon, 3 Oct 2022 14:01:57 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:38226 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229926AbiJCSBh (ORCPT ); Mon, 3 Oct 2022 14:01:37 -0400 Received: from mail-lj1-x22e.google.com (mail-lj1-x22e.google.com [IPv6:2a00:1450:4864:20::22e]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 4DA482BB33 for ; Mon, 3 Oct 2022 11:01:33 -0700 (PDT) Received: by mail-lj1-x22e.google.com with SMTP id b6so12663991ljr.10 for ; Mon, 03 Oct 2022 11:01:33 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20210112; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:from:to:cc:subject:date; bh=D28XvKTv00teVfLwfyN9M9/AZIufFU4k2cieAlFfcPU=; b=JcyhKWsgCnYxPgaWsHHffDyudEL3s19lLgvoma891PS50XIYA8Q1I6Qj3806CkR5QX fSv8It+f/TW2tXXqcCUQ7TxUSYPfNe8+8N5Bj5S3UXuze44v1O8BJzpkS9mkbdteBiLu aSCE7q78XIVq8PxbqWk0bKpBWA0yNOZiKA/lI6N+FCmHJ9T8cfW4lEp5wGbUSjfKOI0Z a2+5EY+hoxySnbW4SBcjwLdCvMZ1G/HCykEqo8Q8PbJIArj9FtV/AUEo1kHH5moRUZB/ VbN4atttazrqqWo+h0VQpAPKpxkf81kdlYojEVeANjKaqxtJl1x3ykgLW3zO2w5Y+IW4 Q1aQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:x-gm-message-state:from:to:cc:subject:date; bh=D28XvKTv00teVfLwfyN9M9/AZIufFU4k2cieAlFfcPU=; b=SvFHN3jeEvO2oJz5EcyBqzHOWj9M1jLmn37Onk3VRwF+KpLU5LtMJavvpHD8LnLl5f vYoqvd9JdFH5n3KIvdpS9+k0GR1HWE3XAwuTmBHBlIr1INJZJxGa6y2AlwfFb2W9IkI/ C4UQr7tTD33QexMRYIu1+7btr+VmzKqOiL6QBSmXGzVOY6a2FdKkslKDRbNzZYcHY7xI 3yMGlVqszxjc/crP8SO9/SQFGeBbc8hYZaK3JPH30fp/F/84tpKTR/K5tNIWkDb4SVUi bqsI99ESU0ss2ceL68YpamqweNpsIqPs1O4r2lK3wGWWogfixFsxdcZXAXrNUMresdoR +Rgw== X-Gm-Message-State: ACrzQf0CqH96dYMpnO4y6rXEyzSZ+7f4nZ2DBZmvy757oErzOAZxtPLa +cBbeVQbMrs76VGb91/c2G/IGyS4SmF0HZOFhQW3lw== X-Received: by 2002:a05:651c:1510:b0:26d:cd1d:cc4d with SMTP id e16-20020a05651c151000b0026dcd1dcc4dmr3496274ljf.502.1664820091240; Mon, 03 Oct 2022 11:01:31 -0700 (PDT) MIME-Version: 1.0 References: In-Reply-To: From: Peter Gonda Date: Mon, 3 Oct 2022 12:01:19 -0600 Message-ID: Subject: Re: [PATCH Part2 v6 13/49] crypto:ccp: Provide APIs to issue SEV-SNP commands To: Borislav Petkov Cc: "Kalra, Ashish" , "x86@kernel.org" , "linux-kernel@vger.kernel.org" , "kvm@vger.kernel.org" , "linux-coco@lists.linux.dev" , "linux-mm@kvack.org" , "linux-crypto@vger.kernel.org" , "tglx@linutronix.de" , "mingo@redhat.com" , "jroedel@suse.de" , "Lendacky, Thomas" , "hpa@zytor.com" , "ardb@kernel.org" , "pbonzini@redhat.com" , "seanjc@google.com" , "vkuznets@redhat.com" , "jmattson@google.com" , "luto@kernel.org" , "dave.hansen@linux.intel.com" , "slp@redhat.com" , "peterz@infradead.org" , "srinivas.pandruvada@linux.intel.com" , "rientjes@google.com" , "dovmurik@linux.ibm.com" , "tobin@ibm.com" , "Roth, Michael" , "vbabka@suse.cz" , "kirill@shutemov.name" , "ak@linux.intel.com" , "tony.luck@intel.com" , "marcorr@google.com" , "sathyanarayanan.kuppuswamy@linux.intel.com" , "alpergun@google.com" , "dgilbert@redhat.com" , "jarkko@kernel.org" 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=unavailable 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-crypto@vger.kernel.org On Mon, Oct 3, 2022 at 11:45 AM Borislav Petkov wrote: > > On Mon, Oct 03, 2022 at 05:11:05PM +0000, Kalra, Ashish wrote: > > They are basically providing the APIs for the hypervisor to manage a > > SNP guest. > > Yes, I know. But that is not my question. Lemme try again. > > My previous comment was: > > "I think you should simply export sev_do_cmd() and call it instead." > > In this case, the API is a single function - sev_do_cmd() - which the > hypervisor calls. > > So my question still stands: why is it better to have silly wrappers > of sev_do_cmd() instead of having the hypervisor call sev_do_cmd() > directly? We already have sev_issue_cmd_external_user() exported right? Another option could be to make these wrappers more helpful and less silly. For example callers need to know the PSP command format right now, see sev_guest_decommission(). int sev_guest_decommission(struct sev_data_decommission *data, int *error) Instead of taking @data this function could just take inputs to create sev_data_decommission: int sev_guest_decommission(u32 handle, int *error) > > -- > Regards/Gruss, > Boris. > > https://people.kernel.org/tglx/notes-about-netiquette