From: "Kamble, Nitin A" <nitin.a.kamble@intel.com>
To: "Kamble, Nitin A" <nitin.a.kamble@intel.com>,
"Pavel Machek" <pavel@ucw.cz>,
"Linus Torvalds" <torvalds@osdl.org>,
"Andrew Morton" <akpm@osdl.org>,
"Jeff Garzik" <jgarzik@pobox.com>
Cc: <linux-kernel@vger.kernel.org>,
"Nakajima, Jun" <jun.nakajima@intel.com>,
"Mallick, Asit K" <asit.k.mallick@intel.com>,
"Saxena, Sunil" <sunil.saxena@intel.com>
Subject: RE: [PATCH] mxcsr patch for i386 & x86-64
Date: Thu, 6 May 2004 18:40:15 -0700 [thread overview]
Message-ID: <E305A4AFB7947540BC487567B5449BA802D798AB@scsmsx402.sc.intel.com> (raw)
[-- Attachment #1: Type: text/plain, Size: 1210 bytes --]
Pavel,
The test for suspend & resume has passed.
One more patch to be applied on top of the previous patch is attached.
It cleans up the duplicate code, as per Jeff's suggestion.
Thanks & Regards,
Nitin
------------------------------------------------------------------------
-
>-----Original Message-----
>From: Kamble, Nitin A
>Sent: Thursday, May 06, 2004 2:01 PM
>To: 'Pavel Machek'; Linus Torvalds
>Cc: Andrew Morton; linux-kernel@vger.kernel.org; Nakajima, Jun;
Mallick,
>Asit K; Saxena, Sunil
>Subject: RE: [PATCH] mxcsr patch for i386 & x86-64
>
>>i386/kernel/power/cpu.c now probably wants fpu_init, too...
>
>Hi Pavel,
> I have updated the mxcsr patch to also enable it at the time of
resume.
>Please find the patch attached.
> fpu_init() is needed in the resume path, only if the user want to
change
>the cpu between suspend and resume. Otherwise the mxcsr_features_mask
>calculated earlier will still be valid.
> Also for changing the cpu, the user will need to shutdown the
system,
>so it is useful for S4 (suspend to disk) state.
> I am testing the patch. Meanwhile please let me know if these changes
are
>ok for you?
>
>Thanks & Regards,
>Nitin
[-- Attachment #2: mxcsr_shared.patch --]
[-- Type: application/octet-stream, Size: 3706 bytes --]
--- 2.6.6-rc3/arch/i386/kernel/Makefile.orig 2004-05-06 17:57:10.000000000 -0700
+++ 2.6.6-rc3/arch/i386/kernel/Makefile 2004-05-06 18:06:30.000000000 -0700
@@ -6,8 +6,8 @@
obj-y := process.o semaphore.o signal.o entry.o traps.o irq.o vm86.o \
ptrace.o i8259.o ioport.o ldt.o setup.o time.o sys_i386.o \
- pci-dma.o i386_ksyms.o i387.o dmi_scan.o bootflag.o \
- doublefault.o
+ pci-dma.o i386_ksyms.o i387.o i387_shared.o dmi_scan.o \
+ bootflag.o doublefault.o
obj-y += cpu/
obj-y += timers/
--- /dev/null 2003-09-23 15:19:32.000000000 -0700
+++ 2.6.6-rc3/arch/i386/kernel/i387_shared.c 2004-05-06 18:12:09.000000000 -0700
@@ -0,0 +1,29 @@
+/*
+ * linux/arch/i386/kernel/i387_shared.c
+ *
+ * Taking the archicture shared mxcsr functionality out from i387.c
+ * to this i387_shared.c.(6th May 2004)
+ * Nitin Kamble <nitin.a.kamble@intel.com>
+ */
+
+#include <asm/types.h>
+#include <asm/system.h>
+#include <asm/processor.h>
+#include <asm/string.h>
+#include <linux/sched.h>
+
+u32 mxcsr_feature_mask = 0xffffffff;
+
+void mxcsr_feature_mask_init(void)
+{
+ u32 mask = 0;
+ clts();
+ if (cpu_has_fxsr) {
+ memset(¤t->thread.i387.fxsave, 0, sizeof(struct i387_fxsave_struct));
+ asm volatile("fxsave %0" : : "m" (current->thread.i387.fxsave));
+ mask = current->thread.i387.fxsave.mxcsr_mask;
+ if (mask == 0) mask = 0x0000ffbf;
+ }
+ mxcsr_feature_mask &= mask;
+ stts();
+}
--- 2.6.6-rc3/arch/i386/kernel/i387.c.orig 2004-05-06 17:57:16.000000000 -0700
+++ 2.6.6-rc3/arch/i386/kernel/i387.c 2004-05-06 18:06:30.000000000 -0700
@@ -24,22 +24,6 @@
#define HAVE_HWFP 1
#endif
-unsigned long mxcsr_feature_mask = 0xffffffff;
-
-void mxcsr_feature_mask_init(void)
-{
- unsigned long mask = 0;
- clts();
- if (cpu_has_fxsr) {
- memset(¤t->thread.i387.fxsave, 0, sizeof(struct i387_fxsave_struct));
- asm volatile("fxsave %0" : : "m" (current->thread.i387.fxsave));
- mask = current->thread.i387.fxsave.mxcsr_mask;
- if (mask == 0) mask = 0x0000ffbf;
- }
- mxcsr_feature_mask &= mask;
- stts();
-}
-
/*
* The _current_ task is using the FPU for the first time
* so initialize it and set the mxcsr to its default
--- 2.6.6-rc3/arch/x86_64/kernel/Makefile.orig 2004-05-06 17:57:18.000000000 -0700
+++ 2.6.6-rc3/arch/x86_64/kernel/Makefile 2004-05-06 18:06:30.000000000 -0700
@@ -6,7 +6,7 @@
EXTRA_AFLAGS := -traditional
obj-y := process.o semaphore.o signal.o entry.o traps.o irq.o \
ptrace.o i8259.o ioport.o ldt.o setup.o time.o sys_x86_64.o \
- x8664_ksyms.o i387.o syscall.o vsyscall.o \
+ x8664_ksyms.o i387.o i387_shared.o syscall.o vsyscall.o \
setup64.o bootflag.o e820.o reboot.o warmreboot.o
obj-y += mce.o acpi/
@@ -35,3 +35,4 @@
topology-y += ../../i386/mach-default/topology.o
swiotlb-$(CONFIG_SWIOTLB) += ../../ia64/lib/swiotlb.o
microcode-$(subst m,y,$(CONFIG_MICROCODE)) += ../../i386/kernel/microcode.o
+i387_shared-y += ../../i386/kernel/i387_shared.o
--- 2.6.6-rc3/arch/x86_64/kernel/i387.c.orig 2004-05-06 17:57:19.000000000 -0700
+++ 2.6.6-rc3/arch/x86_64/kernel/i387.c 2004-05-06 18:06:30.000000000 -0700
@@ -24,20 +24,6 @@
#include <asm/ptrace.h>
#include <asm/uaccess.h>
-unsigned int mxcsr_feature_mask = 0xffffffff;
-
-void mxcsr_feature_mask_init(void)
-{
- unsigned int mask;
- clts();
- memset(¤t->thread.i387.fxsave, 0, sizeof(struct i387_fxsave_struct));
- asm volatile("fxsave %0" : : "m" (current->thread.i387.fxsave));
- mask = current->thread.i387.fxsave.mxcsr_mask;
- if (mask == 0) mask = 0x0000ffbf;
- mxcsr_feature_mask &= mask;
- stts();
-}
-
/*
* Called at bootup to set up the initial FPU state that is later cloned
* into all processes.
next reply other threads:[~2004-05-07 1:43 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2004-05-07 1:40 Kamble, Nitin A [this message]
-- strict thread matches above, loose matches on Subject: below --
2004-05-06 21:00 Kamble, Nitin A
2004-05-07 14:23 ` Pavel Machek
2004-05-04 21:47 Nakajima, Jun
2004-05-04 21:06 Kamble, Nitin A
2004-05-04 20:25 Kamble, Nitin A
2004-05-04 18:50 Kamble, Nitin A
2004-05-04 19:10 ` Linus Torvalds
2004-05-04 19:26 ` Linus Torvalds
2004-05-04 20:24 ` Linus Torvalds
2004-05-04 21:07 ` Jeff Garzik
2004-05-05 13:51 ` Pavel Machek
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=E305A4AFB7947540BC487567B5449BA802D798AB@scsmsx402.sc.intel.com \
--to=nitin.a.kamble@intel.com \
--cc=akpm@osdl.org \
--cc=asit.k.mallick@intel.com \
--cc=jgarzik@pobox.com \
--cc=jun.nakajima@intel.com \
--cc=linux-kernel@vger.kernel.org \
--cc=pavel@ucw.cz \
--cc=sunil.saxena@intel.com \
--cc=torvalds@osdl.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®