License cleanup: add SPDX GPL-2.0 license identifier to files with no license
Many source files in the tree are missing licensing information, which
makes it harder for compliance tools to determine the correct license.
By default all files without license information are under the default
license of the kernel, which is GPL version 2.
Update the files which contain no license information with the 'GPL-2.0'
SPDX license identifier. The SPDX identifier is a legally binding
shorthand, which can be used instead of the full boiler plate text.
This patch is based on work done by Thomas Gleixner and Kate Stewart and
Philippe Ombredanne.
How this work was done:
Patches were generated and checked against linux-4.14-rc6 for a subset of
the use cases:
- file had no licensing information it it.
- file was a */uapi/* one with no licensing information in it,
- file was a */uapi/* one with existing licensing information,
Further patches will be generated in subsequent months to fix up cases
where non-standard license headers were used, and references to license
had to be inferred by heuristics based on keywords.
The analysis to determine which SPDX License Identifier to be applied to
a file was done in a spreadsheet of side by side results from of the
output of two independent scanners (ScanCode & Windriver) producing SPDX
tag:value files created by Philippe Ombredanne. Philippe prepared the
base worksheet, and did an initial spot review of a few 1000 files.
The 4.13 kernel was the starting point of the analysis with 60,537 files
assessed. Kate Stewart did a file by file comparison of the scanner
results in the spreadsheet to determine which SPDX license identifier(s)
to be applied to the file. She confirmed any determination that was not
immediately clear with lawyers working with the Linux Foundation.
Criteria used to select files for SPDX license identifier tagging was:
- Files considered eligible had to be source code files.
- Make and config files were included as candidates if they contained >5
lines of source
- File already had some variant of a license header in it (even if <5
lines).
All documentation files were explicitly excluded.
The following heuristics were used to determine which SPDX license
identifiers to apply.
- when both scanners couldn't find any license traces, file was
considered to have no license information in it, and the top level
COPYING file license applied.
For non */uapi/* files that summary was:
SPDX license identifier # files
---------------------------------------------------|-------
GPL-2.0 11139
and resulted in the first patch in this series.
If that file was a */uapi/* path one, it was "GPL-2.0 WITH
Linux-syscall-note" otherwise it was "GPL-2.0". Results of that was:
SPDX license identifier # files
---------------------------------------------------|-------
GPL-2.0 WITH Linux-syscall-note 930
and resulted in the second patch in this series.
- if a file had some form of licensing information in it, and was one
of the */uapi/* ones, it was denoted with the Linux-syscall-note if
any GPL family license was found in the file or had no licensing in
it (per prior point). Results summary:
SPDX license identifier # files
---------------------------------------------------|------
GPL-2.0 WITH Linux-syscall-note 270
GPL-2.0+ WITH Linux-syscall-note 169
((GPL-2.0 WITH Linux-syscall-note) OR BSD-2-Clause) 21
((GPL-2.0 WITH Linux-syscall-note) OR BSD-3-Clause) 17
LGPL-2.1+ WITH Linux-syscall-note 15
GPL-1.0+ WITH Linux-syscall-note 14
((GPL-2.0+ WITH Linux-syscall-note) OR BSD-3-Clause) 5
LGPL-2.0+ WITH Linux-syscall-note 4
LGPL-2.1 WITH Linux-syscall-note 3
((GPL-2.0 WITH Linux-syscall-note) OR MIT) 3
((GPL-2.0 WITH Linux-syscall-note) AND MIT) 1
and that resulted in the third patch in this series.
- when the two scanners agreed on the detected license(s), that became
the concluded license(s).
- when there was disagreement between the two scanners (one detected a
license but the other didn't, or they both detected different
licenses) a manual inspection of the file occurred.
- In most cases a manual inspection of the information in the file
resulted in a clear resolution of the license that should apply (and
which scanner probably needed to revisit its heuristics).
- When it was not immediately clear, the license identifier was
confirmed with lawyers working with the Linux Foundation.
- If there was any question as to the appropriate license identifier,
the file was flagged for further research and to be revisited later
in time.
In total, over 70 hours of logged manual review was done on the
spreadsheet to determine the SPDX license identifiers to apply to the
source files by Kate, Philippe, Thomas and, in some cases, confirmation
by lawyers working with the Linux Foundation.
Kate also obtained a third independent scan of the 4.13 code base from
FOSSology, and compared selected files where the other two scanners
disagreed against that SPDX file, to see if there was new insights. The
Windriver scanner is based on an older version of FOSSology in part, so
they are related.
Thomas did random spot checks in about 500 files from the spreadsheets
for the uapi headers and agreed with SPDX license identifier in the
files he inspected. For the non-uapi files Thomas did random spot checks
in about 15000 files.
In initial set of patches against 4.14-rc6, 3 files were found to have
copy/paste license identifier errors, and have been fixed to reflect the
correct identifier.
Additionally Philippe spent 10 hours this week doing a detailed manual
inspection and review of the 12,461 patched files from the initial patch
version early this week with:
- a full scancode scan run, collecting the matched texts, detected
license ids and scores
- reviewing anything where there was a license detected (about 500+
files) to ensure that the applied SPDX license was correct
- reviewing anything where there was no detection but the patch license
was not GPL-2.0 WITH Linux-syscall-note to ensure that the applied
SPDX license was correct
This produced a worksheet with 20 files needing minor correction. This
worksheet was then exported into 3 different .csv files for the
different types of files to be modified.
These .csv files were then reviewed by Greg. Thomas wrote a script to
parse the csv files and add the proper SPDX tag to the file, in the
format that the file expected. This script was further refined by Greg
based on the output to detect more types of files automatically and to
distinguish between header and source .c files (which need different
comment types.) Finally Greg ran the script using the .csv files to
generate the patches.
Reviewed-by: Kate Stewart <kstewart@linuxfoundation.org>
Reviewed-by: Philippe Ombredanne <pombredanne@nexb.com>
Reviewed-by: Thomas Gleixner <tglx@linutronix.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2017-11-01 17:07:57 +03:00
|
|
|
/* SPDX-License-Identifier: GPL-2.0 */
|
2005-09-22 05:50:51 +04:00
|
|
|
/* arch/sparc64/kernel/ktlb.S: Kernel mapping TLB miss handling.
|
|
|
|
*
|
2008-01-11 08:10:54 +03:00
|
|
|
* Copyright (C) 1995, 1997, 2005, 2008 David S. Miller <davem@davemloft.net>
|
2005-09-22 05:50:51 +04:00
|
|
|
* Copyright (C) 1996 Eddie C. Dost (ecd@brainaid.de)
|
|
|
|
* Copyright (C) 1996 Miguel de Icaza (miguel@nuclecu.unam.mx)
|
|
|
|
* Copyright (C) 1996,98,99 Jakub Jelinek (jj@sunsite.mff.cuni.cz)
|
2006-02-01 05:29:18 +03:00
|
|
|
*/
|
2005-09-22 05:50:51 +04:00
|
|
|
|
2020-06-09 07:32:42 +03:00
|
|
|
#include <linux/pgtable.h>
|
2005-09-22 05:50:51 +04:00
|
|
|
#include <asm/head.h>
|
|
|
|
#include <asm/asi.h>
|
|
|
|
#include <asm/page.h>
|
2006-02-01 05:29:18 +03:00
|
|
|
#include <asm/tsb.h>
|
2005-09-22 05:50:51 +04:00
|
|
|
|
|
|
|
.text
|
|
|
|
.align 32
|
|
|
|
|
2006-02-01 05:29:18 +03:00
|
|
|
kvmap_itlb:
|
|
|
|
/* g6: TAG TARGET */
|
|
|
|
mov TLB_TAG_ACCESS, %g4
|
|
|
|
ldxa [%g4] ASI_IMMU, %g4
|
|
|
|
|
2016-07-28 03:50:26 +03:00
|
|
|
/* The kernel executes in context zero, therefore we do not
|
|
|
|
* need to clear the context ID bits out of %g4 here.
|
|
|
|
*/
|
|
|
|
|
2006-02-07 10:44:37 +03:00
|
|
|
/* sun4v_itlb_miss branches here with the missing virtual
|
|
|
|
* address already loaded into %g4
|
|
|
|
*/
|
|
|
|
kvmap_itlb_4v:
|
|
|
|
|
2006-02-01 05:29:18 +03:00
|
|
|
/* Catch kernel NULL pointer calls. */
|
|
|
|
sethi %hi(PAGE_SIZE), %g5
|
|
|
|
cmp %g4, %g5
|
2013-08-02 19:23:18 +04:00
|
|
|
blu,pn %xcc, kvmap_itlb_longpath
|
2006-02-01 05:29:18 +03:00
|
|
|
nop
|
|
|
|
|
|
|
|
KERN_TSB_LOOKUP_TL1(%g4, %g6, %g5, %g1, %g2, %g3, kvmap_itlb_load)
|
|
|
|
|
|
|
|
kvmap_itlb_tsb_miss:
|
2005-09-22 05:50:51 +04:00
|
|
|
sethi %hi(LOW_OBP_ADDRESS), %g5
|
|
|
|
cmp %g4, %g5
|
2006-02-01 05:29:18 +03:00
|
|
|
blu,pn %xcc, kvmap_itlb_vmalloc_addr
|
2005-09-22 05:50:51 +04:00
|
|
|
mov 0x1, %g5
|
|
|
|
sllx %g5, 32, %g5
|
|
|
|
cmp %g4, %g5
|
2006-02-01 05:29:18 +03:00
|
|
|
blu,pn %xcc, kvmap_itlb_obp
|
2005-09-22 05:50:51 +04:00
|
|
|
nop
|
|
|
|
|
2006-02-01 05:29:18 +03:00
|
|
|
kvmap_itlb_vmalloc_addr:
|
|
|
|
KERN_PGTABLE_WALK(%g4, %g5, %g2, kvmap_itlb_longpath)
|
|
|
|
|
2011-08-05 11:53:57 +04:00
|
|
|
TSB_LOCK_TAG(%g1, %g2, %g7)
|
|
|
|
TSB_WRITE(%g1, %g5, %g6)
|
2006-02-01 05:29:18 +03:00
|
|
|
|
|
|
|
/* fallthrough to TLB load */
|
|
|
|
|
|
|
|
kvmap_itlb_load:
|
2006-02-11 23:21:20 +03:00
|
|
|
|
|
|
|
661: stxa %g5, [%g0] ASI_ITLB_DATA_IN
|
2005-09-22 05:50:51 +04:00
|
|
|
retry
|
2006-02-11 23:21:20 +03:00
|
|
|
.section .sun4v_2insn_patch, "ax"
|
|
|
|
.word 661b
|
|
|
|
nop
|
|
|
|
nop
|
|
|
|
.previous
|
|
|
|
|
|
|
|
/* For sun4v the ASI_ITLB_DATA_IN store and the retry
|
|
|
|
* instruction get nop'd out and we get here to branch
|
|
|
|
* to the sun4v tlb load code. The registers are setup
|
|
|
|
* as follows:
|
|
|
|
*
|
|
|
|
* %g4: vaddr
|
|
|
|
* %g5: PTE
|
|
|
|
* %g6: TAG
|
|
|
|
*
|
|
|
|
* The sun4v TLB load wants the PTE in %g3 so we fix that
|
|
|
|
* up here.
|
|
|
|
*/
|
|
|
|
ba,pt %xcc, sun4v_itlb_load
|
|
|
|
mov %g5, %g3
|
2005-09-22 05:50:51 +04:00
|
|
|
|
2006-02-01 05:29:18 +03:00
|
|
|
kvmap_itlb_longpath:
|
2006-02-06 09:27:28 +03:00
|
|
|
|
|
|
|
661: rdpr %pstate, %g5
|
2006-02-01 05:29:18 +03:00
|
|
|
wrpr %g5, PSTATE_AG | PSTATE_MG, %pstate
|
2006-02-07 11:00:16 +03:00
|
|
|
.section .sun4v_2insn_patch, "ax"
|
2006-02-06 09:27:28 +03:00
|
|
|
.word 661b
|
2006-02-19 03:36:39 +03:00
|
|
|
SET_GL(1)
|
2006-02-06 09:27:28 +03:00
|
|
|
nop
|
|
|
|
.previous
|
|
|
|
|
2006-02-01 05:29:18 +03:00
|
|
|
rdpr %tpc, %g5
|
|
|
|
ba,pt %xcc, sparc64_realfault_common
|
|
|
|
mov FAULT_CODE_ITLB, %g4
|
|
|
|
|
|
|
|
kvmap_itlb_obp:
|
|
|
|
OBP_TRANS_LOOKUP(%g4, %g5, %g2, %g3, kvmap_itlb_longpath)
|
|
|
|
|
2011-08-05 11:53:57 +04:00
|
|
|
TSB_LOCK_TAG(%g1, %g2, %g7)
|
2006-02-01 05:29:18 +03:00
|
|
|
|
2011-08-05 11:53:57 +04:00
|
|
|
TSB_WRITE(%g1, %g5, %g6)
|
2006-02-01 05:29:18 +03:00
|
|
|
|
|
|
|
ba,pt %xcc, kvmap_itlb_load
|
|
|
|
nop
|
|
|
|
|
|
|
|
kvmap_dtlb_obp:
|
|
|
|
OBP_TRANS_LOOKUP(%g4, %g5, %g2, %g3, kvmap_dtlb_longpath)
|
|
|
|
|
2011-08-05 11:53:57 +04:00
|
|
|
TSB_LOCK_TAG(%g1, %g2, %g7)
|
2006-02-01 05:29:18 +03:00
|
|
|
|
2011-08-05 11:53:57 +04:00
|
|
|
TSB_WRITE(%g1, %g5, %g6)
|
2006-02-01 05:29:18 +03:00
|
|
|
|
|
|
|
ba,pt %xcc, kvmap_dtlb_load
|
|
|
|
nop
|
2005-10-12 23:22:46 +04:00
|
|
|
|
sparc64: Fix physical memory management regressions with large max_phys_bits.
If max_phys_bits needs to be > 43 (f.e. for T4 chips), things like
DEBUG_PAGEALLOC stop working because the 3-level page tables only
can cover up to 43 bits.
Another problem is that when we increased MAX_PHYS_ADDRESS_BITS up to
47, several statically allocated tables became enormous.
Compounding this is that we will need to support up to 49 bits of
physical addressing for M7 chips.
The two tables in question are sparc64_valid_addr_bitmap and
kpte_linear_bitmap.
The first holds a bitmap, with 1 bit for each 4MB chunk of physical
memory, indicating whether that chunk actually exists in the machine
and is valid.
The second table is a set of 2-bit values which tell how large of a
mapping (4MB, 256MB, 2GB, 16GB, respectively) we can use at each 256MB
chunk of ram in the system.
These tables are huge and take up an enormous amount of the BSS
section of the sparc64 kernel image. Specifically, the
sparc64_valid_addr_bitmap is 4MB, and the kpte_linear_bitmap is 128K.
So let's solve the space wastage and the DEBUG_PAGEALLOC problem
at the same time, by using the kernel page tables (as designed) to
manage this information.
We have to keep using large mappings when DEBUG_PAGEALLOC is disabled,
and we do this by encoding huge PMDs and PUDs.
On a T4-2 with 256GB of ram the kernel page table takes up 16K with
DEBUG_PAGEALLOC disabled and 256MB with it enabled. Furthermore, this
memory is dynamically allocated at run time rather than coded
statically into the kernel image.
Signed-off-by: David S. Miller <davem@davemloft.net>
Acked-by: Bob Picco <bob.picco@oracle.com>
2014-09-25 07:56:11 +04:00
|
|
|
kvmap_linear_early:
|
|
|
|
sethi %hi(kern_linear_pte_xor), %g7
|
|
|
|
ldx [%g7 + %lo(kern_linear_pte_xor)], %g2
|
|
|
|
ba,pt %xcc, kvmap_dtlb_tsb4m_load
|
|
|
|
xor %g2, %g4, %g5
|
|
|
|
|
2005-09-22 05:50:51 +04:00
|
|
|
.align 32
|
2006-02-22 09:31:11 +03:00
|
|
|
kvmap_dtlb_tsb4m_load:
|
2011-08-05 11:53:57 +04:00
|
|
|
TSB_LOCK_TAG(%g1, %g2, %g7)
|
|
|
|
TSB_WRITE(%g1, %g5, %g6)
|
2006-02-22 09:31:11 +03:00
|
|
|
ba,pt %xcc, kvmap_dtlb_load
|
|
|
|
nop
|
|
|
|
|
2006-02-01 05:29:18 +03:00
|
|
|
kvmap_dtlb:
|
|
|
|
/* %g6: TAG TARGET */
|
|
|
|
mov TLB_TAG_ACCESS, %g4
|
|
|
|
ldxa [%g4] ASI_DMMU, %g4
|
2006-02-07 10:44:37 +03:00
|
|
|
|
2016-07-28 03:50:26 +03:00
|
|
|
/* The kernel executes in context zero, therefore we do not
|
|
|
|
* need to clear the context ID bits out of %g4 here.
|
|
|
|
*/
|
|
|
|
|
2006-02-07 10:44:37 +03:00
|
|
|
/* sun4v_dtlb_miss branches here with the missing virtual
|
|
|
|
* address already loaded into %g4
|
|
|
|
*/
|
|
|
|
kvmap_dtlb_4v:
|
2006-02-01 05:29:18 +03:00
|
|
|
brgez,pn %g4, kvmap_dtlb_nonlinear
|
2005-09-26 03:46:57 +04:00
|
|
|
nop
|
|
|
|
|
2007-03-17 03:20:28 +03:00
|
|
|
#ifdef CONFIG_DEBUG_PAGEALLOC
|
|
|
|
/* Index through the base page size TSB even for linear
|
|
|
|
* mappings when using page allocation debugging.
|
|
|
|
*/
|
|
|
|
KERN_TSB_LOOKUP_TL1(%g4, %g6, %g5, %g1, %g2, %g3, kvmap_dtlb_load)
|
|
|
|
#else
|
2006-02-22 09:31:11 +03:00
|
|
|
/* Correct TAG_TARGET is already in %g6, check 4mb TSB. */
|
|
|
|
KERN_TSB4M_LOOKUP_TL1(%g6, %g5, %g1, %g2, %g3, kvmap_dtlb_load)
|
2007-03-17 03:20:28 +03:00
|
|
|
#endif
|
sparc64: Fix physical memory management regressions with large max_phys_bits.
If max_phys_bits needs to be > 43 (f.e. for T4 chips), things like
DEBUG_PAGEALLOC stop working because the 3-level page tables only
can cover up to 43 bits.
Another problem is that when we increased MAX_PHYS_ADDRESS_BITS up to
47, several statically allocated tables became enormous.
Compounding this is that we will need to support up to 49 bits of
physical addressing for M7 chips.
The two tables in question are sparc64_valid_addr_bitmap and
kpte_linear_bitmap.
The first holds a bitmap, with 1 bit for each 4MB chunk of physical
memory, indicating whether that chunk actually exists in the machine
and is valid.
The second table is a set of 2-bit values which tell how large of a
mapping (4MB, 256MB, 2GB, 16GB, respectively) we can use at each 256MB
chunk of ram in the system.
These tables are huge and take up an enormous amount of the BSS
section of the sparc64 kernel image. Specifically, the
sparc64_valid_addr_bitmap is 4MB, and the kpte_linear_bitmap is 128K.
So let's solve the space wastage and the DEBUG_PAGEALLOC problem
at the same time, by using the kernel page tables (as designed) to
manage this information.
We have to keep using large mappings when DEBUG_PAGEALLOC is disabled,
and we do this by encoding huge PMDs and PUDs.
On a T4-2 with 256GB of ram the kernel page table takes up 16K with
DEBUG_PAGEALLOC disabled and 256MB with it enabled. Furthermore, this
memory is dynamically allocated at run time rather than coded
statically into the kernel image.
Signed-off-by: David S. Miller <davem@davemloft.net>
Acked-by: Bob Picco <bob.picco@oracle.com>
2014-09-25 07:56:11 +04:00
|
|
|
/* Linear mapping TSB lookup failed. Fallthrough to kernel
|
|
|
|
* page table based lookup.
|
2006-02-22 07:51:13 +03:00
|
|
|
*/
|
2005-09-26 03:46:57 +04:00
|
|
|
.globl kvmap_linear_patch
|
|
|
|
kvmap_linear_patch:
|
sparc64: Fix physical memory management regressions with large max_phys_bits.
If max_phys_bits needs to be > 43 (f.e. for T4 chips), things like
DEBUG_PAGEALLOC stop working because the 3-level page tables only
can cover up to 43 bits.
Another problem is that when we increased MAX_PHYS_ADDRESS_BITS up to
47, several statically allocated tables became enormous.
Compounding this is that we will need to support up to 49 bits of
physical addressing for M7 chips.
The two tables in question are sparc64_valid_addr_bitmap and
kpte_linear_bitmap.
The first holds a bitmap, with 1 bit for each 4MB chunk of physical
memory, indicating whether that chunk actually exists in the machine
and is valid.
The second table is a set of 2-bit values which tell how large of a
mapping (4MB, 256MB, 2GB, 16GB, respectively) we can use at each 256MB
chunk of ram in the system.
These tables are huge and take up an enormous amount of the BSS
section of the sparc64 kernel image. Specifically, the
sparc64_valid_addr_bitmap is 4MB, and the kpte_linear_bitmap is 128K.
So let's solve the space wastage and the DEBUG_PAGEALLOC problem
at the same time, by using the kernel page tables (as designed) to
manage this information.
We have to keep using large mappings when DEBUG_PAGEALLOC is disabled,
and we do this by encoding huge PMDs and PUDs.
On a T4-2 with 256GB of ram the kernel page table takes up 16K with
DEBUG_PAGEALLOC disabled and 256MB with it enabled. Furthermore, this
memory is dynamically allocated at run time rather than coded
statically into the kernel image.
Signed-off-by: David S. Miller <davem@davemloft.net>
Acked-by: Bob Picco <bob.picco@oracle.com>
2014-09-25 07:56:11 +04:00
|
|
|
ba,a,pt %xcc, kvmap_linear_early
|
2005-09-22 05:50:51 +04:00
|
|
|
|
2006-02-01 05:29:18 +03:00
|
|
|
kvmap_dtlb_vmalloc_addr:
|
|
|
|
KERN_PGTABLE_WALK(%g4, %g5, %g2, kvmap_dtlb_longpath)
|
|
|
|
|
2011-08-05 11:53:57 +04:00
|
|
|
TSB_LOCK_TAG(%g1, %g2, %g7)
|
|
|
|
TSB_WRITE(%g1, %g5, %g6)
|
2006-02-01 05:29:18 +03:00
|
|
|
|
|
|
|
/* fallthrough to TLB load */
|
|
|
|
|
|
|
|
kvmap_dtlb_load:
|
2006-02-11 23:21:20 +03:00
|
|
|
|
|
|
|
661: stxa %g5, [%g0] ASI_DTLB_DATA_IN ! Reload TLB
|
2006-02-01 05:29:18 +03:00
|
|
|
retry
|
2006-02-11 23:21:20 +03:00
|
|
|
.section .sun4v_2insn_patch, "ax"
|
|
|
|
.word 661b
|
|
|
|
nop
|
|
|
|
nop
|
|
|
|
.previous
|
|
|
|
|
|
|
|
/* For sun4v the ASI_DTLB_DATA_IN store and the retry
|
|
|
|
* instruction get nop'd out and we get here to branch
|
|
|
|
* to the sun4v tlb load code. The registers are setup
|
|
|
|
* as follows:
|
|
|
|
*
|
|
|
|
* %g4: vaddr
|
|
|
|
* %g5: PTE
|
|
|
|
* %g6: TAG
|
|
|
|
*
|
|
|
|
* The sun4v TLB load wants the PTE in %g3 so we fix that
|
|
|
|
* up here.
|
|
|
|
*/
|
|
|
|
ba,pt %xcc, sun4v_dtlb_load
|
|
|
|
mov %g5, %g3
|
2006-02-01 05:29:18 +03:00
|
|
|
|
2008-01-11 08:10:54 +03:00
|
|
|
#ifdef CONFIG_SPARSEMEM_VMEMMAP
|
2007-10-16 12:24:16 +04:00
|
|
|
kvmap_vmemmap:
|
2014-09-25 08:20:14 +04:00
|
|
|
KERN_PGTABLE_WALK(%g4, %g5, %g2, kvmap_dtlb_longpath)
|
|
|
|
ba,a,pt %xcc, kvmap_dtlb_load
|
2008-01-11 08:10:54 +03:00
|
|
|
#endif
|
2007-10-16 12:24:16 +04:00
|
|
|
|
2006-02-01 05:29:18 +03:00
|
|
|
kvmap_dtlb_nonlinear:
|
|
|
|
/* Catch kernel NULL pointer derefs. */
|
|
|
|
sethi %hi(PAGE_SIZE), %g5
|
|
|
|
cmp %g4, %g5
|
|
|
|
bleu,pn %xcc, kvmap_dtlb_longpath
|
2005-09-26 03:46:57 +04:00
|
|
|
nop
|
|
|
|
|
2008-01-11 08:10:54 +03:00
|
|
|
#ifdef CONFIG_SPARSEMEM_VMEMMAP
|
2007-10-16 12:24:16 +04:00
|
|
|
/* Do not use the TSB for vmemmap. */
|
2014-09-27 22:05:21 +04:00
|
|
|
sethi %hi(VMEMMAP_BASE), %g5
|
|
|
|
ldx [%g5 + %lo(VMEMMAP_BASE)], %g5
|
2007-10-16 12:24:16 +04:00
|
|
|
cmp %g4,%g5
|
|
|
|
bgeu,pn %xcc, kvmap_vmemmap
|
|
|
|
nop
|
2008-01-11 08:10:54 +03:00
|
|
|
#endif
|
2007-10-16 12:24:16 +04:00
|
|
|
|
2006-02-01 05:29:18 +03:00
|
|
|
KERN_TSB_LOOKUP_TL1(%g4, %g6, %g5, %g1, %g2, %g3, kvmap_dtlb_load)
|
|
|
|
|
|
|
|
kvmap_dtlb_tsbmiss:
|
2005-09-22 05:50:51 +04:00
|
|
|
sethi %hi(MODULES_VADDR), %g5
|
|
|
|
cmp %g4, %g5
|
2006-02-01 05:29:18 +03:00
|
|
|
blu,pn %xcc, kvmap_dtlb_longpath
|
2014-09-27 22:05:21 +04:00
|
|
|
sethi %hi(VMALLOC_END), %g5
|
|
|
|
ldx [%g5 + %lo(VMALLOC_END)], %g5
|
2005-09-22 05:50:51 +04:00
|
|
|
cmp %g4, %g5
|
2006-02-01 05:29:18 +03:00
|
|
|
bgeu,pn %xcc, kvmap_dtlb_longpath
|
2005-09-22 05:50:51 +04:00
|
|
|
nop
|
|
|
|
|
|
|
|
kvmap_check_obp:
|
|
|
|
sethi %hi(LOW_OBP_ADDRESS), %g5
|
|
|
|
cmp %g4, %g5
|
2006-02-01 05:29:18 +03:00
|
|
|
blu,pn %xcc, kvmap_dtlb_vmalloc_addr
|
2005-09-22 05:50:51 +04:00
|
|
|
mov 0x1, %g5
|
|
|
|
sllx %g5, 32, %g5
|
|
|
|
cmp %g4, %g5
|
2006-02-01 05:29:18 +03:00
|
|
|
blu,pn %xcc, kvmap_dtlb_obp
|
2005-09-22 05:50:51 +04:00
|
|
|
nop
|
2006-02-01 05:29:18 +03:00
|
|
|
ba,pt %xcc, kvmap_dtlb_vmalloc_addr
|
2005-09-22 05:50:51 +04:00
|
|
|
nop
|
|
|
|
|
2006-02-01 05:29:18 +03:00
|
|
|
kvmap_dtlb_longpath:
|
2006-02-06 09:27:28 +03:00
|
|
|
|
|
|
|
661: rdpr %pstate, %g5
|
2006-02-01 05:29:18 +03:00
|
|
|
wrpr %g5, PSTATE_AG | PSTATE_MG, %pstate
|
2006-02-07 11:00:16 +03:00
|
|
|
.section .sun4v_2insn_patch, "ax"
|
2006-02-06 09:27:28 +03:00
|
|
|
.word 661b
|
2006-02-18 05:01:02 +03:00
|
|
|
SET_GL(1)
|
|
|
|
ldxa [%g0] ASI_SCRATCHPAD, %g5
|
2006-02-06 09:27:28 +03:00
|
|
|
.previous
|
|
|
|
|
2006-02-11 23:21:20 +03:00
|
|
|
rdpr %tl, %g3
|
|
|
|
cmp %g3, 1
|
|
|
|
|
|
|
|
661: mov TLB_TAG_ACCESS, %g4
|
2006-02-01 05:29:18 +03:00
|
|
|
ldxa [%g4] ASI_DMMU, %g5
|
2006-02-11 23:21:20 +03:00
|
|
|
.section .sun4v_2insn_patch, "ax"
|
|
|
|
.word 661b
|
2006-02-18 05:01:02 +03:00
|
|
|
ldx [%g5 + HV_FAULT_D_ADDR_OFFSET], %g5
|
2006-02-11 23:21:20 +03:00
|
|
|
nop
|
|
|
|
.previous
|
|
|
|
|
2016-07-28 03:50:26 +03:00
|
|
|
/* The kernel executes in context zero, therefore we do not
|
|
|
|
* need to clear the context ID bits out of %g5 here.
|
|
|
|
*/
|
|
|
|
|
2006-02-01 05:29:18 +03:00
|
|
|
be,pt %xcc, sparc64_realfault_common
|
|
|
|
mov FAULT_CODE_DTLB, %g4
|
|
|
|
ba,pt %xcc, winfix_trampoline
|
|
|
|
nop
|