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 BBF0BC67871 for ; Thu, 27 Oct 2022 09:45:45 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234682AbiJ0Jpn (ORCPT ); Thu, 27 Oct 2022 05:45:43 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:50056 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233280AbiJ0Jpl (ORCPT ); Thu, 27 Oct 2022 05:45:41 -0400 Received: from mail.skyhub.de (mail.skyhub.de [IPv6:2a01:4f8:190:11c2::b:1457]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 5027376955 for ; Thu, 27 Oct 2022 02:45:40 -0700 (PDT) Received: from zn.tnic (p200300ea9733e7cb329c23fffea6a903.dip0.t-ipconnect.de [IPv6:2003:ea:9733:e7cb:329c:23ff:fea6:a903]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.skyhub.de (SuperMail on ZX Spectrum 128k) with ESMTPSA id B556C1EC02AD; Thu, 27 Oct 2022 11:45:38 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=alien8.de; s=dkim; t=1666863938; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:in-reply-to:in-reply-to: references:references; bh=kRvdo0VXbVuM9lNlzKBftAdtlpQQ17w5SrGYtszVIXg=; b=Losv+AjqGqH6kvUmnR+XkVj+jt8yiZTHbNf4ua4Ry+7vKaTmowiHkLLacQAedpPW/yBtJn b0kWK8c7ZTJpPUqJng78uplVFjJFpzXJkkDWpAh5JXjtQ+AxMBRY8k+mU7UnkyVCjkuwIL yIWNL9K122b5GjU4BQQmXhibhHy8jIg= Date: Thu, 27 Oct 2022 11:45:31 +0200 From: Borislav Petkov To: Dionna Amalie Glaze Cc: Peter Gonda , x86@kernel.org, linux-kernel@vger.kernel.org, Tom Lendacky , Paolo Bonzini , Joerg Roedel , Thomas Gleixner , Dave Hansen Subject: Re: [PATCH] virt/coco/sev-guest: Initialize err in handle_guest_request Message-ID: References: <20221012002323.2015637-1-dionnaglaze@google.com> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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, 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. :-) Thx. -- Regards/Gruss, Boris. https://people.kernel.org/tglx/notes-about-netiquette