All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Roger Pau Monné" <roger.pau@citrix.com>
To: Jan Beulich <jbeulich@suse.com>
Cc: Stefano Stabellini <sstabellini@kernel.org>,
	Julien Grall <julien@xen.org>, Wei Liu <wl@xen.org>,
	Paul Durrant <paul@xen.org>,
	George Dunlap <George.Dunlap@eu.citrix.com>,
	Andrew Cooper <andrew.cooper3@citrix.com>,
	Ian Jackson <ian.jackson@citrix.com>,
	"xen-devel@lists.xenproject.org" <xen-devel@lists.xenproject.org>,
	Daniel de Graaf <dgdegra@tycho.nsa.gov>
Subject: Re: [PATCH v2 6/7] flask: drop dead compat translation code
Date: Wed, 15 Jul 2020 10:41:15 +0200	[thread overview]
Message-ID: <20200715084115.GS7191@Air-de-Roger> (raw)
In-Reply-To: <937a51c5-7563-0ac2-4ada-b4dfd7a5d636@suse.com>

On Wed, Jul 15, 2020 at 08:42:44AM +0200, Jan Beulich wrote:
> On 14.07.2020 16:58, Roger Pau Monné wrote:
> > On Wed, Jul 01, 2020 at 12:28:07PM +0200, Jan Beulich wrote:
> >> Translation macros aren't needed at all (or else a devicetree_label
> >> entry would have been missing), and userlist has been removed quite some
> >> time ago.
> >>
> >> No functional change.
> >>
> >> Signed-off-by: Jan Beulich <jbeulich@suse.com>
> >>
> >> --- a/xen/include/xlat.lst
> >> +++ b/xen/include/xlat.lst
> >> @@ -148,14 +148,11 @@
> >>  ?	xenoprof_init			xenoprof.h
> >>  ?	xenoprof_passive		xenoprof.h
> >>  ?	flask_access			xsm/flask_op.h
> >> -!	flask_boolean			xsm/flask_op.h
> >>  ?	flask_cache_stats		xsm/flask_op.h
> >>  ?	flask_hash_stats		xsm/flask_op.h
> >> -!	flask_load			xsm/flask_op.h
> >>  ?	flask_ocontext			xsm/flask_op.h
> >>  ?	flask_peersid			xsm/flask_op.h
> >>  ?	flask_relabel			xsm/flask_op.h
> >>  ?	flask_setavc_threshold		xsm/flask_op.h
> >>  ?	flask_setenforce		xsm/flask_op.h
> >> -!	flask_sid_context		xsm/flask_op.h
> >>  ?	flask_transition		xsm/flask_op.h
> > 
> > Shouldn't those become checks then?
> 
> No, checking will never succeed for structures containing
> XEN_GUEST_HANDLE(). But there's no point in generating xlat macros
> when they're never used. There are two fundamentally different
> strategies for handling the compat hypercalls: One is to wrap a
> translation layer around the native hypercall. That's where the
> xlat macros come into play. The other, used here, is to compile
> the entire hypercall function a second time, arranging for the
> compat structures to get used in place of the native ones. There
> are no xlat macros involved here, all that's needed are correctly
> translated structures. (For completeness, x86's MCA hypercall
> uses yet another, quite adhoc strategy for handling, but also not
> involving any xlat macro use. Hence the consideration there to
> possibly drop the respective lines from the file here.)

Thanks, I think this explanation is helpful and I wonder whether it
would be possible to have something along this lines in a file or as a
comment somewhere, maybe at the top of xlat.lst?

Also could you add a line to the commit message noting that flask code
doesn't use any of the translation macros because it follows a
different approach to compat handling?

IMO the compat code is complicated to understand, and it also seems to
be mostly undocumented.

For the patch:

Reviewed-by: Roger Pau Monné <roger.pau@citrix.com>

Thanks.


  reply	other threads:[~2020-07-15  8:41 UTC|newest]

Thread overview: 34+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-07-01 10:22 [PATCH v2 0/7] x86: compat header generation and checking adjustments Jan Beulich
2020-07-01 10:25 ` [PATCH v2 1/7] x86: fix compat header generation Jan Beulich
2020-07-01 16:10   ` Roger Pau Monné
2020-07-01 16:17     ` Jan Beulich
2020-07-15  8:43   ` Roger Pau Monné
2020-07-15  8:56     ` Jan Beulich
2020-07-01 10:25 ` [PATCH v2 2/7] x86/mce: add compat struct checking for XEN_MC_inject_v2 Jan Beulich
2020-07-14 10:24   ` Roger Pau Monné
2020-07-14 11:44     ` Jan Beulich
2020-07-14 14:30   ` Roger Pau Monné
2020-07-01 10:26 ` [PATCH v2 3/7] x86/mce: bring hypercall subop compat checking in sync again Jan Beulich
2020-07-14 11:19   ` Roger Pau Monné
2020-07-14 11:47     ` Jan Beulich
2020-07-14 14:31       ` Roger Pau Monné
2020-07-15  6:27         ` Jan Beulich
2020-07-14 14:32   ` Roger Pau Monné
2020-07-01 10:27 ` [PATCH v2 4/7] x86/dmop: add compat struct checking for XEN_DMOP_map_mem_type_to_ioreq_server Jan Beulich
2020-07-14 11:19   ` Roger Pau Monné
2020-07-01 10:27 ` [PATCH v2 5/7] x86: generalize padding field handling Jan Beulich
2020-07-14 14:29   ` Roger Pau Monné
2020-07-15  6:36     ` Jan Beulich
2020-07-15  8:34       ` Roger Pau Monné
2020-07-15  8:47         ` Jan Beulich
2020-07-01 10:28 ` [PATCH v2 6/7] flask: drop dead compat translation code Jan Beulich
2020-07-14 14:58   ` Roger Pau Monné
2020-07-15  6:42     ` Jan Beulich
2020-07-15  8:41       ` Roger Pau Monné [this message]
2020-07-15  8:52         ` Jan Beulich
2020-07-15 10:08           ` Roger Pau Monné
2020-07-01 10:28 ` [PATCH v2 7/7] x86: only generate compat headers actually needed Jan Beulich
2020-07-14 15:03   ` Roger Pau Monné
2020-07-15  6:47     ` Jan Beulich
2020-07-02  7:34 ` [PATCH v2 0/7] x86: compat header generation and checking adjustments Paul Durrant
2020-07-02  7:42   ` Jan Beulich

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=20200715084115.GS7191@Air-de-Roger \
    --to=roger.pau@citrix.com \
    --cc=George.Dunlap@eu.citrix.com \
    --cc=andrew.cooper3@citrix.com \
    --cc=dgdegra@tycho.nsa.gov \
    --cc=ian.jackson@citrix.com \
    --cc=jbeulich@suse.com \
    --cc=julien@xen.org \
    --cc=paul@xen.org \
    --cc=sstabellini@kernel.org \
    --cc=wl@xen.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 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.