Skip to content

Commit f0c5f7e

Browse files
committed
Merge tag 'loongarch-fixes-6.0-2' of git://git.kernel.org/pub/scm/linux/kernel/git/chenhuacai/linux-loongson
Pull LoongArch fixes from Huacai Chen: "Fix several build errors or warnings, cleanup some code, and adjust arch_do_signal_or_restart() to adapt generic entry" * tag 'loongarch-fixes-6.0-2' of git://git.kernel.org/pub/scm/linux/kernel/git/chenhuacai/linux-loongson: LoongArch: mm: Remove the unneeded result variable LoongArch: Fix arch_remove_memory() undefined build error LoongArch: Fix section mismatch due to acpi_os_ioremap() LoongArch: Improve dump_tlb() output messages LoongArch: Adjust arch_do_signal_or_restart() to adapt generic entry LoongArch: Avoid orphan input sections
2 parents cda9a84 + ac9284d commit f0c5f7e

File tree

7 files changed

+28
-29
lines changed

7 files changed

+28
-29
lines changed

arch/loongarch/Kconfig

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,7 @@ config LOONGARCH
3939
select ARCH_INLINE_SPIN_UNLOCK_BH if !PREEMPTION
4040
select ARCH_INLINE_SPIN_UNLOCK_IRQ if !PREEMPTION
4141
select ARCH_INLINE_SPIN_UNLOCK_IRQRESTORE if !PREEMPTION
42+
select ARCH_KEEP_MEMBLOCK
4243
select ARCH_MIGHT_HAVE_PC_PARPORT
4344
select ARCH_MIGHT_HAVE_PC_SERIO
4445
select ARCH_SPARSEMEM_ENABLE
@@ -51,6 +52,7 @@ config LOONGARCH
5152
select ARCH_USE_CMPXCHG_LOCKREF
5253
select ARCH_USE_QUEUED_RWLOCKS
5354
select ARCH_WANT_DEFAULT_TOPDOWN_MMAP_LAYOUT
55+
select ARCH_WANT_LD_ORPHAN_WARN
5456
select ARCH_WANTS_NO_INSTR
5557
select BUILDTIME_TABLE_SORT
5658
select COMMON_CLK

arch/loongarch/include/asm/acpi.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ extern int acpi_pci_disabled;
1515
extern int acpi_noirq;
1616

1717
#define acpi_os_ioremap acpi_os_ioremap
18-
void __init __iomem *acpi_os_ioremap(acpi_physical_address phys, acpi_size size);
18+
void __iomem *acpi_os_ioremap(acpi_physical_address phys, acpi_size size);
1919

2020
static inline void disable_acpi(void)
2121
{

arch/loongarch/kernel/acpi.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ void __init __acpi_unmap_table(void __iomem *map, unsigned long size)
4848
early_memunmap(map, size);
4949
}
5050

51-
void __init __iomem *acpi_os_ioremap(acpi_physical_address phys, acpi_size size)
51+
void __iomem *acpi_os_ioremap(acpi_physical_address phys, acpi_size size)
5252
{
5353
if (!memblock_is_memory(phys))
5454
return ioremap(phys, size);

arch/loongarch/kernel/signal.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -529,11 +529,11 @@ static void handle_signal(struct ksignal *ksig, struct pt_regs *regs)
529529
signal_setup_done(ret, ksig, 0);
530530
}
531531

532-
void arch_do_signal_or_restart(struct pt_regs *regs, bool has_signal)
532+
void arch_do_signal_or_restart(struct pt_regs *regs)
533533
{
534534
struct ksignal ksig;
535535

536-
if (has_signal && get_signal(&ksig)) {
536+
if (get_signal(&ksig)) {
537537
/* Whee! Actually deliver the signal. */
538538
handle_signal(&ksig, regs);
539539
return;

arch/loongarch/kernel/vmlinux.lds.S

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -77,6 +77,8 @@ SECTIONS
7777
PERCPU_SECTION(1 << CONFIG_L1_CACHE_SHIFT)
7878
#endif
7979

80+
.rela.dyn : ALIGN(8) { *(.rela.dyn) *(.rela*) }
81+
8082
.init.bss : {
8183
*(.init.bss)
8284
}

arch/loongarch/lib/dump_tlb.c

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -18,11 +18,11 @@ void dump_tlb_regs(void)
1818
{
1919
const int field = 2 * sizeof(unsigned long);
2020

21-
pr_info("Index : %0x\n", read_csr_tlbidx());
22-
pr_info("PageSize : %0x\n", read_csr_pagesize());
23-
pr_info("EntryHi : %0*llx\n", field, read_csr_entryhi());
24-
pr_info("EntryLo0 : %0*llx\n", field, read_csr_entrylo0());
25-
pr_info("EntryLo1 : %0*llx\n", field, read_csr_entrylo1());
21+
pr_info("Index : 0x%0x\n", read_csr_tlbidx());
22+
pr_info("PageSize : 0x%0x\n", read_csr_pagesize());
23+
pr_info("EntryHi : 0x%0*llx\n", field, read_csr_entryhi());
24+
pr_info("EntryLo0 : 0x%0*llx\n", field, read_csr_entrylo0());
25+
pr_info("EntryLo1 : 0x%0*llx\n", field, read_csr_entrylo1());
2626
}
2727

2828
static void dump_tlb(int first, int last)
@@ -33,8 +33,8 @@ static void dump_tlb(int first, int last)
3333
unsigned int s_index, s_asid;
3434
unsigned int pagesize, c0, c1, i;
3535
unsigned long asidmask = cpu_asid_mask(&current_cpu_data);
36-
int pwidth = 11;
37-
int vwidth = 11;
36+
int pwidth = 16;
37+
int vwidth = 16;
3838
int asidwidth = DIV_ROUND_UP(ilog2(asidmask) + 1, 4);
3939

4040
s_entryhi = read_csr_entryhi();
@@ -64,22 +64,22 @@ static void dump_tlb(int first, int last)
6464
/*
6565
* Only print entries in use
6666
*/
67-
pr_info("Index: %2d pgsize=%x ", i, (1 << pagesize));
67+
pr_info("Index: %4d pgsize=0x%x ", i, (1 << pagesize));
6868

6969
c0 = (entrylo0 & ENTRYLO_C) >> ENTRYLO_C_SHIFT;
7070
c1 = (entrylo1 & ENTRYLO_C) >> ENTRYLO_C_SHIFT;
7171

72-
pr_cont("va=%0*lx asid=%0*lx",
72+
pr_cont("va=0x%0*lx asid=0x%0*lx",
7373
vwidth, (entryhi & ~0x1fffUL), asidwidth, asid & asidmask);
7474

7575
/* NR/NX are in awkward places, so mask them off separately */
7676
pa = entrylo0 & ~(ENTRYLO_NR | ENTRYLO_NX);
7777
pa = pa & PAGE_MASK;
7878
pr_cont("\n\t[");
79-
pr_cont("ri=%d xi=%d ",
79+
pr_cont("nr=%d nx=%d ",
8080
(entrylo0 & ENTRYLO_NR) ? 1 : 0,
8181
(entrylo0 & ENTRYLO_NX) ? 1 : 0);
82-
pr_cont("pa=%0*llx c=%d d=%d v=%d g=%d plv=%lld] [",
82+
pr_cont("pa=0x%0*llx c=%d d=%d v=%d g=%d plv=%lld] [",
8383
pwidth, pa, c0,
8484
(entrylo0 & ENTRYLO_D) ? 1 : 0,
8585
(entrylo0 & ENTRYLO_V) ? 1 : 0,
@@ -88,10 +88,10 @@ static void dump_tlb(int first, int last)
8888
/* NR/NX are in awkward places, so mask them off separately */
8989
pa = entrylo1 & ~(ENTRYLO_NR | ENTRYLO_NX);
9090
pa = pa & PAGE_MASK;
91-
pr_cont("ri=%d xi=%d ",
91+
pr_cont("nr=%d nx=%d ",
9292
(entrylo1 & ENTRYLO_NR) ? 1 : 0,
9393
(entrylo1 & ENTRYLO_NX) ? 1 : 0);
94-
pr_cont("pa=%0*llx c=%d d=%d v=%d g=%d plv=%lld]\n",
94+
pr_cont("pa=0x%0*llx c=%d d=%d v=%d g=%d plv=%lld]\n",
9595
pwidth, pa, c1,
9696
(entrylo1 & ENTRYLO_D) ? 1 : 0,
9797
(entrylo1 & ENTRYLO_V) ? 1 : 0,

arch/loongarch/mm/init.c

Lines changed: 7 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -131,18 +131,6 @@ int arch_add_memory(int nid, u64 start, u64 size, struct mhp_params *params)
131131
return ret;
132132
}
133133

134-
#ifdef CONFIG_NUMA
135-
int memory_add_physaddr_to_nid(u64 start)
136-
{
137-
int nid;
138-
139-
nid = pa_to_nid(start);
140-
return nid;
141-
}
142-
EXPORT_SYMBOL_GPL(memory_add_physaddr_to_nid);
143-
#endif
144-
145-
#ifdef CONFIG_MEMORY_HOTREMOVE
146134
void arch_remove_memory(u64 start, u64 size, struct vmem_altmap *altmap)
147135
{
148136
unsigned long start_pfn = start >> PAGE_SHIFT;
@@ -154,6 +142,13 @@ void arch_remove_memory(u64 start, u64 size, struct vmem_altmap *altmap)
154142
page += vmem_altmap_offset(altmap);
155143
__remove_pages(start_pfn, nr_pages, altmap);
156144
}
145+
146+
#ifdef CONFIG_NUMA
147+
int memory_add_physaddr_to_nid(u64 start)
148+
{
149+
return pa_to_nid(start);
150+
}
151+
EXPORT_SYMBOL_GPL(memory_add_physaddr_to_nid);
157152
#endif
158153
#endif
159154

0 commit comments

Comments
 (0)