Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id BE1B2C433EF for ; Tue, 7 Dec 2021 23:33:14 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S242587AbhLGXgo (ORCPT ); Tue, 7 Dec 2021 18:36:44 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:34182 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S242567AbhLGXgn (ORCPT ); Tue, 7 Dec 2021 18:36:43 -0500 Received: from mail-pj1-x104a.google.com (mail-pj1-x104a.google.com [IPv6:2607:f8b0:4864:20::104a]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id B172DC061746 for ; Tue, 7 Dec 2021 15:33:12 -0800 (PST) Received: by mail-pj1-x104a.google.com with SMTP id hg9-20020a17090b300900b001a6aa0b7d8cso488726pjb.2 for ; Tue, 07 Dec 2021 15:33:12 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20210112; h=date:message-id:mime-version:subject:from:to:cc; bh=iIqu28BeAUoA+tn6qtuHLblGA5Z72SgaTk+HvlXOhpM=; b=olgFNAjwG1AeRcw2PppFf/EUtPbfGR933cWHJ3Omt83fxkDYo/HetlZYrVHNcapkz9 PUHZNPhkIKEJacNJcOuI4nHrnGuLQ1rtCrjfKPxbZEBglaXaY0smso+1eAw/U9k41CNQ kkOcMQSKpDZMomeAD3cL/QpCyHoRBGldcppdtpsc6xbnAU3/cSYgA2LWkNSI9Ci7K4LD CcCPIdwjdesWpcVZ8crEFeGBMtLYBJLA6XyilOnNcDL+ksJaVyG9wBOCnG6w7YNfLNZd UDiljsUgKh5WNuqKzyKt6j41FapC/EI5GRKLyIEjucKrEYDavXz85ozuf4+ITr+XFHks u4mA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:date:message-id:mime-version:subject:from:to:cc; bh=iIqu28BeAUoA+tn6qtuHLblGA5Z72SgaTk+HvlXOhpM=; b=QGt13g72mgtF15uIB+uTyAEEQCu9CIf1FLMANngLRnUMdPKmMzY6v5RBIdwuiBMDGo htVU43RL5R+GiOoAWcU2Fu6769Q/Ho15XFeiT1zPkaaczTbGdMLcRxpjwrI9vLPsOiJ9 vpRjTDzy1WWiesDe40Ja3f3LEwOUdteH1222h2ve1C/7jymyfYHAo9xTtT2zYBeQz/wB vFpkgOnBF09SIL/P/85QdWYNiNd9vuyAFKz7IYQ2bMj9iCOks4LGulexSR1ipJdQxhx2 YwchKWe7GiCADjKjfxbnc7KPAFCE2cDV2D0chtcBwfY06uMsQOEafQuNFKuNQP4EqHo3 5ZCg== X-Gm-Message-State: AOAM530PZp8DHmnzDT5dE3UxX03xpBMWOQPg3VlzhkaWusqz1CesQWhz s5ZuCZY8cWUfFkedxEN3W8FpOhvA+Uw= X-Google-Smtp-Source: ABdhPJxvziXdsdc0pNZh+Am/zNB3QgSZSap+AN8IzbDa9hpqE9VRdVreOlojNbRundI42qp++YRE+JjUTbw= X-Received: from pgonda1.kir.corp.google.com ([2620:15c:29:203:46ed:9c47:8229:475d]) (user=pgonda job=sendgmr) by 2002:a05:6a00:2283:b0:49f:dea0:b9ba with SMTP id f3-20020a056a00228300b0049fdea0b9bamr2197867pfe.56.1638919992248; Tue, 07 Dec 2021 15:33:12 -0800 (PST) Date: Tue, 7 Dec 2021 15:33:01 -0800 Message-Id: <20211207233306.2200118-1-pgonda@google.com> Mime-Version: 1.0 X-Mailer: git-send-email 2.34.1.400.ga245620fadb-goog Subject: [PATCH V6 0/5] Add SEV_INIT_EX support From: Peter Gonda To: thomas.lendacky@amd.com Cc: Peter Gonda , Marc Orr , David Rientjes , Brijesh Singh , Joerg Roedel , Herbert Xu , John Allen , "David S. Miller" , Paolo Bonzini , linux-crypto@vger.kernel.org, linux-kernel@vger.kernel.org Content-Type: text/plain; charset="UTF-8" Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org SEV_INIT requires users to unlock their SPI bus for the PSP's non volatile (NV) storage. Users may wish to lock their SPI bus for numerous reasons, to support this the PSP firmware supports SEV_INIT_EX. INIT_EX allows the firmware to use a region of memory for its NV storage leaving the kernel responsible for actually storing the data in a persistent way. This series adds a new module parameter to ccp allowing users to specify a path to a file for use as the PSP's NV storage. The ccp driver then reads the file into memory for the PSP to use and is responsible for writing the file whenever the PSP modifies the memory region. V4-5 * Fix make C=1 W=1 warnings. V3 * Add another module parameter 'psp_init_on_probe' to allow for skipping PSP init on module init. * Fixes review comments from Sean. * Fixes missing error checking with file reading. * Removed setting 'error' to a set value in patch 1. Signed-off-by: Peter Gonda Reviewed-by: Marc Orr Acked-by: David Rientjes Acked-by: Brijesh Singh Cc: Tom Lendacky Cc: Brijesh Singh Cc: Marc Orr Cc: Joerg Roedel Cc: Herbert Xu Cc: David Rientjes Cc: John Allen Cc: "David S. Miller" Cc: Paolo Bonzini Cc: linux-crypto@vger.kernel.org Cc: linux-kernel@vger.kernel.org David Rientjes (1): crypto: ccp - Add SEV_INIT_EX support Peter Gonda (4): crypto: ccp - Add SEV_INIT rc error logging on init crypto: ccp - Move SEV_INIT retry for corrupted data crypto: ccp - Refactor out sev_fw_alloc() crypto: ccp - Add psp_init_on_probe module parameter .../virt/kvm/amd-memory-encryption.rst | 6 + drivers/crypto/ccp/sev-dev.c | 259 +++++++++++++++--- include/linux/psp-sev.h | 21 ++ 3 files changed, 245 insertions(+), 41 deletions(-) -- 2.34.1.400.ga245620fadb-goog