Re: [PATCH] x86: let 32bit use apic_ops too - fix

Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]
From: Suresh Siddha
Date: Tuesday, July 15, 2008 - 10:33 am

On Sun, Jul 13, 2008 at 10:19:35PM -0700, Yinghai Lu wrote:

Yinghai, Looking more closely at this, based on my understanding this might be
wrong for VMI. Correct patch should be as follows. Any comments?

thanks,
suresh
---
Fix VMI apic_ops.

Signed-off-by: Suresh Siddha <suresh.b.siddha@intel.com>
---

diff --git a/arch/x86/kernel/apic_32.c b/arch/x86/kernel/apic_32.c
index b1375fa..3410196 100644
--- a/arch/x86/kernel/apic_32.c
+++ b/arch/x86/kernel/apic_32.c
@@ -145,6 +145,11 @@ static int modern_apic(void)
 	return lapic_get_version() >= 0x14;
 }
 
+/*
+ * Paravirt kernels also might be using these below ops. So we still
+ * use generic apic_read()/apic_write(), which might be pointing to different
+ * ops in PARAVIRT case.
+ */
 void xapic_wait_icr_idle(void)
 {
 	while (apic_read(APIC_ICR) & APIC_ICR_BUSY)
diff --git a/arch/x86/kernel/vmi_32.c b/arch/x86/kernel/vmi_32.c
index cf30743..d6897e4 100644
--- a/arch/x86/kernel/vmi_32.c
+++ b/arch/x86/kernel/vmi_32.c
@@ -676,50 +676,6 @@ static inline int __init probe_vmi_rom(void)
 	return 0;
 }
 
-#ifdef CONFIG_X86_LOCAL_APIC
-static u32 vmi_apic_read(u32 reg)
-{
-	return 0;
-}
-
-static void vmi_apic_write(u32 reg, u32 val)
-{
-	/* Warn to see if there's any stray references */
-	WARN_ON(1);
-}
-
-static u64 vmi_apic_icr_read(void)
-{
-	return 0;
-}
-
-static void vmi_apic_icr_write(u32 low, u32 id)
-{
-	/* Warn to see if there's any stray references */
-	WARN_ON(1);
-}
-
-static void vmi_apic_wait_icr_idle(void)
-{
-	return;
-}
-
-static u32 vmi_safe_apic_wait_icr_idle(void)
-{
-	return 0;
-}
-
-static struct apic_ops vmi_basic_apic_ops = {
-        .read = vmi_apic_read,
-        .write = vmi_apic_write,
-        .write_atomic = vmi_apic_write,
-        .icr_read = vmi_apic_icr_read,
-        .icr_write = vmi_apic_icr_write,
-        .wait_icr_idle = vmi_apic_wait_icr_idle,
-        .safe_wait_icr_idle = vmi_safe_apic_wait_icr_idle,
-};
-#endif
-
 /*
  * VMI setup common to all processors
  */
@@ -948,10 +904,9 @@ static inline int __init activate_vmi(void)
 #endif
 
 #ifdef CONFIG_X86_LOCAL_APIC
-	para_fill(vmi_basic_apic_ops.read, APICRead);
-	para_fill(vmi_basic_apic_ops.write, APICWrite);
-	para_fill(vmi_basic_apic_ops.write_atomic, APICWrite);
-	apic_ops = &vmi_basic_apic_ops;
+	para_fill(apic_ops->read, APICRead);
+	para_fill(apic_ops->write, APICWrite);
+	para_fill(apic_ops->write_atomic, APICWrite);
 #endif
 
 	/*
--
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]

Messages in current thread:
[PATCH] x86: introduce page_size_mask for 64bit, Yinghai Lu, (Tue Jul 8, 1:41 am)
Re: [PATCH] x86: introduce page_size_mask for 64bit, Ingo Molnar, (Wed Jul 9, 12:38 am)
[PATCH] x86: merge __acpi_map_table, Yinghai Lu, (Wed Jul 9, 8:16 pm)
Re: [PATCH] x86: merge __acpi_map_table, Ingo Molnar, (Wed Jul 9, 11:54 pm)
Re: [PATCh] x86: overmapped fix when 4K pages on tail - 64bit, Arjan van de Ven, (Thu Jul 10, 7:16 am)
[PATCH] x86: save slit, Yinghai Lu, (Thu Jul 10, 8:36 pm)
[PATCH] x86: introduce max_low_pfn_mapped for 64bit, Yinghai Lu, (Thu Jul 10, 8:38 pm)
Re: [PATCH] x86: save slit, Ingo Molnar, (Fri Jul 11, 1:22 am)
[PATCH] x86: let 32bit use apic_ops too, Yinghai Lu, (Fri Jul 11, 6:41 pm)
[PATCH] x86: make read_apic_id return final apicid, Yinghai Lu, (Fri Jul 11, 6:44 pm)
[PATCH] x86: make 64bit have get_apic_id, Yinghai Lu, (Sat Jul 12, 1:01 am)
[PATCH] x86: max_low_pfn_mapped fix #1, Yinghai Lu, (Sat Jul 12, 2:30 pm)
[PATCH] x86: max_low_pfn_mapped fix #2, Yinghai Lu, (Sat Jul 12, 2:31 pm)
[PATCH] x86: max_low_pfn_mapped fix #3, Yinghai Lu, (Sat Jul 12, 2:32 pm)
Re: [PATCH] x86: let 32bit use apic_ops too, Suresh Siddha, (Sat Jul 12, 6:08 pm)
Re: [PATCH] x86: make read_apic_id return final apicid, Suresh Siddha, (Sat Jul 12, 6:19 pm)
Re: [PATCH] x86: let 32bit use apic_ops too, Maciej W. Rozycki, (Sat Jul 12, 6:43 pm)
Re: [PATCH] x86: let 32bit use apic_ops too, Yinghai Lu, (Sat Jul 12, 6:45 pm)
Re: [PATCH] x86: let 32bit use apic_ops too, Maciej W. Rozycki, (Sat Jul 12, 6:54 pm)
Re: [PATCH] x86: let 32bit use apic_ops too, Yinghai Lu, (Sat Jul 12, 7:04 pm)
Re: [PATCH] x86: make 64bit have get_apic_id, Ingo Molnar, (Sat Jul 12, 11:28 pm)
Re: [PATCH] x86: make 64bit have get_apic_id, Ingo Molnar, (Sat Jul 12, 11:59 pm)
Re: [PATCH] x86: make 64bit have get_apic_id, Yinghai Lu, (Sun Jul 13, 12:05 am)
Re: [PATCH] x86: make 64bit have get_apic_id, Ingo Molnar, (Sun Jul 13, 2:23 am)
Re: [PATCH] x86: make 64bit have get_apic_id, Ingo Molnar, (Sun Jul 13, 2:28 am)
Re: [PATCH] x86: max_low_pfn_mapped fix #1, Ingo Molnar, (Sun Jul 13, 2:45 am)
Re: [PATCh] x86: overmapped fix when 4K pages on tail - 64bit, Arjan van de Ven, (Sun Jul 13, 8:33 am)
Re: [PATCH] x86: make 64bit have get_apic_id, Suresh Siddha, (Sun Jul 13, 9:15 am)
Re: [PATCH] x86: let 32bit use apic_ops too, Suresh Siddha, (Sun Jul 13, 9:28 am)
Re: [PATCH] x86: let 32bit use apic_ops too, Suresh Siddha, (Sun Jul 13, 9:43 am)
Re: [PATCH] x86: let 32bit use apic_ops too, Maciej W. Rozycki, (Sun Jul 13, 9:51 am)
Re: [PATCH] x86: let 32bit use apic_ops too, Maciej W. Rozycki, (Sun Jul 13, 10:05 am)
Re: [PATCH] x86: let 32bit use apic_ops too, Cyrill Gorcunov, (Sun Jul 13, 10:16 am)
[PATCH] x86: max_low_pfn_mapped fix #4, Yinghai Lu, (Sun Jul 13, 2:29 pm)
[PATCH] x86: get x86_phys_bits early, Yinghai Lu, (Sun Jul 13, 2:30 pm)
Re: [PATCH] x86: let 32bit use apic_ops too, Maciej W. Rozycki, (Sun Jul 13, 4:46 pm)
[PATCH] x86: let 32bit use apic_ops too - fix, Yinghai Lu, (Sun Jul 13, 10:19 pm)
Re: [PATCH] x86: let 32bit use apic_ops too - fix, Ingo Molnar, (Mon Jul 14, 12:12 am)
Re: [PATCH] x86: let 32bit use apic_ops too, Cyrill Gorcunov, (Mon Jul 14, 9:48 am)
Re: [PATCH] x86: let 32bit use apic_ops too - fix, Suresh Siddha, (Mon Jul 14, 9:49 am)
Re: [PATCH] x86: let 32bit use apic_ops too - fix, Yinghai Lu, (Mon Jul 14, 10:00 am)
Re: [PATCH] x86: let 32bit use apic_ops too, Maciej W. Rozycki, (Mon Jul 14, 10:20 am)
Re: [PATCH] x86: let 32bit use apic_ops too - fix, Suresh Siddha, (Mon Jul 14, 11:03 am)
Re: [PATCH] x86: let 32bit use apic_ops too, Cyrill Gorcunov, (Mon Jul 14, 11:09 am)
Re: [PATCH] x86: let 32bit use apic_ops too, Maciej W. Rozycki, (Mon Jul 14, 11:24 am)
Re: [PATCH] x86: let 32bit use apic_ops too, Cyrill Gorcunov, (Mon Jul 14, 11:32 am)
Re: [PATCH] x86: let 32bit use apic_ops too - fix, Suresh Siddha, (Tue Jul 15, 10:33 am)
Re: [PATCH] x86: let 32bit use apic_ops too - fix, Yinghai Lu, (Tue Jul 15, 11:10 am)
Re: [PATCH] x86: let 32bit use apic_ops too - fix, Suresh Siddha, (Tue Jul 15, 11:27 am)
Re: [PATCH] x86: let 32bit use apic_ops too - fix, Ingo Molnar, (Fri Jul 18, 10:06 am)
Re: [PATCH] x86: let 32bit use apic_ops too - fix, Ingo Molnar, (Fri Jul 18, 10:07 am)