From nobody Fri Nov 29 22:47:09 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of lists.xenproject.org designates 192.237.175.120 as permitted sender) client-ip=192.237.175.120; envelope-from=xen-devel-bounces@lists.xenproject.org; helo=lists.xenproject.org; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of lists.xenproject.org designates 192.237.175.120 as permitted sender) smtp.mailfrom=xen-devel-bounces@lists.xenproject.org; dmarc=pass(p=quarantine dis=none) header.from=suse.com ARC-Seal: i=1; a=rsa-sha256; t=1620376856; cv=none; d=zohomail.com; s=zohoarc; b=EnDC/LYOHu/Ow/oUqUn3mOT3zrwif7pYDWW1Yy8HWSXIBFSe/53LbJWtErIj4D2Gfx5a0PrfmyYptNyjfFMDKPnVCnBtfhGkUTOIfIl0iihKnXCaDwnOCtO9GGXbJ2xosbApJ/LhNQBARpFKeBiVv8i+WUjRB3QNY+LMleU95ks= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1620376856; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:List-Subscribe:List-Post:List-Id:List-Help:List-Unsubscribe:MIME-Version:Message-ID:Sender:Subject:To; bh=lSP494LFhPRsS9tN9QB1W7zthLUosYhvW9R78Mu49p0=; b=ltEhPvqItbEhfppvhu/K8QSrWDqMVnko8jBZDYeSbHpebTqh1MsI9Hyvz4JjRrqYMUnhtlwHBLLi1SPypx07j+jGhZiUXqsdaDNaDoY8IrvFnSOnULf5c96+IudE2nkG+PcZT/GRjeGpzq1R2l725B4Lrxk4pIIIznd/Jv5aFL4= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of lists.xenproject.org designates 192.237.175.120 as permitted sender) smtp.mailfrom=xen-devel-bounces@lists.xenproject.org; dmarc=pass header.from= (p=quarantine dis=none) header.from= Return-Path: Received: from lists.xenproject.org (lists.xenproject.org [192.237.175.120]) by mx.zohomail.com with SMTPS id 1620376856286469.97903857147537; Fri, 7 May 2021 01:40:56 -0700 (PDT) Received: from list by lists.xenproject.org with outflank-mailman.123839.233679 (Exim 4.92) (envelope-from ) id 1lew2H-0006Zh-59; Fri, 07 May 2021 08:40:37 +0000 Received: by outflank-mailman (output) from mailman id 123839.233679; Fri, 07 May 2021 08:40:37 +0000 Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1lew2H-0006Za-26; Fri, 07 May 2021 08:40:37 +0000 Received: by outflank-mailman (input) for mailman id 123839; Fri, 07 May 2021 08:40:35 +0000 Received: from us1-rack-iad1.inumbo.com ([172.99.69.81]) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1lew2F-0006ZU-9S for xen-devel@lists.xenproject.org; Fri, 07 May 2021 08:40:35 +0000 Received: from mx2.suse.de (unknown [195.135.220.15]) by us1-rack-iad1.inumbo.com (Halon) with ESMTPS id 7c57a31a-961e-4422-bd31-daa7bc2dffe5; Fri, 07 May 2021 08:40:34 +0000 (UTC) Received: from relay2.suse.de (unknown [195.135.221.27]) by mx2.suse.de (Postfix) with ESMTP id 477F3AF1F; Fri, 7 May 2021 08:40:33 +0000 (UTC) X-Outflank-Mailman: Message body and most headers restored to incoming version X-BeenThere: xen-devel@lists.xenproject.org List-Id: Xen developer discussion List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Errors-To: xen-devel-bounces@lists.xenproject.org Precedence: list Sender: "Xen-devel" X-Inumbo-ID: 7c57a31a-961e-4422-bd31-daa7bc2dffe5 X-Virus-Scanned: by amavisd-new at test-mx.suse.de DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.com; s=susede1; t=1620376833; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=lSP494LFhPRsS9tN9QB1W7zthLUosYhvW9R78Mu49p0=; b=VWOOTltafbDR208fCN3YxKjNbvWpYFimCIeMFcvUYqIGLyrIo9tcj7XebO8RnurwqRf6tW 7BWDIdGPQaAnNH8D15zB2bf+PxkyIxZ07EJB0e33/1F9SbXD5WveWkFti52FOTWwi9K9oy kc56ChdF3NWnM2WC99yWhnoeFtkrFpA= To: "xen-devel@lists.xenproject.org" Cc: Andrew Cooper , Wei Liu , =?UTF-8?Q?Roger_Pau_Monn=c3=a9?= From: Jan Beulich Subject: [PATCH] x86/CPUID: don't shrink hypervisor leaves Message-ID: <0f5fe8d3-4c43-e60f-c585-67b2f23383ab@suse.com> Date: Fri, 7 May 2021 10:40:34 +0200 User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:78.0) Gecko/20100101 Thunderbird/78.10.1 MIME-Version: 1.0 Content-Language: en-US Content-Transfer-Encoding: quoted-printable X-ZohoMail-DKIM: pass (identity @suse.com) Content-Type: text/plain; charset="utf-8" This is a partial revert of 540d911c2813 ("x86/CPUID: shrink max_{,sub}leaf fields according to actual leaf contents"). Andrew points out that XXX. Reported-by: Andrew Cooper Signed-off-by: Jan Beulich --- Obviously the XXX wants filling in. So far I did not really understand what bad consequences there might be, but I can agree with the undoing of this part of the original change along the lines of why the Viridian side adjustment was also requested to be dropped (before the patch went in). --- a/xen/arch/x86/traps.c +++ b/xen/arch/x86/traps.c @@ -964,15 +964,13 @@ void cpuid_hypervisor_leaves(const struc uint32_t base =3D is_viridian_domain(d) ? 0x40000100 : 0x40000000; uint32_t idx =3D leaf - base; unsigned int limit =3D is_viridian_domain(d) ? p->hv2_limit : p->hv_li= mit; - unsigned int dflt =3D is_pv_domain(d) ? XEN_CPUID_MAX_PV_NUM_LEAVES - : XEN_CPUID_MAX_HVM_NUM_LEAVES; =20 if ( limit =3D=3D 0 ) /* Default number of leaves */ - limit =3D dflt; + limit =3D XEN_CPUID_MAX_NUM_LEAVES; else /* Clamp toolstack value between 2 and MAX_NUM_LEAVES. */ - limit =3D min(max(limit, 2u), dflt); + limit =3D min(max(limit, 2u), XEN_CPUID_MAX_NUM_LEAVES + 0u); =20 if ( idx > limit ) return; --- a/xen/include/public/arch-x86/cpuid.h +++ b/xen/include/public/arch-x86/cpuid.h @@ -113,10 +113,6 @@ /* Max. address width in bits taking memory hotplug into account. */ #define XEN_CPUID_MACHINE_ADDRESS_WIDTH_MASK (0xffu << 0) =20 -#define XEN_CPUID_MAX_PV_NUM_LEAVES 5 -#define XEN_CPUID_MAX_HVM_NUM_LEAVES 4 -#define XEN_CPUID_MAX_NUM_LEAVES \ - (XEN_CPUID_MAX_PV_NUM_LEAVES > XEN_CPUID_MAX_HVM_NUM_LEAVES ? \ - XEN_CPUID_MAX_PV_NUM_LEAVES : XEN_CPUID_MAX_HVM_NUM_LEAVES) +#define XEN_CPUID_MAX_NUM_LEAVES 5 =20 #endif /* __XEN_PUBLIC_ARCH_X86_CPUID_H__ */