|
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] Re: [Xen-devel] [PATCH] x86/AMD: Add support for AMD's OSVW feature in guests
On 01/18/12 04:50, Jan Beulich wrote: On 17.01.12 at 18:54, Boris Ostrovsky<boris.ostrovsky@xxxxxxx> wrote:On 01/17/12 03:26, Jan Beulich wrote:On 16.01.12 at 22:11, Boris Ostrovsky<boris.ostrovsky@xxxxxxx> wrote: It was actually a bad example --- the guest is not using amd_e400_idle() and so there are no extra MSR accesses. However, without this change OSVW bit will not show up in the guest's CPUID and I think guests should be able to see it. One could argue whether or not we should mask off status bits for the two errata (400 and 415) since they are not currently used; I'd mask them off just to be consistent with HVM, it won't affect anything. + vcpu->arch.amd.osvw.length = (osvw_length >= 3) ? (osvw_length) : 3 + vcpu->arch.amd.osvw.status = osvw_status& ~(6ULL); + + /* + * By increasing VCPU's osvw.length to 3 we are telling the guest that + * all osvw.status bits inside that length, including bit 0 (which is + * reserved for erratum 298), are valid. However, if host processor's + * osvw_len is 0 then osvw_status[0] carries no information. We need to + * be conservative here and therefore we tell the guest that erratum298+ * is present (because we really don't know). + */ + if (osvw_length == 0&& boot_cpu_data.x86 == 0x10)Why do you check the family here? If osvw_length can only ever be zero on Fam10, then the first check is sufficient. If osvw_length can be zero on other than Fam10 (no matter whether we bail early older CPUs), then the check is actually wrong.10h is the only family affected by this erratum.What is "this erratum" here? My comment was to suggest that either of the two conditions can likely be eliminated for being redundant.
("This erratum" is erratum 298, which is bit 0)
If osvw_length!=0 then we don't need to do anything since bit 0 is
already valid.
If osvw_length==0 then -- since we just made the guest's version of this register 3 and thus turned bit 0 from being invalid to valid -- we need to do something about bit 0. But the bit can only be set on family 10h, thus both checks. Thanks. -boris _______________________________________________ Xen-devel mailing list Xen-devel@xxxxxxxxxxxxxxxxxxx http://lists.xensource.com/xen-devel
|
![]() |
Lists.xenproject.org is hosted with RackSpace, monitoring our |