Received: by 2002:a05:6358:3188:b0:123:57c1:9b43 with SMTP id q8csp6764564rwd; Tue, 6 Jun 2023 01:18:47 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ5CMKEbAQZGOlBuNrHQ4xKcPqkQICpv75njbhNigA38KsXuABho0/BtdbORwDHWls6am2Nm X-Received: by 2002:a05:6214:aca:b0:626:1862:7d6c with SMTP id g10-20020a0562140aca00b0062618627d6cmr1770594qvi.46.1686039527448; Tue, 06 Jun 2023 01:18:47 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1686039527; cv=none; d=google.com; s=arc-20160816; b=aq93GRP26xOc+8vAZFfFFiAwg/bsnWcVA9OMqN92XLmcoWuqYCOZN8UIApzVwiBr+4 QiUVhENF6qDwQobYb1IqBD69LdK/PyxywqUdFWTX3TYHM2Xc+/jbtvo1X8KLrNVWTeYq akbtH4hbmLhb6BdfCMFQarZuTLKHvhSrdCkrFmUkVZEZvblXNBKU7ENSXPEFOYADN1HO z750ZvC2s8GZcYyKdkOWcM9ELh7XiwJzPxxdUP5MIMFNNvwSd8Qp7IxcxAJm/HL8B45f wJkU6rPyUe7yNDYjWTBW3JM7NqwfIPhfSN3l6uNkf6zN6+fLWY5NNZ5aH/pTEZ8Ibo91 IC5g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:in-reply-to:from :references:to:content-language:subject:cc:user-agent:mime-version :date:message-id:dkim-signature; bh=jm8gmHCReBiuJDsHtK961BCwO/CrU8zpvn8PCpLc5Qk=; b=K8PnMLFzUWFqpYs84J/YT6Q/WzzH62ZW+wWK6F6Chv+adVMrAkqmaWizyrz4IFffPt ClDTJiP588nNVM3wKCbAL2mAKYmh21/FfzWL0n7zsjA8S46Wn5s8uGeLclcIj9MStsq3 UORlsxztyhToSktg+plUIltznDFpJU9KKeN7YphPYGvGOi/wY5tcIb9xl9e07uQn2cii KQPMyxl0RjHK4X768NxeuFsChBh193UizzSB7/tMMIgE/0Nn1/lWW/aJ6fT2N9zlZTEy TAzCtbIwhoLCt4//DeJ5Ck860NgDUIrx482GLBe0ZowWBL30rfyYSlPDDxl0OeRSPXyW fRoQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@collabora.com header.s=mail header.b=H0Sfp4f8; 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=QUARANTINE sp=QUARANTINE dis=NONE) header.from=collabora.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id u15-20020ad45aaf000000b0062388040b4csi5959642qvg.203.2023.06.06.01.18.32; Tue, 06 Jun 2023 01:18:47 -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=@collabora.com header.s=mail header.b=H0Sfp4f8; 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=QUARANTINE sp=QUARANTINE dis=NONE) header.from=collabora.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S236018AbjFFH6m (ORCPT + 99 others); Tue, 6 Jun 2023 03:58:42 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:34194 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232770AbjFFH6W (ORCPT ); Tue, 6 Jun 2023 03:58:22 -0400 Received: from madras.collabora.co.uk (madras.collabora.co.uk [46.235.227.172]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id ADBCA1FC1; Tue, 6 Jun 2023 00:55:38 -0700 (PDT) Received: from [192.168.10.48] (unknown [119.152.150.198]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits)) (No client certificate requested) (Authenticated sender: usama.anjum) by madras.collabora.co.uk (Postfix) with ESMTPSA id 3B73D6600359; Tue, 6 Jun 2023 08:55:19 +0100 (BST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=collabora.com; s=mail; t=1686038121; bh=fLoyE29jwAeZymQXtcLwzwFxwOHx58ue1ihixP2knDc=; h=Date:Cc:Subject:To:References:From:In-Reply-To:From; b=H0Sfp4f89qEuDMkNJ8J/XXRTGjc69n7zYEiu4g3yPCu41jdMi1mWoJybEs9Zlf/A1 kjuPQwGabfoTINNKRCBVzF4l68/qtBZCcwp89Ty7odG2oR63eiWFKHkf9eEQImh/Mx cSPJa4nnO5ojWa9jZp9wk/LqqfisW88lCSBX4/7/hkpi9NmWg1yDpZCPIh4pgmr7Mm VObjbe5iFx/KqGYDIpGwbBS3gk2BFs1LYCYcpmwcNdPUPkBAc7rV3R+725+7ePltF+ ABa5rNyjy70Q6oFf4RGnXrsVKrMU376LPpxNTrAg5NwkIeN4dmb3aEpy3rOMRG2Fyj PLJ7J8Lv2/HNQ== Message-ID: <1acf4b3a-71b7-3412-fe83-a9b730530583@collabora.com> Date: Tue, 6 Jun 2023 12:55:16 +0500 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.11.0 Cc: Muhammad Usama Anjum , David Hildenbrand , Peter Xu , Shuah Khan , Nathan Chancellor , linux-mm@kvack.org, linux-kselftest@vger.kernel.org, LKML Subject: Re: [PATCH v3 07/11] selftests/mm: fix a "possibly uninitialized" warning in pkey-x86.h Content-Language: en-US To: John Hubbard , Andrew Morton References: <20230606071637.267103-1-jhubbard@nvidia.com> <20230606071637.267103-8-jhubbard@nvidia.com> From: Muhammad Usama Anjum In-Reply-To: <20230606071637.267103-8-jhubbard@nvidia.com> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-2.2 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,NICE_REPLY_A,SPF_HELO_NONE, SPF_PASS,T_SCC_BODY_TEXT_LINE,URIBL_BLOCKED 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 6/6/23 12:16 PM, John Hubbard wrote: > This fixes a real bug, too, because xstate_size() was assuming that > the stack variable xstate_size was initialized to zero. That's not > guaranteed nor even especially likely. > > Reviewed-by: David Hildenbrand > Cc: Peter Xu > Signed-off-by: John Hubbard Tested-by: Muhammad Usama Anjum > --- > tools/testing/selftests/mm/pkey-x86.h | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > diff --git a/tools/testing/selftests/mm/pkey-x86.h b/tools/testing/selftests/mm/pkey-x86.h > index 72c14cd3ddc7..e32ae8a1cd99 100644 > --- a/tools/testing/selftests/mm/pkey-x86.h > +++ b/tools/testing/selftests/mm/pkey-x86.h > @@ -132,7 +132,7 @@ int pkey_reg_xstate_offset(void) > unsigned int ecx; > unsigned int edx; > int xstate_offset; > - int xstate_size; > + int xstate_size = 0; > unsigned long XSTATE_CPUID = 0xd; > int leaf; > -- BR, Muhammad Usama Anjum