From: Don Slutz <dslutz@verizon.com>
To: Jan Beulich <JBeulich@suse.com>, Don Slutz <dslutz@verizon.com>
Cc: Jun Nakajima <jun.nakajima@intel.com>, Tim Deegan <tim@xen.org>,
Kevin Tian <kevin.tian@intel.com>, Keir Fraser <keir@xen.org>,
Ian Campbell <ian.campbell@citrix.com>,
Stefano Stabellini <stefano.stabellini@eu.citrix.com>,
George Dunlap <George.Dunlap@eu.citrix.com>,
Andrew Cooper <andrew.cooper3@citrix.com>,
Ian Jackson <ian.jackson@eu.citrix.com>,
xen-devel@lists.xen.org, Eddie Dong <eddie.dong@intel.com>,
Aravind Gopalakrishnan <Aravind.Gopalakrishnan@amd.com>,
Suravee Suthikulpanit <suravee.suthikulpanit@amd.com>,
Boris Ostrovsky <boris.ostrovsky@oracle.com>
Subject: Re: [PATCH for-4.5 v7 1/7] xen: Add support for VMware cpuid leaves
Date: Thu, 15 Jan 2015 16:00:57 -0500 [thread overview]
Message-ID: <54B82A89.2060808@terremark.com> (raw)
In-Reply-To: <54B7FBF6020000780005587C@mail.emea.novell.com>
On 01/15/15 11:42, Jan Beulich wrote:
>>>> On 02.10.14 at 23:30, <dslutz@verizon.com> wrote:
>> @@ -5536,6 +5540,11 @@ long do_hvm_op(unsigned long op, XEN_GUEST_HANDLE_PARAM(void) arg)
>> if ( curr_d == d )
>> break;
>>
>> + if ( d->arch.hvm_domain.params[HVM_PARAM_VMWARE_HW] )
>> + {
>> + rc = -EXDEV;
>
> That's a pretty strange error code here. -EOPNOTSUPP perhaps?
>
Sure.
>> --- /dev/null
>> +++ b/xen/arch/x86/hvm/vmware/cpuid.c
>
> Whether adding another subdirectory here is really the way to go
> heavily depends on how much of this new code we really want to
> take into the tree. There sheer size of the series makes me
> hesitant to consider taking it all.
>
Not sure what I can say here to help.
>> +/*
>> + * VMware hardware version 7 defines some of these cpuid levels,
>> + * below is a brief description about those.
>> + *
>> + * Leaf 0x40000000, Hypervisor CPUID information
>> + * # EAX: The maximum input value for hypervisor CPUID info (0x40000010).
>> + * # EBX, ECX, EDX: Hypervisor vendor ID signature. E.g. "VMwareVMware"
>> + *
>> + * Leaf 0x40000010, Timing information.
>> + * # EAX: (Virtual) TSC frequency in kHz.
>> + * # EBX: (Virtual) Bus (local apic timer) frequency in kHz.
>> + * # ECX, EDX: RESERVED
>> + */
>> +
>> +int cpuid_vmware_leaves(uint32_t idx, uint32_t *eax, uint32_t *ebx,
>> + uint32_t *ecx, uint32_t *edx)
>> +{
>> + struct domain *d = current->domain;
>> +
>> + if ( !is_vmware_domain(d) )
>> + return 0;
>> +
>> + switch ( idx - 0x40000000 )
>> + {
>> + case 0x0:
>> + if ( d->arch.hvm_domain.params[HVM_PARAM_VMWARE_HW] >= 7 )
>> + {
>> + *eax = 0x40000010; /* Largest leaf */
>> + *ebx = 0x61774d56; /* "VMwa" */
>> + *ecx = 0x4d566572; /* "reVM" */
>> + *edx = 0x65726177; /* "ware" */
>> + break;
>> + }
>> + /* fallthrough */
>> + case 0x10:
>> + if ( d->arch.hvm_domain.params[HVM_PARAM_VMWARE_HW] >= 7 )
>> + {
>> + /* (Virtual) TSC frequency in kHz. */
>> + *eax = d->arch.tsc_khz;
>> + /* (Virtual) Bus (local apic timer) frequency in kHz. */
>> + *ebx = 1000000ull / APIC_BUS_CYCLE_NS;
>> + *ecx = 0; /* Reserved */
>> + *edx = 0; /* Reserved */
>> + break;
>> + }
>> + /* fallthrough */
>
> So for versions < 7 there's effectively no CPUID support at all?
> Wouldn't it then make more sense to check for the version together
> with the is_vmware_domain() check at the top?
>
Nope, when version is > 0 & < 7, all zeros are returned for these.
This is why there is a fallthrough comment.
Doing the zero returns is part of making the environment look as much
like VMware as possible. I feel this is better, but I can be pushed
into including this check at the top (since the VMware KB article
referenced just has an equal statement).
This range of zeros is what I see during testing on a VMware ESX server.
>> --- a/xen/include/asm-x86/hvm/hvm.h
>> +++ b/xen/include/asm-x86/hvm/hvm.h
>> @@ -346,6 +346,9 @@ static inline unsigned long hvm_get_shadow_gs_base(struct vcpu *v)
>> #define is_viridian_domain(d) \
>> (is_hvm_domain(d) && (viridian_feature_mask(d) & HVMPV_base_freq))
>>
>> +#define is_vmware_domain(_d) \
>> + (is_hvm_domain(_d) && ((_d)->arch.hvm_domain.params[HVM_PARAM_VMWARE_HW]))
>
> Indentation. Also please use d, not _d. I.e. take the macro above
> as reference.
>
I did, it has changed during the time I started this patch set. Will
fix.
>> --- a/xen/include/public/hvm/params.h
>> +++ b/xen/include/public/hvm/params.h
>> @@ -189,6 +189,9 @@
>> /* Location of the VM Generation ID in guest physical address space. */
>> #define HVM_PARAM_VM_GENERATION_ID_ADDR 34
>>
>> -#define HVM_NR_PARAMS 35
>> +/* Params for VMware */
>> +#define HVM_PARAM_VMWARE_HW 35
>
> The comment seems wrong - after all it's the version, not some
> arbitrary parameters/flags.
>
It use to be a set of Params. Will fix, thinking of:
/* VMware Hardware Version */
Did you what me to rename HVM_PARAM_VMWARE_HW also to new name (maybe
HVM_PARAM_VMWARE_HARDWARE_VERSION)?
-Don Slutz
> Jan
>
next prev parent reply other threads:[~2015-01-15 21:00 UTC|newest]
Thread overview: 37+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-10-02 21:30 [PATCH for-4.5 v7 0/7] Xen VMware tools support Don Slutz
2014-10-02 21:30 ` [PATCH for-4.5 v7 1/7] xen: Add support for VMware cpuid leaves Don Slutz
2015-01-15 16:42 ` Jan Beulich
2015-01-15 21:00 ` Don Slutz [this message]
2015-01-16 7:57 ` Jan Beulich
2015-01-16 19:21 ` Don Slutz
2014-10-02 21:30 ` [PATCH for-4.5 v7 2/7] tools: Add vmware_hw support Don Slutz
2014-10-02 22:21 ` Andrew Cooper
2014-10-02 22:56 ` [PATCH for-4.5 v8 " Don Slutz
2014-10-02 21:30 ` [PATCH for-4.5 v7 3/7] vmware: Add VMware provided include files Don Slutz
2015-01-15 16:46 ` Jan Beulich
2015-01-15 21:36 ` Don Slutz
2014-10-02 21:30 ` [PATCH for-4.5 v7 4/7] xen: Add vmware_port support Don Slutz
2014-10-02 21:58 ` Don Slutz
2014-10-02 22:40 ` [PATCH for-4.5 v8 " Don Slutz
2015-01-16 10:09 ` Jan Beulich
2015-01-21 17:52 ` Don Slutz
2015-01-22 8:32 ` Jan Beulich
2015-01-26 15:58 ` Don Slutz
2015-01-26 16:46 ` Jan Beulich
2015-01-26 20:19 ` Don Slutz
2015-01-27 7:58 ` Jan Beulich
2015-01-28 8:19 ` Jan Beulich
2015-01-28 22:47 ` Don Slutz
2015-01-29 0:32 ` Don Slutz
2015-02-10 19:30 ` [PATCH " Don Slutz
2015-02-11 7:56 ` Jan Beulich
2015-02-11 17:04 ` Andrew Cooper
2015-02-17 7:45 ` Jan Beulich
2014-10-02 21:30 ` [PATCH for-4.5 v7 5/7] tools: " Don Slutz
2014-10-02 21:30 ` [PATCH for-4.5 v7 6/7] Add xentrace to vmware_port Don Slutz
2014-10-02 21:30 ` [OPTIONAL][PATCH for-4.5 v7 7/7] Add xen-hvm-param Don Slutz
2014-10-16 8:12 ` [PATCH for-4.5 v7 0/7] Xen VMware tools support Jan Beulich
2014-10-16 12:10 ` Don Slutz
2014-10-16 12:17 ` Ian Jackson
2014-10-16 12:22 ` Jan Beulich
2014-10-16 12:58 ` Don Slutz
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=54B82A89.2060808@terremark.com \
--to=dslutz@verizon.com \
--cc=Aravind.Gopalakrishnan@amd.com \
--cc=George.Dunlap@eu.citrix.com \
--cc=JBeulich@suse.com \
--cc=andrew.cooper3@citrix.com \
--cc=boris.ostrovsky@oracle.com \
--cc=eddie.dong@intel.com \
--cc=ian.campbell@citrix.com \
--cc=ian.jackson@eu.citrix.com \
--cc=jun.nakajima@intel.com \
--cc=keir@xen.org \
--cc=kevin.tian@intel.com \
--cc=stefano.stabellini@eu.citrix.com \
--cc=suravee.suthikulpanit@amd.com \
--cc=tim@xen.org \
--cc=xen-devel@lists.xen.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.