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

Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]
From: Maciej W. Rozycki
Date: Sunday, July 13, 2008 - 4:46 pm

On Sun, 13 Jul 2008, Cyrill Gorcunov wrote:


 Confirmed -- with one exception all the generic write accesses to the
APIC absolutely have to use apic_write_around() because of the lethal
implications of the double-write erratum of some local APIC versions
integrated with Pentium CPUs.

 The exception is the ESR register which cannot use the function because
of: 1. its semantics which gives side-effects on a read, 2. another
erratum, which makes the register lose its contents on a write.  
Therefore the approach is to avoid writes, which are architecturally
required, altogether on Pentium CPUs, which ignore them by their
implementation, and then use straigth apic_write() on all the newer APIC
versions which would lose some information if a read happened before a
write.

 The K8 does not have to use apic_write_around() for the same reasons
x86-64 does not, as neither are hit by the double-write erratum, so all
their processor-specific write accesses may use apic_write() to avoid a
performance hit when used with a kernel with X86_GOOD_APIC cleared.  
Unfortunately, the LOCK# bus access always implied by the XCHG is quite
expensive, but still less intrusive than a sequence involving masking
interrupts locally beforehand and then restoring the IF flag to the
previous state afterwards.  As the APIC is local to the CPU, the grant
should not extend outside to the external bus though.

 And last, but not least, alternatives can be used these days to patch the
expensive XCHG instructions out with cheap MOV ones -- something that was
not available when the workaround was designed some ten years ago.

  Maciej
--
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)