Received: by 2002:a05:6358:1087:b0:cb:c9d3:cd90 with SMTP id j7csp801562rwi; Thu, 27 Oct 2022 07:45:00 -0700 (PDT) X-Google-Smtp-Source: AMsMyM4HYNAt6DPXbb8v/NVJzxo7UZxjxvdDLL99xTx0zgrn+D7Xwsz7qPFyysrjt/Cuc1HKztBV X-Received: by 2002:a17:907:7fa9:b0:791:a5c2:e25 with SMTP id qk41-20020a1709077fa900b00791a5c20e25mr39975605ejc.444.1666881900097; Thu, 27 Oct 2022 07:45:00 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1666881900; cv=none; d=google.com; s=arc-20160816; b=cfuhEuxi/+QK3NBaQJgvdVmUfl2bIltPlkVe6OHt3p0ynkfuEiZed8ysARpWNy2Ta0 FeeccpuBL+fE3ItZIujSAXM3oBLoPYoXOQvBb7ZXl9O+StfZhLOPGWSnQhHnlLtVg5lf coNmtdOgxlTa1Ooz/7iFkCRowGuoLE6NOqteBP7Jn24L9pA60dF2TfEu86DRGLoZ4gsj BiGI73WAJXjN72wQj67TEos8o+Sq4W5UDv+wJz9mO8a2DnvPyRO9lE5/3ZlTr8YyMxj2 h0kx1P5yYco3HtyPCMM1RawqX9TyBS4u07q+nQKsGE0lOT40acnWyf7R0pHOmzP4kw2D R7nw== 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=jrIU22cTxb3Bgw4qwsYPzB4cQE/SP06ICkrfPKGmXxE=; b=oR0ZKFirykoN5KwH0biIdhQcV9Y9Uwtdinv9h7Cf9HIyv/y4+d6r1OLXzcd3oMH2c4 POznlxxpZ+v0S9uEgwCt2OS2cXH/dC7Zr3cUgIJoY7/iBlF7D84nPPhkfXIcI5D4lLBM 5ibVxk2yeO9ddR3OksADsAN8eXZbUZlHG8fMjrFVe9as7Cxa5Oo0Tq5o5NGOQe5OpUTQ 2bz2jf4jQxLpHBVrtYqb92yb5qdlhzKjLOYgVgSu8nJPcogU9aY/CKN1FFsz6ZVh+IEl ts5MMOACAZQFomXD7ku+QfLYA8I7T8Y38IE6Apgf0YfLmJbtADE6tm/VmQLPrCaRe2Bv MZzg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@google.com header.s=20210112 header.b=a8Ow75Og; 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 ga38-20020a1709070c2600b0076f061ffab4si1766681ejc.51.2022.10.27.07.44.34; Thu, 27 Oct 2022 07:45:00 -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=a8Ow75Og; 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 S236324AbiJ0OQ3 (ORCPT + 99 others); Thu, 27 Oct 2022 10:16:29 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:57450 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S236318AbiJ0OQ2 (ORCPT ); Thu, 27 Oct 2022 10:16:28 -0400 Received: from mail-lj1-x231.google.com (mail-lj1-x231.google.com [IPv6:2a00:1450:4864:20::231]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 488BE173FC4 for ; Thu, 27 Oct 2022 07:16:27 -0700 (PDT) Received: by mail-lj1-x231.google.com with SMTP id b18so2731413ljr.13 for ; Thu, 27 Oct 2022 07:16:27 -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:message-id:reply-to; bh=jrIU22cTxb3Bgw4qwsYPzB4cQE/SP06ICkrfPKGmXxE=; b=a8Ow75Og8ZAdIQdZNR9xPleiWBlE4qI7VFClPu3bxyL+3R+bDj6uB4dBXGXViGRL4E ml2Y8jhwYd0CobP2mEanjVdlDUpHShZ3fpJHtpEM2afHfeBb6aI/G6Y/WYhaaAhOGajY e4vzPsBXYezNFBD29M4FSeNTiqieIN0TqJkIKsMHk23ph9Y62rmk2uLO9IzcnLW06q69 bb9URXVoz7z8aGH2T/S5oZ6QNXsIA8wazGrnXz3uRfC8gvmSanEgW/llb+P4YCOivPBk eI1P8Nbhy2GKFXueam8awFmGv8uoM+PRA5QeHTa9L3JK8lCtcf3KHx+mPVYNIuzLJvyH MqEQ== 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:message-id :reply-to; bh=jrIU22cTxb3Bgw4qwsYPzB4cQE/SP06ICkrfPKGmXxE=; b=iVc2DB9c60wf8W3rThGV0ywX5/RB/KnCc9aooo8QSKgD73p4lcgZB4qTUIUZ+70pcT R94rFLqKfxDyvWKl+IveN2jtR9Zu350KfV/mDwQDwSh4efmxqmT6cBygaj+qrt6pfSF5 XCaqOVtXpqawqnXN/g/S87tjGAK19QxHuH5YcvX98UpskhpdQhU3D6BD1WdL48q1NjXA bRxKALcpkR0xchBQh7iDa7rmp2dD8y2dOyLyoKx6499bs+uAROSOf0Q94DeQXg6x0CBA b7Tp/v6XQY5NOFyz7ZJeSW/VYXGfokVp6S+HsfAn7Tk6qitW4TwMs28MnqOuoJpq3Rz5 p/8w== X-Gm-Message-State: ACrzQf22yBag8vW1J72bA7TQ4jWSfnqsKW3T0/4PctcE3agO+hwL+AyY HDPEu4fOvpVRcuEYyafvAk7SU5QO3AjjnFMrKcEbwA== X-Received: by 2002:a05:651c:a09:b0:277:2ded:cfc0 with SMTP id k9-20020a05651c0a0900b002772dedcfc0mr988387ljq.398.1666880185342; Thu, 27 Oct 2022 07:16:25 -0700 (PDT) MIME-Version: 1.0 References: <20221012002323.2015637-1-dionnaglaze@google.com> In-Reply-To: From: Peter Gonda Date: Thu, 27 Oct 2022 08:16:13 -0600 Message-ID: Subject: Re: [PATCH] virt/coco/sev-guest: Initialize err in handle_guest_request To: Borislav Petkov Cc: Dionna Amalie Glaze , x86@kernel.org, linux-kernel@vger.kernel.org, Tom Lendacky , Paolo Bonzini , Joerg Roedel , Thomas Gleixner , Dave Hansen 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 Thu, Oct 27, 2022 at 3:45 AM Borislav Petkov wrote: > > On Wed, Oct 19, 2022 at 12:58:12PM -0700, Dionna Amalie Glaze wrote: > > fw_err = 0xff doesn't make sense to me actually. It's not a documented > > code that the firmware was never called. > > Still, we can simply pass fw_err to snp_issue_guest_request rather > > than an unsigned long err, since a null pointer results in an -EINVAL. Yes this was not what my comments on the patch series intended. On the host side we have `psp_ret = -1` inside of __sev_platform_init_locked(). I think defining SEV_RET_NO_FW_CALL as UINT32_MAX and moving to make all values of psp_ret where the psp is not yet called would help callers understand errors more clearly. > > Yes, pls do that. Such I/O function args are always a PITA anyway. > > In retrospect, that handle_guest_request() with gazillion args should > have been made to take a struct as a single argument and populate it as > it operates. > > The callers then would look at it and decide what to do. > > Looking at the callers, they all take members of struct > snp_guest_request_ioctl and pass them in. A first step in cleaning that > up could be to simply pass that struct snp_guest_request_ioctl pointer > instead... > > Oh well, in case folks feel bored. :-) Ah, good idea. If I have some spare cycles. > > Thx. > > -- > Regards/Gruss, > Boris. > > https://people.kernel.org/tglx/notes-about-netiquette