Skip to content

Commit 847165d

Browse files
committed
Merge tag 'parisc-for-6.6-rc2' of git://git.kernel.org/pub/scm/linux/kernel/git/deller/parisc-linux
Pull parisc architecture fixes from Helge Deller: - fix reference to exported symbols for parisc64 [Masahiro Yamada] - Block-TLB (BTLB) support on 32-bit CPUs - sparse and build-warning fixes * tag 'parisc-for-6.6-rc2' of git://git.kernel.org/pub/scm/linux/kernel/git/deller/parisc-linux: linux/export: fix reference to exported functions for parisc64 parisc: BTLB: Initialize BTLB tables at CPU startup parisc: firmware: Simplify calling non-PA20 functions parisc: BTLB: _edata symbol has to be page aligned for BTLB support parisc: BTLB: Add BTLB insert and purge firmware function wrappers parisc: BTLB: Clear possibly existing BTLB entries parisc: Prepare for Block-TLB support on 32-bit kernel parisc: shmparam.h: Document aliasing requirements of PA-RISC parisc: irq: Make irq_stack_union static to avoid sparse warning parisc: drivers: Fix sparse warning parisc: iosapic.c: Fix sparse warnings parisc: ccio-dma: Fix sparse warnings parisc: sba-iommu: Fix sparse warnigs parisc: sba: Fix compile warning wrt list of SBA devices parisc: sba_iommu: Fix build warning if procfs if disabled
2 parents 99214f6 + 08700ec commit 847165d

File tree

23 files changed

+207
-76
lines changed

23 files changed

+207
-76
lines changed

arch/parisc/include/asm/cache.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,7 @@ extern int split_tlb;
3737
extern int dcache_stride;
3838
extern int icache_stride;
3939
extern struct pdc_cache_info cache_info;
40+
extern struct pdc_btlb_info btlb_info;
4041
void parisc_setup_cache_timing(void);
4142

4243
#define pdtlb(sr, addr) asm volatile("pdtlb 0(%%sr%0,%1)" \

arch/parisc/include/asm/mckinley.h

Lines changed: 0 additions & 8 deletions
This file was deleted.

arch/parisc/include/asm/pdc.h

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -44,10 +44,11 @@ int pdc_model_capabilities(unsigned long *capabilities);
4444
int pdc_model_platform_info(char *orig_prod_num, char *current_prod_num, char *serial_no);
4545
int pdc_cache_info(struct pdc_cache_info *cache);
4646
int pdc_spaceid_bits(unsigned long *space_bits);
47-
#ifndef CONFIG_PA20
4847
int pdc_btlb_info(struct pdc_btlb_info *btlb);
48+
int pdc_btlb_insert(unsigned long long vpage, unsigned long physpage, unsigned long len,
49+
unsigned long entry_info, unsigned long slot);
50+
int pdc_btlb_purge_all(void);
4951
int pdc_mem_map_hpa(struct pdc_memory_map *r_addr, struct pdc_module_path *mod_path);
50-
#endif /* !CONFIG_PA20 */
5152
int pdc_pim_toc11(struct pdc_toc_pim_11 *ret);
5253
int pdc_pim_toc20(struct pdc_toc_pim_20 *ret);
5354
int pdc_lan_station_id(char *lan_addr, unsigned long net_hpa);

arch/parisc/include/asm/processor.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -310,6 +310,7 @@ extern void do_syscall_trace_exit(struct pt_regs *);
310310
struct seq_file;
311311
extern void early_trap_init(void);
312312
extern void collect_boot_cpu_data(void);
313+
extern void btlb_init_per_cpu(void);
313314
extern int show_cpuinfo (struct seq_file *m, void *v);
314315

315316
/* driver code in driver/parisc */

arch/parisc/include/asm/ropes.h

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@
2929
struct ioc {
3030
void __iomem *ioc_hpa; /* I/O MMU base address */
3131
char *res_map; /* resource map, bit == pdir entry */
32-
u64 *pdir_base; /* physical base address */
32+
__le64 *pdir_base; /* physical base address */
3333
unsigned long ibase; /* pdir IOV Space base - shared w/lba_pci */
3434
unsigned long imask; /* pdir IOV Space mask - shared w/lba_pci */
3535
#ifdef ZX1_SUPPORT
@@ -86,6 +86,9 @@ struct sba_device {
8686
struct ioc ioc[MAX_IOC];
8787
};
8888

89+
/* list of SBA's in system, see drivers/parisc/sba_iommu.c */
90+
extern struct sba_device *sba_list;
91+
8992
#define ASTRO_RUNWAY_PORT 0x582
9093
#define IKE_MERCED_PORT 0x803
9194
#define REO_MERCED_PORT 0x804
@@ -110,7 +113,7 @@ static inline int IS_PLUTO(struct parisc_device *d) {
110113

111114
#define SBA_PDIR_VALID_BIT 0x8000000000000000ULL
112115

113-
#define SBA_AGPGART_COOKIE 0x0000badbadc0ffeeULL
116+
#define SBA_AGPGART_COOKIE (__force __le64) 0x0000badbadc0ffeeULL
114117

115118
#define SBA_FUNC_ID 0x0000 /* function id */
116119
#define SBA_FCLASS 0x0008 /* function class, bist, header, rev... */

arch/parisc/include/asm/shmparam.h

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,21 @@
22
#ifndef _ASMPARISC_SHMPARAM_H
33
#define _ASMPARISC_SHMPARAM_H
44

5+
/*
6+
* PA-RISC uses virtually indexed & physically tagged (VIPT) caches
7+
* which has strict requirements when two pages to the same physical
8+
* address are accessed through different mappings. Read the section
9+
* "Address Aliasing" in the arch docs for more detail:
10+
* PA-RISC 1.1 (page 3-6):
11+
* https://parisc.wiki.kernel.org/images-parisc/6/68/Pa11_acd.pdf
12+
* PA-RISC 2.0 (page F-5):
13+
* https://parisc.wiki.kernel.org/images-parisc/7/73/Parisc2.0.pdf
14+
*
15+
* For Linux we allow kernel and userspace to map pages on page size
16+
* granularity (SHMLBA) but have to ensure that, if two pages are
17+
* mapped to the same physical address, the virtual and physical
18+
* addresses modulo SHM_COLOUR are identical.
19+
*/
520
#define SHMLBA PAGE_SIZE /* attach addr a multiple of this */
621
#define SHM_COLOUR 0x00400000 /* shared mappings colouring */
722

arch/parisc/kernel/asm-offsets.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -275,6 +275,8 @@ int main(void)
275275
* and kernel data on physical huge pages */
276276
#ifdef CONFIG_HUGETLB_PAGE
277277
DEFINE(HUGEPAGE_SIZE, 1UL << REAL_HPAGE_SHIFT);
278+
#elif !defined(CONFIG_64BIT)
279+
DEFINE(HUGEPAGE_SIZE, 4*1024*1024);
278280
#else
279281
DEFINE(HUGEPAGE_SIZE, PAGE_SIZE);
280282
#endif

arch/parisc/kernel/cache.c

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ int pa_serialize_tlb_flushes __ro_after_init;
5858

5959
struct pdc_cache_info cache_info __ro_after_init;
6060
#ifndef CONFIG_PA20
61-
static struct pdc_btlb_info btlb_info __ro_after_init;
61+
struct pdc_btlb_info btlb_info __ro_after_init;
6262
#endif
6363

6464
DEFINE_STATIC_KEY_TRUE(parisc_has_cache);
@@ -264,12 +264,6 @@ parisc_cache_init(void)
264264
icache_stride = CAFL_STRIDE(cache_info.ic_conf);
265265
#undef CAFL_STRIDE
266266

267-
#ifndef CONFIG_PA20
268-
if (pdc_btlb_info(&btlb_info) < 0) {
269-
memset(&btlb_info, 0, sizeof btlb_info);
270-
}
271-
#endif
272-
273267
if ((boot_cpu_data.pdc.capabilities & PDC_MODEL_NVA_MASK) ==
274268
PDC_MODEL_NVA_UNSUPPORTED) {
275269
printk(KERN_WARNING "parisc_cache_init: Only equivalent aliasing supported!\n");

arch/parisc/kernel/drivers.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -925,9 +925,9 @@ static __init void qemu_header(void)
925925
pr_info("#define PARISC_MODEL \"%s\"\n\n",
926926
boot_cpu_data.pdc.sys_model_name);
927927

928+
#define p ((unsigned long *)&boot_cpu_data.pdc.model)
928929
pr_info("#define PARISC_PDC_MODEL 0x%lx, 0x%lx, 0x%lx, "
929930
"0x%lx, 0x%lx, 0x%lx, 0x%lx, 0x%lx, 0x%lx\n\n",
930-
#define p ((unsigned long *)&boot_cpu_data.pdc.model)
931931
p[0], p[1], p[2], p[3], p[4], p[5], p[6], p[7], p[8]);
932932
#undef p
933933

arch/parisc/kernel/firmware.c

Lines changed: 45 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -687,7 +687,6 @@ int pdc_spaceid_bits(unsigned long *space_bits)
687687
return retval;
688688
}
689689

690-
#ifndef CONFIG_PA20
691690
/**
692691
* pdc_btlb_info - Return block TLB information.
693692
* @btlb: The return buffer.
@@ -696,18 +695,51 @@ int pdc_spaceid_bits(unsigned long *space_bits)
696695
*/
697696
int pdc_btlb_info(struct pdc_btlb_info *btlb)
698697
{
699-
int retval;
698+
int retval;
700699
unsigned long flags;
701700

702-
spin_lock_irqsave(&pdc_lock, flags);
703-
retval = mem_pdc_call(PDC_BLOCK_TLB, PDC_BTLB_INFO, __pa(pdc_result), 0);
704-
memcpy(btlb, pdc_result, sizeof(*btlb));
705-
spin_unlock_irqrestore(&pdc_lock, flags);
701+
if (IS_ENABLED(CONFIG_PA20))
702+
return PDC_BAD_PROC;
706703

707-
if(retval < 0) {
708-
btlb->max_size = 0;
709-
}
710-
return retval;
704+
spin_lock_irqsave(&pdc_lock, flags);
705+
retval = mem_pdc_call(PDC_BLOCK_TLB, PDC_BTLB_INFO, __pa(pdc_result), 0);
706+
memcpy(btlb, pdc_result, sizeof(*btlb));
707+
spin_unlock_irqrestore(&pdc_lock, flags);
708+
709+
if(retval < 0) {
710+
btlb->max_size = 0;
711+
}
712+
return retval;
713+
}
714+
715+
int pdc_btlb_insert(unsigned long long vpage, unsigned long physpage, unsigned long len,
716+
unsigned long entry_info, unsigned long slot)
717+
{
718+
int retval;
719+
unsigned long flags;
720+
721+
if (IS_ENABLED(CONFIG_PA20))
722+
return PDC_BAD_PROC;
723+
724+
spin_lock_irqsave(&pdc_lock, flags);
725+
retval = mem_pdc_call(PDC_BLOCK_TLB, PDC_BTLB_INSERT, (unsigned long) (vpage >> 32),
726+
(unsigned long) vpage, physpage, len, entry_info, slot);
727+
spin_unlock_irqrestore(&pdc_lock, flags);
728+
return retval;
729+
}
730+
731+
int pdc_btlb_purge_all(void)
732+
{
733+
int retval;
734+
unsigned long flags;
735+
736+
if (IS_ENABLED(CONFIG_PA20))
737+
return PDC_BAD_PROC;
738+
739+
spin_lock_irqsave(&pdc_lock, flags);
740+
retval = mem_pdc_call(PDC_BLOCK_TLB, PDC_BTLB_PURGE_ALL);
741+
spin_unlock_irqrestore(&pdc_lock, flags);
742+
return retval;
711743
}
712744

713745
/**
@@ -728,6 +760,9 @@ int pdc_mem_map_hpa(struct pdc_memory_map *address,
728760
int retval;
729761
unsigned long flags;
730762

763+
if (IS_ENABLED(CONFIG_PA20))
764+
return PDC_BAD_PROC;
765+
731766
spin_lock_irqsave(&pdc_lock, flags);
732767
memcpy(pdc_result2, mod_path, sizeof(*mod_path));
733768
retval = mem_pdc_call(PDC_MEM_MAP, PDC_MEM_MAP_HPA, __pa(pdc_result),
@@ -737,7 +772,6 @@ int pdc_mem_map_hpa(struct pdc_memory_map *address,
737772

738773
return retval;
739774
}
740-
#endif /* !CONFIG_PA20 */
741775

742776
/**
743777
* pdc_lan_station_id - Get the LAN address.

0 commit comments

Comments
 (0)