|
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] Re: [Xen-devel] [PATCH v3 2/2][XTF] xtf/vpmu: MSR read/write tests for VPMU
On 05/03/2017 04:41 PM, Andrew Cooper wrote: On 25/04/17 22:45, Mohit Gambhir wrote:diff --git a/tests/vpmu/Makefile b/tests/vpmu/Makefile new file mode 100644 index 0000000..1eaf436 --- /dev/null +++ b/tests/vpmu/Makefile @@ -0,0 +1,9 @@ +include $(ROOT)/build/common.mk + +NAME := vpmu +CATEGORY := utilityutilities don't get run automatically. Is this intentional? If it isn't, what is the plan for making it automatically run? vpmu is still disabled by default in all branches due to the security vulnerabilities, so even if this vpmu test was automatically run, it would skip due to vpmu not being visible.The reason I wanted it to not run automatically was because I thought it will fail when vpmu is not enabled - which is the default case. But if XTF will skip vpmu tests when it is disabled then we can run the tests automatically. Should the CATEGORY be functional in that case?As a tangent, I wonder if it would be a useful to have a separate category for incomplete tests, but which are still useful to have for manual running.Possibly. Utility category seems to do just that but I can see that it is really not meant for functional tests. There are situations where writing tests before or while implementing a feature is useful and in that case this new category can be beneficial. It would also benefit to have some kind of "expected failure" return type.Hopefully I have covered all of these points sufficiently in the 0/2 thread. In the meantime, I'll consider how best to introduce a "not quite fully baked yet" category.+TEST-ENVS := $(ALL_ENVIRONMENTS)You build for all environments, but then have PV unilaterally skip. Again, is this intentional?Yes, I thought I would go back and add PV/AMD tests in V2 but I can leave those TEST-ENVS out for now and "skip the skip" :) if that's preferable.For HVM, why all environments? does PMU have any interaction with the operating or paging mode in use at the time of the samples?Not that I know of. So should it just be hvm64?For now, I'd stick with just hvm64. (A complication which I have yet to sort out is the TEST-REVISION builds, so adding new logical content to an existing test doesn't interfere with OSSTests bisection logic, but that isn't an immediate problem.) Fixed in v5.
Fixed in v5 + wval = ((1ull << 31) - 1) ; + + if ( !test_valid_msr_write(idx, wval) ) + return false; + + /* set all valid bits in MSR_IA32_EVENTSELx */ + idx = MSR_IA32_PERFEVTSEL(i); + wval = ((1ull << 32) - 1) ^ (IA32_PERFEVENTSELx_ENABLE_ANYTHREAD | + IA32_PERFEVENTSELx_ENABLE_PCB);What is wrong with Pin Control in this register? Architecturally, it is a software configurable bit.Look at this patch on xen-devel [PATCH] Fix hypervisor crash when writing to VPMU MSR I found that out while writing this test.Welcome to the very grey areas of processors which XTF has a habit of finding. (I really need to correlate all the suspected errata in the doxygen comments). Obviously, Xen shouldn't crash, but we are going to need feedback from Intel before working out how to proceed.+ /* test IA32_DEBUGCTL */ + idx = MSR_IA32_DEBUGCTL; + + /* Test IA32_DEBUGCTL facilities enabled by v2 */ + wval = IA32_DEBUGCTL_Freeze_LBR_ON_PMI | IA32_DEBUGCTL_Freeze_PerfMon_On_PMI; + + /* FIXME: This should really be a valid write but it isnt supported by the + * VPMU yet */In which case the test should be correct here, and highlight that there is a bug in Xen.But then, should the main test return xtf_success, xtf_skip or xtf_failure?Failure. Xen is provably malfunctioning. Fixed in v5. The tests now fail.
Fixed in v5 ( I think!) + return false; + } + + if ( !(caps >> 13) & 1 )This lacks sufficient brackets for what you are intending to do. Also, it looks like you probably want a #define at the top of the file for this constant.! and & have the same precedence and right to left associativity. So technically it should do what it is intended to do. But I will make it look better. Hard to argue that. Fixed in v5. Yes, I think I understand what you are saying. I still do stand by the decision of having a separate function to test v1 facilities for - A) modularityB) Localizing the knowledge of xen internals to test_main() function. The rest of the code is written to test the facilities as described in the SDM. On another note about the MSR leakage, the v$N test case should ideally check that none of the v$N+1 capabilities/features are leaked into the guest, but this smells like a similar quantity of "redoing it properly the 2nd time around" as my attempts to fix CPUID handling in Xen. Maybe something that we can add in a future patch? ~Andrew _______________________________________________ Xen-devel mailing list Xen-devel@xxxxxxxxxxxxx https://lists.xen.org/xen-devel _______________________________________________ Xen-devel mailing list Xen-devel@xxxxxxxxxxxxx https://lists.xen.org/xen-devel
|
![]() |
Lists.xenproject.org is hosted with RackSpace, monitoring our |