Bug 671510

Summary: virt-what fails to detect Citrix (upstream) Xen HVM with Viridian extensions
Product: Red Hat Enterprise Linux 7 Reporter: Richard W.M. Jones <rjones>
Component: virt-whatAssignee: Richard W.M. Jones <rjones>
Status: CLOSED WONTFIX QA Contact: YongkuiGuo <yoguo>
Severity: unspecified Docs Contact:
Priority: unspecified    
Version: 7.0CC: bkearney, cwei, dgoodwin, jsefler, jzheng, leiwang, linl, lmiksik, qwan, valentine.sinitsyn, wshi, xchen, yuzhang
Target Milestone: rc   
Target Release: 7.0   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2019-05-13 09:28:26 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Bug Depends On: 672211    
Bug Blocks: 1288337, 1301891    
Attachments:
Description Flags
Modified code to differentiate between XenServer and Hyper-V none

Description Richard W.M. Jones 2011-01-21 18:04:40 UTC
Description of problem:

(This was reported in a private email by Ian Campbell)

<<
For HVM (32 or 64 bit) virt-what returns:
# virt-what                                                                     
hyperv
xen

I disabled the Xen Viridian extensions and it returns:
# virt-what                                                                     
xen
xen-hvm

Your cpuid helper should check every 0x100 from 0x40000000
and then it will find multiple signatures on Xen when
viridian compat is enabled.
>>

Ian goes on to point to this piece of code from xendetect:

        static inline uint32_t xen_cpuid_base(void)
        {
                uint32_t base, eax, ebx, ecx, edx;
                char signature[13];

                for (base = 0x40000000; base < 0x40010000; base += 0x100) {
                        cpuid(base, &eax, &ebx, &ecx, &edx);
                        *(uint32_t *)(signature + 0) = ebx;
                        *(uint32_t *)(signature + 4) = ecx;
                        *(uint32_t *)(signature + 8) = edx;
                        signature[12] = 0;

                        if (!strcmp("XenVMMXenVMM", signature) && ((eax - base)
>= 2))
                                return base;
                }                                                               

                return 0;
        }                                                                       


Version-Release number of selected component (if applicable):

virt-what 1.7

How reproducible:

Always.

Steps to Reproduce:
1. Using upstream Xen, HVM with Viridian extensions turned on.
2. Run virt-what in the guest.
  
Actual results:

hyperv
xen

Expected results:

Something like:

xen
xen-hvm
xen-hyperv_compat

Additional info:

Comment 4 Richard W.M. Jones 2011-06-10 10:12:02 UTC
Need to find a Citrix Xen box.

Comment 5 Richard W.M. Jones 2011-08-11 11:40:18 UTC
Push this up to 6.3.  It's not a customer bug.

Comment 6 Richard W.M. Jones 2012-03-05 13:12:45 UTC
Push to 6.4, for the same reason as comment 5.

Comment 7 Valentine Sinitsyn 2012-04-25 15:01:17 UTC
(In reply to comment #2)
> Fixed upstream:
> http://git.annexia.org/?p=virt-what.git;a=commitdiff;h=300c5168ca007ed5fbd49189efbe66ae0dbd9ad1

The patch is not that simple; on our XenServer boxes, after running the code above, %eax (max_entries) will contain garbage and sanity check would fail.

I've modified the code a bit for our purposes; hope it would be useful for others as well.

Comment 8 Valentine Sinitsyn 2012-04-25 15:02:56 UTC
Created attachment 580182 [details]
Modified code to differentiate between XenServer and Hyper-V

Comment 10 RHEL Program Management 2012-07-10 08:08:23 UTC
This request was not resolved in time for the current release.
Red Hat invites you to ask your support representative to
propose this request, if still desired, for consideration in
the next release of Red Hat Enterprise Linux.

Comment 11 RHEL Program Management 2012-07-11 02:02:20 UTC
This request was erroneously removed from consideration in Red Hat Enterprise Linux 6.4, which is currently under development.  This request will be evaluated for inclusion in Red Hat Enterprise Linux 6.4.

Comment 12 RHEL Program Management 2012-09-07 05:28:56 UTC
This request was evaluated by Red Hat Product Management for
inclusion in the current release of Red Hat Enterprise Linux.
Because the affected component is not scheduled to be updated
in the current release, Red Hat is unable to address this
request at this time.

Red Hat invites you to ask your support representative to
propose this request, if appropriate, in the next release of
Red Hat Enterprise Linux.

Comment 14 Richard W.M. Jones 2013-12-10 15:46:56 UTC
Moving to RHEL 7.1 as we need to get a developer to
install a Citrix Xen box and test.

Comment 19 Richard W.M. Jones 2016-06-20 11:52:14 UTC
This package is on the ACL for RHEL 7.3 (yay!).  Unfortunately
we don't have a clear fix for this upstream.  So I will defer
this to RHEL 7.4 unless we have a clear plan to fix this upstream
and test the fix.

Comment 20 Richard W.M. Jones 2017-02-16 12:33:28 UTC
Moving to RHEL 7.5 for the same reasons as comment 19.

Comment 21 Richard W.M. Jones 2017-10-17 12:22:32 UTC
No fix upstream still, so moving to RHEL 7.6.

Comment 22 Richard W.M. Jones 2019-05-13 09:28:26 UTC
Looks like we're not going to fix this in RHEL 7, so I'm closing this.  If this is
an issue for anyone, please reopen the bug against RHEL 8.