From: Daniel De Graaf <dgdegra@tycho.nsa.gov>
To: Jan Beulich <JBeulich@suse.com>
Cc: Tim Deegan <tim@xen.org>, Keir Fraser <keir@xen.org>,
xen-devel@lists.xen.org
Subject: Re: [PATCH 20/22] arch/x86: use XSM hooks for get_pg_owner access checks
Date: Thu, 13 Sep 2012 09:55:46 -0400 [thread overview]
Message-ID: <5051E5E2.50801@tycho.nsa.gov> (raw)
In-Reply-To: <5051B1CC020000780009AFCE@nat28.tlf.novell.com>
On 09/13/2012 04:13 AM, Jan Beulich wrote:
>>>> On 12.09.12 at 17:59, Daniel De Graaf <dgdegra@tycho.nsa.gov> wrote:
>> @@ -3353,9 +3357,14 @@ long do_mmu_update(
>> mfn = req.ptr >> PAGE_SHIFT;
>> gpfn = req.val;
>>
>> - rc = xsm_mmu_machphys_update(d, pg_owner, mfn);
>> - if ( rc )
>> - break;
>> + xsm_needed |= XSM_MMU_MACHPHYS_UPDATE;
>> + if ( xsm_needed != xsm_checked )
>> + {
>> + rc = xsm_mmu_update(d, pt_owner, pg_owner, xsm_needed);
>
> If you're already updating it this way, it would seem appropriate
> to remove the over-checking here: pt_owner is meaningless for
> this operation (there are no page tables involved), and hence
> you could/should pass d instead.
>
> Jan
>
While this is safe, it makes thinking about the arguments to the XSM hook
harder: the second argument would be defined as "pt_owner if called with
XSM_MMU_NORMAL_UPDATE set and either XSM_MMU_MACHPHYS_UPDATE unset or
XSM_MMU_MACHPHYS_UPDATE set in the previous call; otherwise, d." I would
prefer the simpler method of passing pt_owner every time, and only checking
it if XSM_MMU_NORMAL_UPDATE is set (which I now notice that the default
XSM hook does not do, although the FLASK hook does; I'll fix that).
--
Daniel De Graaf
National Security Agency
next prev parent reply other threads:[~2012-09-13 13:55 UTC|newest]
Thread overview: 40+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-09-12 15:59 [PATCH v3] Merge IS_PRIV checks into XSM hooks Daniel De Graaf
2012-09-12 15:59 ` [PATCH 01/22] xsm/flask: remove inherited class attributes Daniel De Graaf
2012-09-12 15:59 ` [PATCH 02/22] xsm/flask: remove unneeded create_sid field Daniel De Graaf
2012-09-12 15:59 ` [PATCH 03/22] xen: Add versions of rcu_lock_*_domain without IS_PRIV checks Daniel De Graaf
2012-09-12 15:59 ` [PATCH 04/22] xsm/flask: add domain relabel support Daniel De Graaf
2012-09-12 15:59 ` [PATCH 05/22] libxl: introduce XSM relabel on build Daniel De Graaf
2012-09-12 15:59 ` [PATCH 06/22] flask/policy: Add domain relabel example Daniel De Graaf
2012-09-12 15:59 ` [PATCH 07/22] arch/x86: add distinct XSM hooks for map/unmap Daniel De Graaf
2012-09-12 15:59 ` [PATCH 08/22] xsm/flask: Add checks on the domain performing the set_target operation Daniel De Graaf
2012-09-12 15:59 ` [PATCH 09/22] xsm: Use the dummy XSM module if XSM is disabled Daniel De Graaf
2012-09-13 7:46 ` Jan Beulich
2012-09-13 13:40 ` Daniel De Graaf
2012-09-12 15:59 ` [PATCH 10/22] xen: use XSM instead of IS_PRIV where duplicated Daniel De Graaf
2012-09-12 15:59 ` [PATCH 11/22] xen: avoid calling rcu_lock_*target_domain when an XSM hook exists Daniel De Graaf
2012-09-12 15:59 ` [PATCH 12/22] arch/x86: convert platform_hypercall to use XSM Daniel De Graaf
2012-09-12 15:59 ` [PATCH 13/22] xen: lock target domain in do_domctl common code Daniel De Graaf
2012-09-12 15:59 ` [PATCH 14/22] xen: convert do_domctl to use XSM Daniel De Graaf
2012-09-12 15:59 ` [PATCH 15/22] xen: convert do_sysctl " Daniel De Graaf
2012-09-12 15:59 ` [PATCH 16/22] xsm/flask: add missing hooks Daniel De Graaf
2012-09-12 15:59 ` [PATCH 17/22] xsm/flask: add distinct SIDs for self/target access Daniel De Graaf
2012-09-12 15:59 ` [PATCH 18/22] arch/x86: Add missing mem_sharing XSM hooks Daniel De Graaf
2012-09-12 15:59 ` [PATCH 19/22] arch/x86: check remote MMIO remap permissions Daniel De Graaf
2012-09-13 8:00 ` Jan Beulich
2012-09-13 13:46 ` Daniel De Graaf
2012-09-13 14:13 ` Jan Beulich
2012-09-13 14:25 ` Daniel De Graaf
2012-09-13 15:04 ` Jan Beulich
2012-09-13 16:46 ` Daniel De Graaf
2012-09-14 8:54 ` Jan Beulich
2012-09-14 13:37 ` Daniel De Graaf
2012-09-14 14:21 ` Jan Beulich
2012-09-12 15:59 ` [PATCH 20/22] arch/x86: use XSM hooks for get_pg_owner access checks Daniel De Graaf
2012-09-13 8:13 ` Jan Beulich
2012-09-13 13:55 ` Daniel De Graaf [this message]
2012-09-13 14:15 ` Jan Beulich
2012-09-12 15:59 ` [PATCH 21/22] xen: Add XSM hook for XENMEM_exchange Daniel De Graaf
2012-09-12 15:59 ` [PATCH 22/22] tmem: add XSM hooks Daniel De Graaf
2012-09-13 14:37 ` [PATCH v3] Merge IS_PRIV checks into " Ian Jackson
2012-09-13 15:08 ` Daniel De Graaf
2012-09-13 15:29 ` Ian Jackson
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=5051E5E2.50801@tycho.nsa.gov \
--to=dgdegra@tycho.nsa.gov \
--cc=JBeulich@suse.com \
--cc=keir@xen.org \
--cc=tim@xen.org \
--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 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).