From: Andrew Cooper <andrew.cooper3@citrix.com>
To: "Zhang, Yang Z" <yang.z.zhang@intel.com>,
Jan Beulich <jbeulich@suse.com>,
"hanweidong@huawei.com" <hanweidong@huawei.com>,
"john.liuqiming@huawei.com" <john.liuqiming@huawei.com>
Cc: "xen-devel@lists.xenproject.org" <xen-devel@lists.xenproject.org>,
"dario.faggioli@citrix.com" <dario.faggioli@citrix.com>,
"zw.zhang@huawei.com" <zw.zhang@huawei.com>
Subject: Re: [PATCH] Remove a set operation for VCPU_KICK_SOFTIRQ when post interrupt to vm.
Date: Fri, 18 Sep 2015 12:44:47 +0100 [thread overview]
Message-ID: <55FBF92F.2090505@citrix.com> (raw)
In-Reply-To: <A9667DDFB95DB7438FA9D7D576C3D87E0ADB2B09@SHSMSX104.ccr.corp.intel.com>
On 18/09/15 12:40, Zhang, Yang Z wrote:
> Jan Beulich wrote on 2015-09-18:
>>>>> "Zhang, Yang Z" <yang.z.zhang@intel.com> 09/18/15 2:29 AM >>>
>>> Zhang, Yang Z wrote on 2015-09-08:
>>> I have a quick check on current code. I am curious that is current Xen
>>> preemptive?
>>>
>>> Also, when return from an interrupt handler, hypervisor didn't check
>>> whether reschedule is needed if the interrupt is occurred in kernel context.
>>> ENTRY(ret_from_intr)
>>> GET_CURRENT(%rbx)
>>> testb $3,UREGS_cs(%rsp)
>>> jz restore_all_xen //call iret directly to restore
>> previous context where interrupt occur if it is in kernel space.
>>
>>> If Xen isn't preemptive, the above case I mentioned should never happen since
>>> the VCPU still run in the same PCPU. Am I right?
>> I have to admit that I don't see the connection to preemptiveness: The
>> reference above is to a code section with interrupts disabled.
> Ok. Maybe I am asking a wrong question. My initial question is how Xen to support the preemption. For example, if VCPU is running in hypervisor (executing any code), can this VCPU be preempted immediately? If yes, how to achieve it because I didn't find any related code. I know if the PCPU get an SCHED_SOFTIRQ, the VCPU will do the schedule before do vmentry. But it only happens before do vmentry. Is it possible that VCPU been preempted at any time when running in hypervisor mode?
All vcpus may be preempted at any time by the Xen scheduler.
However, paths through the hypervisor are synchronous, so a vcpu will
notice that it has been preempted on the return-to-guest path, and a
context switch will occur as appropriate.
~Andrew
next prev parent reply other threads:[~2015-09-18 11:44 UTC|newest]
Thread overview: 31+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <1441637175-18070-1-git-send-email-john.liuqiming@huawei.com>
2015-09-07 14:24 ` [PATCH] Remove a set operation for VCPU_KICK_SOFTIRQ when post interrupt to vm Liuqiming (John)
2015-09-07 14:45 ` Jan Beulich
2015-09-08 0:39 ` Hanweidong (Randy)
2015-09-08 2:46 ` Zhang, Yang Z
2015-09-08 4:07 ` Liuqiming (John)
2015-09-08 8:10 ` Zhang, Yang Z
2015-09-08 8:49 ` Jan Beulich
2015-09-18 0:29 ` Zhang, Yang Z
2015-09-18 5:30 ` Jan Beulich
2015-09-18 11:40 ` Zhang, Yang Z
2015-09-18 11:44 ` Andrew Cooper [this message]
2015-09-18 11:50 ` Zhang, Yang Z
2015-09-18 12:56 ` Dario Faggioli
2015-09-23 3:50 ` Zhang, Yang Z
2015-09-23 7:42 ` Jan Beulich
2015-09-23 9:08 ` George Dunlap
2015-09-23 9:18 ` Zhang, Yang Z
2015-09-23 10:01 ` George Dunlap
2015-09-23 9:21 ` Jan Beulich
2015-09-23 9:15 ` Zhang, Yang Z
2015-09-23 9:31 ` Jan Beulich
2015-09-23 13:02 ` Zhang, Yang Z
2015-09-23 13:38 ` Hanweidong (Randy)
2015-09-23 13:41 ` Zhang, Yang Z
2015-09-24 2:41 ` Liuqiming (John)
2015-09-24 3:25 ` Zhang, Yang Z
2015-09-24 7:07 ` Liuqiming (John)
2015-09-24 8:07 ` Zhang, Yang Z
2015-10-10 6:32 ` Zhang, Yang Z
2015-10-10 9:55 ` Liuqiming (John)
2015-11-10 1:15 ` Zhang, Yang Z
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=55FBF92F.2090505@citrix.com \
--to=andrew.cooper3@citrix.com \
--cc=dario.faggioli@citrix.com \
--cc=hanweidong@huawei.com \
--cc=jbeulich@suse.com \
--cc=john.liuqiming@huawei.com \
--cc=xen-devel@lists.xenproject.org \
--cc=yang.z.zhang@intel.com \
--cc=zw.zhang@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).