From: Chao Gao <chao.gao@intel.com>
To: Jan Beulich <JBeulich@suse.com>
Cc: Andrew Cooper <andrew.cooper3@citrix.com>,
Xuquan <xuquan8@huawei.com>,
osstest-admin@xenproject.org, Kevin Tian <kevin.tian@intel.com>,
xen-devel <xen-devel@lists.xenproject.org>
Subject: Re: [xen-unstable test] 106504: regressions - FAIL
Date: Wed, 5 Apr 2017 07:57:30 +0800 [thread overview]
Message-ID: <20170404235730.GA6485@skl-2s3.sh.intel.com> (raw)
In-Reply-To: <58D280750200007800146399@prv-mh.provo.novell.com>
On Wed, Mar 22, 2017 at 06:47:33AM -0600, Jan Beulich wrote:
>>>> On 22.03.17 at 05:53, <chao.gao@intel.com> wrote:
>> I have written a xtf test case (many codes are from hvmloader) to
>> trigger this assertion. The test case is in attachments.
>
>Thanks for doing this.
>
>> Bottom is the output
>> of this test. This test initializes PIT channel0 to generate periodic timer
>> interrupt at 1000hz per second. The timer interrupt is delivered to vCPU0. And
>> vCPU1 is used to change IOAPIC RTE 2 frequently.
>
>Well, this is certainly helpful (due to some of the conclusions you
>draw below), but it is very likely not what has caused the assertion
>to trigger in osstest. So by removing the assertion (as you suggest
>below) we then will have a silent, non-understood misbehavior.
>
>> The assertion can be triggered by guest. To fix assertion failure,
>> I propose to remove this assertion for the reason below:
>
>Of course I agree that a guest triggerable assertion is bad, and
>hence needs a correction somewhere.
>
>> 1. Operations in this test case are very intrusive and abnormal. It updates
>> RTE frequently without disabling interrupt source. In this case, I think
>> software can't assume hardware works correctly.
>
>I guess hardware behavior simply is unspecified in such a case, so
>it's hard to judge whether it works "correctly".
>
>> 2. If we remove this assertion(means we admit pt_vector may be different
>> from (or bigger than) the vector we set in vIRR in a rare case), the side
>> effect is that we won't decrease the counter pt->ending_intr_nr in
>> pt_intr_post() and one more timer interrupt in number is injected to guest.
>
>Which is clearly wrong, afaict, as that may drive the guest clock
>off (depending on how the guest OS does its accounting).
>
>> 3. We read RTE 3 times. 1st happens when we set vIRR. 2nd happens when
>> pt_update_irq() returns. 3rd happens in pt_intr_post(). If guest changes
>> the vector in RTE during the window, it will also incur losing or getting
>> more periodic timer interrupt.
>
>Which raises the question whether latching the value read the first
>time would address the issue you demonstrate with the test case.
>Or alternatively deferring writes to take effect only once readers
>are done with their perhaps multiple accesses?
Hi, Jan.
I plan to do the following changes:
1. get the vector set in vIRR to avoid getting a wrong interrupt vector
I think there are two appoaches. One is to extend hvm_isa_irq_assert()
to return the vector set in vIRR. Several functions in call trees are
also involved. The other is to make vIOAPIC support disabling
write operations to RTE. In this case, a rwlock_t is introduced to
protect RTE. pt_update_irq() will disable write operations
at first, then get the vector and assert the vector, at last enable
write operations. Which one do you think is better?
2. let pt_update_irq() pass the periodic timer
whose interrupt is to be injected to vmx_intr_assit() which
in turn can pass it to pt_intr_post(). After this, pt_intr_post()
needn't search the periodic timer that matches the interrupt has
been injected. Through this, we can avoid reading the RTE there.
Do you think the above changes would be a clean solution or you have
some different suggestion on how to fix it now.
Thanks
Chao
_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
https://lists.xen.org/xen-devel
next prev parent reply other threads:[~2017-04-05 7:00 UTC|newest]
Thread overview: 20+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-03-07 5:52 [xen-unstable test] 106504: regressions - FAIL osstest service owner
2017-03-07 9:16 ` Jan Beulich
2017-03-07 4:24 ` Chao Gao
2017-03-07 14:11 ` Jan Beulich
2017-03-22 4:53 ` Chao Gao
2017-03-22 12:47 ` Jan Beulich
2017-03-22 6:13 ` Chao Gao
2017-03-22 13:40 ` Jan Beulich
2017-03-29 3:28 ` Xuquan (Quan Xu)
2017-03-28 20:48 ` Chao Gao
2017-03-24 7:48 ` Tian, Kevin
2017-03-24 8:17 ` Jan Beulich
2017-03-24 8:25 ` Tian, Kevin
[not found] ` <AADFC41AFE54684AB9EE6CBC0274A5D190C7CFB9@SHSMSX101.ccr.corp.intel.com>
2017-03-24 8:49 ` Tian, Kevin
2017-03-24 9:00 ` Andrew Cooper
2017-04-04 23:57 ` Chao Gao [this message]
2017-04-05 7:48 ` Jan Beulich
2017-04-05 1:49 ` Chao Gao
2017-04-07 8:56 ` Xuquan (Quan Xu)
2017-03-08 3:16 ` Xuquan (Quan Xu)
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20170404235730.GA6485@skl-2s3.sh.intel.com \
--to=chao.gao@intel.com \
--cc=JBeulich@suse.com \
--cc=andrew.cooper3@citrix.com \
--cc=kevin.tian@intel.com \
--cc=osstest-admin@xenproject.org \
--cc=xen-devel@lists.xenproject.org \
--cc=xuquan8@huawei.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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).