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 Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id F2E6FC61DB3 for ; Sun, 8 Jan 2023 22:49:33 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233863AbjAHWtc (ORCPT ); Sun, 8 Jan 2023 17:49:32 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:36516 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230175AbjAHWt1 (ORCPT ); Sun, 8 Jan 2023 17:49:27 -0500 Received: from mail-pl1-x635.google.com (mail-pl1-x635.google.com [IPv6:2607:f8b0:4864:20::635]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 5FA156310 for ; Sun, 8 Jan 2023 14:49:26 -0800 (PST) Received: by mail-pl1-x635.google.com with SMTP id d3so7622788plr.10 for ; Sun, 08 Jan 2023 14:49:26 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20210112; h=mime-version:references:message-id:in-reply-to:subject:cc:to:from :date:from:to:cc:subject:date:message-id:reply-to; bh=+2EwBkT4ghB1jNt4S3UOpy3yeEZLhAzU9lSbZIAM7I4=; b=IjbxJtzUDxQwTlGXvZfUXOkwvqxSafaHnYeSIIG1WzG669+JyAc4qXN/gkvArxh5SD KsO/Gv3wxOSLuyRYLl7m++Sq+g2drIqTdrxHsBlUpfTotBCSHg6+bVEfSVH1azliE2T6 kMuxAfKCDqnPkj6ErNSZQcpYqqgzNbw1dL0XfJp7+zFUEPB+EvTlPWcm9HtX7LUVmzhd ByL2BLxvkd6E8hMF+wBGoDQ8BbnAEINIRyGfhoWVJejIo8RthJBu2RF2L6c+QtHw++DZ CTAC17nlepfakuYDSfZnfsWM8iXclE/CuFhCDYSVdCMCN+ZnCAMp5X+ACqqFzjacfUKi t5iQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=mime-version:references:message-id:in-reply-to:subject:cc:to:from :date:x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=+2EwBkT4ghB1jNt4S3UOpy3yeEZLhAzU9lSbZIAM7I4=; b=4PUjPipkWWwVlJqJTDzU6sV5iF/fXlKsOIcCkO0jMDMufjFl4gz/knMBTlZJerhtga hUsAq40WPPtC1fGkASXGZw4KGyPhry5bCbZpHAjnAoazZDEjquVfdbsdHh/9Fmy4Mj/C eZLjYvEuR7q7tXMdT5xaNRDh9gm0uafK80p1S9NzUWd2ZQdIjFwZJMCWWemKlSa/kLU8 B4jeP+iOErA1knEWcWz5z97jv8yZJWi9qACEXsE42l9Vg2vbIfcjtQ6ys7KlUqi46j0e g2Pw3HS6bHxFfEul4w6HHDnw6+cp8HhZW+yS4QDf048axlhrHc8icQO7td/IJMQ+XXz9 VqPw== X-Gm-Message-State: AFqh2koxEnDjcrCOP2kQAwyF9oBbPNRlRNQnF4Wr4NdYbYg/6/U7OsJd teoIgCR/RCwT5uRgvKpWv3OYiw== X-Google-Smtp-Source: AMrXdXvFomA3pBImLcMEFvQje52p88TQ7bSKJjQem9k+a9RDK9TT4WhVZ39yoEM1TO2IIQGIx51y+w== X-Received: by 2002:a17:90b:3d03:b0:226:59d6:8219 with SMTP id pt3-20020a17090b3d0300b0022659d68219mr393178pjb.0.1673218165776; Sun, 08 Jan 2023 14:49:25 -0800 (PST) Received: from [2620:15c:29:203:dfeb:5ed2:4968:d28b] ([2620:15c:29:203:dfeb:5ed2:4968:d28b]) by smtp.gmail.com with ESMTPSA id r23-20020a17090b051700b002271f55157bsm22569pjz.9.2023.01.08.14.49.24 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 08 Jan 2023 14:49:25 -0800 (PST) Date: Sun, 8 Jan 2023 14:49:24 -0800 (PST) From: David Rientjes To: Jarkko Sakkinen cc: Sean Christopherson , Paolo Bonzini , Thomas Gleixner , Ingo Molnar , Borislav Petkov , Dave Hansen , x86@kernel.org, "H. Peter Anvin" , Brijesh Singh , Tom Lendacky , John Allen , Herbert Xu , "David S. Miller" , Jarkko Sakkinen , "open list:KERNEL VIRTUAL MACHINE FOR X86 (KVM/x86)" , "open list:X86 ARCHITECTURE (32-BIT AND 64-BIT)" , "open list:AMD CRYPTOGRAPHIC COPROCESSOR (CCP) DRIVER - SE..." Subject: Re: [PATCH v2] crypto: ccp: Sanitize sev_platform_init() error messages In-Reply-To: <20230108202407.104963-1-jarkko@profian.com> Message-ID: <30d6aa4c-3af9-9e4c-748e-c7378b519504@google.com> References: <20230108202407.104963-1-jarkko@profian.com> MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Sun, 8 Jan 2023, Jarkko Sakkinen wrote: > The following functions end up calling sev_platform_init() or > __sev_platform_init_locked(): > > * sev_guest_init() > * sev_ioctl_do_pek_csr > * sev_ioctl_do_pdh_export() > * sev_ioctl_do_pek_import() > * sev_ioctl_do_pek_pdh_gen() > * sev_pci_init() > > However, only sev_pci_init() prints out the failed command error code, and > even there the error message does not specify, SEV which command failed. > > Address this by printing out the SEV command errors inside > __sev_platform_init_locked(), and differentiate between DF_FLUSH, INIT and > INIT_EX commands. As a side-effect, @error can be removed from the > parameter list. > > This extra information is particularly useful if firmware loading and/or > initialization is going to be made more robust, e.g. by allowing firmware > loading to be postponed. > > Signed-off-by: Jarkko Sakkinen Acked-by: David Rientjes