From: Julien Grall <julien.grall@citrix.com>
To: Tamas K Lengyel <tklengyel@sec.in.tum.de>, xen-devel@lists.xen.org
Cc: wei.liu2@citrix.com, ian.campbell@citrix.com,
stefano.stabellini@eu.citrix.com, ian.jackson@eu.citrix.com,
julien.grall@linaro.org, tim@xen.org,
stefano.stabellini@citrix.com, jbeulich@suse.com, keir@xen.org
Subject: Re: [PATCH V14 3/7] xen/arm: Allow hypervisor access to mem_access protected pages
Date: Wed, 8 Apr 2015 15:33:06 +0100 [thread overview]
Message-ID: <55253C22.5030701@citrix.com> (raw)
In-Reply-To: <1427407531-31694-4-git-send-email-tklengyel@sec.in.tum.de>
Hi Tamas,
One minor question.
On 26/03/15 22:05, Tamas K Lengyel wrote:
> + /*
> + * We had a mem_access permission limiting the access, but the page type
> + * could also be limiting, so we need to check that as well.
> + */
> + maddr = p2m_lookup(current->domain, ipa, &t);
> + if ( maddr == INVALID_PADDR )
> + goto err;
> +
> + mfn = maddr >> PAGE_SHIFT;
> + if ( !mfn_valid(mfn) )
> + goto err;
> +
> + /*
> + * Base type doesn't allow r/w
> + */
> + if ( t != p2m_ram_rw )
> + goto err;
> +
> + page = mfn_to_page(mfn);
> +
> + if ( unlikely(!get_page(page, current->domain)) )
> + page = NULL;
I just found that this code is very similar to get_page_from_gfn. Would
it make sense to use it?
> diff --git a/xen/arch/arm/traps.c b/xen/arch/arm/traps.c
> index ad046e8..5d90609 100644
> --- a/xen/arch/arm/traps.c
> +++ b/xen/arch/arm/traps.c
> @@ -1988,7 +1988,7 @@ static void do_trap_data_abort_guest(struct cpu_user_regs *regs,
> if (dabt.s1ptw)
> goto bad_data_abort;
>
> - rc = gva_to_ipa(info.gva, &info.gpa);
> + rc = gva_to_ipa(info.gva, &info.gpa, GV2M_READ);
The correct value would be to use dabt.write in order to give either
GV2M_READ or GV2M_WRITE. Although you keep compatibility and it's out of
the scope of this patch.
I will send a follow-up when your series will be pushed.
Regards,
--
Julien Grall
next prev parent reply other threads:[~2015-04-08 14:33 UTC|newest]
Thread overview: 36+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-03-26 22:05 [PATCH V14 0/7] Mem_access for ARM Tamas K Lengyel
2015-03-26 22:05 ` [PATCH V14 1/7] xen/arm: groundwork for mem_access support on ARM Tamas K Lengyel
2015-04-15 13:39 ` Ian Campbell
2015-03-26 22:05 ` [PATCH V14 2/7] xen/arm: Implement domain_get_maximum_gpfn Tamas K Lengyel
2015-04-08 13:23 ` Julien Grall
2015-04-08 13:38 ` Tamas K Lengyel
2015-04-08 13:42 ` Julien Grall
2015-04-08 13:47 ` Tamas K Lengyel
2015-04-08 13:49 ` Julien Grall
2015-03-26 22:05 ` [PATCH V14 3/7] xen/arm: Allow hypervisor access to mem_access protected pages Tamas K Lengyel
2015-04-08 14:33 ` Julien Grall [this message]
2015-04-08 15:57 ` Tamas K Lengyel
2015-04-08 16:07 ` Julien Grall
2015-04-15 13:48 ` Ian Campbell
2015-04-15 15:36 ` Tamas K Lengyel
2015-04-15 15:45 ` Ian Campbell
2015-04-16 9:04 ` Tim Deegan
2015-03-26 22:05 ` [PATCH V14 4/7] xen/arm: Data abort exception (R/W) mem_access events Tamas K Lengyel
2015-04-08 15:26 ` Julien Grall
2015-04-08 15:45 ` Tamas K Lengyel
2015-04-15 13:53 ` Ian Campbell
2015-03-26 22:05 ` [PATCH V14 5/7] xen/arm: Instruction prefetch abort (X) mem_access event handling Tamas K Lengyel
2015-03-26 23:21 ` Julien Grall
2015-03-27 8:32 ` Tamas K Lengyel
2015-03-27 12:21 ` Julien Grall
2015-03-27 15:52 ` Ian Campbell
2015-03-27 22:18 ` Tamas K Lengyel
2015-03-30 9:41 ` Ian Campbell
2015-03-30 15:14 ` Tamas K Lengyel
2015-03-30 15:24 ` Ian Campbell
2015-03-30 15:28 ` Tamas K Lengyel
2015-03-26 22:05 ` [PATCH V14 6/7] xen/arm: Enable mem_access on ARM Tamas K Lengyel
2015-03-26 22:05 ` [PATCH V14 7/7] tools/libxc: Allocate magic page for mem access " Tamas K Lengyel
2015-04-15 13:36 ` [PATCH V14 0/7] Mem_access for ARM Ian Campbell
2015-04-15 14:47 ` Tamas K Lengyel
2015-04-15 15:04 ` Ian Campbell
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=55253C22.5030701@citrix.com \
--to=julien.grall@citrix.com \
--cc=ian.campbell@citrix.com \
--cc=ian.jackson@eu.citrix.com \
--cc=jbeulich@suse.com \
--cc=julien.grall@linaro.org \
--cc=keir@xen.org \
--cc=stefano.stabellini@citrix.com \
--cc=stefano.stabellini@eu.citrix.com \
--cc=tim@xen.org \
--cc=tklengyel@sec.in.tum.de \
--cc=wei.liu2@citrix.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.