From: Keir Fraser <keir@xen.org>
To: Wei Huang <wei.huang2@amd.com>,
"'xen-devel@lists.xensource.com'" <xen-devel@lists.xensource.com>
Subject: Re: [PATCH][RFC] FPU LWP 1/5: clean up the FPU code
Date: Fri, 15 Apr 2011 10:20:13 +0100 [thread overview]
Message-ID: <C9CDCC5D.2CB27%keir@xen.org> (raw)
In-Reply-To: <4DA75B22.1010702@amd.com>
On 14/04/2011 21:37, "Wei Huang" <wei.huang2@amd.com> wrote:
> This patch reorganizes and cleans up the FPU code. Main changes include:
>
> 1. Related functions are re-arranged together.
> 2. FPU save/restore code are extracted out as independent functions
> (fsave/frstor, fxsave/fxrstor, xsave/xrstor).
> 3. Two FPU entry functions, fpu_save() and fpu_restore(), are defined.
> They utilize xsave/xrstor to save/restore FPU state if CPU supports
> extended state. Otherwise they fall back to fxsave/fxrstor or fsave/frstor.
Wei,
If you're going to clean this up, please don't politely skirt around the
existing file- and function-name conventions. The fact is that i387/fpu is
but one item of state handled by XSAVE/XRSTOR and friends. Thus it is the
tail wagging the dog to keep all the new mechanism in files and functions
called {i387,fpu}*. I'd prefer you to move some or all functionality into
newly-named files and functions -- perhaps using a prefix like xstate_ on
functions and sticking it all in files xstate.[ch]. Perhaps the old i387
files would disappear completely, or perhaps you'll find a few bits and
pieces logically remain in them, I don't mind either way as long as
everything is in a logical place with a logical name.
The naming in your 3rd patch is also unnecessarily confusing: is it really
clear the difference between *_reload and *_restore, for example, that one
is done on context switch and the other on #NM? We need better names; for
example:
xstate_save: Straightforward I guess as we always unlazily save everything
that's dirty straight away during context switch.
xstate_restore_lazy: Handle stuff we restore lazily on #NM.
xstate_restore_eager: Handle stuff we restore unconditionally (if in use by
the guest) on ctxt switch.
These names would mean a lot more to me than what you chose. However, feel
free to work out a comprehensive naming scheme that you think works best.
All I'm saying is that our current naming scheme is already pretty crappy,
and you make it quite a bit worse by following the existing direction way
too much!
-- Keir
> Signed-off-by: Wei Huang <wei.huang2@amd.com>
>
>
>
> _______________________________________________
> Xen-devel mailing list
> Xen-devel@lists.xensource.com
> http://lists.xensource.com/xen-devel
next prev parent reply other threads:[~2011-04-15 9:20 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-04-14 20:37 [PATCH][RFC] FPU LWP 1/5: clean up the FPU code Wei Huang
2011-04-15 9:20 ` Keir Fraser [this message]
2011-04-15 16:22 ` Huang2, Wei
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=C9CDCC5D.2CB27%keir@xen.org \
--to=keir@xen.org \
--cc=wei.huang2@amd.com \
--cc=xen-devel@lists.xensource.com \
/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.