Skip to content

Commit 1f1c153

Browse files
committed
Merge tag 'powerpc-5.18-1' of git://git.kernel.org/pub/scm/linux/kernel/git/powerpc/linux
Pull powerpc updates from Michael Ellerman: "Livepatch support for 32-bit is probably the standout new feature, otherwise mostly just lots of bits and pieces all over the board. There's a series of commits cleaning up function descriptor handling, which touches a few other arches as well as LKDTM. It has acks from Arnd, Kees and Helge. Summary: - Enforce kernel RO, and implement STRICT_MODULE_RWX for 603. - Add support for livepatch to 32-bit. - Implement CONFIG_DYNAMIC_FTRACE_WITH_ARGS. - Merge vdso64 and vdso32 into a single directory. - Fix build errors with newer binutils. - Add support for UADDR64 relocations, which are emitted by some toolchains. This allows powerpc to build with the latest lld. - Fix (another) potential userspace r13 corruption in transactional memory handling. - Cleanups of function descriptor handling & related fixes to LKDTM. Thanks to Abdul Haleem, Alexey Kardashevskiy, Anders Roxell, Aneesh Kumar K.V, Anton Blanchard, Arnd Bergmann, Athira Rajeev, Bhaskar Chowdhury, Cédric Le Goater, Chen Jingwen, Christophe JAILLET, Christophe Leroy, Corentin Labbe, Daniel Axtens, Daniel Henrique Barboza, David Dai, Fabiano Rosas, Ganesh Goudar, Guo Zhengkui, Hangyu Hua, Haren Myneni, Hari Bathini, Igor Zhbanov, Jakob Koschel, Jason Wang, Jeremy Kerr, Joachim Wiberg, Jordan Niethe, Julia Lawall, Kajol Jain, Kees Cook, Laurent Dufour, Madhavan Srinivasan, Mamatha Inamdar, Maxime Bizon, Maxim Kiselev, Maxim Kochetkov, Michal Suchanek, Nageswara R Sastry, Nathan Lynch, Naveen N. Rao, Nicholas Piggin, Nour-eddine Taleb, Paul Menzel, Ping Fang, Pratik R. Sampat, Randy Dunlap, Ritesh Harjani, Rohan McLure, Russell Currey, Sachin Sant, Segher Boessenkool, Shivaprasad G Bhat, Sourabh Jain, Thierry Reding, Tobias Waldekranz, Tyrel Datwyler, Vaibhav Jain, Vladimir Oltean, Wedson Almeida Filho, and YueHaibing" * tag 'powerpc-5.18-1' of git://git.kernel.org/pub/scm/linux/kernel/git/powerpc/linux: (179 commits) powerpc/pseries: Fix use after free in remove_phb_dynamic() powerpc/time: improve decrementer clockevent processing powerpc/time: Fix KVM host re-arming a timer beyond decrementer range powerpc/tm: Fix more userspace r13 corruption powerpc/xive: fix return value of __setup handler powerpc/64: Add UADDR64 relocation support powerpc: 8xx: fix a return value error in mpc8xx_pic_init powerpc/ps3: remove unneeded semicolons powerpc/64: Force inlining of prevent_user_access() and set_kuap() powerpc/bitops: Force inlining of fls() powerpc: declare unmodified attribute_group usages const powerpc/spufs: Fix build warning when CONFIG_PROC_FS=n powerpc/secvar: fix refcount leak in format_show() powerpc/64e: Tie PPC_BOOK3E_64 to PPC_FSL_BOOK3E powerpc: Move C prototypes out of asm-prototypes.h powerpc/kexec: Declare kexec_paca static powerpc/smp: Declare current_set static powerpc: Cleanup asm-prototypes.c powerpc/ftrace: Use STK_GOT in ftrace_mprofile.S powerpc/ftrace: Regroup PPC64 specific operations in ftrace_mprofile.S ...
2 parents 9a8b3d5 + fe2640b commit 1f1c153

File tree

252 files changed

+4893
-2196
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

252 files changed

+4893
-2196
lines changed

Documentation/ABI/testing/sysfs-bus-papr-pmem

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -61,3 +61,15 @@ Description:
6161
* "CchRHCnt" : Cache Read Hit Count
6262
* "CchWHCnt" : Cache Write Hit Count
6363
* "FastWCnt" : Fast Write Count
64+
65+
What: /sys/bus/nd/devices/nmemX/papr/health_bitmap_inject
66+
Date: Jan, 2022
67+
KernelVersion: v5.17
68+
Contact: linuxppc-dev <linuxppc-dev@lists.ozlabs.org>, nvdimm@lists.linux.dev,
69+
Description:
70+
(RO) Reports the health bitmap inject bitmap that is applied to
71+
bitmap received from PowerVM via the H_SCM_HEALTH. This is used
72+
to forcibly set specific bits returned from Hcall. These is then
73+
used to simulate various health or shutdown states for an nvdimm
74+
and are set by user-space tools like ndctl by issuing a PAPR DSM.
75+
Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
What: /sys/firmware/papr/energy_scale_info
2+
Date: February 2022
3+
Contact: Linux for PowerPC mailing list <linuxppc-dev@ozlabs.org>
4+
Description: Directory hosting a set of platform attributes like
5+
energy/frequency on Linux running as a PAPR guest.
6+
7+
Each file in a directory contains a platform
8+
attribute hierarchy pertaining to performance/
9+
energy-savings mode and processor frequency.
10+
11+
What: /sys/firmware/papr/energy_scale_info/<id>
12+
Date: February 2022
13+
Contact: Linux for PowerPC mailing list <linuxppc-dev@ozlabs.org>
14+
Description: Energy, frequency attributes directory for POWERVM servers
15+
16+
What: /sys/firmware/papr/energy_scale_info/<id>/desc
17+
Date: February 2022
18+
Contact: Linux for PowerPC mailing list <linuxppc-dev@ozlabs.org>
19+
Description: String description of the energy attribute of <id>
20+
21+
What: /sys/firmware/papr/energy_scale_info/<id>/value
22+
Date: February 2022
23+
Contact: Linux for PowerPC mailing list <linuxppc-dev@ozlabs.org>
24+
Description: Numeric value of the energy attribute of <id>
25+
26+
What: /sys/firmware/papr/energy_scale_info/<id>/value_desc
27+
Date: February 2022
28+
Contact: Linux for PowerPC mailing list <linuxppc-dev@ozlabs.org>
29+
Description: String value of the energy attribute of <id>

arch/Kconfig

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -202,6 +202,9 @@ config HAVE_FUNCTION_ERROR_INJECTION
202202
config HAVE_NMI
203203
bool
204204

205+
config HAVE_FUNCTION_DESCRIPTORS
206+
bool
207+
205208
config TRACE_IRQFLAGS_SUPPORT
206209
bool
207210

arch/ia64/Kconfig

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,7 @@ config IA64
3636
select HAVE_SETUP_PER_CPU_AREA
3737
select TTY
3838
select HAVE_ARCH_TRACEHOOK
39+
select HAVE_FUNCTION_DESCRIPTORS
3940
select HAVE_VIRT_CPU_ACCOUNTING
4041
select HUGETLB_PAGE_SIZE_VARIABLE if HUGETLB_PAGE
4142
select VIRT_TO_BUS

arch/ia64/include/asm/elf.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -226,7 +226,7 @@ struct got_entry {
226226
* Layout of the Function Descriptor
227227
*/
228228
struct fdesc {
229-
uint64_t ip;
229+
uint64_t addr;
230230
uint64_t gp;
231231
};
232232

arch/ia64/include/asm/sections.h

Lines changed: 3 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,9 @@
99

1010
#include <linux/elf.h>
1111
#include <linux/uaccess.h>
12+
13+
typedef struct fdesc func_desc_t;
14+
1215
#include <asm-generic/sections.h>
1316

1417
extern char __phys_per_cpu_start[];
@@ -27,25 +30,4 @@ extern char __start_gate_brl_fsys_bubble_down_patchlist[], __end_gate_brl_fsys_b
2730
extern char __start_unwind[], __end_unwind[];
2831
extern char __start_ivt_text[], __end_ivt_text[];
2932

30-
#define HAVE_DEREFERENCE_FUNCTION_DESCRIPTOR 1
31-
32-
#undef dereference_function_descriptor
33-
static inline void *dereference_function_descriptor(void *ptr)
34-
{
35-
struct fdesc *desc = ptr;
36-
void *p;
37-
38-
if (!get_kernel_nofault(p, (void *)&desc->ip))
39-
ptr = p;
40-
return ptr;
41-
}
42-
43-
#undef dereference_kernel_function_descriptor
44-
static inline void *dereference_kernel_function_descriptor(void *ptr)
45-
{
46-
if (ptr < (void *)__start_opd || ptr >= (void *)__end_opd)
47-
return ptr;
48-
return dereference_function_descriptor(ptr);
49-
}
50-
5133
#endif /* _ASM_IA64_SECTIONS_H */

arch/ia64/kernel/module.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -602,15 +602,15 @@ get_fdesc (struct module *mod, uint64_t value, int *okp)
602602
return value;
603603

604604
/* Look for existing function descriptor. */
605-
while (fdesc->ip) {
606-
if (fdesc->ip == value)
605+
while (fdesc->addr) {
606+
if (fdesc->addr == value)
607607
return (uint64_t)fdesc;
608608
if ((uint64_t) ++fdesc >= mod->arch.opd->sh_addr + mod->arch.opd->sh_size)
609609
BUG();
610610
}
611611

612612
/* Create new one */
613-
fdesc->ip = value;
613+
fdesc->addr = value;
614614
fdesc->gp = mod->arch.gp;
615615
return (uint64_t) fdesc;
616616
}

arch/parisc/Kconfig

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -72,6 +72,7 @@ config PARISC
7272
select HAVE_DYNAMIC_FTRACE_WITH_REGS
7373
select HAVE_SOFTIRQ_ON_OWN_STACK if IRQSTACKS
7474
select TRACE_IRQFLAGS_SUPPORT
75+
select HAVE_FUNCTION_DESCRIPTORS if 64BIT
7576

7677
help
7778
The PA-RISC microprocessor is designed by Hewlett-Packard and used

arch/parisc/include/asm/sections.h

Lines changed: 5 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -2,20 +2,14 @@
22
#ifndef _PARISC_SECTIONS_H
33
#define _PARISC_SECTIONS_H
44

5+
#ifdef CONFIG_HAVE_FUNCTION_DESCRIPTORS
6+
#include <asm/elf.h>
7+
typedef Elf64_Fdesc func_desc_t;
8+
#endif
9+
510
/* nothing to see, move along */
611
#include <asm-generic/sections.h>
712

813
extern char __alt_instructions[], __alt_instructions_end[];
914

10-
#ifdef CONFIG_64BIT
11-
12-
#define HAVE_DEREFERENCE_FUNCTION_DESCRIPTOR 1
13-
14-
#undef dereference_function_descriptor
15-
void *dereference_function_descriptor(void *);
16-
17-
#undef dereference_kernel_function_descriptor
18-
void *dereference_kernel_function_descriptor(void *);
19-
#endif
20-
2115
#endif

arch/parisc/kernel/process.c

Lines changed: 0 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -263,27 +263,6 @@ __get_wchan(struct task_struct *p)
263263
return 0;
264264
}
265265

266-
#ifdef CONFIG_64BIT
267-
void *dereference_function_descriptor(void *ptr)
268-
{
269-
Elf64_Fdesc *desc = ptr;
270-
void *p;
271-
272-
if (!get_kernel_nofault(p, (void *)&desc->addr))
273-
ptr = p;
274-
return ptr;
275-
}
276-
277-
void *dereference_kernel_function_descriptor(void *ptr)
278-
{
279-
if (ptr < (void *)__start_opd ||
280-
ptr >= (void *)__end_opd)
281-
return ptr;
282-
283-
return dereference_function_descriptor(ptr);
284-
}
285-
#endif
286-
287266
static inline unsigned long brk_rnd(void)
288267
{
289268
return (get_random_int() & BRK_RND_MASK) << PAGE_SHIFT;

0 commit comments

Comments
 (0)