* [PATCH] minor processor.h cleanup
@ 2004-04-28 16:11 Bjorn Helgaas
2004-04-29 4:52 ` David Mosberger
` (2 more replies)
0 siblings, 3 replies; 4+ messages in thread
From: Bjorn Helgaas @ 2004-04-28 16:11 UTC (permalink / raw)
To: linux-ia64
Move PSR.ic clear/restore into ia64_itr().
Remove ia64_itc(), ia64_ptr(), ia64_set_iva() (unused).
=== arch/ia64/kernel/efi.c 1.32 vs edited ==--- 1.32/arch/ia64/kernel/efi.c Mon Apr 26 23:07:41 2004
+++ edited/arch/ia64/kernel/efi.c Tue Apr 27 17:16:24 2004
@@ -383,7 +383,7 @@
efi_memory_desc_t *md;
u64 efi_desc_size;
int pal_code_count = 0;
- u64 mask, psr;
+ u64 mask;
u64 vaddr;
int cpu;
@@ -437,15 +437,9 @@
vaddr & mask, (vaddr & mask) + IA64_GRANULE_SIZE);
#endif
- /*
- * Cannot write to CRx with PSR.ic=1
- */
- psr = ia64_clear_ic();
ia64_itr(0x1, IA64_TR_PALCODE, vaddr & mask,
pte_val(pfn_pte(md->phys_addr >> PAGE_SHIFT, PAGE_KERNEL)),
IA64_GRANULE_SHIFT);
- ia64_set_psr(psr); /* restore psr */
- ia64_srlz_i();
cpu = smp_processor_id();
=== arch/ia64/mm/init.c 1.59 vs edited ==--- 1.59/arch/ia64/mm/init.c Mon Apr 26 23:07:41 2004
+++ edited/arch/ia64/mm/init.c Tue Apr 27 17:17:02 2004
@@ -278,7 +278,7 @@
void __init
ia64_mmu_init (void *my_cpu_data)
{
- unsigned long psr, pta, impl_va_bits;
+ unsigned long pta, impl_va_bits;
extern void __init tlb_init (void);
int cpu;
@@ -289,13 +289,9 @@
#endif
/* Pin mapping for percpu area into TLB */
- psr = ia64_clear_ic();
ia64_itr(0x2, IA64_TR_PERCPU_DATA, PERCPU_ADDR,
pte_val(pfn_pte(__pa(my_cpu_data) >> PAGE_SHIFT, PAGE_KERNEL)),
PERCPU_PAGE_SHIFT);
-
- ia64_set_psr(psr);
- ia64_srlz_i();
/*
* Check if the virtually mapped linear page table (VMLPT) overlaps with a mapped
=== include/asm-ia64/processor.h 1.59 vs edited ==--- 1.59/include/asm-ia64/processor.h Thu Mar 25 19:06:29 2004
+++ edited/include/asm-ia64/processor.h Tue Apr 27 17:22:04 2004
@@ -489,6 +489,8 @@
__u64 vmaddr, __u64 pte,
__u64 log_page_size)
{
+ __u64 psr;
+ psr = ia64_clear_ic();
ia64_setreg(_IA64_REG_CR_ITIR, (log_page_size << 2));
ia64_setreg(_IA64_REG_CR_IFA, vmaddr);
ia64_stop();
@@ -496,44 +498,7 @@
ia64_itri(tr_num, pte);
if (target_mask & 0x2)
ia64_itrd(tr_num, pte);
-}
-
-/*
- * Insert a translation into the instruction and/or data translation
- * cache.
- */
-static inline void
-ia64_itc (__u64 target_mask, __u64 vmaddr, __u64 pte,
- __u64 log_page_size)
-{
- ia64_setreg(_IA64_REG_CR_ITIR, (log_page_size << 2));
- ia64_setreg(_IA64_REG_CR_IFA, vmaddr);
- ia64_stop();
- /* as per EAS2.6, itc must be the last instruction in an instruction group */
- if (target_mask & 0x1)
- ia64_itci(pte);
- if (target_mask & 0x2)
- ia64_itcd(pte);
-}
-
-/*
- * Purge a range of addresses from instruction and/or data translation
- * register(s).
- */
-static inline void
-ia64_ptr (__u64 target_mask, __u64 vmaddr, __u64 log_size)
-{
- if (target_mask & 0x1)
- ia64_ptri(vmaddr, (log_size << 2));
- if (target_mask & 0x2)
- ia64_ptrd(vmaddr, (log_size << 2));
-}
-
-/* Set the interrupt vector address. The address must be suitably aligned (32KB). */
-static inline void
-ia64_set_iva (void *ivt_addr)
-{
- ia64_setreg(_IA64_REG_CR_IVA, (__u64) ivt_addr);
+ ia64_set_psr(psr);
ia64_srlz_i();
}
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH] minor processor.h cleanup
2004-04-28 16:11 [PATCH] minor processor.h cleanup Bjorn Helgaas
@ 2004-04-29 4:52 ` David Mosberger
2004-04-29 14:38 ` Bjorn Helgaas
2004-04-29 16:11 ` David Mosberger
2 siblings, 0 replies; 4+ messages in thread
From: David Mosberger @ 2004-04-29 4:52 UTC (permalink / raw)
To: linux-ia64
>>>>> On Wed, 28 Apr 2004 10:11:38 -0600, Bjorn Helgaas <bjorn.helgaas@HP.COM> said:
Bjorn> Move PSR.ic clear/restore into ia64_itr().
Bjorn> Remove ia64_itc(), ia64_ptr(), ia64_set_iva() (unused).
I'm not sure I consider this a cleanup. The processor.h
inlines/macros were meant to map more or less directly to processor
instructions. Mucking with psr.ic is quite expensive so it's useful
to be able to batch several things together and not have to toggle
psr.ic every time. But then again, if we never use it that way, I can
see your point...
--david
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH] minor processor.h cleanup
2004-04-28 16:11 [PATCH] minor processor.h cleanup Bjorn Helgaas
2004-04-29 4:52 ` David Mosberger
@ 2004-04-29 14:38 ` Bjorn Helgaas
2004-04-29 16:11 ` David Mosberger
2 siblings, 0 replies; 4+ messages in thread
From: Bjorn Helgaas @ 2004-04-29 14:38 UTC (permalink / raw)
To: linux-ia64
On Wednesday 28 April 2004 10:52 pm, David Mosberger wrote:
> >>>>> On Wed, 28 Apr 2004 10:11:38 -0600, Bjorn Helgaas <bjorn.helgaas@HP.COM> said:
>
> Bjorn> Move PSR.ic clear/restore into ia64_itr().
> Bjorn> Remove ia64_itc(), ia64_ptr(), ia64_set_iva() (unused).
>
> I'm not sure I consider this a cleanup. The processor.h
> inlines/macros were meant to map more or less directly to processor
> instructions. Mucking with psr.ic is quite expensive so it's useful
> to be able to batch several things together and not have to toggle
> psr.ic every time. But then again, if we never use it that way, I can
> see your point...
I don't feel strongly either way. The comment "Cannot write to CRx with
PSR.ic=1" preceding the ia64_itr() call just wasn't obvious to me and it
seemed like a good opportunity for someone to screw up when calling
ia64_itr().
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH] minor processor.h cleanup
2004-04-28 16:11 [PATCH] minor processor.h cleanup Bjorn Helgaas
2004-04-29 4:52 ` David Mosberger
2004-04-29 14:38 ` Bjorn Helgaas
@ 2004-04-29 16:11 ` David Mosberger
2 siblings, 0 replies; 4+ messages in thread
From: David Mosberger @ 2004-04-29 16:11 UTC (permalink / raw)
To: linux-ia64
>>>>> On Thu, 29 Apr 2004 08:38:36 -0600, Bjorn Helgaas <bjorn.helgaas@hp.com> said:
Bjorn> I don't feel strongly either way. The comment "Cannot write
Bjorn> to CRx with PSR.ic=1" preceding the ia64_itr() call just
Bjorn> wasn't obvious to me and it seemed like a good opportunity
Bjorn> for someone to screw up when calling ia64_itr().
That's true, but they'll notice _very_ quickly if they miss that
(instant fault...).
Perhaps we should have a higher-level convenience-routine which does
all the psr.ic magic. That would be fine with me.
--david
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2004-04-29 16:11 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2004-04-28 16:11 [PATCH] minor processor.h cleanup Bjorn Helgaas
2004-04-29 4:52 ` David Mosberger
2004-04-29 14:38 ` Bjorn Helgaas
2004-04-29 16:11 ` David Mosberger
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox