Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
openeuler
raspberrypi-kernel
提交
2ec077c1
R
raspberrypi-kernel
项目概览
openeuler
/
raspberrypi-kernel
通知
13
Star
1
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
R
raspberrypi-kernel
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
提交
2ec077c1
编写于
12月 17, 2017
作者:
I
Ingo Molnar
浏览文件
操作
浏览文件
下载
差异文件
Merge branch 'upstream-acpi-fixes' into WIP.x86/pti.base
Signed-off-by:
N
Ingo Molnar
<
mingo@kernel.org
>
上级
650400b2
4f89fa28
变更
3
隐藏空白更改
内联
并排
Showing
3 changed file
with
33 addition
and
58 deletion
+33
-58
arch/arm64/include/asm/fixmap.h
arch/arm64/include/asm/fixmap.h
+7
-0
arch/x86/include/asm/fixmap.h
arch/x86/include/asm/fixmap.h
+6
-0
drivers/acpi/apei/ghes.c
drivers/acpi/apei/ghes.c
+20
-58
未找到文件。
arch/arm64/include/asm/fixmap.h
浏览文件 @
2ec077c1
...
...
@@ -51,6 +51,13 @@ enum fixed_addresses {
FIX_EARLYCON_MEM_BASE
,
FIX_TEXT_POKE0
,
#ifdef CONFIG_ACPI_APEI_GHES
/* Used for GHES mapping from assorted contexts */
FIX_APEI_GHES_IRQ
,
FIX_APEI_GHES_NMI
,
#endif
/* CONFIG_ACPI_APEI_GHES */
__end_of_permanent_fixed_addresses
,
/*
...
...
arch/x86/include/asm/fixmap.h
浏览文件 @
2ec077c1
...
...
@@ -104,6 +104,12 @@ enum fixed_addresses {
FIX_GDT_REMAP_BEGIN
,
FIX_GDT_REMAP_END
=
FIX_GDT_REMAP_BEGIN
+
NR_CPUS
-
1
,
#ifdef CONFIG_ACPI_APEI_GHES
/* Used for GHES mapping from assorted contexts */
FIX_APEI_GHES_IRQ
,
FIX_APEI_GHES_NMI
,
#endif
__end_of_permanent_fixed_addresses
,
/*
...
...
drivers/acpi/apei/ghes.c
浏览文件 @
2ec077c1
...
...
@@ -51,6 +51,7 @@
#include <acpi/actbl1.h>
#include <acpi/ghes.h>
#include <acpi/apei.h>
#include <asm/fixmap.h>
#include <asm/tlbflush.h>
#include <ras/ras_event.h>
...
...
@@ -112,7 +113,7 @@ static DEFINE_MUTEX(ghes_list_mutex);
* Because the memory area used to transfer hardware error information
* from BIOS to Linux can be determined only in NMI, IRQ or timer
* handler, but general ioremap can not be used in atomic context, so
*
a special version of atomic ioremap is implemented for that
.
*
the fixmap is used instead
.
*/
/*
...
...
@@ -126,8 +127,8 @@ static DEFINE_MUTEX(ghes_list_mutex);
/* virtual memory area for atomic ioremap */
static
struct
vm_struct
*
ghes_ioremap_area
;
/*
* These 2 spinlock
is used to prevent atomic ioremap virtual memory
*
area from being mapped
simultaneously.
* These 2 spinlock
s are used to prevent the fixmap entries from being used
* simultaneously.
*/
static
DEFINE_RAW_SPINLOCK
(
ghes_ioremap_lock_nmi
);
static
DEFINE_SPINLOCK
(
ghes_ioremap_lock_irq
);
...
...
@@ -159,52 +160,36 @@ static void ghes_ioremap_exit(void)
static
void
__iomem
*
ghes_ioremap_pfn_nmi
(
u64
pfn
)
{
unsigned
long
vaddr
;
phys_addr_t
paddr
;
pgprot_t
prot
;
vaddr
=
(
unsigned
long
)
GHES_IOREMAP_NMI_PAGE
(
ghes_ioremap_area
->
addr
);
paddr
=
pfn
<<
PAGE_SHIFT
;
prot
=
arch_apei_get_mem_attribute
(
paddr
);
ioremap_page_range
(
vaddr
,
vaddr
+
PAGE_SIZE
,
paddr
,
prot
);
__set_fixmap
(
FIX_APEI_GHES_NMI
,
paddr
,
prot
);
return
(
void
__iomem
*
)
vaddr
;
return
(
void
__iomem
*
)
fix_to_virt
(
FIX_APEI_GHES_NMI
)
;
}
static
void
__iomem
*
ghes_ioremap_pfn_irq
(
u64
pfn
)
{
unsigned
long
vaddr
,
paddr
;
phys_addr_t
paddr
;
pgprot_t
prot
;
vaddr
=
(
unsigned
long
)
GHES_IOREMAP_IRQ_PAGE
(
ghes_ioremap_area
->
addr
);
paddr
=
pfn
<<
PAGE_SHIFT
;
prot
=
arch_apei_get_mem_attribute
(
paddr
);
__set_fixmap
(
FIX_APEI_GHES_IRQ
,
paddr
,
prot
);
ioremap_page_range
(
vaddr
,
vaddr
+
PAGE_SIZE
,
paddr
,
prot
);
return
(
void
__iomem
*
)
vaddr
;
return
(
void
__iomem
*
)
fix_to_virt
(
FIX_APEI_GHES_IRQ
);
}
static
void
ghes_iounmap_nmi
(
void
__iomem
*
vaddr_ptr
)
static
void
ghes_iounmap_nmi
(
void
)
{
unsigned
long
vaddr
=
(
unsigned
long
__force
)
vaddr_ptr
;
void
*
base
=
ghes_ioremap_area
->
addr
;
BUG_ON
(
vaddr
!=
(
unsigned
long
)
GHES_IOREMAP_NMI_PAGE
(
base
));
unmap_kernel_range_noflush
(
vaddr
,
PAGE_SIZE
);
arch_apei_flush_tlb_one
(
vaddr
);
clear_fixmap
(
FIX_APEI_GHES_NMI
);
}
static
void
ghes_iounmap_irq
(
void
__iomem
*
vaddr_ptr
)
static
void
ghes_iounmap_irq
(
void
)
{
unsigned
long
vaddr
=
(
unsigned
long
__force
)
vaddr_ptr
;
void
*
base
=
ghes_ioremap_area
->
addr
;
BUG_ON
(
vaddr
!=
(
unsigned
long
)
GHES_IOREMAP_IRQ_PAGE
(
base
));
unmap_kernel_range_noflush
(
vaddr
,
PAGE_SIZE
);
arch_apei_flush_tlb_one
(
vaddr
);
clear_fixmap
(
FIX_APEI_GHES_IRQ
);
}
static
int
ghes_estatus_pool_init
(
void
)
...
...
@@ -360,10 +345,10 @@ static void ghes_copy_tofrom_phys(void *buffer, u64 paddr, u32 len,
paddr
+=
trunk
;
buffer
+=
trunk
;
if
(
in_nmi
)
{
ghes_iounmap_nmi
(
vaddr
);
ghes_iounmap_nmi
();
raw_spin_unlock
(
&
ghes_ioremap_lock_nmi
);
}
else
{
ghes_iounmap_irq
(
vaddr
);
ghes_iounmap_irq
();
spin_unlock_irqrestore
(
&
ghes_ioremap_lock_irq
,
flags
);
}
}
...
...
@@ -851,17 +836,8 @@ static void ghes_sea_remove(struct ghes *ghes)
synchronize_rcu
();
}
#else
/* CONFIG_ACPI_APEI_SEA */
static
inline
void
ghes_sea_add
(
struct
ghes
*
ghes
)
{
pr_err
(
GHES_PFX
"ID: %d, trying to add SEA notification which is not supported
\n
"
,
ghes
->
generic
->
header
.
source_id
);
}
static
inline
void
ghes_sea_remove
(
struct
ghes
*
ghes
)
{
pr_err
(
GHES_PFX
"ID: %d, trying to remove SEA notification which is not supported
\n
"
,
ghes
->
generic
->
header
.
source_id
);
}
static
inline
void
ghes_sea_add
(
struct
ghes
*
ghes
)
{
}
static
inline
void
ghes_sea_remove
(
struct
ghes
*
ghes
)
{
}
#endif
/* CONFIG_ACPI_APEI_SEA */
#ifdef CONFIG_HAVE_ACPI_APEI_NMI
...
...
@@ -1063,23 +1039,9 @@ static void ghes_nmi_init_cxt(void)
init_irq_work
(
&
ghes_proc_irq_work
,
ghes_proc_in_irq
);
}
#else
/* CONFIG_HAVE_ACPI_APEI_NMI */
static
inline
void
ghes_nmi_add
(
struct
ghes
*
ghes
)
{
pr_err
(
GHES_PFX
"ID: %d, trying to add NMI notification which is not supported!
\n
"
,
ghes
->
generic
->
header
.
source_id
);
BUG
();
}
static
inline
void
ghes_nmi_remove
(
struct
ghes
*
ghes
)
{
pr_err
(
GHES_PFX
"ID: %d, trying to remove NMI notification which is not supported!
\n
"
,
ghes
->
generic
->
header
.
source_id
);
BUG
();
}
static
inline
void
ghes_nmi_init_cxt
(
void
)
{
}
static
inline
void
ghes_nmi_add
(
struct
ghes
*
ghes
)
{
}
static
inline
void
ghes_nmi_remove
(
struct
ghes
*
ghes
)
{
}
static
inline
void
ghes_nmi_init_cxt
(
void
)
{
}
#endif
/* CONFIG_HAVE_ACPI_APEI_NMI */
static
int
ghes_probe
(
struct
platform_device
*
ghes_dev
)
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录