]> Git Repo - linux.git/commitdiff
Merge tag 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/rmk/linux
authorLinus Torvalds <[email protected]>
Fri, 17 May 2024 15:53:47 +0000 (08:53 -0700)
committerLinus Torvalds <[email protected]>
Fri, 17 May 2024 15:53:47 +0000 (08:53 -0700)
Pull ARM updates from Russell King:

 - Updates to AMBA bus subsystem to drop .owner struct device_driver
   initialisations, moving that to code instead.

 - Add LPAE privileged-access-never support

 - Add support for Clang CFI

 - clkdev: report over-sized device or connection strings

* tag 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/rmk/linux: (36 commits)
  ARM: 9398/1: Fix userspace enter on LPAE with CC_OPTIMIZE_FOR_SIZE=y
  clkdev: report over-sized strings when creating clkdev entries
  ARM: 9393/1: mm: Use conditionals for CFI branches
  ARM: 9392/2: Support CLANG CFI
  ARM: 9391/2: hw_breakpoint: Handle CFI breakpoints
  ARM: 9390/2: lib: Annotate loop delay instructions for CFI
  ARM: 9389/2: mm: Define prototypes for all per-processor calls
  ARM: 9388/2: mm: Type-annotate all per-processor assembly routines
  ARM: 9387/2: mm: Rewrite cacheflush vtables in CFI safe C
  ARM: 9386/2: mm: Use symbol alias for cache functions
  ARM: 9385/2: mm: Type-annotate all cache assembly routines
  ARM: 9384/2: mm: Make tlbflush routines CFI safe
  ARM: 9382/1: ftrace: Define ftrace_stub_graph
  ARM: 9358/2: Implement PAN for LPAE by TTBR0 page table walks disablement
  ARM: 9357/2: Reduce the number of #ifdef CONFIG_CPU_SW_DOMAIN_PAN
  ARM: 9356/2: Move asm statements accessing TTBCR into C functions
  ARM: 9355/2: Add TTBCR_* definitions to pgtable-3level-hwdef.h
  ARM: 9379/1: coresight: tpda: drop owner assignment
  ARM: 9378/1: coresight: etm4x: drop owner assignment
  ARM: 9377/1: hwrng: nomadik: drop owner assignment
  ...

1  2 
arch/arm/kernel/hw_breakpoint.c
drivers/dma/pl330.c

index 054e9199f30db654e3fba1116b48ccf9ae7bafb6,93f9034e4e72dee6eb9cdea7ceb0532f0722a514..a12efd0f43e81a173a532d09f15e79b3bcf0cebd
@@@ -17,6 -17,7 +17,7 @@@
  #include <linux/perf_event.h>
  #include <linux/hw_breakpoint.h>
  #include <linux/smp.h>
+ #include <linux/cfi.h>
  #include <linux/cpu_pm.h>
  #include <linux/coresight.h>
  
@@@ -626,7 -627,7 +627,7 @@@ int hw_breakpoint_arch_parse(struct per
        hw->address &= ~alignment_mask;
        hw->ctrl.len <<= offset;
  
 -      if (uses_default_overflow_handler(bp)) {
 +      if (is_default_overflow_handler(bp)) {
                /*
                 * Mismatch breakpoints are required for single-stepping
                 * breakpoints.
@@@ -798,7 -799,7 +799,7 @@@ static void watchpoint_handler(unsigne
                 * Otherwise, insert a temporary mismatch breakpoint so that
                 * we can single-step over the watchpoint trigger.
                 */
 -              if (!uses_default_overflow_handler(wp))
 +              if (!is_default_overflow_handler(wp))
                        continue;
  step:
                enable_single_step(wp, instruction_pointer(regs));
                info->trigger = addr;
                pr_debug("watchpoint fired: address = 0x%x\n", info->trigger);
                perf_bp_event(wp, regs);
 -              if (uses_default_overflow_handler(wp))
 +              if (is_default_overflow_handler(wp))
                        enable_single_step(wp, instruction_pointer(regs));
        }
  
@@@ -886,7 -887,7 +887,7 @@@ static void breakpoint_handler(unsigne
                        info->trigger = addr;
                        pr_debug("breakpoint fired: address = 0x%x\n", addr);
                        perf_bp_event(bp, regs);
 -                      if (uses_default_overflow_handler(bp))
 +                      if (is_default_overflow_handler(bp))
                                enable_single_step(bp, addr);
                        goto unlock;
                }
@@@ -903,6 -904,37 +904,37 @@@ unlock
        watchpoint_single_step_handler(addr);
  }
  
+ #ifdef CONFIG_CFI_CLANG
+ static void hw_breakpoint_cfi_handler(struct pt_regs *regs)
+ {
+       /*
+        * TODO: implementing target and type to pass to CFI using the more
+        * elaborate report_cfi_failure() requires compiler work. To be able
+        * to properly extract target information the compiler needs to
+        * emit a stable instructions sequence for the CFI checks so we can
+        * decode the instructions preceding the trap and figure out which
+        * registers were used.
+        */
+       switch (report_cfi_failure_noaddr(regs, instruction_pointer(regs))) {
+       case BUG_TRAP_TYPE_BUG:
+               die("Oops - CFI", regs, 0);
+               break;
+       case BUG_TRAP_TYPE_WARN:
+               /* Skip the breaking instruction */
+               instruction_pointer(regs) += 4;
+               break;
+       default:
+               die("Unknown CFI error", regs, 0);
+               break;
+       }
+ }
+ #else
+ static void hw_breakpoint_cfi_handler(struct pt_regs *regs)
+ {
+ }
+ #endif
  /*
   * Called from either the Data Abort Handler [watchpoint] or the
   * Prefetch Abort Handler [breakpoint] with interrupts disabled.
@@@ -932,6 -964,9 +964,9 @@@ static int hw_breakpoint_pending(unsign
        case ARM_ENTRY_SYNC_WATCHPOINT:
                watchpoint_handler(addr, fsr, regs);
                break;
+       case ARM_ENTRY_CFI_BREAKPOINT:
+               hw_breakpoint_cfi_handler(regs);
+               break;
        default:
                ret = 1; /* Unhandled fault. */
        }
diff --combined drivers/dma/pl330.c
index ad8e3da1b2cd229ff9bdf222439c1db6d1e229ad,b37ef28bb41770ffed081f2394b9b5b23444e42d..60c4de8dac1d2abd067ff1065d21d960b1dac844
@@@ -1053,6 -1053,9 +1053,6 @@@ static bool _trigger(struct pl330_threa
  
        thrd->req_running = idx;
  
 -      if (desc->rqtype == DMA_MEM_TO_DEV || desc->rqtype == DMA_DEV_TO_MEM)
 -              UNTIL(thrd, PL330_STATE_WFP);
 -
        return true;
  }
  
@@@ -3262,7 -3265,6 +3262,6 @@@ MODULE_DEVICE_TABLE(amba, pl330_ids)
  
  static struct amba_driver pl330_driver = {
        .drv = {
-               .owner = THIS_MODULE,
                .name = "dma-pl330",
                .pm = &pl330_pm,
        },
This page took 0.086767 seconds and 4 git commands to generate.