From: "Woods, Brian" <Brian.Woods@amd.com>
To: Paul Durrant <Paul.Durrant@citrix.com>
Cc: xen-devel <xen-devel@lists.xenproject.org>,
"Woods, Brian" <Brian.Woods@amd.com>,
'Jan Beulich' <JBeulich@suse.com>,
"Suthikulpanit, Suravee" <Suravee.Suthikulpanit@amd.com>
Subject: Re: [PATCH] amd-iommu: get rid of pointless IOMMU_PAGING_MODE_LEVEL_X definitions
Date: Fri, 26 Oct 2018 18:39:24 +0000 [thread overview]
Message-ID: <20181026183919.GA10850@amd.com> (raw)
In-Reply-To: <e98d404a82e042c190e66bd5969e8359@AMSPEX02CL03.citrite.net>
On Fri, Oct 26, 2018 at 03:55:32PM +0000, Paul Durrant wrote:
> > -----Original Message-----
> > From: Jan Beulich [mailto:JBeulich@suse.com]
> > Sent: 25 October 2018 11:29
> > To: Brian Woods <brian.woods@amd.com>; Paul Durrant
> > <Paul.Durrant@citrix.com>
> > Cc: Suravee Suthikulpanit <suravee.suthikulpanit@amd.com>; xen-devel <xen-
> > devel@lists.xenproject.org>
> > Subject: Re: [Xen-devel] [PATCH] amd-iommu: get rid of pointless
> > IOMMU_PAGING_MODE_LEVEL_X definitions
> >
> > >>> On 12.10.18 at 19:18, <Paul.Durrant@citrix.com> wrote:
> > >> -----Original Message-----
> > >> From: Woods, Brian [mailto:Brian.Woods@amd.com]
> > >> Sent: 12 October 2018 18:14
> > >> To: Paul Durrant <Paul.Durrant@citrix.com>
> > >> Cc: xen-devel@lists.xenproject.org; Suthikulpanit, Suravee
> > >> <Suravee.Suthikulpanit@amd.com>; Woods, Brian <Brian.Woods@amd.com>
> > >> Subject: Re: [PATCH] amd-iommu: get rid of pointless
> > >> IOMMU_PAGING_MODE_LEVEL_X definitions
> > >>
> > >> On Thu, Sep 27, 2018 at 01:46:01PM +0100, Paul Durrant wrote:
> > >> > The levels are absolute numbers such that IOMMU_PAGING_MODE_LEVEL_X
> > >> > evaluates to X (for the valid range of 0 - 7) so simply use numbers
> > in
> > >> > the code.
> > >> >
> > >> > No functional change.
> > >> >
> > >> > NOTE: This patch also adds emacs boilerplate to amd-iommu-defs.h
> > >> >
> > >> > Signed-off-by: Paul Durrant <paul.durrant@citrix.com>
> > >>
> > >> Is there a strong reason to get rid of these? Some of examples below
> > >> create seemingly magic numbers in the code. While if you're familiar
> > >> with the functions this isn't a big deal, otherwise you have to dig
> > >> further to tell.
> > >>
> > >
> > > The numbers aren't magic though. The spec refers to levels by number
> > rather
> > > than any sort of name. If the levels were named then it would be
> > absolutely
> > > right to #define <level name> <level number>, but that is not the case.
> > Thus IMO
> > > getting rid of the definitions actually makes the code clearer for those
> > > (like myself) reading the spec.
> > >
> > >> > + pte = table + pfn_to_pde_idx(gfn, 1);
> > >>
> > >> > + need_flush = set_iommu_pde_present(pde, next_mfn, 0, iw, ir);
> > >>
> > >> If there's a general consensus that getting rid of these is better, I
> > >> don't mind and will agree to it.
> > >>
> > >
> > > Anyone else care to comment?
> >
> > I think that, quite the opposite of what is often the case, the amount
> > of manifest constants the AMD IOMMU code uses is quite a bit too
> > large. I therefore welcome this change, and I've been planning some
> > other reduction there (but haven't got to it in a couple of years).
> >
>
> Brian,
>
> Are you ok to ack this patch now, or would you like more opinions?
>
> Paul
>
I'd still rather shorter names rather than getting rid of them all
together but,
Acked-by: Brian Woods <brian.woods@amd.com>
--
Brian Woods
_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xenproject.org
https://lists.xenproject.org/mailman/listinfo/xen-devel
prev parent reply other threads:[~2018-10-26 18:39 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-09-27 12:46 [PATCH] amd-iommu: get rid of pointless IOMMU_PAGING_MODE_LEVEL_X definitions Paul Durrant
2018-10-02 12:33 ` Paul Durrant
2018-10-11 8:25 ` Paul Durrant
2018-10-12 17:14 ` Woods, Brian
2018-10-12 17:18 ` Paul Durrant
2018-10-25 10:29 ` Jan Beulich
2018-10-26 15:55 ` Paul Durrant
2018-10-26 18:39 ` Woods, Brian [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=20181026183919.GA10850@amd.com \
--to=brian.woods@amd.com \
--cc=JBeulich@suse.com \
--cc=Paul.Durrant@citrix.com \
--cc=Suravee.Suthikulpanit@amd.com \
--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.