From nobody Mon Feb 9 19:07:00 2026 Delivered-To: importer@patchew.org Received-SPF: none (zoho.com: 192.237.175.120 is neither permitted nor denied by domain of lists.xenproject.org) client-ip=192.237.175.120; envelope-from=xen-devel-bounces@lists.xenproject.org; helo=lists.xenproject.org; Authentication-Results: mx.zohomail.com; dkim=fail; spf=none (zoho.com: 192.237.175.120 is neither permitted nor denied by domain of lists.xenproject.org) smtp.mailfrom=xen-devel-bounces@lists.xenproject.org ARC-Seal: i=1; a=rsa-sha256; t=1571995083; cv=none; d=zoho.com; s=zohoarc; b=aBk7mjPzqox+L3PapF4LbzHLTWmqBTHBiPIlJwKQomfZ+UyMIPhMqhup7VngnZ7oSbd4n1JtFhTdfQJK32bNQQen55FPY0EvAtdxL5cTha0UuIZ7Pmjg+bNvXAc/z7HcO3UCJiYg0wsSEM0WVPo6MHf+kg8oOOnxWKol1NxHg60= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zoho.com; s=zohoarc; t=1571995083; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=a2BoCMkFvVO5ig07meR4QT83IRoCw+w0khv/7CSiUWo=; b=HQyJoVw8c7YLLsRSXVIAKY5r9OAnR1MnnaIoM5o0ZSfRXc/dg9f3E5I7c+q8qhnuozMOikV287A5+F625LMiCCySNwfvNjRjetOBCntSEF+TUpRpWD51cTtipXzgr6+A2zBPqEVmnUlTDyKxFf86k/62RZTvjKqqs2f5dShr34s= ARC-Authentication-Results: i=1; mx.zoho.com; dkim=fail; spf=none (zoho.com: 192.237.175.120 is neither permitted nor denied by domain of lists.xenproject.org) smtp.mailfrom=xen-devel-bounces@lists.xenproject.org Return-Path: Received: from lists.xenproject.org (lists.xenproject.org [192.237.175.120]) by mx.zohomail.com with SMTPS id 1571995083790375.7618140947426; Fri, 25 Oct 2019 02:18:03 -0700 (PDT) Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.89) (envelope-from ) id 1iNviO-0007p0-WA; Fri, 25 Oct 2019 09:17:00 +0000 Received: from us1-rack-iad1.inumbo.com ([172.99.69.81]) by lists.xenproject.org with esmtp (Exim 4.89) (envelope-from ) id 1iNviN-0007oY-Nd for xen-devel@lists.xenproject.org; Fri, 25 Oct 2019 09:16:59 +0000 Received: from mail-wm1-x342.google.com (unknown [2a00:1450:4864:20::342]) by us1-rack-iad1.inumbo.com (Halon) with ESMTPS id 2aeb47b2-f708-11e9-beca-bc764e2007e4; Fri, 25 Oct 2019 09:16:46 +0000 (UTC) Received: by mail-wm1-x342.google.com with SMTP id c22so1241715wmd.1 for ; Fri, 25 Oct 2019 02:16:46 -0700 (PDT) Received: from debian.mshome.net (54.163.200.146.dyn.plus.net. [146.200.163.54]) by smtp.gmail.com with ESMTPSA id b62sm1873283wmc.13.2019.10.25.02.16.44 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 25 Oct 2019 02:16:45 -0700 (PDT) X-Inumbo-ID: 2aeb47b2-f708-11e9-beca-bc764e2007e4 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=EhsqHaMATtvXE4hbd+Eeu66aFe8FP/Jxe1IdUOxtz0I=; b=cXaqNNMATjfnf//Csgy85n5sfFQ5GaaOMC9FY4AAWj4TcH3tZusKjqY2eGxHZ8DfoO Q+hIOM5DlyZP2Px8OfqP7Ko/+5+7UQ6xfYshHb7cVBx7qrgB0ykb5fZBDAr92hujDrcS DHUgZ8g5YLAB5Ca16VQ+q4Ub6HpRW0BrD5b802aEWxEG5oiLLgMwM8nbnASF4OYFBqQW Nr/cHR7rLwYq8N7FiN5eZckcHtmenfgedpr5GFDvahm3e2cNNskdPGmTiJF6MhH7gZ+a VoR1yezI80LvpJRwt4lwRZmXJo2oRv7r+f052F1yIK0nxWkj/l4P/SRIxpBKyeRP8yAB tf1g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:from:to:cc:subject:date:message-id :in-reply-to:references:mime-version:content-transfer-encoding; bh=EhsqHaMATtvXE4hbd+Eeu66aFe8FP/Jxe1IdUOxtz0I=; b=DZAvroLU9oBMhgxFlHc6hmLU86uhi5Oxs0hfiJq74yTdGhUqOwa+h4FgCSG42CnF18 g9p5hLScoLK6blTJX1h3f7kmhGYcu9Tmjd7TEegJeEz5S6yRZ6OjLvMg9IuedWGmqhB3 mAeRH3NFo72E17ePC8CXajRU8Wy1rPpq1Y3nFyiBgxpreYCFQ8qLkPy/tBJsjk0MWYCz 4J9knYR/r4Yt+wu8fMcJpKmHcLG+RbkQ6nB1UG4wt38wODcddIjo24zdf753g8A5on1D nG46g/HSfhSVpGSJH/Hvp+WCvVtrmc13fjAAT5YPn1592bZXjMPjXwfzhHoHrIMkUG3d aIAQ== X-Gm-Message-State: APjAAAX+i2WaqIFdoNtCsGd92BMzUXPo7ERJR47wtnkjGl6pgU6MGdm3 IdS1vuNsY0DnTKIX5kxBGp3XjFMCBEg= X-Google-Smtp-Source: APXvYqwxYs/IdBeIJfAqfKEw7+Yqzw9jdJUgPtzZkNr/+Ferlo9A9zAWFAMDffCyXAWUf2jiXIFxSg== X-Received: by 2002:a1c:39c1:: with SMTP id g184mr2507650wma.75.1571995005877; Fri, 25 Oct 2019 02:16:45 -0700 (PDT) From: Wei Liu X-Google-Original-From: Wei Liu To: Xen Development List Date: Fri, 25 Oct 2019 10:16:14 +0100 Message-Id: <20191025091618.10153-4-liuwe@microsoft.com> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20191025091618.10153-1-liuwe@microsoft.com> References: <20191025091618.10153-1-liuwe@microsoft.com> MIME-Version: 1.0 Subject: [Xen-devel] [PATCH for-next 3/7] x86/hyperv: extract more information from Hyper-V X-BeenThere: xen-devel@lists.xenproject.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: Xen developer discussion List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Cc: Wei Liu , Wei Liu , Paul Durrant , Andrew Cooper , Michael Kelley , Jan Beulich , =?UTF-8?q?Roger=20Pau=20Monn=C3=A9?= Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Errors-To: xen-devel-bounces@lists.xenproject.org Sender: "Xen-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) Provide a structure to store that information. The structure will be accessed from other places later so make it public. Signed-off-by: Wei Liu Acked-by: Jan Beulich --- xen/arch/x86/guest/hyperv/hyperv.c | 14 ++++++++++++++ xen/include/asm-x86/guest/hyperv.h | 12 ++++++++++++ 2 files changed, 26 insertions(+) diff --git a/xen/arch/x86/guest/hyperv/hyperv.c b/xen/arch/x86/guest/hyperv= /hyperv.c index 7ab4b127f3..041166f344 100644 --- a/xen/arch/x86/guest/hyperv/hyperv.c +++ b/xen/arch/x86/guest/hyperv/hyperv.c @@ -21,6 +21,9 @@ #include =20 #include +#include + +struct ms_hyperv_info ms_hyperv; =20 bool __init hyperv_probe(void) { @@ -36,6 +39,17 @@ bool __init hyperv_probe(void) if ( eax !=3D 0x31237648 ) /* Hv#1 */ return false; =20 + /* Extract more information from Hyper-V */ + ms_hyperv.features =3D cpuid_eax(HYPERV_CPUID_FEATURES); + ms_hyperv.misc_features =3D cpuid_edx(HYPERV_CPUID_FEATURES); + ms_hyperv.hints =3D cpuid_eax(HYPERV_CPUID_ENLIGHTMENT_INFO); + + if ( ms_hyperv.hints & HV_X64_ENLIGHTENED_VMCS_RECOMMENDED ) + ms_hyperv.nested_features =3D cpuid_eax(HYPERV_CPUID_NESTED_FEATUR= ES); + + ms_hyperv.max_vp_index =3D cpuid_eax(HYPERV_CPUID_IMPLEMENT_LIMITS); + ms_hyperv.max_lp_index =3D cpuid_ebx(HYPERV_CPUID_IMPLEMENT_LIMITS); + return true; } =20 diff --git a/xen/include/asm-x86/guest/hyperv.h b/xen/include/asm-x86/guest= /hyperv.h index 4b9cc5a836..0f8800040a 100644 --- a/xen/include/asm-x86/guest/hyperv.h +++ b/xen/include/asm-x86/guest/hyperv.h @@ -21,8 +21,20 @@ =20 #ifdef CONFIG_HYPERV_GUEST =20 +#include + #include =20 +struct ms_hyperv_info { + uint32_t features; + uint32_t misc_features; + uint32_t hints; + uint32_t nested_features; + uint32_t max_vp_index; + uint32_t max_lp_index; +}; +extern struct ms_hyperv_info ms_hyperv; + extern struct hypervisor_ops hyperv_ops; =20 bool hyperv_probe(void); --=20 2.20.1 _______________________________________________ Xen-devel mailing list Xen-devel@lists.xenproject.org https://lists.xenproject.org/mailman/listinfo/xen-devel