Re: fuse, get_user_pages, flush_anon_page, aliasing caches and all that again

Previous thread: Re: [PATCH] Documentation: Explain a second alternative for multi-line macros. by Christoph Hellwig on Monday, January 1, 2007 - 10:20 am. (4 messages)

Next thread: [2.6.20-rc3] PATA_MARVELL: total machine freeze by Paolo Ornati on Tuesday, January 2, 2007 - 10:37 am. (2 messages)
To: <macro@...>, <mingo@...>, <tglx@...>
Cc: <hpa@...>, <yhlu.kernel@...>, <linux-kernel@...>, Cyrill Gorcunov <gorcunov@...>
Date: Wednesday, December 31, 1969 - 8:00 pm

To be able to unify this function we RE-introduce
APIC_DIVISOR for 64bit mode. This snipped was eliminated
in some time ago in a sake of clenup but now we need it
again since it allow up to get rid of #ifdef(s).

And lapic_is_integrated call is added in apic_64.c but
since we always have APIC integrated on 64bit cpu compiler
will ignore this call.

Signed-off-by: Cyrill Gorcunov <gorcunov@gmail.com>
---

diff --git a/arch/x86/kernel/apic_64.c b/arch/x86/kernel/apic_64.c
index 1e0b5d9..5d07689 100644
--- a/arch/x86/kernel/apic_64.c
+++ b/arch/x86/kernel/apic_64.c
@@ -244,6 +244,9 @@ int lapic_get_maxlvt(void)
return APIC_INTEGRATED(GET_APIC_VERSION(v)) ? GET_APIC_MAXLVT(v) : 2;
}

+/* Clock divisor is set to 1 */
+#define APIC_DIVISOR 1
+
/*
* This function sets up the local APIC timer, with a timeout of
* 'clocks' APIC bus clock. During calibration we actually call
@@ -262,6 +265,9 @@ static void __setup_APIC_LVTT(unsigned int clocks, int oneshot, int irqen)
lvtt_value = LOCAL_TIMER_VECTOR;
if (!oneshot)
lvtt_value |= APIC_LVT_TIMER_PERIODIC;
+ if (!lapic_is_integrated())
+ lvtt_value |= SET_APIC_TIMER_BASE(APIC_TIMER_BASE_DIV);
+
if (!irqen)
lvtt_value |= APIC_LVT_MASKED;

@@ -276,7 +282,7 @@ static void __setup_APIC_LVTT(unsigned int clocks, int oneshot, int irqen)
| APIC_TDR_DIV_16);

if (!oneshot)
- apic_write(APIC_TMICT, clocks);
+ apic_write(APIC_TMICT, clocks / APIC_DIVISOR);
}

/*
@@ -450,7 +456,7 @@ static int __init calibrate_APIC_clock(void)
lapic_clockevent.min_delta_ns =
clockevent_delta2ns(0xF, &lapic_clockevent);

- calibration_result = result / HZ;
+ calibration_result = (result * APIC_DIVISOR) / HZ;

/*
* Do a sanity check on the APIC calibration result

--
--

To: Linus Torvalds <torvalds@...>
Cc: Russell King <rmk+lkml@...>, Miklos Szeredi <miklos@...>, <linux-kernel@...>, <linux-arch@...>, Andrew Morton <akpm@...>
Date: Monday, January 1, 2007 - 10:35 am

The sparc handling of anonymous pages is different ... they accitentally
sweep them up in flush_dcache_page(). When I audited the architectures
to try to make fuse work on parisc, parisc and arm were the only ones
that actually needed flush_anon_page().

James

-

To: James Bottomley <James.Bottomley@...>
Cc: Linus Torvalds <torvalds@...>, Miklos Szeredi <miklos@...>, <linux-kernel@...>, <linux-arch@...>, Andrew Morton <akpm@...>
Date: Monday, January 1, 2007 - 12:21 pm

However, as David has said, anonymous pages _are_ supposed to be handled
by flush_dcache_page(), so I now have an (untested) implementation for
ARM which does this. Therefore, I'm revoking the previous two patches.

--
Russell King
Linux kernel 2.6 ARM Linux - http://www.arm.linux.org.uk/
maintainer of:
-

Previous thread: Re: [PATCH] Documentation: Explain a second alternative for multi-line macros. by Christoph Hellwig on Monday, January 1, 2007 - 10:20 am. (4 messages)

Next thread: [2.6.20-rc3] PATA_MARVELL: total machine freeze by Paolo Ornati on Tuesday, January 2, 2007 - 10:37 am. (2 messages)