Received: by 2002:a05:7412:6592:b0:d7:7d3a:4fe2 with SMTP id m18csp1236527rdg; Fri, 11 Aug 2023 14:38:56 -0700 (PDT) X-Google-Smtp-Source: AGHT+IF593lWSMvov/I3ZlA0731E3KAVhM5VdvLrcQTol1zRhSjK2BCxFVAjN/ULpRIr+IzR5e/m X-Received: by 2002:a17:907:7215:b0:991:f0dc:c930 with SMTP id dr21-20020a170907721500b00991f0dcc930mr7392078ejc.16.1691789936690; Fri, 11 Aug 2023 14:38:56 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1691789936; cv=none; d=google.com; s=arc-20160816; b=yYqw8v/xO0RtTtN7K84FAg9id+QraALNs8Mv/QFX1j2M9cYMubKa6K6SWKkayf1pMh kkAoxigsqj+HunkReuxRaJTnIIQPucUs8Ojj9S1jcsPnMQfjoKR0hf5USnJGtvaE3ibc OydtmQMI5RO2cf77svf5uJFJfR64ZOiforVPRKLvP5d7ang8IgszHbcNzoWc6pyKxQTa HiVY3uLg9/TXeHeVHkXzI3q3X71h3K01mKOlQ9HaaPnofi59ktaMqfgTYWrjUJQ+n3Rl 4yEvOt6ZoRvEkANHxDWSME7Tqq7iGtXfaeoyRAh6ADY5dxnvarH6zR2lmr097Esr4xSf p8HQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date; bh=uCGZn5SPgUComZTwtmCaZ+gQn0nxBc61ZSFlcpc5Pco=; fh=h+YDG4PLXg8dzWiLKc5FKHKOKu5X8LwBpw1kLV11q+U=; b=pHwgfG3BJbiL9RAwZUUMwZzFWrYs1cH2JvP6sE9y0ZyeSP4haifC9MEroksmEanK7W vGjC75G8T4/VSPb+sbTK2z2j6GcHDEU8mWieRps2dYy58PHHGNLFS+AW/jFsr3syRpB6 g6eVqalXBq3+FsCLNCo1exOb/APmOuGiVF8Q1G4/Bc6hy8Qlb76S1Jt9GNdWmYSfnmNS LTealTmKeWILLu2UITH2l+gbrhGSkoeG0sKvmSqWxGuhIjW240esSeC8UT2Hhf2K10wh KOCXNaqqvxaWHbarynxkkWjOCynIoo2Hg6rBfsMkV6sJOqKK+tJl2O0lDPOB/aFrGhvq ctfA== ARC-Authentication-Results: i=1; mx.google.com; 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=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id gw4-20020a170906f14400b0099d0c0bb929si3979656ejb.202.2023.08.11.14.38.33; Fri, 11 Aug 2023 14:38:56 -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; 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=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S236838AbjHKVP1 (ORCPT + 99 others); Fri, 11 Aug 2023 17:15:27 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:36942 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229503AbjHKVPZ (ORCPT ); Fri, 11 Aug 2023 17:15:25 -0400 Received: from mail-pf1-f174.google.com (mail-pf1-f174.google.com [209.85.210.174]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 2B1EB171F; Fri, 11 Aug 2023 14:15:25 -0700 (PDT) Received: by mail-pf1-f174.google.com with SMTP id d2e1a72fcca58-686d8c8fc65so1869080b3a.0; Fri, 11 Aug 2023 14:15:25 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1691788524; x=1692393324; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to; bh=uCGZn5SPgUComZTwtmCaZ+gQn0nxBc61ZSFlcpc5Pco=; b=SwKtnMVH93+aWgYFZejmq1Ir5VIc1bcAPT5Cl/HvJW+EOKQUW9yk5ySyi0A2l0Qx39 FWWdO5PUjI9Adoepi1iojO1PZKFKEsE7Pl/gciWKx4q191zFbtwjxOxUAxw2IAaJ8wUZ MLlxVCHIQPl7o4vHHE9v1npNsD2VYcIesoOAhQXz7dV4iFE60Z/MMabxJSB10aAe/nWZ XNXsLhg6vo2MEFmij0pKSNlTH8VedQ9NncpU6rcQ/5nPp+Khn42mdZP9q+GyfGbK1ra1 TfxWb4/vcK1gcsJdATY3DFZnldZJFgGU5sPMJtBJSPm7yC8tFrZ0PW3u1jVGD6i2zbxH Rxyw== X-Gm-Message-State: AOJu0YwpriuqNKI5f3J8Zc3lpIfTfn2wnQ7QwF4HBO19Et5RflnTOm1k bWpTq3CSPD9lAG2PU7izL5bdFjl+Vwo= X-Received: by 2002:a05:6a20:970e:b0:133:bc8:e362 with SMTP id hr14-20020a056a20970e00b001330bc8e362mr2733331pzc.24.1691788524509; Fri, 11 Aug 2023 14:15:24 -0700 (PDT) Received: from liuwe-devbox-debian-v2 ([20.69.120.36]) by smtp.gmail.com with ESMTPSA id d25-20020aa78699000000b0068713008f98sm3718537pfo.129.2023.08.11.14.15.23 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 11 Aug 2023 14:15:23 -0700 (PDT) Date: Fri, 11 Aug 2023 21:15:11 +0000 From: Wei Liu To: Dexuan Cui Cc: Tianyu Lan , KY Srinivasan , Haiyang Zhang , "wei.liu@kernel.org" , "tglx@linutronix.de" , "mingo@redhat.com" , "bp@alien8.de" , "dave.hansen@linux.intel.com" , "x86@kernel.org" , "hpa@zytor.com" , "daniel.lezcano@linaro.org" , "arnd@arndb.de" , "Michael Kelley (LINUX)" , Tianyu Lan , "linux-arch@vger.kernel.org" , "linux-hyperv@vger.kernel.org" , "linux-kernel@vger.kernel.org" , vkuznets Subject: Re: [PATCH V5 2/8] x86/hyperv: Set Virtual Trust Level in VMBus init message Message-ID: References: <20230810160412.820246-1-ltykernel@gmail.com> <20230810160412.820246-3-ltykernel@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: X-Spam-Status: No, score=-1.4 required=5.0 tests=BAYES_00, FREEMAIL_FORGED_FROMDOMAIN,FREEMAIL_FROM,HEADER_FROM_DIFFERENT_DOMAINS, RCVD_IN_DNSWL_BLOCKED,RCVD_IN_MSPIKE_H3,RCVD_IN_MSPIKE_WL, SPF_HELO_NONE,SPF_PASS autolearn=no 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, Aug 10, 2023 at 10:59:35PM +0000, Dexuan Cui wrote: > > From: Tianyu Lan > > Sent: Thursday, August 10, 2023 9:04 AM > > [...] > > diff --git a/arch/x86/hyperv/hv_init.c b/arch/x86/hyperv/hv_init.c > > @@ -378,6 +378,41 @@ static void __init hv_get_partition_id(void) > > local_irq_restore(flags); > > } > > > > +static u8 __init get_vtl(void) > > +{ > > + u64 control = HV_HYPERCALL_REP_COMP_1 | > > HVCALL_GET_VP_REGISTERS; > > + struct hv_get_vp_registers_input *input; > > + struct hv_get_vp_registers_output *output; > > + unsigned long flags; > > + u64 ret; > > This should be > u64 ret = 0; > > > + local_irq_save(flags); > > + input = *this_cpu_ptr(hyperv_pcpu_input_arg); > > + output = (struct hv_get_vp_registers_output *)input; > > + if (!input) { > > + local_irq_restore(flags); > > + goto done; > > Here the uninitialized 'ret' is returned. > > If we move the "done:" label one line earlier, we won't need the > the above " local_irq_restore(flags);" > Maybe we should add a WARN_ON_ONCE(1) before "goto done"? Out of interest why will input be NULL here? Thanks, Wei.