process.c (4c25df5640ae6e4491ee2c50d3f70c1559ef037d) process.c (2c614c1194f2803750c14b751871bd168dcc8054)
1// SPDX-License-Identifier: GPL-2.0-only
2/*
3 * Based on arch/arm/kernel/process.c
4 *
5 * Original Copyright (C) 1995 Linus Torvalds
6 * Copyright (C) 1996-2000 Russell King - Converted to ARM.
7 * Copyright (C) 2012 ARM Ltd.
8 */

--- 594 unchanged lines hidden (view full) ---

603 return 0;
604}
605
606/*
607 * Global sysctl to disable the tagged user addresses support. This control
608 * only prevents the tagged address ABI enabling via prctl() and does not
609 * disable it for tasks that already opted in to the relaxed ABI.
610 */
1// SPDX-License-Identifier: GPL-2.0-only
2/*
3 * Based on arch/arm/kernel/process.c
4 *
5 * Original Copyright (C) 1995 Linus Torvalds
6 * Copyright (C) 1996-2000 Russell King - Converted to ARM.
7 * Copyright (C) 2012 ARM Ltd.
8 */

--- 594 unchanged lines hidden (view full) ---

603 return 0;
604}
605
606/*
607 * Global sysctl to disable the tagged user addresses support. This control
608 * only prevents the tagged address ABI enabling via prctl() and does not
609 * disable it for tasks that already opted in to the relaxed ABI.
610 */
611static int zero;
612static int one = 1;
613
614static struct ctl_table tagged_addr_sysctl_table[] = {
615 {
616 .procname = "tagged_addr_disabled",
617 .mode = 0644,
618 .data = &tagged_addr_disabled,
619 .maxlen = sizeof(int),
620 .proc_handler = proc_dointvec_minmax,
611
612static struct ctl_table tagged_addr_sysctl_table[] = {
613 {
614 .procname = "tagged_addr_disabled",
615 .mode = 0644,
616 .data = &tagged_addr_disabled,
617 .maxlen = sizeof(int),
618 .proc_handler = proc_dointvec_minmax,
621 .extra1 = &zero,
622 .extra2 = &one,
619 .extra1 = SYSCTL_ZERO,
620 .extra2 = SYSCTL_ONE,
623 },
624 { }
625};
626
627static int __init tagged_addr_init(void)
628{
629 if (!register_sysctl("abi", tagged_addr_sysctl_table))
630 return -EINVAL;

--- 10 unchanged lines hidden (view full) ---

641 /*
642 * Preempting a task from an IRQ means we leave copies of PSTATE
643 * on the stack. cpufeature's enable calls may modify PSTATE, but
644 * resuming one of these preempted tasks would undo those changes.
645 *
646 * Only allow a task to be preempted once cpufeatures have been
647 * enabled.
648 */
621 },
622 { }
623};
624
625static int __init tagged_addr_init(void)
626{
627 if (!register_sysctl("abi", tagged_addr_sysctl_table))
628 return -EINVAL;

--- 10 unchanged lines hidden (view full) ---

639 /*
640 * Preempting a task from an IRQ means we leave copies of PSTATE
641 * on the stack. cpufeature's enable calls may modify PSTATE, but
642 * resuming one of these preempted tasks would undo those changes.
643 *
644 * Only allow a task to be preempted once cpufeatures have been
645 * enabled.
646 */
649 if (static_branch_likely(&arm64_const_caps_ready))
647 if (system_capabilities_finalized())
650 preempt_schedule_irq();
651}
648 preempt_schedule_irq();
649}