On Tuesday 01 June 2010 16:51:05 Avi Kivity wrote:
> On 05/31/2010 02:17 PM, Sheng Yang wrote:
> > Only test legal action so far, we can extend it later.
>
> The legal actions are tested by guests, so it's more important for unit
> tests to check illegal (and potentially subversive) actions.
Yes. This is just the first step. I think we need construct IDT and use
something
similar to fixup exception table. That's not a quick work, and we need some
base
for it.
>
> > +
> > +void test_xsave()
> > +{
> > + unsigned int cr4;
> > + uint64_t supported_xcr0;
> > + uint64_t test_bits;
> > +
> > + supported_xcr0 = get_supported_xcr0();
> > + printf("Supported XCR0 bits: 0x%x\n", supported_xcr0);
> > +
> > + printf("Check minimal XSAVE required bits: ");
> > + test_bits = XSTATE_FP | XSTATE_SSE | XSTATE_YMM;
> > + pass_if((supported_xcr0& test_bits) == test_bits);
>
> This will fail on a cpu without YMM but with xsave.
Yes, would discard this...
>
> > +
> > +int main()
> > +{
> > + int cpuid_has_xsave;
> > +
> > + cpuid_has_xsave = check_xsave();
> > + if (cpuid_has_xsave) {
> > + printf("CPU has XSAVE feature\n");
> > + test_xsave();
> > + } else
> > + printf("CPU don't has XSAVE feature\n");
> > + return 0;
>
> Should return 1 if any failure for autotest integration.
OK
>
> > +}
> > +
--
regards
Yang, Sheng
--
To unsubscribe from this list: send the line "unsubscribe kvm" in
the body of a message to [email protected]
More majordomo info at http://vger.kernel.org/majordomo-info.html