* [question kvm-unit-tests] FAIL about apic testcase
@ 2016-04-12 13:34 Zhu Yijun
2016-04-12 21:16 ` Paolo Bonzini
0 siblings, 1 reply; 4+ messages in thread
From: Zhu Yijun @ 2016-04-12 13:34 UTC (permalink / raw)
To: kvm, Paolo Bonzini; +Cc: oscar.zhangbo, Hangaohuai
Hi all,
I run kvm-unit-tests on rhel_7.0, and the apic unittest failed. test.log file showed as follow:
qemu-kvm -enable-kvm -device pc-testdev -device isa-debug-exit,iobase=0xf4,iosize=0x4 -vnc none -serial stdio -device pci-testdev -kernel x86/apic.flat -smp 2 -cpu qemu64,+x2apic,+tsc-deadline
enabling apic
enabling apic
paging enabled
cr0 = 80010011
cr3 = 7fff000
cr4 = 20
apic version: 1050014
PASS: apic existence
x2apic enabled
FAIL: x2apic enabled to invalid state
FAIL: x2apic enabled to apic enabled
FAIL: disabled to invalid state
FAIL: disabled to x2apic enabled
FAIL: apic enabled to invalid state
PASS: apicbase: relocate apic
FAIL: apicbase: reserved physaddr bits
FAIL: apicbase: reserved low bits
PASS: self ipi
PASS: nmi-after-sti
PASS: multiple nmi
tsc deadline timer not detected
SUMMARY: 12 tests, 7 unexpected failures
I found that all the tests with "test_for_exception()" failed. After looking at this function, I cannot understand the macro:
"#define set_exception_jmpbuf(jmpbuf) \
(setjmp(jmpbuf) ? : (__set_exception_jmpbuf(&(jmpbuf)), 0))"
So it it always return 0? and what's mean about the statement "(__set_exception_jmpbuf(&(jmpbuf)), 0)"?
Thanks in advance!
Zhu Yijun
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [question kvm-unit-tests] FAIL about apic testcase
2016-04-12 13:34 [question kvm-unit-tests] FAIL about apic testcase Zhu Yijun
@ 2016-04-12 21:16 ` Paolo Bonzini
2016-04-13 1:35 ` Yang Zhang
0 siblings, 1 reply; 4+ messages in thread
From: Paolo Bonzini @ 2016-04-12 21:16 UTC (permalink / raw)
To: Zhu Yijun, kvm; +Cc: oscar.zhangbo, Hangaohuai
On 12/04/2016 15:34, Zhu Yijun wrote:
> I run kvm-unit-tests on rhel_7.0, and the apic unittest failed.
kvm-unit-tests always corresponds to the latest kernel version
(sometimes even the _next_ kernel version). If you want to use it in
RHEL, you have to look at the failures one by one, find the patch that
fixed it and confirm that it is not present in RHEL (it might be present
in RHEL 7.1 for example). You will then get a set of known failures, and
you can patch kvm-unit-tests to remove those tests.
> qemu-kvm -enable-kvm -device pc-testdev -device isa-debug-exit,iobase=0xf4,iosize=0x4 -vnc none -serial stdio -device pci-testdev -kernel x86/apic.flat -smp 2 -cpu qemu64,+x2apic,+tsc-deadline
> enabling apic
> enabling apic
> paging enabled
> cr0 = 80010011
> cr3 = 7fff000
> cr4 = 20
> apic version: 1050014
> PASS: apic existence
> x2apic enabled
> FAIL: x2apic enabled to invalid state
> FAIL: x2apic enabled to apic enabled
> FAIL: disabled to invalid state
> FAIL: disabled to x2apic enabled
> FAIL: apic enabled to invalid state
> PASS: apicbase: relocate apic
> FAIL: apicbase: reserved physaddr bits
> FAIL: apicbase: reserved low bits
> PASS: self ipi
> PASS: nmi-after-sti
> PASS: multiple nmi
> tsc deadline timer not detected
>
> SUMMARY: 12 tests, 7 unexpected failures
>
> I found that all the tests with "test_for_exception()" failed. After looking at this function, I cannot understand the macro:
>
> "#define set_exception_jmpbuf(jmpbuf) \
> (setjmp(jmpbuf) ? : (__set_exception_jmpbuf(&(jmpbuf)), 0))"
>
> So it it always return 0?
If setjmp(jmpbuf) returns non-zero, it returns the non-zero value that
setjmp returned.
If it returns zero, it calls __set_exception_jmpbuf(&jmpbuf) and then
returns zero. The source for the function is in lib/x86/desc.c, and it
is simply this:
static jmp_buf *exception_jmpbuf;
void __set_exception_jmpbuf(jmp_buf *addr)
{
exception_jmpbuf = addr;
}
Thanks,
Paolo
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [question kvm-unit-tests] FAIL about apic testcase
2016-04-12 21:16 ` Paolo Bonzini
@ 2016-04-13 1:35 ` Yang Zhang
2016-04-13 1:50 ` Zhu Yijun
0 siblings, 1 reply; 4+ messages in thread
From: Yang Zhang @ 2016-04-13 1:35 UTC (permalink / raw)
To: Paolo Bonzini, Zhu Yijun, kvm; +Cc: oscar.zhangbo, Hangaohuai
On 2016/4/13 5:16, Paolo Bonzini wrote:
>
>
> On 12/04/2016 15:34, Zhu Yijun wrote:
>> I run kvm-unit-tests on rhel_7.0, and the apic unittest failed.
>
> kvm-unit-tests always corresponds to the latest kernel version
> (sometimes even the _next_ kernel version). If you want to use it in
> RHEL, you have to look at the failures one by one, find the patch that
> fixed it and confirm that it is not present in RHEL (it might be present
> in RHEL 7.1 for example). You will then get a set of known failures, and
> you can patch kvm-unit-tests to remove those tests.
Yes, Paolo is right. Even for RHEL7u2, I also saw some failures when
running km-unit-tests. All the failures are due to lack of corresponding
patch which already in upstream KVM. You need to figure out it one by
one and backport the patch manually.
>
>> qemu-kvm -enable-kvm -device pc-testdev -device isa-debug-exit,iobase=0xf4,iosize=0x4 -vnc none -serial stdio -device pci-testdev -kernel x86/apic.flat -smp 2 -cpu qemu64,+x2apic,+tsc-deadline
>> enabling apic
>> enabling apic
>> paging enabled
>> cr0 = 80010011
>> cr3 = 7fff000
>> cr4 = 20
>> apic version: 1050014
>> PASS: apic existence
>> x2apic enabled
>> FAIL: x2apic enabled to invalid state
>> FAIL: x2apic enabled to apic enabled
>> FAIL: disabled to invalid state
>> FAIL: disabled to x2apic enabled
>> FAIL: apic enabled to invalid state
>> PASS: apicbase: relocate apic
>> FAIL: apicbase: reserved physaddr bits
>> FAIL: apicbase: reserved low bits
>> PASS: self ipi
>> PASS: nmi-after-sti
>> PASS: multiple nmi
>> tsc deadline timer not detected
>>
>> SUMMARY: 12 tests, 7 unexpected failures
>>
>> I found that all the tests with "test_for_exception()" failed. After looking at this function, I cannot understand the macro:
>>
>> "#define set_exception_jmpbuf(jmpbuf) \
>> (setjmp(jmpbuf) ? : (__set_exception_jmpbuf(&(jmpbuf)), 0))"
>>
>> So it it always return 0?
>
> If setjmp(jmpbuf) returns non-zero, it returns the non-zero value that
> setjmp returned.
>
> If it returns zero, it calls __set_exception_jmpbuf(&jmpbuf) and then
> returns zero. The source for the function is in lib/x86/desc.c, and it
> is simply this:
>
> static jmp_buf *exception_jmpbuf;
>
> void __set_exception_jmpbuf(jmp_buf *addr)
> {
> exception_jmpbuf = addr;
> }
>
> Thanks,
>
> Paolo
> --
> To unsubscribe from this list: send the line "unsubscribe kvm" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at http://vger.kernel.org/majordomo-info.html
>
--
best regards
yang
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [question kvm-unit-tests] FAIL about apic testcase
2016-04-13 1:35 ` Yang Zhang
@ 2016-04-13 1:50 ` Zhu Yijun
0 siblings, 0 replies; 4+ messages in thread
From: Zhu Yijun @ 2016-04-13 1:50 UTC (permalink / raw)
To: Yang Zhang, Paolo Bonzini; +Cc: kvm, oscar.zhangbo, Hangaohuai
Get it! Thanks paolo and Yang Zhang.
On 2016/4/13 9:35, Yang Zhang wrote:
> On 2016/4/13 5:16, Paolo Bonzini wrote:
>>
>>
>> On 12/04/2016 15:34, Zhu Yijun wrote:
>>> I run kvm-unit-tests on rhel_7.0, and the apic unittest failed.
>>
>> kvm-unit-tests always corresponds to the latest kernel version
>> (sometimes even the _next_ kernel version). If you want to use it in
>> RHEL, you have to look at the failures one by one, find the patch that
>> fixed it and confirm that it is not present in RHEL (it might be present
>> in RHEL 7.1 for example). You will then get a set of known failures, and
>> you can patch kvm-unit-tests to remove those tests.
>
> Yes, Paolo is right. Even for RHEL7u2, I also saw some failures when running km-unit-tests. All the failures are due to lack of corresponding patch which already in upstream KVM. You need to figure out it one by one and backport the patch manually.
>
>>
>>> qemu-kvm -enable-kvm -device pc-testdev -device isa-debug-exit,iobase=0xf4,iosize=0x4 -vnc none -serial stdio -device pci-testdev -kernel x86/apic.flat -smp 2 -cpu qemu64,+x2apic,+tsc-deadline
>>> enabling apic
>>> enabling apic
>>> paging enabled
>>> cr0 = 80010011
>>> cr3 = 7fff000
>>> cr4 = 20
>>> apic version: 1050014
>>> PASS: apic existence
>>> x2apic enabled
>>> FAIL: x2apic enabled to invalid state
>>> FAIL: x2apic enabled to apic enabled
>>> FAIL: disabled to invalid state
>>> FAIL: disabled to x2apic enabled
>>> FAIL: apic enabled to invalid state
>>> PASS: apicbase: relocate apic
>>> FAIL: apicbase: reserved physaddr bits
>>> FAIL: apicbase: reserved low bits
>>> PASS: self ipi
>>> PASS: nmi-after-sti
>>> PASS: multiple nmi
>>> tsc deadline timer not detected
>>>
>>> SUMMARY: 12 tests, 7 unexpected failures
>>>
>>> I found that all the tests with "test_for_exception()" failed. After looking at this function, I cannot understand the macro:
>>>
>>> "#define set_exception_jmpbuf(jmpbuf) \
>>> (setjmp(jmpbuf) ? : (__set_exception_jmpbuf(&(jmpbuf)), 0))"
>>>
>>> So it it always return 0?
>>
>> If setjmp(jmpbuf) returns non-zero, it returns the non-zero value that
>> setjmp returned.
>>
>> If it returns zero, it calls __set_exception_jmpbuf(&jmpbuf) and then
>> returns zero. The source for the function is in lib/x86/desc.c, and it
>> is simply this:
>>
>> static jmp_buf *exception_jmpbuf;
>>
>> void __set_exception_jmpbuf(jmp_buf *addr)
>> {
>> exception_jmpbuf = addr;
>> }
>>
>> Thanks,
>>
>> Paolo
>> --
>> To unsubscribe from this list: send the line "unsubscribe kvm" in
>> the body of a message to majordomo@vger.kernel.org
>> More majordomo info at http://vger.kernel.org/majordomo-info.html
>>
>
>
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2016-04-13 1:51 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-04-12 13:34 [question kvm-unit-tests] FAIL about apic testcase Zhu Yijun
2016-04-12 21:16 ` Paolo Bonzini
2016-04-13 1:35 ` Yang Zhang
2016-04-13 1:50 ` Zhu Yijun
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).