All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Jan Beulich" <JBeulich@suse.com>
To: Petre Ovidiu PIRCALABU <ppircalabu@bitdefender.com>
Cc: "tim@xen.org" <tim@xen.org>,
	"sstabellini@kernel.org" <sstabellini@kernel.org>,
	"wei.liu2@citrix.com" <wei.liu2@citrix.com>,
	"rcojocaru@bitdefender.com" <rcojocaru@bitdefender.com>,
	"konrad.wilk@oracle.com" <konrad.wilk@oracle.com>,
	"George.Dunlap@eu.citrix.com" <George.Dunlap@eu.citrix.com>,
	"andrew.cooper3@citrix.com" <andrew.cooper3@citrix.com>,
	"ian.jackson@eu.citrix.com" <ian.jackson@eu.citrix.com>,
	"xen-devel@lists.xen.org" <xen-devel@lists.xen.org>
Subject: Re: [PATCH v3] x86/altp2m: Added xc_altp2m_set_mem_access_multi()
Date: Mon, 09 Oct 2017 05:56:19 -0600	[thread overview]
Message-ID: <59DB80030200007800183E27@prv-mh.provo.novell.com> (raw)
In-Reply-To: <1507547975.1981.39.camel@bitdefender.com>

>>> On 09.10.17 at 13:19, <ppircalabu@bitdefender.com> wrote:
> On Lu, 2017-10-09 at 04:36 -0600, Jan Beulich wrote:
>> > > > On 09.10.17 at 12:10, <ppircalabu@bitdefender.com> wrote:
>> > On Vi, 2017-10-06 at 09:34 -0600, Jan Beulich wrote:
>> > > > > > On 05.10.17 at 17:42, <ppircalabu@bitdefender.com> wrote:
>> > > > --- a/xen/tools/compat-build-header.py
>> > > > +++ b/xen/tools/compat-build-header.py
>> > > > @@ -16,6 +16,7 @@ pats = [
>> > > >   [ r"(8|16|32|64)_compat_t([^\w]|$)", r"\1_t\2" ],
>> > > >   [ r"(^|[^\w])xen_?(\w*)_compat_t([^\w]|$$)",
>> > > > r"\1compat_\2_t\3"
>> > > > ],
>> > > >   [ r"(^|[^\w])XEN_?", r"\1COMPAT_" ],
>> > > > + [ r"(^|[^\w])HVMMEM_?", r"\1COMPAT_HVMMEM_" ],
>> > > What is this needed for? I can't find any instance of HVMMEM_*
>> > > elsewhere in the patch. As you can see, so far there are only
>> > > pretty generic tokens being replaced here.
>> > > 
>> > Without this, both hvmmem_type_t and hvmmem_type_compat_t enums
>> > will
>> > define the same values (e.g.  HVMMEM_ram_rw,) resulting in a
>> > compile
>> > error. By adding this translation we will have a COMPAT_HVMMEM
>> > value
>> > for each HVMMEM_ value defined in public/hvm/hvm_op.h) (e.g.
>> > HVMMEM_ram_rw -> COMPAT_HVMMEM_ram_rw)
>> That's ugly. I realize that we shouldn't even attempt to translate
>> enumerations (or to be fully precise, there shouldn't be any
>> enumerations in the public interface in the first place), as the
>> enumerator values ought to remain consistent between native
>> and compat uses. Hence we could either convert the enum to a
>> set of #define-s, or we would need a mechanism to exclude
>> parts of a header from the compat conversion.
>> 
>> In the end the problem here is because of the enumerators,
>> other than xenmem_access_t's, aren't properly prefixed with
>> XEN or XEN_ (or else the script would already handle them fine
>> afaict). So another variant of addressing this would be to
>> deprecate (but not remove) the current names, introducing
>> properly named ones for __XEN_INTERFACE_VERSION__ >=
>> 0x00040a00.
>> 
> Unfortunately the enum is referenced also in other functions
> (e.g. xendevicemodel_set_mem_type) so replacing it with #defines would
> be more difficult.
> When generating the compat headers,-DXEN_GENERATING_COMPAT_HEADERS is
> defined (xen/include/Makefile). I can guard hvmmem_type_t with an
> #ifndef XEN_GENERATING_COMPAT_HEADERS so the enum is not processed by
> the compat-build-header.py script. (in my opinion this is the minimum-
> impact approach)
> Do you agree with this?

I'm not entirely happy about that approach, but it'll do for the
moment.

Jan


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

      reply	other threads:[~2017-10-09 11:56 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-10-05 15:42 [PATCH v3] x86/altp2m: Added xc_altp2m_set_mem_access_multi() Petre Pircalabu
2017-10-06 15:34 ` Jan Beulich
2017-10-06 16:07   ` Razvan Cojocaru
2017-10-09  7:23     ` Jan Beulich
2017-10-09  7:25       ` Razvan Cojocaru
2017-10-09 10:10   ` Petre Ovidiu PIRCALABU
2017-10-09 10:36     ` Jan Beulich
2017-10-09 11:19       ` Petre Ovidiu PIRCALABU
2017-10-09 11:56         ` Jan Beulich [this message]

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=59DB80030200007800183E27@prv-mh.provo.novell.com \
    --to=jbeulich@suse.com \
    --cc=George.Dunlap@eu.citrix.com \
    --cc=andrew.cooper3@citrix.com \
    --cc=ian.jackson@eu.citrix.com \
    --cc=konrad.wilk@oracle.com \
    --cc=ppircalabu@bitdefender.com \
    --cc=rcojocaru@bitdefender.com \
    --cc=sstabellini@kernel.org \
    --cc=tim@xen.org \
    --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.