[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PATCH] x86/CPUID: fill all fields in x86_cpuid_policy_fill_native()
- To: "xen-devel@xxxxxxxxxxxxxxxxxxxx" <xen-devel@xxxxxxxxxxxxxxxxxxxx>
- From: Jan Beulich <jbeulich@xxxxxxxx>
- Date: Mon, 22 Jun 2020 14:09:05 +0200
- Arc-authentication-results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=suse.com; dmarc=pass action=none header.from=suse.com; dkim=pass header.d=suse.com; arc=none
- Arc-message-signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=m2QBB9clr1SHHh3MBypsBjTwJY1i/ptJALFqpBUTIKI=; b=PzWYmjEvZIf5DMeSDMkfExzbGjNXvYxUtwtSluqHqUnfl+8aAnJSWMQ/zb9dGsxnAmTqs1QqPo/YqxNluTQzmwtwT/v9JkGEc36iDPp3KkTErTkoWxPwTPDwe5LgqIh2RkVclAxf8uRpp93BSOpJ1Qr6wJoEBm8mb5QhwbtA75+6kEi/uWTbchwgQfrJtnU5VdVm1IQ3u9kb8FjJSkfBVelxRx9sJkqvu2AkFEsh7TIPb8G2fHlPDHNmkNjF42TnETid5TcE8CeXrqcpN4k5MfUUgwRyr0fwd0Tz4P5JSErXLeMpgaUn/oLJtEBmueChf9eGJnOttmfl/81gUzEyvQ==
- Arc-seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=NhQhe6VOQ8v3XFZqzMKWrw8dKFoDlTqeu35cR+cEU0NkXpXAE1LMzMPpkEVNxeaJ0tEJAvf5bHaDAUlZMWWpPoKMjzq50nP6hV5xVRklFDfTtIomCST8PyimeaIMUK1MpibR8nAfdcDwNll0Ix7etPZP4e3utKcG6IcLR4ey51Olo2GtEQ0AW36OebKbzDHc5DiS83RHguU/Jd8F5ioDOqAQpCw81sFXYF4+dqzYtEM+i228p05+JIfn2CmZsgOEfZRoXFZ1WGh7T14F/UJf2y5OZdEPwK6LJV6CTjPsa8acxl1mLi9KjRqjkgNVXoziD22QYQWOFBBioPInxy2t0Q==
- Authentication-results: xen.org; dkim=none (message not signed) header.d=none;xen.org; dmarc=none action=none header.from=suse.com;
- Cc: Andrew Cooper <andrew.cooper3@xxxxxxxxxx>, Paul Durrant <paul@xxxxxxx>, Wei Liu <wl@xxxxxxx>, Roger Pau Monné <roger.pau@xxxxxxxxxx>
- Delivery-date: Mon, 22 Jun 2020 12:09:42 +0000
- List-id: Xen developer discussion <xen-devel.lists.xenproject.org>
Coverity validly complains that the new call from
tools/tests/cpu-policy/test-cpu-policy.c:test_cpuid_current() leaves
two fields uninitialized, yet they get then consumed by
x86_cpuid_copy_to_buffer(). (All other present callers of the function
pass a pointer to a static - and hence initialized - buffer.)
Coverity-ID: 1464809
Fixes: c22ced93e167 ("tests/cpu-policy: Confirm that CPUID serialisation is
sorted")
Signed-off-by: Jan Beulich <jbeulich@xxxxxxxx>
--- a/xen/lib/x86/cpuid.c
+++ b/xen/lib/x86/cpuid.c
@@ -176,6 +176,10 @@ void x86_cpuid_policy_fill_native(struct
ARRAY_SIZE(p->extd.raw) - 1); ++i )
cpuid_leaf(0x80000000 + i, &p->extd.raw[i]);
+ /* Don't report leaves from possible lower level hypervisor. */
+ p->hv_limit = 0;
+ p->hv2_limit = 0;
+
x86_cpuid_policy_recalc_synth(p);
}
|