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 22:07:57 +08:00
|
|
|
// SPDX-License-Identifier: GPL-2.0
|
2011-06-28 17:54:48 +08:00
|
|
|
/*
|
|
|
|
* PPC Huge TLB Page Support for Book3E MMU
|
|
|
|
*
|
|
|
|
* Copyright (C) 2009 David Gibson, IBM Corporation.
|
|
|
|
* Copyright (C) 2011 Becky Bruce, Freescale Semiconductor
|
|
|
|
*
|
|
|
|
*/
|
|
|
|
#include <linux/mm.h>
|
|
|
|
#include <linux/hugetlb.h>
|
|
|
|
|
2016-03-03 12:51:04 +08:00
|
|
|
#include <asm/mmu.h>
|
|
|
|
|
2013-10-12 08:22:39 +08:00
|
|
|
#ifdef CONFIG_PPC_FSL_BOOK3E
|
|
|
|
#ifdef CONFIG_PPC64
|
|
|
|
static inline int tlb1_next(void)
|
|
|
|
{
|
|
|
|
struct paca_struct *paca = get_paca();
|
|
|
|
struct tlb_core_data *tcd;
|
|
|
|
int this, next;
|
|
|
|
|
|
|
|
tcd = paca->tcd_ptr;
|
|
|
|
this = tcd->esel_next;
|
|
|
|
|
|
|
|
next = this + 1;
|
|
|
|
if (next >= tcd->esel_max)
|
|
|
|
next = tcd->esel_first;
|
|
|
|
|
|
|
|
tcd->esel_next = next;
|
|
|
|
return this;
|
|
|
|
}
|
|
|
|
#else
|
|
|
|
static inline int tlb1_next(void)
|
|
|
|
{
|
|
|
|
int index, ncams;
|
|
|
|
|
|
|
|
ncams = mfspr(SPRN_TLB1CFG) & TLBnCFG_N_ENTRY;
|
|
|
|
|
powerpc: Replace __get_cpu_var uses
This still has not been merged and now powerpc is the only arch that does
not have this change. Sorry about missing linuxppc-dev before.
V2->V2
- Fix up to work against 3.18-rc1
__get_cpu_var() is used for multiple purposes in the kernel source. One of
them is address calculation via the form &__get_cpu_var(x). This calculates
the address for the instance of the percpu variable of the current processor
based on an offset.
Other use cases are for storing and retrieving data from the current
processors percpu area. __get_cpu_var() can be used as an lvalue when
writing data or on the right side of an assignment.
__get_cpu_var() is defined as :
__get_cpu_var() always only does an address determination. However, store
and retrieve operations could use a segment prefix (or global register on
other platforms) to avoid the address calculation.
this_cpu_write() and this_cpu_read() can directly take an offset into a
percpu area and use optimized assembly code to read and write per cpu
variables.
This patch converts __get_cpu_var into either an explicit address
calculation using this_cpu_ptr() or into a use of this_cpu operations that
use the offset. Thereby address calculations are avoided and less registers
are used when code is generated.
At the end of the patch set all uses of __get_cpu_var have been removed so
the macro is removed too.
The patch set includes passes over all arches as well. Once these operations
are used throughout then specialized macros can be defined in non -x86
arches as well in order to optimize per cpu access by f.e. using a global
register that may be set to the per cpu base.
Transformations done to __get_cpu_var()
1. Determine the address of the percpu instance of the current processor.
DEFINE_PER_CPU(int, y);
int *x = &__get_cpu_var(y);
Converts to
int *x = this_cpu_ptr(&y);
2. Same as #1 but this time an array structure is involved.
DEFINE_PER_CPU(int, y[20]);
int *x = __get_cpu_var(y);
Converts to
int *x = this_cpu_ptr(y);
3. Retrieve the content of the current processors instance of a per cpu
variable.
DEFINE_PER_CPU(int, y);
int x = __get_cpu_var(y)
Converts to
int x = __this_cpu_read(y);
4. Retrieve the content of a percpu struct
DEFINE_PER_CPU(struct mystruct, y);
struct mystruct x = __get_cpu_var(y);
Converts to
memcpy(&x, this_cpu_ptr(&y), sizeof(x));
5. Assignment to a per cpu variable
DEFINE_PER_CPU(int, y)
__get_cpu_var(y) = x;
Converts to
__this_cpu_write(y, x);
6. Increment/Decrement etc of a per cpu variable
DEFINE_PER_CPU(int, y);
__get_cpu_var(y)++
Converts to
__this_cpu_inc(y)
Cc: Benjamin Herrenschmidt <benh@kernel.crashing.org>
CC: Paul Mackerras <paulus@samba.org>
Signed-off-by: Christoph Lameter <cl@linux.com>
[mpe: Fix build errors caused by set/or_softirq_pending(), and rework
assignment in __set_breakpoint() to use memcpy().]
Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
2014-10-22 04:23:25 +08:00
|
|
|
index = this_cpu_read(next_tlbcam_idx);
|
2013-10-12 08:22:39 +08:00
|
|
|
|
|
|
|
/* Just round-robin the entries and wrap when we hit the end */
|
|
|
|
if (unlikely(index == ncams - 1))
|
powerpc: Replace __get_cpu_var uses
This still has not been merged and now powerpc is the only arch that does
not have this change. Sorry about missing linuxppc-dev before.
V2->V2
- Fix up to work against 3.18-rc1
__get_cpu_var() is used for multiple purposes in the kernel source. One of
them is address calculation via the form &__get_cpu_var(x). This calculates
the address for the instance of the percpu variable of the current processor
based on an offset.
Other use cases are for storing and retrieving data from the current
processors percpu area. __get_cpu_var() can be used as an lvalue when
writing data or on the right side of an assignment.
__get_cpu_var() is defined as :
__get_cpu_var() always only does an address determination. However, store
and retrieve operations could use a segment prefix (or global register on
other platforms) to avoid the address calculation.
this_cpu_write() and this_cpu_read() can directly take an offset into a
percpu area and use optimized assembly code to read and write per cpu
variables.
This patch converts __get_cpu_var into either an explicit address
calculation using this_cpu_ptr() or into a use of this_cpu operations that
use the offset. Thereby address calculations are avoided and less registers
are used when code is generated.
At the end of the patch set all uses of __get_cpu_var have been removed so
the macro is removed too.
The patch set includes passes over all arches as well. Once these operations
are used throughout then specialized macros can be defined in non -x86
arches as well in order to optimize per cpu access by f.e. using a global
register that may be set to the per cpu base.
Transformations done to __get_cpu_var()
1. Determine the address of the percpu instance of the current processor.
DEFINE_PER_CPU(int, y);
int *x = &__get_cpu_var(y);
Converts to
int *x = this_cpu_ptr(&y);
2. Same as #1 but this time an array structure is involved.
DEFINE_PER_CPU(int, y[20]);
int *x = __get_cpu_var(y);
Converts to
int *x = this_cpu_ptr(y);
3. Retrieve the content of the current processors instance of a per cpu
variable.
DEFINE_PER_CPU(int, y);
int x = __get_cpu_var(y)
Converts to
int x = __this_cpu_read(y);
4. Retrieve the content of a percpu struct
DEFINE_PER_CPU(struct mystruct, y);
struct mystruct x = __get_cpu_var(y);
Converts to
memcpy(&x, this_cpu_ptr(&y), sizeof(x));
5. Assignment to a per cpu variable
DEFINE_PER_CPU(int, y)
__get_cpu_var(y) = x;
Converts to
__this_cpu_write(y, x);
6. Increment/Decrement etc of a per cpu variable
DEFINE_PER_CPU(int, y);
__get_cpu_var(y)++
Converts to
__this_cpu_inc(y)
Cc: Benjamin Herrenschmidt <benh@kernel.crashing.org>
CC: Paul Mackerras <paulus@samba.org>
Signed-off-by: Christoph Lameter <cl@linux.com>
[mpe: Fix build errors caused by set/or_softirq_pending(), and rework
assignment in __set_breakpoint() to use memcpy().]
Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
2014-10-22 04:23:25 +08:00
|
|
|
__this_cpu_write(next_tlbcam_idx, tlbcam_index);
|
2013-10-12 08:22:39 +08:00
|
|
|
else
|
powerpc: Replace __get_cpu_var uses
This still has not been merged and now powerpc is the only arch that does
not have this change. Sorry about missing linuxppc-dev before.
V2->V2
- Fix up to work against 3.18-rc1
__get_cpu_var() is used for multiple purposes in the kernel source. One of
them is address calculation via the form &__get_cpu_var(x). This calculates
the address for the instance of the percpu variable of the current processor
based on an offset.
Other use cases are for storing and retrieving data from the current
processors percpu area. __get_cpu_var() can be used as an lvalue when
writing data or on the right side of an assignment.
__get_cpu_var() is defined as :
__get_cpu_var() always only does an address determination. However, store
and retrieve operations could use a segment prefix (or global register on
other platforms) to avoid the address calculation.
this_cpu_write() and this_cpu_read() can directly take an offset into a
percpu area and use optimized assembly code to read and write per cpu
variables.
This patch converts __get_cpu_var into either an explicit address
calculation using this_cpu_ptr() or into a use of this_cpu operations that
use the offset. Thereby address calculations are avoided and less registers
are used when code is generated.
At the end of the patch set all uses of __get_cpu_var have been removed so
the macro is removed too.
The patch set includes passes over all arches as well. Once these operations
are used throughout then specialized macros can be defined in non -x86
arches as well in order to optimize per cpu access by f.e. using a global
register that may be set to the per cpu base.
Transformations done to __get_cpu_var()
1. Determine the address of the percpu instance of the current processor.
DEFINE_PER_CPU(int, y);
int *x = &__get_cpu_var(y);
Converts to
int *x = this_cpu_ptr(&y);
2. Same as #1 but this time an array structure is involved.
DEFINE_PER_CPU(int, y[20]);
int *x = __get_cpu_var(y);
Converts to
int *x = this_cpu_ptr(y);
3. Retrieve the content of the current processors instance of a per cpu
variable.
DEFINE_PER_CPU(int, y);
int x = __get_cpu_var(y)
Converts to
int x = __this_cpu_read(y);
4. Retrieve the content of a percpu struct
DEFINE_PER_CPU(struct mystruct, y);
struct mystruct x = __get_cpu_var(y);
Converts to
memcpy(&x, this_cpu_ptr(&y), sizeof(x));
5. Assignment to a per cpu variable
DEFINE_PER_CPU(int, y)
__get_cpu_var(y) = x;
Converts to
__this_cpu_write(y, x);
6. Increment/Decrement etc of a per cpu variable
DEFINE_PER_CPU(int, y);
__get_cpu_var(y)++
Converts to
__this_cpu_inc(y)
Cc: Benjamin Herrenschmidt <benh@kernel.crashing.org>
CC: Paul Mackerras <paulus@samba.org>
Signed-off-by: Christoph Lameter <cl@linux.com>
[mpe: Fix build errors caused by set/or_softirq_pending(), and rework
assignment in __set_breakpoint() to use memcpy().]
Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
2014-10-22 04:23:25 +08:00
|
|
|
__this_cpu_inc(next_tlbcam_idx);
|
2013-10-12 08:22:39 +08:00
|
|
|
|
|
|
|
return index;
|
|
|
|
}
|
|
|
|
#endif /* !PPC64 */
|
|
|
|
#endif /* FSL */
|
|
|
|
|
2011-06-28 17:54:48 +08:00
|
|
|
static inline int mmu_get_tsize(int psize)
|
|
|
|
{
|
|
|
|
return mmu_psize_defs[psize].enc;
|
|
|
|
}
|
|
|
|
|
2015-12-05 06:31:13 +08:00
|
|
|
#if defined(CONFIG_PPC_FSL_BOOK3E) && defined(CONFIG_PPC64)
|
|
|
|
#include <asm/paca.h>
|
|
|
|
|
|
|
|
static inline void book3e_tlb_lock(void)
|
|
|
|
{
|
|
|
|
struct paca_struct *paca = get_paca();
|
|
|
|
unsigned long tmp;
|
|
|
|
int token = smp_processor_id() + 1;
|
|
|
|
|
2016-03-03 12:51:04 +08:00
|
|
|
/*
|
|
|
|
* Besides being unnecessary in the absence of SMT, this
|
|
|
|
* check prevents trying to do lbarx/stbcx. on e5500 which
|
|
|
|
* doesn't implement either feature.
|
|
|
|
*/
|
|
|
|
if (!cpu_has_feature(CPU_FTR_SMT))
|
|
|
|
return;
|
|
|
|
|
2015-12-05 06:31:13 +08:00
|
|
|
asm volatile("1: lbarx %0, 0, %1;"
|
|
|
|
"cmpwi %0, 0;"
|
|
|
|
"bne 2f;"
|
|
|
|
"stbcx. %2, 0, %1;"
|
|
|
|
"bne 1b;"
|
|
|
|
"b 3f;"
|
|
|
|
"2: lbzx %0, 0, %1;"
|
|
|
|
"cmpwi %0, 0;"
|
|
|
|
"bne 2b;"
|
|
|
|
"b 1b;"
|
|
|
|
"3:"
|
|
|
|
: "=&r" (tmp)
|
|
|
|
: "r" (&paca->tcd_ptr->lock), "r" (token)
|
|
|
|
: "memory");
|
|
|
|
}
|
|
|
|
|
|
|
|
static inline void book3e_tlb_unlock(void)
|
|
|
|
{
|
|
|
|
struct paca_struct *paca = get_paca();
|
|
|
|
|
2016-03-03 12:51:04 +08:00
|
|
|
if (!cpu_has_feature(CPU_FTR_SMT))
|
|
|
|
return;
|
|
|
|
|
2015-12-05 06:31:13 +08:00
|
|
|
isync();
|
|
|
|
paca->tcd_ptr->lock = 0;
|
|
|
|
}
|
|
|
|
#else
|
|
|
|
static inline void book3e_tlb_lock(void)
|
|
|
|
{
|
|
|
|
}
|
|
|
|
|
|
|
|
static inline void book3e_tlb_unlock(void)
|
|
|
|
{
|
|
|
|
}
|
|
|
|
#endif
|
|
|
|
|
2011-06-28 17:54:48 +08:00
|
|
|
static inline int book3e_tlb_exists(unsigned long ea, unsigned long pid)
|
|
|
|
{
|
|
|
|
int found = 0;
|
|
|
|
|
|
|
|
mtspr(SPRN_MAS6, pid << 16);
|
|
|
|
if (mmu_has_feature(MMU_FTR_USE_TLBRSRV)) {
|
|
|
|
asm volatile(
|
|
|
|
"li %0,0\n"
|
|
|
|
"tlbsx. 0,%1\n"
|
|
|
|
"bne 1f\n"
|
|
|
|
"li %0,1\n"
|
|
|
|
"1:\n"
|
|
|
|
: "=&r"(found) : "r"(ea));
|
|
|
|
} else {
|
|
|
|
asm volatile(
|
|
|
|
"tlbsx 0,%1\n"
|
|
|
|
"mfspr %0,0x271\n"
|
|
|
|
"srwi %0,%0,31\n"
|
|
|
|
: "=&r"(found) : "r"(ea));
|
|
|
|
}
|
|
|
|
|
|
|
|
return found;
|
|
|
|
}
|
|
|
|
|
2011-11-28 22:43:33 +08:00
|
|
|
void book3e_hugetlb_preload(struct vm_area_struct *vma, unsigned long ea,
|
|
|
|
pte_t pte)
|
2011-06-28 17:54:48 +08:00
|
|
|
{
|
|
|
|
unsigned long mas1, mas2;
|
|
|
|
u64 mas7_3;
|
|
|
|
unsigned long psize, tsize, shift;
|
|
|
|
unsigned long flags;
|
2011-11-28 22:43:33 +08:00
|
|
|
struct mm_struct *mm;
|
2011-06-28 17:54:48 +08:00
|
|
|
|
|
|
|
#ifdef CONFIG_PPC_FSL_BOOK3E
|
2013-10-12 08:22:39 +08:00
|
|
|
int index;
|
2011-06-28 17:54:48 +08:00
|
|
|
#endif
|
|
|
|
|
|
|
|
if (unlikely(is_kernel_addr(ea)))
|
|
|
|
return;
|
|
|
|
|
2011-11-28 22:43:33 +08:00
|
|
|
mm = vma->vm_mm;
|
|
|
|
|
|
|
|
psize = vma_mmu_pagesize(vma);
|
2011-10-10 18:50:38 +08:00
|
|
|
shift = __ilog2(psize);
|
|
|
|
tsize = shift - 10;
|
2011-06-28 17:54:48 +08:00
|
|
|
/*
|
|
|
|
* We can't be interrupted while we're setting up the MAS
|
|
|
|
* regusters or after we've confirmed that no tlb exists.
|
|
|
|
*/
|
|
|
|
local_irq_save(flags);
|
|
|
|
|
2015-12-05 06:31:13 +08:00
|
|
|
book3e_tlb_lock();
|
|
|
|
|
2011-06-28 17:54:48 +08:00
|
|
|
if (unlikely(book3e_tlb_exists(ea, mm->context.id))) {
|
2015-12-05 06:31:13 +08:00
|
|
|
book3e_tlb_unlock();
|
2011-06-28 17:54:48 +08:00
|
|
|
local_irq_restore(flags);
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
|
|
|
|
#ifdef CONFIG_PPC_FSL_BOOK3E
|
|
|
|
/* We have to use the CAM(TLB1) on FSL parts for hugepages */
|
2013-10-12 08:22:39 +08:00
|
|
|
index = tlb1_next();
|
2011-06-28 17:54:48 +08:00
|
|
|
mtspr(SPRN_MAS0, MAS0_ESEL(index) | MAS0_TLBSEL(1));
|
|
|
|
#endif
|
2013-10-12 08:22:39 +08:00
|
|
|
|
2011-06-28 17:54:48 +08:00
|
|
|
mas1 = MAS1_VALID | MAS1_TID(mm->context.id) | MAS1_TSIZE(tsize);
|
|
|
|
mas2 = ea & ~((1UL << shift) - 1);
|
|
|
|
mas2 |= (pte_val(pte) >> PTE_WIMGE_SHIFT) & MAS2_WIMGE_MASK;
|
|
|
|
mas7_3 = (u64)pte_pfn(pte) << PAGE_SHIFT;
|
|
|
|
mas7_3 |= (pte_val(pte) >> PTE_BAP_SHIFT) & MAS3_BAP_MASK;
|
|
|
|
if (!pte_dirty(pte))
|
|
|
|
mas7_3 &= ~(MAS3_SW|MAS3_UW);
|
|
|
|
|
|
|
|
mtspr(SPRN_MAS1, mas1);
|
|
|
|
mtspr(SPRN_MAS2, mas2);
|
|
|
|
|
|
|
|
if (mmu_has_feature(MMU_FTR_USE_PAIRED_MAS)) {
|
|
|
|
mtspr(SPRN_MAS7_MAS3, mas7_3);
|
|
|
|
} else {
|
2013-12-24 15:12:03 +08:00
|
|
|
if (mmu_has_feature(MMU_FTR_BIG_PHYS))
|
|
|
|
mtspr(SPRN_MAS7, upper_32_bits(mas7_3));
|
2011-06-28 17:54:48 +08:00
|
|
|
mtspr(SPRN_MAS3, lower_32_bits(mas7_3));
|
|
|
|
}
|
|
|
|
|
|
|
|
asm volatile ("tlbwe");
|
|
|
|
|
2015-12-05 06:31:13 +08:00
|
|
|
book3e_tlb_unlock();
|
2011-06-28 17:54:48 +08:00
|
|
|
local_irq_restore(flags);
|
|
|
|
}
|
|
|
|
|
|
|
|
void flush_hugetlb_page(struct vm_area_struct *vma, unsigned long vmaddr)
|
|
|
|
{
|
|
|
|
struct hstate *hstate = hstate_file(vma->vm_file);
|
|
|
|
unsigned long tsize = huge_page_shift(hstate) - 10;
|
|
|
|
|
2013-11-22 08:26:42 +08:00
|
|
|
__flush_tlb_page(vma->vm_mm, vmaddr, tsize, 0);
|
2011-06-28 17:54:48 +08:00
|
|
|
}
|