Received: by 2002:a25:7ec1:0:0:0:0:0 with SMTP id z184csp5023914ybc; Tue, 26 Nov 2019 19:46:58 -0800 (PST) X-Google-Smtp-Source: APXvYqyL3jQE6O1rroaKIyMrOAsA/tVIq6mAH5iY9Ewb3/wmgOLanw7De57BtfbYlsMNwKPlQSVP X-Received: by 2002:a17:906:6847:: with SMTP id a7mr21024887ejs.95.1574826418596; Tue, 26 Nov 2019 19:46:58 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1574826418; cv=none; d=google.com; s=arc-20160816; b=mg9tOt6FmJknjR30ORqFDZJLdlJYi2qKEA37y15R3r5BltXTIA8zTHbHMRBeDDiqUC WxupzwwrPe7CJb08FwEs4fwGhVa0exnVSUCb3zmEl4SJSypvRE8fxyEh2bcaWbw9QnUb Dkw4dTqzHoF+A/caeKe6TN2uj5+6CmCubUrrNUc2Hr5jAiH0nBT+/ChkhXNChIHjPGE2 BUkyi7mf859L36jcPee6iwaK8qnn7peeNcuAK1LAhdu5b2lnCF3o3KDODrJX0dzmK57D a6dt3mLpENZrhikrXSWcwnP8bsr702qwkGcrjaqUsDAQ+xqt6fzXUMgpueEMDoFnxbyW w/zg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date; bh=zRKyVj8NspIkeHtVj53FQrqv8yS8Gv8tDAXo77nQah0=; b=eTO67cpPBGhQ6twlKNlloZfGCMvCBzybdY6c/DKb9ngb2dNPPRY1U8o8Ad8Izg6yfo z80afViilo6MIEU0QSpX2P9f6jOYYxopxW1yOztG0joAscWTUwBCRdC7e1UgH5jJEbDx F2bJ//s7cB3KsGIJ8iSqYmlOWnA3derFCd5K1oZUfVqFNK7asjtjk76kwQhKUSNEyQtN XOBZDziN2A2cfA1rZY29bFd4Ku+UoJK+EiMvpKcuUxeK5sFnYU3VtKjt1gHpamvIIdrj 1KFajterAoBQ5qvA9wR9N8Zs6NjMHTGR4s7Nux0p6DLNOQsuboYyqJkirMx+7r0iBPBX 9/8A== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=intel.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id l12si10356923edk.60.2019.11.26.19.46.34; Tue, 26 Nov 2019 19:46:58 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=intel.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726655AbfK0Doo (ORCPT + 99 others); Tue, 26 Nov 2019 22:44:44 -0500 Received: from mga03.intel.com ([134.134.136.65]:55996 "EHLO mga03.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726525AbfK0Doo (ORCPT ); Tue, 26 Nov 2019 22:44:44 -0500 X-Amp-Result: UNKNOWN X-Amp-Original-Verdict: FILE UNKNOWN X-Amp-File-Uploaded: False Received: from orsmga001.jf.intel.com ([10.7.209.18]) by orsmga103.jf.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 26 Nov 2019 19:44:43 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.69,248,1571727600"; d="scan'208";a="291935296" Received: from sjchrist-coffee.jf.intel.com (HELO linux.intel.com) ([10.54.74.41]) by orsmga001.jf.intel.com with ESMTP; 26 Nov 2019 19:44:43 -0800 Date: Tue, 26 Nov 2019 19:44:43 -0800 From: Sean Christopherson To: linmiaohe Cc: Haiwei Li , "linux-kernel@vger.kernel.org" , "kvm@vger.kernel.org" , "x86@kernel.org" , "pbonzini@redhat.com" , "rkrcmar@redhat.com" , "vkuznets@redhat.com" , "wanpengli@tencent.com" , "jmattson@google.com" , "joro@8bytes.org" , "tglx@linutronix.de" , "mingo@redhat.com" , "bp@alien8.de" , "hpa@zytor.com" Subject: Re: [PATCH] KVM: SVM: Fix "error" isn't initialized Message-ID: <20191127034443.GF22233@linux.intel.com> References: <3b418fab6b804c6cba48e372cce875c1@huawei.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <3b418fab6b804c6cba48e372cce875c1@huawei.com> User-Agent: Mutt/1.5.24 (2015-08-30) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, Nov 27, 2019 at 03:30:06AM +0000, linmiaohe wrote: > > > From: Haiwei Li > > Subject: [PATCH] initialize 'error' > > > > There are a bunch of error paths were "error" isn't initialized. > Hi, > In case error case, sev_guest_df_flush() do not set the error. > Can you set the value of error to reflect what error happened > in sev_guest_df_flush()? > The current fix may looks confused when print "DF_FLUSH failed" with > error = 0. > Thanks. > > PS: This is just my personal point. Disclaimer: not my world at all... Based on the prototype for __sev_do_cmd_locked(), @error is intended to be filled only if there's an actual response from the PSP, which is a 16-bit value. So maybe init @psp_ret at the beginning of __sev_do_cmd_locked() to -1 to indicate the command was never sent to the PSP? And update the pr_err() in sev_asid_flush() to explicitly state it's the PSP return?