From patchwork Mon Jan 27 14:34:44 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andrew Cooper X-Patchwork-Id: 11352767 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id D6202924 for ; Mon, 27 Jan 2020 14:41:46 +0000 (UTC) Received: from lists.xenproject.org (lists.xenproject.org [192.237.175.120]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id B2CC5214AF for ; Mon, 27 Jan 2020 14:41:46 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=fail reason="signature verification failed" (1024-bit key) header.d=citrix.com header.i=@citrix.com header.b="R8c4eYbT" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org B2CC5214AF Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=citrix.com Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=xen-devel-bounces@lists.xenproject.org Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.89) (envelope-from ) id 1iw5ZL-000386-2A; Mon, 27 Jan 2020 14:40:51 +0000 Received: from all-amaz-eas1.inumbo.com ([34.197.232.57] helo=us1-amaz-eas2.inumbo.com) by lists.xenproject.org with esmtp (Exim 4.89) (envelope-from ) id 1iw5ZK-00037v-8f for xen-devel@lists.xenproject.org; Mon, 27 Jan 2020 14:40:50 +0000 X-Inumbo-ID: 026bb376-4113-11ea-855d-12813bfff9fa Received: from esa1.hc3370-68.iphmx.com (unknown [216.71.145.142]) by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS id 026bb376-4113-11ea-855d-12813bfff9fa; Mon, 27 Jan 2020 14:40:49 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=citrix.com; s=securemail; t=1580136050; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version; bh=KxBZdLUfu5p+vxv/yMA6EcE+zysbJli0udL61VhwHJY=; b=R8c4eYbTA7g8IktHVWFX97zTfoQVWvjpNozoaGmZAP6xkgXRWFa6ZIUi u3Ebx7YfI1nM0BSU6aaNrROitkdnLYL0PjTR3RMdr4FDnxpS3dmFJOXtB ImyeQ443bmtCqDcJQFZnmGU5QbPnC2FeqIFYdb91E5BqpqOeuqIcurU2M A=; Authentication-Results: esa1.hc3370-68.iphmx.com; dkim=none (message not signed) header.i=none; spf=None smtp.pra=andrew.cooper3@citrix.com; spf=Pass smtp.mailfrom=Andrew.Cooper3@citrix.com; spf=None smtp.helo=postmaster@mail.citrix.com Received-SPF: None (esa1.hc3370-68.iphmx.com: no sender authenticity information available from domain of andrew.cooper3@citrix.com) identity=pra; client-ip=162.221.158.21; receiver=esa1.hc3370-68.iphmx.com; envelope-from="Andrew.Cooper3@citrix.com"; x-sender="andrew.cooper3@citrix.com"; x-conformance=sidf_compatible Received-SPF: Pass (esa1.hc3370-68.iphmx.com: domain of Andrew.Cooper3@citrix.com designates 162.221.158.21 as permitted sender) identity=mailfrom; client-ip=162.221.158.21; receiver=esa1.hc3370-68.iphmx.com; envelope-from="Andrew.Cooper3@citrix.com"; x-sender="Andrew.Cooper3@citrix.com"; x-conformance=sidf_compatible; x-record-type="v=spf1"; x-record-text="v=spf1 ip4:209.167.231.154 ip4:178.63.86.133 ip4:195.66.111.40/30 ip4:85.115.9.32/28 ip4:199.102.83.4 ip4:192.28.146.160 ip4:192.28.146.107 ip4:216.52.6.88 ip4:216.52.6.188 ip4:162.221.158.21 ip4:162.221.156.83 ip4:168.245.78.127 ~all" Received-SPF: None (esa1.hc3370-68.iphmx.com: no sender authenticity information available from domain of postmaster@mail.citrix.com) identity=helo; client-ip=162.221.158.21; receiver=esa1.hc3370-68.iphmx.com; envelope-from="Andrew.Cooper3@citrix.com"; x-sender="postmaster@mail.citrix.com"; x-conformance=sidf_compatible IronPort-SDR: W8sA4/Sy3VixmI5FXI8s+GOSPsedtPbPZsQE/Vueks4Nqaz54KIOI9Eh3uYrfJPb8lweGqqpyV es1yP0T7t3aHPIC6APMAp+u+Sw9ra+BhpCvWzlAI1ZFCQNBeF9dTPXjqM6AOiNv5vfkgiUWlHh wKrRHBgZmiYQpPvkf7YyOAjJjuSvmDTBJlfcjT9d1tYRD93bIEZc9Asjj7Iedj8SjoZKkMAwga NoJvQfdpgbDS46ed4A7XtcuP0DYEhK+TQKnt1pHcyM1mUj+qacDMYSlUQuwIgbIt6v5W6mlim2 22E= X-SBRS: 2.7 X-MesageID: 11665349 X-Ironport-Server: esa1.hc3370-68.iphmx.com X-Remote-IP: 162.221.158.21 X-Policy: $RELAYED X-IronPort-AV: E=Sophos;i="5.70,370,1574139600"; d="scan'208";a="11665349" From: Andrew Cooper To: Xen-devel Date: Mon, 27 Jan 2020 14:34:44 +0000 Message-ID: <20200127143444.25538-18-andrew.cooper3@citrix.com> X-Mailer: git-send-email 2.11.0 In-Reply-To: <20200127143444.25538-1-andrew.cooper3@citrix.com> References: <20200127143444.25538-1-andrew.cooper3@citrix.com> MIME-Version: 1.0 Subject: [Xen-devel] [PATCH v2 17/17] docs/xl.cfg: Rewrite cpuid= section 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: Anthony PERARD , Andrew Cooper , Wei Liu , Ian Jackson Errors-To: xen-devel-bounces@lists.xenproject.org Sender: "Xen-devel" This is partly to adjust the description of 'k' and 's' seeing as they have changed, but mostly restructuring the information for clarity. In particular, use indentation to clearly separate the areas discussing libxl format from xend format. In addition, extend the xend format section to discuss subleaf notation. Signed-off-by: Andrew Cooper Acked-by: Ian Jackson --- CC: Ian Jackson CC: Wei Liu CC: Anthony PERARD v2: * New --- docs/man/xl.cfg.5.pod.in | 74 ++++++++++++++++++++++++++++++++++-------------- 1 file changed, 53 insertions(+), 21 deletions(-) diff --git a/docs/man/xl.cfg.5.pod.in b/docs/man/xl.cfg.5.pod.in index 245d3f9472..1da68c4a07 100644 --- a/docs/man/xl.cfg.5.pod.in +++ b/docs/man/xl.cfg.5.pod.in @@ -1964,26 +1964,42 @@ This option is disabled by default. Configure the value returned when a guest executes the CPUID instruction. Two versions of config syntax are recognized: libxl and xend. -The libxl syntax is a comma separated list of key=value pairs, preceded by the -word "host". A few keys take a numerical value, all others take a single -character which describes what to do with the feature bit. - -Possible values for a single feature bit: +Both formats use a common notation for specifying a single feature bit. +Possible values are: '1' -> force the corresponding bit to 1 '0' -> force to 0 'x' -> Get a safe value (pass through and mask with the default policy) - 'k' -> pass through the host bit value - 's' -> as 'k' but preserve across save/restore and migration (not implemented) + 'k' -> pass through the host bit value (at boot only - value preserved on migrate) + 's' -> legacy alias for 'k' -Note: when specifying B for hypervisor leaves (0x4000xxxx major group) -only the lowest 8 bits of leaf's 0x4000xx00 EAX register are processed, the -rest are ignored (these 8 bits signify maximum number of hypervisor leaves). +B: + +=over 4 + +The libxl format is a single string, starting with the word "host", and +followed by a comma separated list of key=value pairs. A few keys take a +numerical value, all others take a single character which describes what to do +with the feature bit. e.g.: + +=over 4 + +cpuid="host,tm=0,sse3=0" + +=back List of keys taking a value: + +=over 4 + apicidsize brandid clflush family localapicid maxleaf maxhvleaf model nc proccount procpkg stepping +=back + List of keys taking a character: + +=over 4 + 3dnow 3dnowext 3dnowprefetch abm acpi adx aes altmovcr8 apic arat avx avx2 avx512-4fmaps avx512-4vnniw avx512bw avx512cd avx512dq avx512er avx512f avx512ifma avx512pf avx512vbmi avx512vl bmi1 bmi2 clflushopt clfsh clwb cmov @@ -1997,21 +2013,37 @@ ssse3 svm svm_decode svm_lbrv svm_npt svm_nrips svm_pausefilt svm_tscrate svm_vmcbclean syscall sysenter tbm tm tm2 topoext tsc tsc-deadline tsc_adjust umip vme vmx wdt x2apic xop xsave xtpr +=back + +=back + +B: -The xend syntax is a list of values in the form of -'leafnum:register=bitstring,register=bitstring' - "leafnum" is the requested function, - "register" is the response register to modify - "bitstring" represents all bits in the register, its length must be 32 chars. - Each successive character represent a lesser-significant bit, possible values - are listed above in the libxl section. +=over 4 -Example to hide two features from the guest: 'tm', which is bit #29 in EDX, and -'pni' (SSE3), which is bit #0 in ECX: +Xend format consists of an array of one or more strings of the form +"leaf:reg=bitstring,...". e.g. (matching the libxl example above): -xend: [ "1:ecx=xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx0,edx=xx0xxxxxxxxxxxxxxxxxxxxxxxxxxxxx" ] +=over 4 -libxl: "host,tm=0,sse3=0" +cpuid=["1:ecx=xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx0,edx=xx0xxxxxxxxxxxxxxxxxxxxxxxxxxxxx", ...] + +=back + +"leaf" is an integer, either decimal or hex with a "0x" prefix. e.g. to +specify something in the AMD feature leaves, use "0x80000001:ecx=...". + +Some leaves have subleaves which can be specified as "leaf,subleaf". e.g. for +the Intel structured feature leaf, use "7,0:ebx=..." + +The bitstring represents all bits in the register, its length must be 32 +chars. Each successive character represent a lesser-significant bit. + +=back + +Note: when specifying B for hypervisor leaves (0x4000xxxx major group) +only the lowest 8 bits of leaf's 0x4000xx00 EAX register are processed, the +rest are ignored (these 8 bits signify maximum number of hypervisor leaves). More info about the CPUID instruction can be found in the processor manuals, and on Wikipedia: L