LKML Archive on lore.kernel.org
help / color / mirror / Atom feed
* [RFC PATCH] x86/apic: Drop superfluous apic_phys
@ 2020-03-13 6:37 Cao jin
2020-03-13 9:09 ` Cao jin
0 siblings, 1 reply; 4+ messages in thread
From: Cao jin @ 2020-03-13 6:37 UTC (permalink / raw)
To: x86, linux-kernel; +Cc: tglx, mingo, bp, hpa
apic_phys seems having totally the same meaning as mp_lapic_addr,
except it is static, replace it.
Signed-off-by: Cao jin <caoj.fnst@cn.fujitsu.com>
---
Not sure if there is still any corner case, but it boots fine.
arch/x86/kernel/apic/apic.c | 14 +++++---------
1 file changed, 5 insertions(+), 9 deletions(-)
diff --git a/arch/x86/kernel/apic/apic.c b/arch/x86/kernel/apic/apic.c
index 5f973fed3c9f..5b7b59951421 100644
--- a/arch/x86/kernel/apic/apic.c
+++ b/arch/x86/kernel/apic/apic.c
@@ -199,8 +199,6 @@ unsigned int lapic_timer_period = 0;
static void apic_pm_activate(void);
-static unsigned long apic_phys __ro_after_init;
-
/*
* Get the LAPIC version
*/
@@ -1170,7 +1168,7 @@ void clear_local_APIC(void)
u32 v;
/* APIC hasn't been mapped yet */
- if (!x2apic_mode && !apic_phys)
+ if (!x2apic_mode && !mp_lapic_addr)
return;
maxlvt = lapic_get_maxlvt();
@@ -1261,7 +1259,7 @@ void apic_soft_disable(void)
void disable_local_APIC(void)
{
/* APIC hasn't been mapped yet */
- if (!x2apic_mode && !apic_phys)
+ if (!x2apic_mode && !mp_lapic_addr)
return;
apic_soft_disable();
@@ -2111,14 +2109,12 @@ void __init init_apic_mappings(void)
pr_info("APIC: disable apic facility\n");
apic_disable();
} else {
- apic_phys = mp_lapic_addr;
-
/*
* If the system has ACPI MADT tables or MP info, the LAPIC
* address is already registered.
*/
if (!acpi_lapic && !smp_found_config)
- register_lapic_address(apic_phys);
+ register_lapic_address(mp_lapic_addr);
}
/*
@@ -2874,11 +2870,11 @@ early_param("apic", apic_set_verbosity);
static int __init lapic_insert_resource(void)
{
- if (!apic_phys)
+ if (!mp_lapic_addr)
return -1;
/* Put local APIC into the resource map. */
- lapic_resource.start = apic_phys;
+ lapic_resource.start = mp_lapic_addr;
lapic_resource.end = lapic_resource.start + PAGE_SIZE - 1;
insert_resource(&iomem_resource, &lapic_resource);
--
2.21.1
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [RFC PATCH] x86/apic: Drop superfluous apic_phys
2020-03-13 6:37 [RFC PATCH] x86/apic: Drop superfluous apic_phys Cao jin
@ 2020-03-13 9:09 ` Cao jin
0 siblings, 0 replies; 4+ messages in thread
From: Cao jin @ 2020-03-13 9:09 UTC (permalink / raw)
To: x86, linux-kernel; +Cc: tglx, mingo, bp, hpa
Sorry I sent the same mail 3 times, seems my address is kicked out of the mail
list, again. I thought my mail server has problems again... Please use this
thread.
^ permalink raw reply [flat|nested] 4+ messages in thread
* [RFC PATCH] x86/apic: Drop superfluous apic_phys
@ 2020-03-12 7:10 Cao jin
0 siblings, 0 replies; 4+ messages in thread
From: Cao jin @ 2020-03-12 7:10 UTC (permalink / raw)
To: x86, linux-kernel; +Cc: tglx, mingo, bp, hpa
apic_phys seems having totally the same meaning as mp_lapic_addr, except it is
static, replace it.
Signed-off-by: Cao jin <caoj.fnst@cn.fujitsu.com>
---
Not sure if there is still any corner case, but it boots fine.
arch/x86/kernel/apic/apic.c | 14 +++++---------
1 file changed, 5 insertions(+), 9 deletions(-)
diff --git a/arch/x86/kernel/apic/apic.c b/arch/x86/kernel/apic/apic.c
index 5f973fed3c9f..5b7b59951421 100644
--- a/arch/x86/kernel/apic/apic.c
+++ b/arch/x86/kernel/apic/apic.c
@@ -199,8 +199,6 @@ unsigned int lapic_timer_period = 0;
static void apic_pm_activate(void);
-static unsigned long apic_phys __ro_after_init;
-
/*
* Get the LAPIC version
*/
@@ -1170,7 +1168,7 @@ void clear_local_APIC(void)
u32 v;
/* APIC hasn't been mapped yet */
- if (!x2apic_mode && !apic_phys)
+ if (!x2apic_mode && !mp_lapic_addr)
return;
maxlvt = lapic_get_maxlvt();
@@ -1261,7 +1259,7 @@ void apic_soft_disable(void)
void disable_local_APIC(void)
{
/* APIC hasn't been mapped yet */
- if (!x2apic_mode && !apic_phys)
+ if (!x2apic_mode && !mp_lapic_addr)
return;
apic_soft_disable();
@@ -2111,14 +2109,12 @@ void __init init_apic_mappings(void)
pr_info("APIC: disable apic facility\n");
apic_disable();
} else {
- apic_phys = mp_lapic_addr;
-
/*
* If the system has ACPI MADT tables or MP info, the LAPIC
* address is already registered.
*/
if (!acpi_lapic && !smp_found_config)
- register_lapic_address(apic_phys);
+ register_lapic_address(mp_lapic_addr);
}
/*
@@ -2874,11 +2870,11 @@ early_param("apic", apic_set_verbosity);
static int __init lapic_insert_resource(void)
{
- if (!apic_phys)
+ if (!mp_lapic_addr)
return -1;
/* Put local APIC into the resource map. */
- lapic_resource.start = apic_phys;
+ lapic_resource.start = mp_lapic_addr;
lapic_resource.end = lapic_resource.start + PAGE_SIZE - 1;
insert_resource(&iomem_resource, &lapic_resource);
--
2.21.1
^ permalink raw reply [flat|nested] 4+ messages in thread
* [RFC PATCH] x86/apic: Drop superfluous apic_phys
@ 2020-03-12 5:38 Cao jin
0 siblings, 0 replies; 4+ messages in thread
From: Cao jin @ 2020-03-12 5:38 UTC (permalink / raw)
To: x86, linux-kernel; +Cc: tglx, mingo, bp, hpa
apic_phys seems having totally the same meaning as mp_lapic_addr, except it is
static, replace it.
Signed-off-by: Cao jin <caoj.fnst@cn.fujitsu.com>
---
Not sure if there is still any corner case, but it boots fine.
arch/x86/kernel/apic/apic.c | 14 +++++---------
1 file changed, 5 insertions(+), 9 deletions(-)
diff --git a/arch/x86/kernel/apic/apic.c b/arch/x86/kernel/apic/apic.c
index 5f973fed3c9f..5b7b59951421 100644
--- a/arch/x86/kernel/apic/apic.c
+++ b/arch/x86/kernel/apic/apic.c
@@ -199,8 +199,6 @@ unsigned int lapic_timer_period = 0;
static void apic_pm_activate(void);
-static unsigned long apic_phys __ro_after_init;
-
/*
* Get the LAPIC version
*/
@@ -1170,7 +1168,7 @@ void clear_local_APIC(void)
u32 v;
/* APIC hasn't been mapped yet */
- if (!x2apic_mode && !apic_phys)
+ if (!x2apic_mode && !mp_lapic_addr)
return;
maxlvt = lapic_get_maxlvt();
@@ -1261,7 +1259,7 @@ void apic_soft_disable(void)
void disable_local_APIC(void)
{
/* APIC hasn't been mapped yet */
- if (!x2apic_mode && !apic_phys)
+ if (!x2apic_mode && !mp_lapic_addr)
return;
apic_soft_disable();
@@ -2111,14 +2109,12 @@ void __init init_apic_mappings(void)
pr_info("APIC: disable apic facility\n");
apic_disable();
} else {
- apic_phys = mp_lapic_addr;
-
/*
* If the system has ACPI MADT tables or MP info, the LAPIC
* address is already registered.
*/
if (!acpi_lapic && !smp_found_config)
- register_lapic_address(apic_phys);
+ register_lapic_address(mp_lapic_addr);
}
/*
@@ -2874,11 +2870,11 @@ early_param("apic", apic_set_verbosity);
static int __init lapic_insert_resource(void)
{
- if (!apic_phys)
+ if (!mp_lapic_addr)
return -1;
/* Put local APIC into the resource map. */
- lapic_resource.start = apic_phys;
+ lapic_resource.start = mp_lapic_addr;
lapic_resource.end = lapic_resource.start + PAGE_SIZE - 1;
insert_resource(&iomem_resource, &lapic_resource);
--
2.21.1
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2020-03-13 9:09 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-03-13 6:37 [RFC PATCH] x86/apic: Drop superfluous apic_phys Cao jin
2020-03-13 9:09 ` Cao jin
-- strict thread matches above, loose matches on Subject: below --
2020-03-12 7:10 Cao jin
2020-03-12 5:38 Cao jin
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).