2008-10-22 22:26:29 -07:00
|
|
|
|
|
|
|
|
|
2008-01-30 13:31:03 +01:00
|
|
|
|
2008-01-30 13:31:27 +01:00
|
|
|
|
|
|
|
|
|
2008-01-30 13:31:27 +01:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2008-01-30 13:31:57 +01:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2008-01-30 13:31:27 +01:00
|
|
|
|
2009-02-11 10:20:05 -08:00
|
|
|
|
2008-01-30 13:31:31 +01:00
|
|
|
|
2008-01-30 13:31:57 +01:00
|
|
|
|
|
|
|
|
|
2008-01-30 13:32:38 +01:00
|
|
|
|
2012-03-28 18:11:12 +01:00
|
|
|
|
2008-02-21 04:24:40 +01:00
|
|
|
|
2008-01-30 13:31:57 +01:00
|
|
|
|
2008-01-30 13:31:33 +01:00
|
|
|
|
|
|
|
|
|
2008-01-30 13:31:57 +01:00
|
|
|
|
2009-09-02 11:49:52 +02:00
|
|
|
|
2008-01-30 13:31:57 +01:00
|
|
|
|
2010-03-25 14:51:50 +01:00
|
|
|
|
2012-03-28 18:11:12 +01:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2008-01-30 13:31:27 +01:00
|
|
|
|
2009-06-01 23:43:10 +05:30
|
|
|
|
2008-01-30 13:31:27 +01:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2008-02-21 04:24:40 +01:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2008-01-30 13:31:27 +01:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2008-01-30 13:31:31 +01:00
|
|
|
|
2008-02-21 04:24:40 +01:00
|
|
|
|
|
|
|
|
|
2008-01-30 13:31:31 +01:00
|
|
|
|
2008-02-21 04:24:40 +01:00
|
|
|
|
|
|
|
|
|
2008-01-30 13:31:31 +01:00
|
|
|
|
|
|
|
|
|
x86/tlb_info: get last level TLB entry number of CPU
For 4KB pages, x86 CPU has 2 or 1 level TLB, first level is data TLB and
instruction TLB, second level is shared TLB for both data and instructions.
For hupe page TLB, usually there is just one level and seperated by 2MB/4MB
and 1GB.
Although each levels TLB size is important for performance tuning, but for
genernal and rude optimizing, last level TLB entry number is suitable. And
in fact, last level TLB always has the biggest entry number.
This patch will get the biggest TLB entry number and use it in furture TLB
optimizing.
Accroding Borislav's suggestion, except tlb_ll[i/d]_* array, other
function and data will be released after system boot up.
For all kinds of x86 vendor friendly, vendor specific code was moved to its
specific files.
Signed-off-by: Alex Shi <alex.shi@intel.com>
Link: http://lkml.kernel.org/r/1340845344-27557-2-git-send-email-alex.shi@intel.com
Signed-off-by: H. Peter Anvin <hpa@zytor.com>
2012-06-28 09:02:16 +08:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2012-06-28 09:02:19 +08:00
|
|
|
|
|
|
|
|
|
2008-01-30 13:31:33 +01:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2008-02-21 04:24:40 +01:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2008-01-30 13:31:33 +01:00
|
|
|
|
2008-02-21 04:24:40 +01:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2008-01-30 13:31:33 +01:00
|
|
|
|
2008-02-21 04:24:40 +01:00
|
|
|
|
2009-01-23 17:18:52 -08:00
|
|
|
|
2009-03-12 12:37:34 +00:00
|
|
|
|
2008-02-21 04:24:40 +01:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2013-03-20 15:07:23 +01:00
|
|
|
|
2008-02-21 04:24:40 +01:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2008-03-06 13:46:39 -08:00
|
|
|
|
2008-02-21 04:24:40 +01:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2010-09-30 14:38:57 +02:00
|
|
|
|
|
|
|
|
|
2008-02-21 04:24:40 +01:00
|
|
|
|
|
|
|
|
|
2011-10-12 17:46:33 -07:00
|
|
|
|
2008-01-30 13:31:33 +01:00
|
|
|
|
|
|
|
|
|
2008-02-21 04:24:40 +01:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2008-01-30 13:31:33 +01:00
|
|
|
|
2008-01-30 13:31:39 +01:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2008-02-21 04:24:40 +01:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2009-05-09 23:47:42 -07:00
|
|
|
|
|
|
|
|
|
2008-01-30 13:31:33 +01:00
|
|
|
|
|
|
|
|
|
2009-04-21 23:00:24 +01:00
|
|
|
|
2008-01-30 13:31:33 +01:00
|
|
|
|
|
|
|
|
|
2010-12-18 16:30:05 +01:00
|
|
|
|
2008-01-30 13:31:33 +01:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2008-07-21 22:40:37 +05:30
|
|
|
|
|
|
|
|
|
2008-02-21 04:24:40 +01:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2008-01-30 13:31:39 +01:00
|
|
|
|
2008-06-21 03:24:19 -07:00
|
|
|
|
2008-01-30 13:31:39 +01:00
|
|
|
|
|
|
|
|
|
2008-01-30 13:31:33 +01:00
|
|
|
|
2012-02-12 09:53:57 -08:00
|
|
|
|
2008-01-30 13:31:33 +01:00
|
|
|
|
|
|
|
|
|
2012-10-19 10:59:33 +02:00
|
|
|
|
2008-01-30 13:31:33 +01:00
|
|
|
|
2008-08-23 17:47:10 +02:00
|
|
|
|
2008-01-30 13:31:39 +01:00
|
|
|
|
|
|
|
|
|
2012-12-20 23:44:23 -08:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2008-01-30 13:31:03 +01:00
|
|
|
|
2008-02-21 04:24:40 +01:00
|
|
|
|
2008-01-30 13:31:03 +01:00
|
|
|
|
|
|
|
|
|
2009-12-16 16:25:42 -08:00
|
|
|
|
2008-03-23 01:03:15 -07:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2011-10-12 17:46:33 -07:00
|
|
|
|
|
|
|
|
|
2008-01-30 13:31:03 +01:00
|
|
|
|
|
|
|
|
|
2008-01-30 13:31:27 +01:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2008-01-30 13:31:03 +01:00
|
|
|
|
2008-01-30 13:31:31 +01:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2008-02-21 04:24:40 +01:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2008-01-30 13:31:31 +01:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2008-02-21 04:24:40 +01:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2008-01-30 13:31:31 +01:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2008-02-21 04:24:40 +01:00
|
|
|
|
2008-01-30 13:31:31 +01:00
|
|
|
|
2008-02-21 04:24:40 +01:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2008-01-30 13:31:31 +01:00
|
|
|
|
|
|
|
|
|
2008-02-21 04:24:40 +01:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2008-01-30 13:31:31 +01:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2008-02-21 04:24:40 +01:00
|
|
|
|
|
|
|
|
|
2008-01-30 13:31:31 +01:00
|
|
|
|
2008-02-21 04:24:40 +01:00
|
|
|
|
2008-01-30 13:31:31 +01:00
|
|
|
|
2008-02-21 04:24:40 +01:00
|
|
|
|
|
|
|
|
|
2008-07-04 13:56:16 +01:00
|
|
|
|
2008-01-30 13:31:31 +01:00
|
|
|
|
2009-04-21 23:00:24 +01:00
|
|
|
|
2008-01-30 13:31:31 +01:00
|
|
|
|
2008-02-21 04:24:40 +01:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2008-01-30 13:31:39 +01:00
|
|
|
|
2008-02-21 04:24:40 +01:00
|
|
|
|
2008-01-30 13:31:39 +01:00
|
|
|
|
|
|
|
|
|
2008-01-30 13:31:48 +01:00
|
|
|
|
|
|
|
|
|
2008-01-30 13:31:41 +01:00
|
|
|
|
2008-03-05 15:15:42 +01:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2008-02-21 04:24:40 +01:00
|
|
|
|
2008-03-05 15:15:42 +01:00
|
|
|
|
|
|
|
|
|
2008-02-21 04:24:40 +01:00
|
|
|
|
2008-01-30 13:31:41 +01:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2008-03-05 15:15:42 +01:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2008-01-30 13:31:48 +01:00
|
|
|
|
|
|
|
|
|
2008-03-05 15:15:42 +01:00
|
|
|
|
|
|
|
|
|
2008-01-30 13:31:48 +01:00
|
|
|
|
|
|
|
|
|
2008-03-05 15:15:42 +01:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2008-01-30 13:31:48 +01:00
|
|
|
|
|
|
|
|
|
2008-03-05 15:15:42 +01:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2008-02-21 04:24:40 +01:00
|
|
|
|
2008-03-05 15:15:42 +01:00
|
|
|
|
|
|
|
|
|
2008-02-21 04:24:40 +01:00
|
|
|
|
2008-03-05 15:15:42 +01:00
|
|
|
|
2008-07-29 10:29:24 -07:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2008-02-21 04:24:40 +01:00
|
|
|
|
2008-01-30 13:31:41 +01:00
|
|
|
|
|
|
|
|
|
2008-01-30 13:31:48 +01:00
|
|
|
|
2008-02-21 04:24:40 +01:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2009-02-09 22:17:39 +09:00
|
|
|
|
2008-02-21 04:24:40 +01:00
|
|
|
|
2008-01-30 13:31:41 +01:00
|
|
|
|
|
|
|
|
|
2009-04-10 15:21:24 -07:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2008-07-29 10:29:19 -07:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2009-04-10 15:21:24 -07:00
|
|
|
|
2008-07-29 10:29:19 -07:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2008-03-10 15:28:04 -07:00
|
|
|
|
2008-01-30 13:31:48 +01:00
|
|
|
|
|
|
|
|
|
2008-02-21 04:24:40 +01:00
|
|
|
|
2008-07-29 10:29:20 -07:00
|
|
|
|
2008-01-30 13:31:48 +01:00
|
|
|
|
|
|
|
|
|
2010-05-06 11:45:46 +03:00
|
|
|
|
i387: support lazy restore of FPU state
This makes us recognize when we try to restore FPU state that matches
what we already have in the FPU on this CPU, and avoids the restore
entirely if so.
To do this, we add two new data fields:
- a percpu 'fpu_owner_task' variable that gets written any time we
update the "has_fpu" field, and thus acts as a kind of back-pointer
to the task that owns the CPU. The exception is when we save the FPU
state as part of a context switch - if the save can keep the FPU
state around, we leave the 'fpu_owner_task' variable pointing at the
task whose FP state still remains on the CPU.
- a per-thread 'last_cpu' field, that indicates which CPU that thread
used its FPU on last. We update this on every context switch
(writing an invalid CPU number if the last context switch didn't
leave the FPU in a lazily usable state), so we know that *that*
thread has done nothing else with the FPU since.
These two fields together can be used when next switching back to the
task to see if the CPU still matches: if 'fpu_owner_task' matches the
task we are switching to, we know that no other task (or kernel FPU
usage) touched the FPU on this CPU in the meantime, and if the current
CPU number matches the 'last_cpu' field, we know that this thread did no
other FP work on any other CPU, so the FPU state on the CPU must match
what was saved on last context switch.
In that case, we can avoid the 'f[x]rstor' entirely, and just clear the
CR0.TS bit.
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2012-02-19 13:27:00 -08:00
|
|
|
|
|
|
|
|
|
2010-05-06 11:45:46 +03:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2008-03-03 14:12:56 -03:00
|
|
|
|
2008-01-30 13:31:57 +01:00
|
|
|
|
2009-01-19 00:38:58 +09:00
|
|
|
|
2009-01-19 12:21:28 +09:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2009-04-21 23:00:24 +01:00
|
|
|
|
2009-02-08 09:58:39 -05:00
|
|
|
|
|
|
|
|
|
2009-01-19 00:38:58 +09:00
|
|
|
|
2009-03-14 11:19:49 +05:30
|
|
|
|
|
|
|
|
|
2009-02-09 22:17:40 +09:00
|
|
|
|
|
|
|
|
|
2009-09-03 12:27:15 -07:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2009-09-03 14:31:44 -07:00
|
|
|
|
2007-10-11 11:20:03 +02:00
|
|
|
|
2009-02-09 22:17:40 +09:00
|
|
|
|
2008-01-30 13:31:03 +01:00
|
|
|
|
2008-03-10 15:28:04 -07:00
|
|
|
|
2008-03-10 15:28:05 -07:00
|
|
|
|
|
|
|
|
|
2008-01-30 13:31:27 +01:00
|
|
|
|
2009-09-09 19:22:48 +02:00
|
|
|
|
|
|
|
|
|
2008-01-30 13:31:31 +01:00
|
|
|
|
2008-02-21 04:24:40 +01:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2008-01-30 13:31:31 +01:00
|
|
|
|
2008-02-21 04:24:40 +01:00
|
|
|
|
2008-01-30 13:31:31 +01:00
|
|
|
|
2008-02-21 04:24:40 +01:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2008-01-30 13:31:31 +01:00
|
|
|
|
2009-05-04 03:30:15 +04:00
|
|
|
|
2008-02-21 04:24:40 +01:00
|
|
|
|
2009-05-04 03:30:15 +04:00
|
|
|
|
2009-05-04 03:29:52 +04:00
|
|
|
|
2008-02-21 04:24:40 +01:00
|
|
|
|
2009-05-04 03:29:52 +04:00
|
|
|
|
2008-02-21 04:24:40 +01:00
|
|
|
|
2009-09-09 19:22:48 +02:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2010-02-18 18:24:18 +01:00
|
|
|
|
|
|
|
|
|
2008-02-21 04:24:40 +01:00
|
|
|
|
|
|
|
|
|
2012-03-12 14:55:55 +05:30
|
|
|
|
2008-02-21 04:24:40 +01:00
|
|
|
|
2008-03-10 15:28:04 -07:00
|
|
|
|
2010-05-06 11:45:46 +03:00
|
|
|
|
2008-01-30 13:31:31 +01:00
|
|
|
|
2008-02-21 04:24:40 +01:00
|
|
|
|
2008-01-30 13:31:31 +01:00
|
|
|
|
|
|
|
|
|
2008-02-21 04:24:40 +01:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2008-01-30 13:31:31 +01:00
|
|
|
|
2008-02-21 04:24:40 +01:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2008-01-30 13:31:31 +01:00
|
|
|
|
|
|
|
|
|
2008-01-30 13:31:27 +01:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2008-02-21 04:24:40 +01:00
|
|
|
|
2008-03-23 01:03:15 -07:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2008-01-30 13:31:27 +01:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2008-02-21 04:24:40 +01:00
|
|
|
|
|
|
|
|
|
2008-01-30 13:31:31 +01:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2008-02-21 04:24:40 +01:00
|
|
|
|
2008-01-30 13:31:31 +01:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2008-01-30 13:31:27 +01:00
|
|
|
|
2008-01-30 13:32:08 +01:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2008-01-30 13:31:31 +01:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2008-02-21 04:24:40 +01:00
|
|
|
|
|
|
|
|
|
2008-01-30 13:31:27 +01:00
|
|
|
|
2008-03-23 01:03:15 -07:00
|
|
|
|
|
|
|
|
|
2008-01-30 13:31:31 +01:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2008-01-30 13:31:27 +01:00
|
|
|
|
2008-01-30 13:31:27 +01:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2012-05-08 21:22:46 +03:00
|
|
|
|
|
|
|
|
|
2008-01-30 13:31:27 +01:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2010-09-03 21:17:08 -04:00
|
|
|
|
2008-02-21 04:24:40 +01:00
|
|
|
|
2008-01-30 13:31:27 +01:00
|
|
|
|
2012-05-08 21:22:46 +03:00
|
|
|
|
|
|
|
|
|
2008-01-30 13:31:27 +01:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2010-09-03 21:17:08 -04:00
|
|
|
|
2008-02-21 04:24:40 +01:00
|
|
|
|
2008-01-30 13:31:27 +01:00
|
|
|
|
2012-05-08 21:22:46 +03:00
|
|
|
|
|
|
|
|
|
2008-01-30 13:31:27 +01:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2008-01-30 13:31:38 +01:00
|
|
|
|
2008-02-21 04:24:40 +01:00
|
|
|
|
2008-01-30 13:31:38 +01:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2008-01-30 13:31:27 +01:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2008-01-30 13:31:03 +01:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2008-02-21 04:24:40 +01:00
|
|
|
|
2008-01-30 13:31:03 +01:00
|
|
|
|
|
|
|
|
|
2008-02-21 04:24:40 +01:00
|
|
|
|
2008-01-30 13:31:03 +01:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2008-02-21 04:24:40 +01:00
|
|
|
|
2008-01-30 13:31:03 +01:00
|
|
|
|
|
|
|
|
|
2008-02-21 04:24:40 +01:00
|
|
|
|
2008-01-30 13:31:03 +01:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2008-02-21 04:24:40 +01:00
|
|
|
|
2008-01-30 13:31:03 +01:00
|
|
|
|
|
|
|
|
|
2008-02-21 04:24:40 +01:00
|
|
|
|
2008-01-30 13:31:03 +01:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2008-02-21 04:24:40 +01:00
|
|
|
|
2008-01-30 13:31:03 +01:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2008-01-30 13:31:27 +01:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2008-03-23 01:03:15 -07:00
|
|
|
|
2008-01-30 13:31:27 +01:00
|
|
|
|
|
|
|
|
|
2008-02-21 04:24:40 +01:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2009-09-10 02:53:50 +01:00
|
|
|
|
2008-01-30 13:31:27 +01:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2008-02-21 04:24:40 +01:00
|
|
|
|
2012-11-28 11:50:23 -08:00
|
|
|
|
2012-11-28 11:50:30 -08:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2009-09-10 02:53:50 +01:00
|
|
|
|
2008-01-30 13:31:27 +01:00
|
|
|
|
|
|
|
|
|
2008-03-23 01:03:15 -07:00
|
|
|
|
|
|
|
|
|
2008-01-30 13:31:27 +01:00
|
|
|
|
2008-02-21 04:24:40 +01:00
|
|
|
|
2008-03-23 01:03:15 -07:00
|
|
|
|
|
|
|
|
|
2008-01-30 13:31:27 +01:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2008-02-21 04:24:40 +01:00
|
|
|
|
2008-03-23 01:03:15 -07:00
|
|
|
|
|
|
|
|
|
2008-01-30 13:31:27 +01:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2008-04-25 17:39:01 +02:00
|
|
|
|
2008-02-21 04:24:40 +01:00
|
|
|
|
2008-03-23 01:03:15 -07:00
|
|
|
|
|
|
|
|
|
2008-01-30 13:31:27 +01:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2011-04-01 16:59:53 -04:00
|
|
|
|
2008-01-30 13:31:27 +01:00
|
|
|
|
2008-02-21 04:24:40 +01:00
|
|
|
|
2011-04-01 16:59:53 -04:00
|
|
|
|
2008-01-30 13:31:27 +01:00
|
|
|
|
2010-11-03 17:06:14 +01:00
|
|
|
|
2013-02-10 01:38:39 -05:00
|
|
|
|
2010-11-03 17:06:14 +01:00
|
|
|
|
2008-01-30 13:31:39 +01:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2010-05-20 21:04:29 -05:00
|
|
|
|
x86, 64bit: Use a #PF handler to materialize early mappings on demand
Linear mode (CR0.PG = 0) is mutually exclusive with 64-bit mode; all
64-bit code has to use page tables. This makes it awkward before we
have first set up properly all-covering page tables to access objects
that are outside the static kernel range.
So far we have dealt with that simply by mapping a fixed amount of
low memory, but that fails in at least two upcoming use cases:
1. We will support load and run kernel, struct boot_params, ramdisk,
command line, etc. above the 4 GiB mark.
2. need to access ramdisk early to get microcode to update that as
early possible.
We could use early_iomap to access them too, but it will make code to
messy and hard to be unified with 32 bit.
Hence, set up a #PF table and use a fixed number of buffers to set up
page tables on demand. If the buffers fill up then we simply flush
them and start over. These buffers are all in __initdata, so it does
not increase RAM usage at runtime.
Thus, with the help of the #PF handler, we can set the final kernel
mapping from blank, and switch to init_level4_pgt later.
During the switchover in head_64.S, before #PF handler is available,
we use three pages to handle kernel crossing 1G, 512G boundaries with
sharing page by playing games with page aliasing: the same page is
mapped twice in the higher-level tables with appropriate wraparound.
The kernel region itself will be properly mapped; other mappings may
be spurious.
early_make_pgtable is using kernel high mapping address to access pages
to set page table.
-v4: Add phys_base offset to make kexec happy, and add
init_mapping_kernel() - Yinghai
-v5: fix compiling with xen, and add back ident level3 and level2 for xen
also move back init_level4_pgt from BSS to DATA again.
because we have to clear it anyway. - Yinghai
-v6: switch to init_level4_pgt in init_mem_mapping. - Yinghai
-v7: remove not needed clear_page for init_level4_page
it is with fill 512,8,0 already in head_64.S - Yinghai
-v8: we need to keep that handler alive until init_mem_mapping and don't
let early_trap_init to trash that early #PF handler.
So split early_trap_pf_init out and move it down. - Yinghai
-v9: switchover only cover kernel space instead of 1G so could avoid
touch possible mem holes. - Yinghai
-v11: change far jmp back to far return to initial_code, that is needed
to fix failure that is reported by Konrad on AMD systems. - Yinghai
Signed-off-by: Yinghai Lu <yinghai@kernel.org>
Link: http://lkml.kernel.org/r/1359058816-7615-12-git-send-email-yinghai@kernel.org
Signed-off-by: H. Peter Anvin <hpa@linux.intel.com>
2013-01-24 12:19:52 -08:00
|
|
|
|
2010-05-20 21:04:29 -05:00
|
|
|
|
2008-01-30 13:31:39 +01:00
|
|
|
|
2008-02-21 04:24:40 +01:00
|
|
|
|
2008-01-30 13:31:39 +01:00
|
|
|
|
|
|
|
|
|
2009-01-30 17:47:53 +09:00
|
|
|
|
2009-01-30 17:47:54 +09:00
|
|
|
|
2008-01-30 13:31:39 +01:00
|
|
|
|
|
|
|
|
|
2008-12-11 13:49:59 +01:00
|
|
|
|
|
|
|
|
|
2010-03-25 14:51:51 +01:00
|
|
|
|
2008-12-11 13:49:59 +01:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2010-03-25 14:51:51 +01:00
|
|
|
|
2008-12-11 13:49:59 +01:00
|
|
|
|
|
|
|
|
|
2008-03-10 13:11:17 +00:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2012-09-03 15:24:17 +02:00
|
|
|
|
|
|
|
|
|
2008-02-21 04:24:40 +01:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2008-01-30 13:31:39 +01:00
|
|
|
|
2008-02-21 04:24:40 +01:00
|
|
|
|
|
|
|
|
|
2009-05-07 16:54:11 -07:00
|
|
|
|
2008-01-30 13:31:39 +01:00
|
|
|
|
2008-02-21 04:24:40 +01:00
|
|
|
|
2008-01-30 13:31:27 +01:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2008-01-30 13:31:40 +01:00
|
|
|
|
2008-02-21 04:24:40 +01:00
|
|
|
|
|
|
|
|
|
2008-01-30 13:31:40 +01:00
|
|
|
|
2008-02-21 04:24:40 +01:00
|
|
|
|
2008-01-30 13:31:40 +01:00
|
|
|
|
|
|
|
|
|
2008-02-21 04:24:40 +01:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2008-01-30 13:31:40 +01:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2008-02-21 04:24:40 +01:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2008-01-30 13:31:40 +01:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2008-02-21 04:24:40 +01:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2008-01-30 13:31:57 +01:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2008-02-21 04:24:40 +01:00
|
|
|
|
2009-02-20 23:32:28 +01:00
|
|
|
|
2008-02-21 04:24:40 +01:00
|
|
|
|
|
|
|
|
|
2008-01-30 13:31:57 +01:00
|
|
|
|
2008-02-21 04:24:40 +01:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2008-01-30 13:31:57 +01:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2008-02-21 04:24:40 +01:00
|
|
|
|
|
|
|
|
|
2008-01-30 13:31:57 +01:00
|
|
|
|
2008-02-21 04:24:40 +01:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2008-01-30 13:31:57 +01:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
tree-wide: fix comment/printk typos
"gadget", "through", "command", "maintain", "maintain", "controller", "address",
"between", "initiali[zs]e", "instead", "function", "select", "already",
"equal", "access", "management", "hierarchy", "registration", "interest",
"relative", "memory", "offset", "already",
Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
Signed-off-by: Jiri Kosina <jkosina@suse.cz>
2010-11-01 15:38:34 -04:00
|
|
|
|
2008-01-30 13:31:57 +01:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2008-02-21 04:24:40 +01:00
|
|
|
|
2008-01-30 13:31:57 +01:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2009-02-20 23:32:28 +01:00
|
|
|
|
2008-01-30 13:31:57 +01:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2008-02-21 04:24:40 +01:00
|
|
|
|
|
|
|
|
|
2008-01-30 13:31:57 +01:00
|
|
|
|
2012-02-06 13:03:09 -08:00
|
|
|
|
2009-02-20 23:32:28 +01:00
|
|
|
|
2012-02-06 13:03:09 -08:00
|
|
|
|
2009-02-20 23:32:28 +01:00
|
|
|
|
2008-01-30 13:31:57 +01:00
|
|
|
|
2008-02-08 04:19:26 -08:00
|
|
|
|
2009-02-20 23:32:28 +01:00
|
|
|
|
2008-02-08 04:19:26 -08:00
|
|
|
|
2008-01-30 13:31:57 +01:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2008-02-21 04:24:40 +01:00
|
|
|
|
2008-01-30 13:31:57 +01:00
|
|
|
|
2008-02-21 04:24:40 +01:00
|
|
|
|
2009-11-03 10:22:40 +01:00
|
|
|
|
2012-02-14 13:49:48 -08:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2008-01-30 13:31:57 +01:00
|
|
|
|
|
|
|
|
|
2008-02-21 05:18:40 +01:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2008-02-21 04:24:40 +01:00
|
|
|
|
|
|
|
|
|
2008-01-30 13:31:27 +01:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2008-02-21 04:24:40 +01:00
|
|
|
|
2008-01-30 13:31:27 +01:00
|
|
|
|
2008-04-14 00:24:18 +02:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2012-11-27 14:32:10 +08:00
|
|
|
|
2009-09-16 11:33:40 +02:00
|
|
|
|
2009-09-02 11:49:52 +02:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2012-03-28 18:11:12 +01:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2013-02-09 23:08:07 -05:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2012-03-28 18:11:12 +01:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2008-10-22 22:26:29 -07:00
|
|
|
|