From: Hiro Yoshioka <hyoshiok@miraclelinux.com>
To: 76306.1226@compuserve.com
Cc: lkml.hyoshiok@gmail.com, taka@valinux.co.jp, arjan@infradead.org,
linux-kernel@vger.kernel.org, hyoshiok@miraclelinux.com,
hyoshiok@miraclelinux.com
Subject: Re: [RFC] [PATCH] cache pollution aware __copy_from_user_ll()
Date: Wed, 17 Aug 2005 13:50:22 +0900 (JST) [thread overview]
Message-ID: <20050817.135022.596527188.hyoshiok@miraclelinux.com> (raw)
In-Reply-To: <20050817.082153.719902707.hyoshiok@miraclelinux.com>
From: Hiro Yoshioka <hyoshiok@miraclelinux.com>
Subject: Re: [RFC] [PATCH] cache pollution aware __copy_from_user_ll()
Date: Wed, 17 Aug 2005 08:21:53 +0900 (JST)
Message-ID: <20050817.082153.719902707.hyoshiok@miraclelinux.com>
> Chuck,
>
> From: Chuck Ebbert <76306.1226@compuserve.com>
> > On Tue, 16 Aug 2005 at 19:16:17 +0900 (JST), Hiro Yoshioka wrote:
> > > oh, really? Does the linux kernel take care of
> > > SSE save/restore on a task switch?
> >
> > Check out XMMS_SAVE and XMMS_RESTORE in include/asm-i386/xor.h
>
> Thanks for your suggestion. But it seems to me it won't help
> when we have a page fault or other exeptions.
Hi,
Let me understand what the kernel does save/resfore FPU/MMX/XMM
registers. Please let me know if I'm wrong.
1) kernel_fpu_begin()
preempt_disable()
if TS_USEDFPU then
__save_init_fpu()
... save to tsk->thread.i387.f*save
clear TS_USEDFPU flag of tsk->thread_info->status
else
clts() --- clear TS flag of CR0
2) copy
MMX/XMM registers are used.
3) page faults/exceptions/...
3-1 TS flag is set by the CPU (Am I right?)
if nobody uses MMX/XMM
3-2 it's fine. we don't need save/restore
else
3-3 MMX/XMM is used
When TS flag is set, the CPU monitors the instruction stream
of X87 FPU/MMX/SSE/SSE2 instructions. When the CPU detects one of
these instruction, it raises a device-not-available exception (#NM)
prior to executing the instruction. (IA32 Software Developer's Manual,
Vol. 3, 12.5.1)
math_state_restore() is the device-not-available exception
clts()
if (!tsk_used_math(tsk))
init_fpu(tsk);
restore_fpu(tsk);
set TS_USEDFPU;
4) kernel_fpu_end()
stts(); set TS flag of CR0
preempt_enable();
It seems to me that the kernel automatically save/restore FPU/MMX/XMM
registers.
What's wrong with it? Do I misunderstand it?
Regards,
Hiro
next prev parent reply other threads:[~2005-08-17 4:55 UTC|newest]
Thread overview: 63+ messages / expand[flat|nested] mbox.gz Atom feed top
2005-08-16 18:09 Chuck Ebbert
2005-08-16 23:21 ` Hiro Yoshioka
2005-08-17 4:50 ` Hiro Yoshioka [this message]
[not found] <20050818.201138.607962419.hyoshiok@miraclelinux.com.suse.lists.linux.kernel>
[not found] ` <98df96d30508181629d85edb5@mail.gmail.com.suse.lists.linux.kernel>
[not found] ` <20050823.081246.846946371.hyoshiok@miraclelinux.com.suse.lists.linux.kernel>
[not found] ` <20050824.231156.278740508.hyoshiok@miraclelinux.com.suse.lists.linux.kernel>
2005-08-24 16:18 ` Andi Kleen
2005-08-25 4:54 ` Hiro Yoshioka
2005-09-01 9:07 ` Hiro Yoshioka
2005-09-01 9:36 ` Andi Kleen
2005-09-02 1:43 ` Hiro Yoshioka
2005-09-02 2:06 ` Andi Kleen
2005-09-02 2:08 ` Andrew Morton
2005-09-02 2:17 ` Andi Kleen
2005-09-02 2:28 ` Andrew Morton
2005-09-02 3:41 ` Hiro Yoshioka
2005-09-02 4:29 ` Andrew Morton
2005-09-02 4:37 ` Hiro Yoshioka
2005-09-03 11:59 ` Hiro Yoshioka
-- strict thread matches above, loose matches on Subject: below --
2005-08-17 15:19 Chuck Ebbert
2005-08-18 9:45 ` Hiro Yoshioka
[not found] <20050816.131729.15816429.taka@valinux.co.jp.suse.lists.linux.kernel>
[not found] ` <20050816.135425.719901536.hyoshiok@miraclelinux.com.suse.lists.linux.kernel>
[not found] ` <1124171015.3215.0.camel@laptopd505.fenrus.org.suse.lists.linux.kernel>
[not found] ` <20050816.191617.1025215458.hyoshiok@miraclelinux.com.suse.lists.linux.kernel>
[not found] ` <1124187950.3215.31.camel@laptopd505.fenrus.org.suse.lists.linux.kernel>
2005-08-16 13:15 ` Andi Kleen
2005-08-18 11:06 ` Hiro Yoshioka
2005-08-18 11:11 ` Hiro Yoshioka
2005-08-18 23:29 ` Hiro Yoshioka
2005-08-22 1:24 ` Hiro Yoshioka
2005-08-22 13:07 ` Andi Kleen
2005-08-22 2:43 ` Hiro Yoshioka
2005-08-22 23:12 ` Hiro Yoshioka
2005-08-24 14:11 ` Hiro Yoshioka
2005-08-24 14:21 ` Arjan van de Ven
2005-08-24 16:22 ` Hirokazu Takahashi
2005-08-25 4:53 ` Hiro Yoshioka
[not found] <20050815121555.29159.qmail@science.horizon.com.suse.lists.linux.kernel>
[not found] ` <1124108702.3228.33.camel@laptopd505.fenrus.org.suse.lists.linux.kernel>
2005-08-15 15:02 ` Andi Kleen
2005-08-15 15:09 ` Arjan van de Ven
2005-08-15 15:13 ` Andi Kleen
2005-08-15 12:15 linux
2005-08-15 12:25 ` Arjan van de Ven
2005-08-14 21:24 Ian Kumlien
2005-08-15 7:21 ` Arjan van de Ven
2005-08-15 14:49 ` Ian Kumlien
2005-08-14 9:16 Hiro Yoshioka
2005-08-14 9:41 ` Arjan van de Ven
2005-08-14 10:22 ` Hiro Yoshioka
2005-08-14 10:35 ` Arjan van de Ven
2005-08-14 10:45 ` Christoph Hellwig
2005-08-15 6:43 ` Hiro Yoshioka
2005-08-15 7:16 ` Arjan van de Ven
2005-08-15 8:44 ` Hiro Yoshioka
2005-08-15 8:53 ` Arjan van de Ven
2005-08-15 23:33 ` Hiro Yoshioka
2005-08-16 3:30 ` Hiro Yoshioka
2005-08-16 4:17 ` Hirokazu Takahashi
2005-08-16 4:54 ` Hiro Yoshioka
2005-08-16 5:43 ` Arjan van de Ven
2005-08-16 10:16 ` Hiro Yoshioka
2005-08-16 10:19 ` Hirokazu Takahashi
2005-08-16 10:25 ` Arjan van de Ven
2005-08-16 10:24 ` Hirokazu Takahashi
2005-08-16 5:44 ` Arjan van de Ven
2005-08-16 5:49 ` Arjan van de Ven
[not found] ` <20050817.110503.97359275.taka@valinux.co.jp>
2005-08-17 5:10 ` Hiro Yoshioka
2005-08-17 14:30 ` Akira Tsukamoto
2005-08-17 15:27 ` Akira Tsukamoto
2005-08-18 17:53 ` Lee Revell
2005-08-18 2:37 ` Akira Tsukamoto
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=20050817.135022.596527188.hyoshiok@miraclelinux.com \
--to=hyoshiok@miraclelinux.com \
--cc=76306.1226@compuserve.com \
--cc=arjan@infradead.org \
--cc=linux-kernel@vger.kernel.org \
--cc=lkml.hyoshiok@gmail.com \
--cc=taka@valinux.co.jp \
/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
Powered by JetHome