Received: by 2002:a05:6a10:af89:0:0:0:0 with SMTP id iu9csp1167558pxb; Fri, 21 Jan 2022 11:17:16 -0800 (PST) X-Google-Smtp-Source: ABdhPJydi/xBvn0WzzCtTYmb1XuYEi4FyNOus6iTwPBeleGgpZndgdJqdXhGBaozLYDyqKT8V/6c X-Received: by 2002:aa7:888e:0:b0:4c4:3ad:9eee with SMTP id z14-20020aa7888e000000b004c403ad9eeemr4810681pfe.13.1642792636034; Fri, 21 Jan 2022 11:17:16 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1642792636; cv=none; d=google.com; s=arc-20160816; b=RJI4GQfpX9J1HYoYB/phW6QsGwlGaXwAIsGIOXhnl8F/9ATck/MNNY6WLoByDvu6zP odZX9Fsudw2AbL8KF2ZleJmxnz6sjpF3HqE4ma0m69txJHmS7poF/J98NmYJlnQ5tfhe 7eX1CxN5Vah5YfVTVw8uvGahrUr4K3dw0cIkfcUHxlkeKOpObjVYHr9s1huhaL56Ye7p vp55WE2yX/E0mRvM7BqhPaPyUCPAVPVF5ntf/F07IeEKnlITkTPjhRLLaLI4MDBlIxBH o59K0kzWtgLNf8SYlwME70ChpP62t6sAjsz6aGfzR8GdEQc9nQCBhoC5XqiUJeQgCShW S7uQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :message-id:date:subject:cc:to:from:dkim-signature; bh=z1ML4GC+j2a5rWM6N2roBceEIMaA3plN8shiVq57uXM=; b=zZyhO9RAwKiyNRmxLmr9FASjk2GqpjBZfljsX18NoPqXmWDSYVBNZ/NK/RrBDKDamc Xa0iKmfUPLFP0aBPwZuqg1L0IWBUSa/lzpvBa7pSzzMg82n0T3yHZrenzA7ZDHteQDzm A8MhVqKgbypfhZF+UwF9UjMkJo2nP4LCG3K6/l4YcIZSywG0cztnepLuoIrFhbQK6Ojr W4c4z6jW0+/IEfQzS79bCSZt0+Xv1my6F94WIqdswN9vZp2bIQJ9xRVcxz4wwc/ufv6Z O7+D+svA3kZ82SXPqNcQd4khv/HVngOqoM1/mEpFziSdJRkTP/nMWqUn5nGNn9ZEJiKZ U7pw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20210112 header.b=feqKKD6t; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id kk9si15814597pjb.176.2022.01.21.11.17.04; Fri, 21 Jan 2022 11:17:16 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20210112 header.b=feqKKD6t; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1355003AbiASODh (ORCPT + 99 others); Wed, 19 Jan 2022 09:03:37 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:39040 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1350177AbiASODg (ORCPT ); Wed, 19 Jan 2022 09:03:36 -0500 Received: from mail-pg1-x542.google.com (mail-pg1-x542.google.com [IPv6:2607:f8b0:4864:20::542]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 41F91C061574; Wed, 19 Jan 2022 06:03:36 -0800 (PST) Received: by mail-pg1-x542.google.com with SMTP id e9so2721897pgb.3; Wed, 19 Jan 2022 06:03:36 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=z1ML4GC+j2a5rWM6N2roBceEIMaA3plN8shiVq57uXM=; b=feqKKD6tisUnEBfXeMh5xY5MivbGBLZfPjcGhnCtrZYFKTcRvoEKolIDnrDa54SuxA i5+tMbQbDlG8sX3z5i4hDDmD2yCtDBLEbNfLmS+bCxtKwc4SGZJaHCT4OB0rfKP0F5in Er8GY5KMl++5g3O5Wcjk9RgFiAh043TcsZv8cLoqzgRcncf/B8ELPbFIds9U/2YdVp/2 zZTFPdvlNJqdjxkXmpumM/zayrQGP7TIKuEruU3pb3xJpajM3nsYQoGC6eqJh/hOrl3Q B1oQij/TfFn+HdDKZda/jtyJE43GZ4XvqfA/DFnfdBlVwPNlrfPAgQLgGi/Azt4+4nFA v2eA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=z1ML4GC+j2a5rWM6N2roBceEIMaA3plN8shiVq57uXM=; b=DyLXMnl9H3jrNVCbwy6AQvAtcDxqt/+JyYQj5Tk7wu1vwTK1VGARhg87hqzkjtZhLJ fdXHz8UwXMmtJAK627dXJH8070z2Ypaav/SfAeQ2gkf4aTVYY7rUeb+NIvjQLLyURlV5 RYmJYzvLi05sSC9JJGqS1V/ABfkTqaaxYDl3Yez/5cXfz+S4u8kqbG5rTAfuYfPU6/9Z 71Sh1jKdkhyrHY1k87kkXxOEFkpPBqleI4Vq0Pu5i+yz1nnxNrM/TmxkabdeH+HgVXc2 Rqnn068Qb0Q7bz1R3kyrU21sK18coQE0vkgO/JWW5pE0GtSp31kTqByRuRVjZfUpLmpl dLyw== X-Gm-Message-State: AOAM531JD7dKBKVBqKWyCljfvDHN+TtzLNne3A5Ke7L4aPttAqOgb0SB tWq55JxpZy9YlR+vsCTsk3Q= X-Received: by 2002:a63:85c6:: with SMTP id u189mr20086333pgd.282.1642601015829; Wed, 19 Jan 2022 06:03:35 -0800 (PST) Received: from CLOUDLIANG-MB0.tencent.com ([103.7.29.32]) by smtp.gmail.com with ESMTPSA id t6sm20031177pfg.92.2022.01.19.06.03.32 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Wed, 19 Jan 2022 06:03:35 -0800 (PST) From: Jinrong Liang X-Google-Original-From: Jinrong Liang To: Paolo Bonzini Cc: Wanpeng Li , Sean Christopherson , Jim Mattson , Vitaly Kuznetsov , Joerg Roedel , Jinrong Liang , kvm@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH] selftests: kvm/x86: Fix the warning in lib/x86_64/processor.c Date: Wed, 19 Jan 2022 22:03:25 +0800 Message-Id: <20220119140325.59369-1-cloudliang@tencent.com> X-Mailer: git-send-email 2.30.1 (Apple Git-130) MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Jinrong Liang The following warning appears when executing make -C tools/testing/selftests/kvm In file included from lib/x86_64/processor.c:11: lib/x86_64/processor.c: In function ': include/x86_64/processor.h:290:2: warning: 'ecx' may be used uninitialized in this function [-Wmaybe-uninitialized] asm volatile("cpuid" ^~~ lib/x86_64/processor.c:1523:21: note: 'ecx' was declared here uint32_t eax, ebx, ecx, edx, max_ext_leaf; Just initialize ecx to remove this warning. Fixes: c8cc43c1eae2 ("selftests: KVM: avoid failures due to reserved HyperTransport region") Signed-off-by: Jinrong Liang --- tools/testing/selftests/kvm/lib/x86_64/processor.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tools/testing/selftests/kvm/lib/x86_64/processor.c b/tools/testing/selftests/kvm/lib/x86_64/processor.c index 59dcfe1967cc..4a4c7945cf3e 100644 --- a/tools/testing/selftests/kvm/lib/x86_64/processor.c +++ b/tools/testing/selftests/kvm/lib/x86_64/processor.c @@ -1520,7 +1520,7 @@ unsigned long vm_compute_max_gfn(struct kvm_vm *vm) { const unsigned long num_ht_pages = 12 << (30 - vm->page_shift); /* 12 GiB */ unsigned long ht_gfn, max_gfn, max_pfn; - uint32_t eax, ebx, ecx, edx, max_ext_leaf; + uint32_t eax, ebx, ecx = 0, edx, max_ext_leaf; max_gfn = (1ULL << (vm->pa_bits - vm->page_shift)) - 1; -- 2.27.0