Received: by 2002:a25:7ec1:0:0:0:0:0 with SMTP id z184csp5142738ybc; Tue, 26 Nov 2019 22:30:10 -0800 (PST) X-Google-Smtp-Source: APXvYqxIVbX/HML8tOuAtBnq5+hS6vlPajtD/LKLSEkVwGByKZAxJqkihYZPNDDwtOajhWfjzXt4 X-Received: by 2002:a17:906:5604:: with SMTP id f4mr21152498ejq.255.1574836210523; Tue, 26 Nov 2019 22:30:10 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1574836210; cv=none; d=google.com; s=arc-20160816; b=B8CioNPdQQz2QsZYtMXjGLTCfhSAzMOrwy2hfxoys8sfMdFYCACPc9d7EU4N1BH8AG 14fMQkXtN8GOPGa0/k2TG30yqonAq4sAr3laCCuAzsjNCXmGOcdSN52bGDHhTZ7ZGAI1 olStSX3SKpdfkKchYlPAv0jRmdSnL3wrCz2EVOzbSHE0cUr0D7hqKOsRzHiCLHxdwxiN JzK+Qe81lRVHrkGVMbmTInh8JWKg4qTNvU4Btt9IvVTOCeJyC00No2ekbWXzmauU4hNK 1btzemDjKimL6Bd/meovASAlXaWgAw4TrcUi1wA/vpCYGzBjLu0sO0k2+IfkhOHwhz20 cRxg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:content-transfer-encoding :content-language:accept-language:message-id:date:thread-index :thread-topic:subject:cc:to:from; bh=TIMN5gRYRK/yI3NyVvpbcX7yJke4/SscOMum6jwIyAs=; b=qIBQJDyMpdePIpDr3r9Q6UhQmP43UCxJT5zmmzWYacqNiBRJjIjsYX5XZUQeb6l/oT Ia5l037VDYn0f0eaUK7esYM75obmnNCg2y2LrZrYB0ps+BLuKW+Pln2s1wXQXslYv3q6 8wfOyxXgXF/KWI8eW/nMJYMD7XJpSh3U/XdkUkp0s0sCkmg6LrH1tgGdETbURft/e1pb 3soIbVG8cQAapeffIBqQaIvEvBYPtyjg81H0/aVHYJN/JCXUwhssEcQsb4ed5rp8gRz8 AmIsIt9kGjPlksG/ntPe6XrwpjntoadqpqU8xyfLm9L9++lJssTqh0lziVwdT6vtBdmd ZThA== 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id o25si8534382ejg.237.2019.11.26.22.29.45; Tue, 26 Nov 2019 22:30:10 -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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726260AbfK0G2v convert rfc822-to-8bit (ORCPT + 99 others); Wed, 27 Nov 2019 01:28:51 -0500 Received: from szxga01-in.huawei.com ([45.249.212.187]:2463 "EHLO huawei.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1726026AbfK0G2u (ORCPT ); Wed, 27 Nov 2019 01:28:50 -0500 Received: from DGGEMM402-HUB.china.huawei.com (unknown [172.30.72.55]) by Forcepoint Email with ESMTP id 10E8E338613FD4519B03; Wed, 27 Nov 2019 14:28:47 +0800 (CST) Received: from dggeme713-chm.china.huawei.com (10.1.199.109) by DGGEMM402-HUB.china.huawei.com (10.3.20.210) with Microsoft SMTP Server (TLS) id 14.3.439.0; Wed, 27 Nov 2019 14:28:46 +0800 Received: from dggeme763-chm.china.huawei.com (10.3.19.109) by dggeme713-chm.china.huawei.com (10.1.199.109) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.1713.5; Wed, 27 Nov 2019 14:28:46 +0800 Received: from dggeme763-chm.china.huawei.com ([10.6.66.36]) by dggeme763-chm.china.huawei.com ([10.6.66.36]) with mapi id 15.01.1713.004; Wed, 27 Nov 2019 14:28:46 +0800 From: linmiaohe To: Sean Christopherson 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 Thread-Topic: [PATCH] KVM: SVM: Fix "error" isn't initialized Thread-Index: AdWk60CcyspD19xwRk++tZYeJJNRuA== Date: Wed, 27 Nov 2019 06:28:46 +0000 Message-ID: Accept-Language: en-US Content-Language: zh-CN X-MS-Has-Attach: X-MS-TNEF-Correlator: x-originating-ip: [10.184.189.20] Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 8BIT MIME-Version: 1.0 X-CFilter-Loop: Reflected Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 2019/11/27 11:44, Sean Christopherson wrote: > 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? > I think it's a good alternative. Many Thanks.