From: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
To: Julien Grall <julien.grall@arm.com>
Cc: xen-devel@lists.xenproject.org, sstabellini@kernel.org,
Ross Lagerwall <ross.lagerwall@citrix.com>,
Andrew Cooper <andrew.cooper3@citrix.com>
Subject: Re: [Very RFC PATCH 3/3] livepatch: Initial ARM32/64 support.
Date: Mon, 15 Aug 2016 11:04:25 -0400 [thread overview]
Message-ID: <20160815150425.GM26970@char.us.oracle.com> (raw)
In-Reply-To: <e14c990c-7db4-d580-4eaf-67c23d526a76@arm.com>
On Mon, Aug 15, 2016 at 03:27:08PM +0200, Julien Grall wrote:
> Hi Konrad,
>
> On 12/08/2016 22:50, Konrad Rzeszutek Wilk wrote:
> > On Fri, Aug 12, 2016 at 05:00:47PM +0200, Julien Grall wrote:
> > > > diff --git a/xen/include/asm-arm/current.h b/xen/include/asm-arm/current.h
> > > > index 65c0cdf..f4fcfd6 100644
> > > > --- a/xen/include/asm-arm/current.h
> > > > +++ b/xen/include/asm-arm/current.h
> > > > @@ -33,8 +33,15 @@ static inline struct cpu_info *get_cpu_info(void)
> > > >
> > > > #define guest_cpu_user_regs() (&get_cpu_info()->guest_cpu_user_regs)
> > > >
> > > > +#ifdef CONFIG_LIVEPATCH
> > > > +#define switch_stack_and_jump(stack, fn) \
> > > > + asm volatile ("mov sp,%0;" \
> > > > + "bl check_for_livepatch_work;" \
> > >
> > > May I ask why check_for_livepatch_work is called in switch_stack_and_jump?
> >
> > From 29f4ab0b0a4ff62589af35b7cbc2334e1d9acdcd:
> > To perform and action on a payload, the hypercall sets up a data
> > structure to schedule the work. A hook is added in the reset_stack_and_jump
> > to check for work and execute it if needed (specifically we check an
> > per-cpu flag to make this as quick as possible).
> >
> > In this way, patches can be applied with all CPUs idle and without
> > stacks. The first CPU to run check_for_xsplice_work() becomes the
> > master and triggers a reschedule softirq to trigger all the other CPUs
> > to enter check_for_xsplice_work() with no stack. Once all CPUs
> > have rendezvoused, all CPUs disable their IRQs and NMIs are ignored.
> > The system is then quiscient and the master performs the action.
> > After this, all CPUs enable IRQs and NMIs are re-enabled.
>
>
> I am a bit confused, switch_stack_and_jump will only be called on ARM when a
> vCPU is created. So why do you want to check livepatch at that time?
>
> After looking at the x86 version, I noticed that reset_stack_and_jump is
> called every time Xen returns to the guest, correct?
Yes. I assumed ARM was the same.
>
> If so, you may want to call check_for_livepatch_work in
> leave_hypervisor_tail instead. The latter will be call every time Xen
> returns to the guest.
Oooh. Thanks!
>
> Regards,
>
> --
> Julien Grall
_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
https://lists.xen.org/xen-devel
next prev parent reply other threads:[~2016-08-15 15:04 UTC|newest]
Thread overview: 14+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-08-09 4:18 [Very RFC PATCH] Livepatch - initial ARM64/32 support Konrad Rzeszutek Wilk
2016-08-09 4:18 ` [Very RFC PATCH 1/3] mm/arm: Introduce modify_xen_mappings Konrad Rzeszutek Wilk
2016-08-09 4:18 ` [Very RFC PATCH 2/3] insn: Add arch64_insn_gen_branch_imm to generate branch Konrad Rzeszutek Wilk
2016-08-11 16:03 ` Julien Grall
2016-08-09 4:19 ` [Very RFC PATCH 3/3] livepatch: Initial ARM32/64 support Konrad Rzeszutek Wilk
2016-08-12 15:00 ` Julien Grall
2016-08-12 20:50 ` Konrad Rzeszutek Wilk
2016-08-15 13:27 ` Julien Grall
2016-08-15 15:04 ` Konrad Rzeszutek Wilk [this message]
2016-08-09 4:24 ` [Very RFC PATCH] Livepatch - initial ARM64/32 support Konrad Rzeszutek Wilk
2016-08-11 16:28 ` Julien Grall
2016-08-11 19:05 ` Stefano Stabellini
2016-08-11 23:08 ` Konrad Rzeszutek Wilk
2016-08-12 8:08 ` 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=20160815150425.GM26970@char.us.oracle.com \
--to=konrad.wilk@oracle.com \
--cc=andrew.cooper3@citrix.com \
--cc=julien.grall@arm.com \
--cc=ross.lagerwall@citrix.com \
--cc=sstabellini@kernel.org \
--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 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).