From: David Laight <David.Laight@ACULAB.COM>
To: "'Li, Aubrey'" <aubrey.li@linux.intel.com>,
Thomas Gleixner <tglx@linutronix.de>,
Aubrey Li <aubrey.li@intel.com>
Cc: "mingo@redhat.com" <mingo@redhat.com>,
"peterz@infradead.org" <peterz@infradead.org>,
"hpa@zytor.com" <hpa@zytor.com>,
"ak@linux.intel.com" <ak@linux.intel.com>,
"tim.c.chen@linux.intel.com" <tim.c.chen@linux.intel.com>,
"arjan@linux.intel.com" <arjan@linux.intel.com>,
"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>
Subject: RE: [RFC PATCH v2 1/2] x86/fpu: detect AVX task
Date: Tue, 13 Nov 2018 14:56:27 +0000 [thread overview]
Message-ID: <8adbc254854244b383147b4a25353cb7@AcuMS.aculab.com> (raw)
In-Reply-To: <2229f120-cb11-8f8e-f27d-eabc94457cd5@linux.intel.com>
From: Li, Aubrey
> Sent: 13 November 2018 13:07
...
> > Isn't there an obvious optimisation to execute VZEROALL during system call
> > entry?
>
> I'm not aware of this in the kernel, maybe you are talking about some
> optimization in glibc?
I've not seen it anywhere either.
IIRC all the xmm and ymm registers are 'caller saved'.
Since system calls all look like function calls the compiler
has to assume that the registers can be modified.
This means that it is safe for the system call code to change them.
It mustn't leak kernel values out to userspace, but it can zero them.
So adding VZEROALL on system call entry would save the FP save code having
to save and restore any of the xmm/ymm registers.
IIRC the hardware just saves a flag indicating that they are all zero.
All the registers do need saving if the kernel is entered by an
interrupt or fault.
David
-
Registered Address Lakeside, Bramley Road, Mount Farm, Milton Keynes, MK1 1PT, UK
Registration No: 1397386 (Wales)
next prev parent reply other threads:[~2018-11-13 14:56 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-11-07 17:16 [RFC PATCH v2 1/2] x86/fpu: detect AVX task Aubrey Li
2018-11-07 17:16 ` [RFC PATCH v2 2/2] proc: add /proc/<pid>/thread_state Aubrey Li
2018-11-09 11:21 ` [RFC PATCH v2 1/2] x86/fpu: detect AVX task Thomas Gleixner
2018-11-12 1:40 ` Li, Aubrey
2018-11-13 10:25 ` David Laight
2018-11-13 13:06 ` Li, Aubrey
2018-11-13 14:56 ` David Laight [this message]
2018-11-12 2:32 ` Dave Hansen
2018-11-12 5:38 ` Li, Aubrey
2018-11-12 15:46 ` Dave Hansen
2018-11-13 6:42 ` Li, Aubrey
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=8adbc254854244b383147b4a25353cb7@AcuMS.aculab.com \
--to=david.laight@aculab.com \
--cc=ak@linux.intel.com \
--cc=arjan@linux.intel.com \
--cc=aubrey.li@intel.com \
--cc=aubrey.li@linux.intel.com \
--cc=hpa@zytor.com \
--cc=linux-kernel@vger.kernel.org \
--cc=mingo@redhat.com \
--cc=peterz@infradead.org \
--cc=tglx@linutronix.de \
--cc=tim.c.chen@linux.intel.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox