All of lore.kernel.org
 help / color / mirror / Atom feed
From: Julien Grall <julien.grall@arm.com>
To: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>,
	Wei Chen <Wei.Chen@arm.com>
Cc: Kaly.Xin@arm.com, nd@arm.com, sstabellini@kernel.org,
	xen-devel@lists.xen.org, steve.capper@arm.com
Subject: Re: [PATCH] xen/arm: Register re-mapped Xen area as a temporary virtual region
Date: Tue, 14 Mar 2017 13:32:31 +0000	[thread overview]
Message-ID: <a3f8c517-6685-90ba-9653-1d3f8f8a9745@arm.com> (raw)
In-Reply-To: <20170314132039.GB472@char.us.oracle.com>

Hi Konrad,

On 14/03/17 13:20, Konrad Rzeszutek Wilk wrote:
> On Tue, Mar 14, 2017 at 05:27:17PM +0800, Wei Chen wrote:
>> While we're doing apply_alternatives, we will generate new instructions
>> if required. The new instructions need to update the Xen text section,
>> but Xen text section is read-only. So we re-map Xen to a new virtual
>> address to enable write access.
>>
>> The targets of the new generated instructions are located in this
>> re-mapped Xen area. But we haven't register this area as a virtual
>> region, so the checking code determines the targets are not in the
>> Xen text section, the new instructions could not be generated.
>
> Could you expand on that please? Where is the checking code that determines
> this? Are we talking about the traps handling and them scanning this
> new region?
>
> But you are saying 'new instructions'.. Hm, please enlighten!

He is talking about the check in branch_insn_requires_update. There is 
some sanity checking about the branch offset. Because Xen text section 
is marked as read-only and we configure the hardware to not allow a 
region to be writable and executable at the same time, we need to re-map 
Xen in a temporary area. This means that the pc given in parameter of 
branch_insn_requires_update will point to a value in the re-mapped area. 
So the check is_active_kernel_text will always return false.

Registering the virtual region temporarily will solve the problem.

Wei, it would be worth to explain that you hit the BUG(); in 
branch_insn_* and show an example in the commit message.

Cheers,

-- 
Julien Grall

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
https://lists.xen.org/xen-devel

  reply	other threads:[~2017-03-14 13:32 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-03-14  9:27 [PATCH] xen/arm: Register re-mapped Xen area as a temporary virtual region Wei Chen
2017-03-14 13:20 ` Konrad Rzeszutek Wilk
2017-03-14 13:32   ` Julien Grall [this message]
2017-03-14 13:56     ` Konrad Rzeszutek Wilk
2017-03-15  6:53       ` Wei Chen
2017-03-15  6:48     ` Wei Chen
2017-03-14 15:35 ` Julien Grall
2017-03-15  6:52   ` Wei Chen
2017-03-14 16:01 ` Julien Grall
2017-03-15  6:54   ` Wei Chen

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=a3f8c517-6685-90ba-9653-1d3f8f8a9745@arm.com \
    --to=julien.grall@arm.com \
    --cc=Kaly.Xin@arm.com \
    --cc=Wei.Chen@arm.com \
    --cc=konrad.wilk@oracle.com \
    --cc=nd@arm.com \
    --cc=sstabellini@kernel.org \
    --cc=steve.capper@arm.com \
    --cc=xen-devel@lists.xen.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.