From: Julien Grall <julien.grall@citrix.com>
To: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
Cc: ian.campbell@citrix.com, Riku Voipio <riku.voipio@linaro.org>,
tim@xen.org, stefano.stabellini@citrix.com,
xen-devel@lists.xenproject.org,
Tamas K Lengyel <tklengyel@sec.in.tum.de>
Subject: Re: [PATCH] xen/arm: p2m: Restrict preemption check in apply_p2m_changes
Date: Tue, 5 May 2015 17:31:01 +0100 [thread overview]
Message-ID: <5548F045.1090506@citrix.com> (raw)
In-Reply-To: <20150505155041.GG31936@l.oracle.com>
Hi Konrad,
On 05/05/15 16:50, Konrad Rzeszutek Wilk wrote:
>> ---
>> xen/arch/arm/p2m.c | 4 +++-
>> 1 file changed, 3 insertions(+), 1 deletion(-)
>>
>> diff --git a/xen/arch/arm/p2m.c b/xen/arch/arm/p2m.c
>> index 65efa94..59dd23a 100644
>> --- a/xen/arch/arm/p2m.c
>> +++ b/xen/arch/arm/p2m.c
>> @@ -948,6 +948,7 @@ static int apply_p2m_changes(struct domain *d,
>> const unsigned long sgfn = paddr_to_pfn(start_gpaddr),
>> egfn = paddr_to_pfn(end_gpaddr);
>> const unsigned int preempt_count_limit = (op == MEMACCESS) ? 1 : 0x2000;
>> + const bool_t preempt = !is_idle_vcpu(current);
>> bool_t flush = false;
>> bool_t flush_pt;
>>
>> @@ -980,7 +981,8 @@ static int apply_p2m_changes(struct domain *d,
>> * always make at least one pass as long as preempt_count_limit is
>> * initialized with a value >= 1.
>> */
>> - if ( count >= preempt_count_limit && hypercall_preempt_check() )
>> + if ( preempt && count >= preempt_count_limit
>> + && hypercall_preempt_check() )
>
> Could you use the softirq_pending() check to deal when there are no domains?
apply_p2m_changes will only be called with no current domain (i.e idle
vcpu) during DOM0 construction.
If we check softirq_pending for this case, you will Xen will fail to
build DOM0 but the preemption is not supported.
I suspect this is the same on x86.
Regards,
--
Julien Grall
next prev parent reply other threads:[~2015-05-05 16:43 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-05-05 15:02 [PATCH] xen/arm: p2m: Restrict preemption check in apply_p2m_changes Julien Grall
2015-05-05 15:23 ` Ian Campbell
2015-05-05 15:50 ` Konrad Rzeszutek Wilk
2015-05-05 16:31 ` Julien Grall [this message]
2015-05-06 8:31 ` Ian Campbell
2015-05-06 10:48 ` Julien Grall
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=5548F045.1090506@citrix.com \
--to=julien.grall@citrix.com \
--cc=ian.campbell@citrix.com \
--cc=konrad.wilk@oracle.com \
--cc=riku.voipio@linaro.org \
--cc=stefano.stabellini@citrix.com \
--cc=tim@xen.org \
--cc=tklengyel@sec.in.tum.de \
--cc=xen-devel@lists.xenproject.org \
/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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.