From mboxrd@z Thu Jan 1 00:00:00 1970 From: "Jan Beulich" Subject: Re: [PATCH RFC 10/31] xen/x86: Calculate HVM featureset Date: Tue, 22 Dec 2015 10:11:51 -0700 Message-ID: <5679926702000078000C265C@prv-mh.provo.novell.com> References: <1450301073-28191-1-git-send-email-andrew.cooper3@citrix.com> <1450301073-28191-11-git-send-email-andrew.cooper3@citrix.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: In-Reply-To: <1450301073-28191-11-git-send-email-andrew.cooper3@citrix.com> Content-Disposition: inline List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xen.org Errors-To: xen-devel-bounces@lists.xen.org To: Andrew Cooper Cc: Tim Deegan , Ian Campbell , Xen-devel List-Id: xen-devel@lists.xenproject.org >>> On 16.12.15 at 22:24, wrote: > @@ -22,6 +24,27 @@ void __init calculate_featuresets(void) > > /* Unconditionally claim to be able to set the hypervisor bit. */ > __set_bit(X86_FEATURE_HYPERVISOR, pv_featureset); > + > + /* HVM featureset. */ > + if ( hvm_enabled ) > + { > + const uint32_t *hvm_featuremask = hvm_funcs.hap_supported > + ? hvm_hap_featuremask : hvm_shadow_featuremask; > + > + for ( i = 0; i < ARRAY_SIZE(hvm_featureset); ++i ) > + hvm_featureset[i] = host_featureset[i] & hvm_featuremask[i]; > + > + /* Unconditionally claim to be able to set the hypervisor bit. */ > + __set_bit(X86_FEATURE_HYPERVISOR, hvm_featureset); > + > + /* > + * On AMD, PV guests are entirely unable to use 'sysenter' as Xen runs > + * in long mode, but HVM guests are able if running in protected mode. > + */ > + if ( (boot_cpu_data.x86_vendor == X86_VENDOR_AMD) && > + !test_bit(X86_FEATURE_SEP, boot_cpu_data.x86_capability) ) Is the ! correct here? And please use cpu_has_sep. Jan