Author: Paul Durrant <[hidden email]>
AuthorDate: Fri May 11 15:48:32 2018 +0100
Commit: Andrew Cooper <[hidden email]>
CommitDate: Mon May 14 12:57:13 2018 +0100
viridian: fix cpuid leaf 0x40000003
The response to viridian leaf 3 needs to split a 64-bit mask across EAX and
EBX, with the low order 32 bits in EAX and the high order 32 bits in EBX.
To facilitate this a union of two uint32_t values and the mask (type
HV_PARTITION_PRIVILEGE_MASK) is allocated on stack as follows:
uint32_t lo, hi;
This, of course, is incorrect as both lo and hi will alias the low order
32 bits of the mask.
This patch wraps lo and hi in an anonmymous struct to achieve the desired
NOTE: Fixing this also stops Windows making the HvGetPartitionId hypercall
which was previously considered erroneous behaviour. Thus the
hypercall handler is also modified to stop squashing the
'unimplemented' warning for this hypercall.
Signed-off-by: Paul Durrant <[hidden email]>
Acked-by: Andrew Cooper <[hidden email]>
Release-acked-by: Juergen Gross <[hidden email]>
xen/arch/x86/hvm/viridian.c | 8 +++-----
1 file changed, 3 insertions(+), 5 deletions(-)
if ( !(viridian_feature_mask(d) & HVMPV_no_freq) )
@@ -964,12 +964,10 @@ int viridian_hypercall(struct cpu_user_regs *regs)
gprintk(XENLOG_WARNING, "unimplemented hypercall %04x\n",
/* Fallthrough. */
- case HvGetPartitionId:
- * These hypercalls seem to be erroneously issued by Windows
- * despite neither AccessPartitionId nor EnableExtendedHypercalls
- * being set in CPUID leaf 2.
+ * This hypercall seems to be erroneously issued by Windows
+ * despite EnableExtendedHypercalls not being set in CPUID leaf 2.
* Given that return a status of 'invalid code' has not so far
* caused any problems it's not worth logging.
generated by git-patchbot for /home/xen/git/xen.git#staging