Pull arm64 and cross-arch updates from Catalin Marinas: "Here's a slightly wider-spread set of updates for 5.9. Going outside the usual arch/arm64/ area is the removal of read_barrier_depends() series from Will and the MSI/IOMMU ID translation series from Lorenzo. The notable arm64 updates include ARMv8.4 TLBI range operations and translation level hint, time namespace support, and perf. Summary: - Removal of the tremendously unpopular read_barrier_depends() barrier, which is a NOP on all architectures apart from Alpha, in favour of allowing architectures to override READ_ONCE() and do whatever dance they need to do to ensure address dependencies provide LOAD -> LOAD/STORE ordering. This work also offers a potential solution if compilers are shown to convert LOAD -> LOAD address dependencies into control dependencies (e.g. under LTO), as weakly ordered architectures will effectively be able to upgrade READ_ONCE() to smp_load_acquire(). The latter case is not used yet, but will be discussed further at LPC. - Make the MSI/IOMMU input/output ID translation PCI agnostic, augment the MSI/IOMMU ACPI/OF ID mapping APIs to accept an input ID bus-specific parameter and apply the resulting changes to the device ID space provided by the Freescale FSL bus. - arm64 support for TLBI range operations and translation table level hints (part of the ARMv8.4 architecture version). - Time namespace support for arm64. - Export the virtual and physical address sizes in vmcoreinfo for makedumpfile and crash utilities. - CPU feature handling cleanups and checks for programmer errors (overlapping bit-fields). - ACPI updates for arm64: disallow AML accesses to EFI code regions and kernel memory. - perf updates for arm64. - Miscellaneous fixes and cleanups, most notably PLT counting optimisation for module loading, recordmcount fix to ignore relocations other than R_AARCH64_CALL26, CMA areas reserved for gigantic pages on 16K and 64K configurations. - Trivial typos, duplicate words" Link: http://lkml.kernel.org/r/20200710165203.31284-1-will@kernel.org Link: http://lkml.kernel.org/r/20200619082013.13661-1-lorenzo.pieralisi@arm.com * tag 'arm64-upstream' of git://git.kernel.org/pub/scm/linux/kernel/git/arm64/linux: (82 commits) arm64: use IRQ_STACK_SIZE instead of THREAD_SIZE for irq stack arm64/mm: save memory access in check_and_switch_context() fast switch path arm64: sigcontext.h: delete duplicated word arm64: ptrace.h: delete duplicated word arm64: pgtable-hwdef.h: delete duplicated words bus: fsl-mc: Add ACPI support for fsl-mc bus/fsl-mc: Refactor the MSI domain creation in the DPRC driver of/irq: Make of_msi_map_rid() PCI bus agnostic of/irq: make of_msi_map_get_device_domain() bus agnostic dt-bindings: arm: fsl: Add msi-map device-tree binding for fsl-mc bus of/device: Add input id to of_dma_configure() of/iommu: Make of_map_rid() PCI agnostic ACPI/IORT: Add an input ID to acpi_dma_configure() ACPI/IORT: Remove useless PCI bus walk ACPI/IORT: Make iort_msi_map_rid() PCI agnostic ACPI/IORT: Make iort_get_device_domain IRQ domain agnostic ACPI/IORT: Make iort_match_node_callback walk the ACPI namespace for NC arm64: enable time namespace support arm64/vdso: Restrict splitting VVAR VMA arm64/vdso: Handle faults on timens page ...
Showing the changes to include/linux (13 of 98 files). Show all
Unified · Split
| @@ -905,6 +905,13 @@ static inline int acpi_dma_configure(struct device *dev, · 904 unmodified lines | ||
| 905 | 905 | return 0; |
| 906 | 906 | } |
| 907 | 907 | |
| 908 | +static inline int acpi_dma_configure_id(struct device *dev, | |
| 909 | + enum dev_dma_attr attr, | |
| 910 | + const u32 *input_id) | |
| 911 | +{ | |
| 912 | + return 0; | |
| 913 | +} | |
| 914 | + | |
| 908 | 915 | #define ACPI_PTR(_ptr) (NULL) |
| 909 | 916 | |
| 910 | 917 | static inline void acpi_device_set_enumerated(struct acpi_device *adev) |
| @@ -28,27 +28,29 @@ void iort_deregister_domain_token(int trans_id); · 27 unmodified lines | ||
| 28 | 28 | struct fwnode_handle *iort_find_domain_token(int trans_id); |
| 29 | 29 | #ifdef CONFIG_ACPI_IORT |
| 30 | 30 | void acpi_iort_init(void); |
| 31 | −u32 iort_msi_map_rid(struct device *dev, u32 req_id); | |
| 32 | −struct irq_domain *iort_get_device_domain(struct device *dev, u32 req_id); | |
| 31 | +u32 iort_msi_map_id(struct device *dev, u32 id); | |
| 32 | +struct irq_domain *iort_get_device_domain(struct device *dev, u32 id, | |
| 33 | + enum irq_domain_bus_token bus_token); | |
| 33 | 34 | void acpi_configure_pmsi_domain(struct device *dev); |
| 34 | 35 | int iort_pmsi_get_dev_id(struct device *dev, u32 *dev_id); |
| 35 | 36 | /* IOMMU interface */ |
| 36 | 37 | void iort_dma_setup(struct device *dev, u64 *dma_addr, u64 *size); |
| 37 | −const struct iommu_ops *iort_iommu_configure(struct device *dev); | |
| 38 | +const struct iommu_ops *iort_iommu_configure_id(struct device *dev, | |
| 39 | + const u32 *id_in); | |
| 38 | 40 | int iort_iommu_msi_get_resv_regions(struct device *dev, struct list_head *head); |
| 39 | 41 | #else |
| 40 | 42 | static inline void acpi_iort_init(void) { } |
| 41 | −static inline u32 iort_msi_map_rid(struct device *dev, u32 req_id) | |
| 42 | −{ return req_id; } | |
| 43 | −static inline struct irq_domain *iort_get_device_domain(struct device *dev, | |
| 44 | − u32 req_id) | |
| 43 | +static inline u32 iort_msi_map_id(struct device *dev, u32 id) | |
| 44 | +{ return id; } | |
| 45 | +static inline struct irq_domain *iort_get_device_domain( | |
| 46 | + struct device *dev, u32 id, enum irq_domain_bus_token bus_token) | |
| 45 | 47 | { return NULL; } |
| 46 | 48 | static inline void acpi_configure_pmsi_domain(struct device *dev) { } |
| 47 | 49 | /* IOMMU interface */ |
| 48 | 50 | static inline void iort_dma_setup(struct device *dev, u64 *dma_addr, |
| 49 | 51 | u64 *size) { } |
| 50 | −static inline const struct iommu_ops *iort_iommu_configure( | |
| 51 | − struct device *dev) | |
| 52 | +static inline const struct iommu_ops *iort_iommu_configure_id( | |
| 53 | + struct device *dev, const u32 *id_in) | |
| 52 | 54 | { return NULL; } |
| 53 | 55 | static inline |
| 54 | 56 | int iort_iommu_msi_get_resv_regions(struct device *dev, struct list_head *head) |
| @@ -81,6 +81,28 @@ · 80 unmodified lines | ||
| 81 | 81 | ARM_SMCCC_SMC_32, \ |
| 82 | 82 | 0, 0x7fff) |
| 83 | 83 | |
| 84 | +/* Paravirtualised time calls (defined by ARM DEN0057A) */ | |
| 85 | +#define ARM_SMCCC_HV_PV_TIME_FEATURES \ | |
| 86 | + ARM_SMCCC_CALL_VAL(ARM_SMCCC_FAST_CALL, \ | |
| 87 | + ARM_SMCCC_SMC_64, \ | |
| 88 | + ARM_SMCCC_OWNER_STANDARD_HYP, \ | |
| 89 | + 0x20) | |
| 90 | + | |
| 91 | +#define ARM_SMCCC_HV_PV_TIME_ST \ | |
| 92 | + ARM_SMCCC_CALL_VAL(ARM_SMCCC_FAST_CALL, \ | |
| 93 | + ARM_SMCCC_SMC_64, \ | |
| 94 | + ARM_SMCCC_OWNER_STANDARD_HYP, \ | |
| 95 | + 0x21) | |
| 96 | + | |
| 97 | +/* | |
| 98 | + * Return codes defined in ARM DEN 0070A | |
| 99 | + * ARM DEN 0070A is now merged/consolidated into ARM DEN 0028 C | |
| 100 | + */ | |
| 101 | +#define SMCCC_RET_SUCCESS 0 | |
| 102 | +#define SMCCC_RET_NOT_SUPPORTED -1 | |
| 103 | +#define SMCCC_RET_NOT_REQUIRED -2 | |
| 104 | +#define SMCCC_RET_INVALID_PARAMETER -3 | |
| 105 | + | |
| 84 | 106 | #ifndef __ASSEMBLY__ |
| 85 | 107 | |
| 86 | 108 | #include <linux/linkage.h> |
| @@ -331,15 +353,6 @@ asmlinkage void __arm_smccc_hvc(unsigned long a0, unsigned long a1, · 244 unmodified lines | ||
| 331 | 353 | */ |
| 332 | 354 | #define arm_smccc_1_1_hvc(...) __arm_smccc_1_1(SMCCC_HVC_INST, __VA_ARGS__) |
| 333 | 355 | |
| 334 | −/* | |
| 335 | − * Return codes defined in ARM DEN 0070A | |
| 336 | − * ARM DEN 0070A is now merged/consolidated into ARM DEN 0028 C | |
| 337 | − */ | |
| 338 | −#define SMCCC_RET_SUCCESS 0 | |
| 339 | −#define SMCCC_RET_NOT_SUPPORTED -1 | |
| 340 | −#define SMCCC_RET_NOT_REQUIRED -2 | |
| 341 | −#define SMCCC_RET_INVALID_PARAMETER -3 | |
| 342 | − | |
| 343 | 356 | /* |
| 344 | 357 | * Like arm_smccc_1_1* but always returns SMCCC_RET_NOT_SUPPORTED. |
| 345 | 358 | * Used when the SMCCC conduit is not defined. The empty asm statement |
| @@ -385,18 +398,5 @@ asmlinkage void __arm_smccc_hvc(unsigned long a0, unsigned long a1, · 39 unmodified lines | ||
| 385 | 398 | method; \ |
| 386 | 399 | }) |
| 387 | 400 | |
| 388 | −/* Paravirtualised time calls (defined by ARM DEN0057A) */ | |
| 389 | −#define ARM_SMCCC_HV_PV_TIME_FEATURES \ | |
| 390 | − ARM_SMCCC_CALL_VAL(ARM_SMCCC_FAST_CALL, \ | |
| 391 | − ARM_SMCCC_SMC_64, \ | |
| 392 | − ARM_SMCCC_OWNER_STANDARD_HYP, \ | |
| 393 | − 0x20) | |
| 394 | − | |
| 395 | −#define ARM_SMCCC_HV_PV_TIME_ST \ | |
| 396 | − ARM_SMCCC_CALL_VAL(ARM_SMCCC_FAST_CALL, \ | |
| 397 | − ARM_SMCCC_SMC_64, \ | |
| 398 | − ARM_SMCCC_OWNER_STANDARD_HYP, \ | |
| 399 | − 0x21) | |
| 400 | − | |
| 401 | 401 | #endif /*__ASSEMBLY__*/ |
| 402 | 402 | #endif /*__LINUX_ARM_SMCCC_H*/ |
| @@ -230,28 +230,6 @@ void ftrace_likely_update(struct ftrace_likely_data *f, int val, · 229 unmodified lines | ||
| 230 | 230 | # define __UNIQUE_ID(prefix) __PASTE(__PASTE(__UNIQUE_ID_, prefix), __LINE__) |
| 231 | 231 | #endif |
| 232 | 232 | |
| 233 | −/* | |
| 234 | − * Prevent the compiler from merging or refetching reads or writes. The | |
| 235 | − * compiler is also forbidden from reordering successive instances of | |
| 236 | − * READ_ONCE and WRITE_ONCE, but only when the compiler is aware of some | |
| 237 | − * particular ordering. One way to make the compiler aware of ordering is to | |
| 238 | − * put the two invocations of READ_ONCE or WRITE_ONCE in different C | |
| 239 | − * statements. | |
| 240 | − * | |
| 241 | − * These two macros will also work on aggregate data types like structs or | |
| 242 | − * unions. | |
| 243 | − * | |
| 244 | − * Their two major use cases are: (1) Mediating communication between | |
| 245 | − * process-level code and irq/NMI handlers, all running on the same CPU, | |
| 246 | − * and (2) Ensuring that the compiler does not fold, spindle, or otherwise | |
| 247 | − * mutilate accesses that either do not require ordering or that interact | |
| 248 | − * with an explicit memory barrier or atomic instruction that provides the | |
| 249 | − * required ordering. | |
| 250 | − */ | |
| 251 | −#include <asm/barrier.h> | |
| 252 | −#include <linux/kasan-checks.h> | |
| 253 | −#include <linux/kcsan-checks.h> | |
| 254 | − | |
| 255 | 233 | /** |
| 256 | 234 | * data_race - mark an expression as containing intentional data races |
| 257 | 235 | * |
| @@ -272,65 +250,6 @@ void ftrace_likely_update(struct ftrace_likely_data *f, int val, · 14 unmodified lines | ||
| 272 | 250 | __v; \ |
| 273 | 251 | }) |
| 274 | 252 | |
| 275 | −/* | |
| 276 | − * Use __READ_ONCE() instead of READ_ONCE() if you do not require any | |
| 277 | − * atomicity or dependency ordering guarantees. Note that this may result | |
| 278 | − * in tears! | |
| 279 | − */ | |
| 280 | −#define __READ_ONCE(x) (*(const volatile __unqual_scalar_typeof(x) *)&(x)) | |
| 281 | − | |
| 282 | −#define __READ_ONCE_SCALAR(x) \ | |
| 283 | −({ \ | |
| 284 | − __unqual_scalar_typeof(x) __x = __READ_ONCE(x); \ | |
| 285 | − smp_read_barrier_depends(); \ | |
| 286 | − (typeof(x))__x; \ | |
| 287 | −}) | |
| 288 | − | |
| 289 | −#define READ_ONCE(x) \ | |
| 290 | −({ \ | |
| 291 | − compiletime_assert_rwonce_type(x); \ | |
| 292 | − __READ_ONCE_SCALAR(x); \ | |
| 293 | −}) | |
| 294 | − | |
| 295 | −#define __WRITE_ONCE(x, val) \ | |
| 296 | −do { \ | |
| 297 | − *(volatile typeof(x) *)&(x) = (val); \ | |
| 298 | −} while (0) | |
| 299 | − | |
| 300 | −#define WRITE_ONCE(x, val) \ | |
| 301 | −do { \ | |
| 302 | − compiletime_assert_rwonce_type(x); \ | |
| 303 | − __WRITE_ONCE(x, val); \ | |
| 304 | −} while (0) | |
| 305 | − | |
| 306 | −static __no_sanitize_or_inline | |
| 307 | −unsigned long __read_once_word_nocheck(const void *addr) | |
| 308 | −{ | |
| 309 | − return __READ_ONCE(*(unsigned long *)addr); | |
| 310 | −} | |
| 311 | − | |
| 312 | −/* | |
| 313 | − * Use READ_ONCE_NOCHECK() instead of READ_ONCE() if you need to load a | |
| 314 | − * word from memory atomically but without telling KASAN/KCSAN. This is | |
| 315 | − * usually used by unwinding code when walking the stack of a running process. | |
| 316 | − */ | |
| 317 | −#define READ_ONCE_NOCHECK(x) \ | |
| 318 | −({ \ | |
| 319 | − unsigned long __x; \ | |
| 320 | − compiletime_assert(sizeof(x) == sizeof(__x), \ | |
| 321 | − "Unsupported access size for READ_ONCE_NOCHECK()."); \ | |
| 322 | − __x = __read_once_word_nocheck(&(x)); \ | |
| 323 | − smp_read_barrier_depends(); \ | |
| 324 | − (typeof(x))__x; \ | |
| 325 | −}) | |
| 326 | − | |
| 327 | −static __no_kasan_or_inline | |
| 328 | −unsigned long read_word_at_a_time(const void *addr) | |
| 329 | −{ | |
| 330 | − kasan_check_read(addr, 1); | |
| 331 | − return *(unsigned long *)addr; | |
| 332 | −} | |
| 333 | − | |
| 334 | 253 | #endif /* __KERNEL__ */ |
| 335 | 254 | |
| 336 | 255 | /* |
| @@ -354,57 +273,6 @@ static inline void *offset_to_ptr(const int *off) · 17 unmodified lines | ||
| 354 | 273 | |
| 355 | 274 | #endif /* __ASSEMBLY__ */ |
| 356 | 275 | |
| 357 | −/* Compile time object size, -1 for unknown */ | |
| 358 | −#ifndef __compiletime_object_size | |
| 359 | −# define __compiletime_object_size(obj) -1 | |
| 360 | −#endif | |
| 361 | −#ifndef __compiletime_warning | |
| 362 | −# define __compiletime_warning(message) | |
| 363 | −#endif | |
| 364 | −#ifndef __compiletime_error | |
| 365 | −# define __compiletime_error(message) | |
| 366 | −#endif | |
| 367 | − | |
| 368 | −#ifdef __OPTIMIZE__ | |
| 369 | −# define __compiletime_assert(condition, msg, prefix, suffix) \ | |
| 370 | − do { \ | |
| 371 | − extern void prefix ## suffix(void) __compiletime_error(msg); \ | |
| 372 | − if (!(condition)) \ | |
| 373 | − prefix ## suffix(); \ | |
| 374 | − } while (0) | |
| 375 | −#else | |
| 376 | −# define __compiletime_assert(condition, msg, prefix, suffix) do { } while (0) | |
| 377 | −#endif | |
| 378 | − | |
| 379 | −#define _compiletime_assert(condition, msg, prefix, suffix) \ | |
| 380 | − __compiletime_assert(condition, msg, prefix, suffix) | |
| 381 | − | |
| 382 | −/** | |
| 383 | − * compiletime_assert - break build and emit msg if condition is false | |
| 384 | − * @condition: a compile-time constant condition to check | |
| 385 | − * @msg: a message to emit if condition is false | |
| 386 | − * | |
| 387 | − * In tradition of POSIX assert, this macro will break the build if the | |
| 388 | − * supplied condition is *false*, emitting the supplied error message if the | |
| 389 | − * compiler has support to do so. | |
| 390 | − */ | |
| 391 | −#define compiletime_assert(condition, msg) \ | |
| 392 | − _compiletime_assert(condition, msg, __compiletime_assert_, __COUNTER__) | |
| 393 | − | |
| 394 | −#define compiletime_assert_atomic_type(t) \ | |
| 395 | − compiletime_assert(__native_word(t), \ | |
| 396 | − "Need native word sized stores/loads for atomicity.") | |
| 397 | − | |
| 398 | −/* | |
| 399 | − * Yes, this permits 64-bit accesses on 32-bit architectures. These will | |
| 400 | − * actually be atomic in some cases (namely Armv7 + LPAE), but for others we | |
| 401 | − * rely on the access being split into 2x32-bit accesses for a 32-bit quantity | |
| 402 | − * (e.g. a virtual address) and a strong prevailing wind. | |
| 403 | − */ | |
| 404 | −#define compiletime_assert_rwonce_type(t) \ | |
| 405 | − compiletime_assert(__native_word(t) || sizeof(t) == sizeof(long long), \ | |
| 406 | − "Unsupported access size for {READ,WRITE}_ONCE().") | |
| 407 | − | |
| 408 | 276 | /* &a[0] degrades to a pointer: a different type from an array */ |
| 409 | 277 | #define __must_be_array(a) BUILD_BUG_ON_ZERO(__same_type((a), &(a)[0])) |
| 410 | 278 | |
| @@ -414,4 +282,6 @@ static inline void *offset_to_ptr(const int *off) · 3 unmodified lines | ||
| 414 | 282 | */ |
| 415 | 283 | #define prevent_tail_call_optimization() mb() |
| 416 | 284 | |
| 285 | +#include <asm/rwonce.h> | |
| 286 | + | |
| 417 | 287 | #endif /* __LINUX_COMPILER_H */ |
| @@ -275,6 +275,47 @@ struct ftrace_likely_data { · 274 unmodified lines | ||
| 275 | 275 | (sizeof(t) == sizeof(char) || sizeof(t) == sizeof(short) || \ |
| 276 | 276 | sizeof(t) == sizeof(int) || sizeof(t) == sizeof(long)) |
| 277 | 277 | |
| 278 | +/* Compile time object size, -1 for unknown */ | |
| 279 | +#ifndef __compiletime_object_size | |
| 280 | +# define __compiletime_object_size(obj) -1 | |
| 281 | +#endif | |
| 282 | +#ifndef __compiletime_warning | |
| 283 | +# define __compiletime_warning(message) | |
| 284 | +#endif | |
| 285 | +#ifndef __compiletime_error | |
| 286 | +# define __compiletime_error(message) | |
| 287 | +#endif | |
| 288 | + | |
| 289 | +#ifdef __OPTIMIZE__ | |
| 290 | +# define __compiletime_assert(condition, msg, prefix, suffix) \ | |
| 291 | + do { \ | |
| 292 | + extern void prefix ## suffix(void) __compiletime_error(msg); \ | |
| 293 | + if (!(condition)) \ | |
| 294 | + prefix ## suffix(); \ | |
| 295 | + } while (0) | |
| 296 | +#else | |
| 297 | +# define __compiletime_assert(condition, msg, prefix, suffix) do { } while (0) | |
| 298 | +#endif | |
| 299 | + | |
| 300 | +#define _compiletime_assert(condition, msg, prefix, suffix) \ | |
| 301 | + __compiletime_assert(condition, msg, prefix, suffix) | |
| 302 | + | |
| 303 | +/** | |
| 304 | + * compiletime_assert - break build and emit msg if condition is false | |
| 305 | + * @condition: a compile-time constant condition to check | |
| 306 | + * @msg: a message to emit if condition is false | |
| 307 | + * | |
| 308 | + * In tradition of POSIX assert, this macro will break the build if the | |
| 309 | + * supplied condition is *false*, emitting the supplied error message if the | |
| 310 | + * compiler has support to do so. | |
| 311 | + */ | |
| 312 | +#define compiletime_assert(condition, msg) \ | |
| 313 | + _compiletime_assert(condition, msg, __compiletime_assert_, __COUNTER__) | |
| 314 | + | |
| 315 | +#define compiletime_assert_atomic_type(t) \ | |
| 316 | + compiletime_assert(__native_word(t), \ | |
| 317 | + "Need native word sized stores/loads for atomicity.") | |
| 318 | + | |
| 278 | 319 | /* Helpers for emitting diagnostics in pragmas. */ |
| 279 | 320 | #ifndef __diag |
| 280 | 321 | #define __diag(string) |
| @@ -5,6 +5,8 @@ · 4 unmodified lines | ||
| 5 | 5 | |
| 6 | 6 | #ifndef _LINUX_NOSPEC_H |
| 7 | 7 | #define _LINUX_NOSPEC_H |
| 8 | + | |
| 9 | +#include <linux/compiler.h> | |
| 8 | 10 | #include <asm/barrier.h> |
| 9 | 11 | |
| 10 | 12 | struct task_struct; |
| @@ -554,7 +554,7 @@ bool of_console_check(struct device_node *dn, char *name, int index); · 553 unmodified lines | ||
| 554 | 554 | |
| 555 | 555 | extern int of_cpu_node_to_id(struct device_node *np); |
| 556 | 556 | |
| 557 | −int of_map_rid(struct device_node *np, u32 rid, | |
| 557 | +int of_map_id(struct device_node *np, u32 id, | |
| 558 | 558 | const char *map_name, const char *map_mask_name, |
| 559 | 559 | struct device_node **target, u32 *id_out); |
| 560 | 560 | |
| @@ -978,7 +978,7 @@ static inline int of_cpu_node_to_id(struct device_node *np) · 417 unmodified lines | ||
| 978 | 978 | return -ENODEV; |
| 979 | 979 | } |
| 980 | 980 | |
| 981 | −static inline int of_map_rid(struct device_node *np, u32 rid, | |
| 981 | +static inline int of_map_id(struct device_node *np, u32 id, | |
| 982 | 982 | const char *map_name, const char *map_mask_name, |
| 983 | 983 | struct device_node **target, u32 *id_out) |
| 984 | 984 | { |
| @@ -55,9 +55,15 @@ static inline struct device_node *of_cpu_device_node_get(int cpu) · 54 unmodified lines | ||
| 55 | 55 | return of_node_get(cpu_dev->of_node); |
| 56 | 56 | } |
| 57 | 57 | |
| 58 | −int of_dma_configure(struct device *dev, | |
| 58 | +int of_dma_configure_id(struct device *dev, | |
| 59 | 59 | struct device_node *np, |
| 60 | − bool force_dma); | |
| 60 | + bool force_dma, const u32 *id); | |
| 61 | +static inline int of_dma_configure(struct device *dev, | |
| 62 | + struct device_node *np, | |
| 63 | + bool force_dma) | |
| 64 | +{ | |
| 65 | + return of_dma_configure_id(dev, np, force_dma, NULL); | |
| 66 | +} | |
| 61 | 67 | #else /* CONFIG_OF */ |
| 62 | 68 | |
| 63 | 69 | static inline int of_driver_match_device(struct device *dev, |
| @@ -106,6 +112,12 @@ static inline struct device_node *of_cpu_device_node_get(int cpu) · 42 unmodified lines | ||
| 106 | 112 | return NULL; |
| 107 | 113 | } |
| 108 | 114 | |
| 115 | +static inline int of_dma_configure_id(struct device *dev, | |
| 116 | + struct device_node *np, | |
| 117 | + bool force_dma) | |
| 118 | +{ | |
| 119 | + return 0; | |
| 120 | +} | |
| 109 | 121 | static inline int of_dma_configure(struct device *dev, |
| 110 | 122 | struct device_node *np, |
| 111 | 123 | bool force_dma) |
| @@ -13,7 +13,8 @@ extern int of_get_dma_window(struct device_node *dn, const char *prefix, · 12 unmodified lines | ||
| 13 | 13 | size_t *size); |
| 14 | 14 | |
| 15 | 15 | extern const struct iommu_ops *of_iommu_configure(struct device *dev, |
| 16 | − struct device_node *master_np); | |
| 16 | + struct device_node *master_np, | |
| 17 | + const u32 *id); | |
| 17 | 18 | |
| 18 | 19 | #else |
| 19 | 20 | |
| @@ -25,7 +26,8 @@ static inline int of_get_dma_window(struct device_node *dn, const char *prefix, · 5 unmodified lines | ||
| 25 | 26 | } |
| 26 | 27 | |
| 27 | 28 | static inline const struct iommu_ops *of_iommu_configure(struct device *dev, |
| 28 | − struct device_node *master_np) | |
| 29 | + struct device_node *master_np, | |
| 30 | + const u32 *id) | |
| 29 | 31 | { |
| 30 | 32 | return NULL; |
| 31 | 33 | } |
| @@ -52,9 +52,10 @@ extern struct irq_domain *of_msi_get_domain(struct device *dev, · 51 unmodified lines | ||
| 52 | 52 | struct device_node *np, |
| 53 | 53 | enum irq_domain_bus_token token); |
| 54 | 54 | extern struct irq_domain *of_msi_map_get_device_domain(struct device *dev, |
| 55 | − u32 rid); | |
| 55 | + u32 id, | |
| 56 | + u32 bus_token); | |
| 56 | 57 | extern void of_msi_configure(struct device *dev, struct device_node *np); |
| 57 | −u32 of_msi_map_rid(struct device *dev, struct device_node *msi_np, u32 rid_in); | |
| 58 | +u32 of_msi_map_id(struct device *dev, struct device_node *msi_np, u32 id_in); | |
| 58 | 59 | #else |
| 59 | 60 | static inline int of_irq_count(struct device_node *dev) |
| 60 | 61 | { |
| @@ -85,17 +86,17 @@ static inline struct irq_domain *of_msi_get_domain(struct device *dev, · 24 unmodified lines | ||
| 85 | 86 | return NULL; |
| 86 | 87 | } |
| 87 | 88 | static inline struct irq_domain *of_msi_map_get_device_domain(struct device *dev, |
| 88 | − u32 rid) | |
| 89 | + u32 id, u32 bus_token) | |
| 89 | 90 | { |
| 90 | 91 | return NULL; |
| 91 | 92 | } |
| 92 | 93 | static inline void of_msi_configure(struct device *dev, struct device_node *np) |
| 93 | 94 | { |
| 94 | 95 | } |
| 95 | −static inline u32 of_msi_map_rid(struct device *dev, | |
| 96 | − struct device_node *msi_np, u32 rid_in) | |
| 96 | +static inline u32 of_msi_map_id(struct device *dev, | |
| 97 | + struct device_node *msi_np, u32 id_in) | |
| 97 | 98 | { |
| 98 | − return rid_in; | |
| 99 | + return id_in; | |
| 99 | 100 | } |
| 100 | 101 | #endif |
| 101 | 102 | |
| @@ -155,7 +155,7 @@ static inline bool __ref_is_percpu(struct percpu_ref *ref, · 154 unmodified lines | ||
| 155 | 155 | * between contaminating the pointer value, meaning that |
| 156 | 156 | * READ_ONCE() is required when fetching it. |
| 157 | 157 | * |
| 158 | − * The smp_read_barrier_depends() implied by READ_ONCE() pairs | |
| 158 | + * The dependency ordering from the READ_ONCE() pairs | |
| 159 | 159 | * with smp_store_release() in __percpu_ref_switch_to_percpu(). |
| 160 | 160 | */ |
| 161 | 161 | percpu_ptr = READ_ONCE(ref->percpu_count_ptr); |
| @@ -107,7 +107,7 @@ static inline int __ptr_ring_produce(struct ptr_ring *r, void *ptr) · 106 unmodified lines | ||
| 107 | 107 | return -ENOSPC; |
| 108 | 108 | |
| 109 | 109 | /* Make sure the pointer we are storing points to a valid data. */ |
| 110 | − /* Pairs with smp_read_barrier_depends in __ptr_ring_consume. */ | |
| 110 | + /* Pairs with the dependency ordering in __ptr_ring_consume. */ | |
| 111 | 111 | smp_wmb(); |
| 112 | 112 | |
| 113 | 113 | WRITE_ONCE(r->queue[r->producer++], ptr); |
| @@ -6,6 +6,34 @@ · 5 unmodified lines | ||
| 6 | 6 | #define LINUX_SCHED_CLOCK |
| 7 | 7 | |
| 8 | 8 | #ifdef CONFIG_GENERIC_SCHED_CLOCK |
| 9 | +/** | |
| 10 | + * struct clock_read_data - data required to read from sched_clock() | |
| 11 | + * | |
| 12 | + * @epoch_ns: sched_clock() value at last update | |
| 13 | + * @epoch_cyc: Clock cycle value at last update. | |
| 14 | + * @sched_clock_mask: Bitmask for two's complement subtraction of non 64bit | |
| 15 | + * clocks. | |
| 16 | + * @read_sched_clock: Current clock source (or dummy source when suspended). | |
| 17 | + * @mult: Multipler for scaled math conversion. | |
| 18 | + * @shift: Shift value for scaled math conversion. | |
| 19 | + * | |
| 20 | + * Care must be taken when updating this structure; it is read by | |
| 21 | + * some very hot code paths. It occupies <=40 bytes and, when combined | |
| 22 | + * with the seqcount used to synchronize access, comfortably fits into | |
| 23 | + * a 64 byte cache line. | |
| 24 | + */ | |
| 25 | +struct clock_read_data { | |
| 26 | + u64 epoch_ns; | |
| 27 | + u64 epoch_cyc; | |
| 28 | + u64 sched_clock_mask; | |
| 29 | + u64 (*read_sched_clock)(void); | |
| 30 | + u32 mult; | |
| 31 | + u32 shift; | |
| 32 | +}; | |
| 33 | + | |
| 34 | +extern struct clock_read_data *sched_clock_read_begin(unsigned int *seq); | |
| 35 | +extern int sched_clock_read_retry(unsigned int seq); | |
| 36 | + | |
| 9 | 37 | extern void generic_sched_clock_init(void); |
| 10 | 38 | |
| 11 | 39 | extern void sched_clock_register(u64 (*read)(void), int bits, |