Merge branch 'x86/entry' into ras/core
to fixup conflicts in arch/x86/kernel/cpu/mce/core.c so MCE specific follow up patches can be applied without creating a horrible merge conflict afterwards.
This commit is contained in:
@@ -65,6 +65,7 @@ struct amba_device {
|
||||
struct device dev;
|
||||
struct resource res;
|
||||
struct clk *pclk;
|
||||
struct device_dma_parameters dma_parms;
|
||||
unsigned int periphid;
|
||||
unsigned int cid;
|
||||
struct amba_cs_uci_id uci;
|
||||
|
@@ -5,12 +5,15 @@
|
||||
#ifndef __LINUX_ARM_SMCCC_H
|
||||
#define __LINUX_ARM_SMCCC_H
|
||||
|
||||
#include <linux/init.h>
|
||||
#include <uapi/linux/const.h>
|
||||
|
||||
/*
|
||||
* This file provides common defines for ARM SMC Calling Convention as
|
||||
* specified in
|
||||
* http://infocenter.arm.com/help/topic/com.arm.doc.den0028a/index.html
|
||||
* https://developer.arm.com/docs/den0028/latest
|
||||
*
|
||||
* This code is up-to-date with version DEN 0028 C
|
||||
*/
|
||||
|
||||
#define ARM_SMCCC_STD_CALL _AC(0,U)
|
||||
@@ -56,6 +59,7 @@
|
||||
|
||||
#define ARM_SMCCC_VERSION_1_0 0x10000
|
||||
#define ARM_SMCCC_VERSION_1_1 0x10001
|
||||
#define ARM_SMCCC_VERSION_1_2 0x10002
|
||||
|
||||
#define ARM_SMCCC_VERSION_FUNC_ID \
|
||||
ARM_SMCCC_CALL_VAL(ARM_SMCCC_FAST_CALL, \
|
||||
@@ -97,6 +101,19 @@ enum arm_smccc_conduit {
|
||||
*/
|
||||
enum arm_smccc_conduit arm_smccc_1_1_get_conduit(void);
|
||||
|
||||
/**
|
||||
* arm_smccc_get_version()
|
||||
*
|
||||
* Returns the version to be used for SMCCCv1.1 or later.
|
||||
*
|
||||
* When SMCCCv1.1 or above is not present, returns SMCCCv1.0, but this
|
||||
* does not imply the presence of firmware or a valid conduit. Caller
|
||||
* handling SMCCCv1.0 must determine the conduit by other means.
|
||||
*/
|
||||
u32 arm_smccc_get_version(void);
|
||||
|
||||
void __init arm_smccc_version_init(u32 version, enum arm_smccc_conduit conduit);
|
||||
|
||||
/**
|
||||
* struct arm_smccc_res - Result from SMC/HVC call
|
||||
* @a0-a3 result values from registers 0 to 3
|
||||
@@ -314,10 +331,14 @@ asmlinkage void __arm_smccc_hvc(unsigned long a0, unsigned long a1,
|
||||
*/
|
||||
#define arm_smccc_1_1_hvc(...) __arm_smccc_1_1(SMCCC_HVC_INST, __VA_ARGS__)
|
||||
|
||||
/* Return codes defined in ARM DEN 0070A */
|
||||
/*
|
||||
* Return codes defined in ARM DEN 0070A
|
||||
* ARM DEN 0070A is now merged/consolidated into ARM DEN 0028 C
|
||||
*/
|
||||
#define SMCCC_RET_SUCCESS 0
|
||||
#define SMCCC_RET_NOT_SUPPORTED -1
|
||||
#define SMCCC_RET_NOT_REQUIRED -2
|
||||
#define SMCCC_RET_INVALID_PARAMETER -3
|
||||
|
||||
/*
|
||||
* Like arm_smccc_1_1* but always returns SMCCC_RET_NOT_SUPPORTED.
|
||||
|
2291
include/linux/atomic-arch-fallback.h
Normal file
2291
include/linux/atomic-arch-fallback.h
Normal file
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
@@ -25,6 +25,12 @@
|
||||
* See Documentation/memory-barriers.txt for ACQUIRE/RELEASE definitions.
|
||||
*/
|
||||
|
||||
#define atomic_cond_read_acquire(v, c) smp_cond_load_acquire(&(v)->counter, (c))
|
||||
#define atomic_cond_read_relaxed(v, c) smp_cond_load_relaxed(&(v)->counter, (c))
|
||||
|
||||
#define atomic64_cond_read_acquire(v, c) smp_cond_load_acquire(&(v)->counter, (c))
|
||||
#define atomic64_cond_read_relaxed(v, c) smp_cond_load_relaxed(&(v)->counter, (c))
|
||||
|
||||
/*
|
||||
* The idea here is to build acquire/release variants by adding explicit
|
||||
* barriers on top of the relaxed variant. In the case where the relaxed
|
||||
@@ -71,7 +77,12 @@
|
||||
__ret; \
|
||||
})
|
||||
|
||||
#ifdef ARCH_ATOMIC
|
||||
#include <linux/atomic-arch-fallback.h>
|
||||
#include <asm-generic/atomic-instrumented.h>
|
||||
#else
|
||||
#include <linux/atomic-fallback.h>
|
||||
#endif
|
||||
|
||||
#include <asm-generic/atomic-long.h>
|
||||
|
||||
|
@@ -19,7 +19,7 @@
|
||||
struct audit_sig_info {
|
||||
uid_t uid;
|
||||
pid_t pid;
|
||||
char ctx[0];
|
||||
char ctx[];
|
||||
};
|
||||
|
||||
struct audit_buffer;
|
||||
@@ -94,6 +94,12 @@ struct audit_ntp_data {
|
||||
struct audit_ntp_data {};
|
||||
#endif
|
||||
|
||||
enum audit_nfcfgop {
|
||||
AUDIT_XT_OP_REGISTER,
|
||||
AUDIT_XT_OP_REPLACE,
|
||||
AUDIT_XT_OP_UNREGISTER,
|
||||
};
|
||||
|
||||
extern int is_audit_feature_set(int which);
|
||||
|
||||
extern int __init audit_register_class(int class, unsigned *list);
|
||||
@@ -379,6 +385,8 @@ extern void __audit_log_kern_module(char *name);
|
||||
extern void __audit_fanotify(unsigned int response);
|
||||
extern void __audit_tk_injoffset(struct timespec64 offset);
|
||||
extern void __audit_ntp_log(const struct audit_ntp_data *ad);
|
||||
extern void __audit_log_nfcfg(const char *name, u8 af, unsigned int nentries,
|
||||
enum audit_nfcfgop op);
|
||||
|
||||
static inline void audit_ipc_obj(struct kern_ipc_perm *ipcp)
|
||||
{
|
||||
@@ -514,6 +522,14 @@ static inline void audit_ntp_log(const struct audit_ntp_data *ad)
|
||||
__audit_ntp_log(ad);
|
||||
}
|
||||
|
||||
static inline void audit_log_nfcfg(const char *name, u8 af,
|
||||
unsigned int nentries,
|
||||
enum audit_nfcfgop op)
|
||||
{
|
||||
if (audit_enabled)
|
||||
__audit_log_nfcfg(name, af, nentries, op);
|
||||
}
|
||||
|
||||
extern int audit_n_rules;
|
||||
extern int audit_signals;
|
||||
#else /* CONFIG_AUDITSYSCALL */
|
||||
@@ -646,6 +662,12 @@ static inline void audit_ntp_log(const struct audit_ntp_data *ad)
|
||||
|
||||
static inline void audit_ptrace(struct task_struct *t)
|
||||
{ }
|
||||
|
||||
static inline void audit_log_nfcfg(const char *name, u8 af,
|
||||
unsigned int nentries,
|
||||
enum audit_nfcfgop op)
|
||||
{ }
|
||||
|
||||
#define audit_n_rules 0
|
||||
#define audit_signals 0
|
||||
#endif /* CONFIG_AUDITSYSCALL */
|
||||
|
@@ -476,6 +476,7 @@ struct virtchnl_rss_key {
|
||||
u16 vsi_id;
|
||||
u16 key_len;
|
||||
u8 key[1]; /* RSS hash key, packed bytes */
|
||||
u8 pad[1];
|
||||
};
|
||||
|
||||
VIRTCHNL_CHECK_STRUCT_LEN(6, virtchnl_rss_key);
|
||||
@@ -484,6 +485,7 @@ struct virtchnl_rss_lut {
|
||||
u16 vsi_id;
|
||||
u16 lut_entries;
|
||||
u8 lut[1]; /* RSS lookup table */
|
||||
u8 pad[1];
|
||||
};
|
||||
|
||||
VIRTCHNL_CHECK_STRUCT_LEN(6, virtchnl_rss_lut);
|
||||
@@ -572,6 +574,7 @@ struct virtchnl_filter {
|
||||
enum virtchnl_action action;
|
||||
u32 action_meta;
|
||||
u8 field_flags;
|
||||
u8 pad[3];
|
||||
};
|
||||
|
||||
VIRTCHNL_CHECK_STRUCT_LEN(272, virtchnl_filter);
|
||||
@@ -610,6 +613,7 @@ struct virtchnl_pf_event {
|
||||
/* link_speed provided in Mbps */
|
||||
u32 link_speed;
|
||||
u8 link_status;
|
||||
u8 pad[3];
|
||||
} link_event_adv;
|
||||
} event_data;
|
||||
|
||||
@@ -635,6 +639,7 @@ struct virtchnl_iwarp_qv_info {
|
||||
u16 ceq_idx;
|
||||
u16 aeq_idx;
|
||||
u8 itr_idx;
|
||||
u8 pad[3];
|
||||
};
|
||||
|
||||
VIRTCHNL_CHECK_STRUCT_LEN(12, virtchnl_iwarp_qv_info);
|
||||
|
@@ -54,7 +54,6 @@ enum wb_reason {
|
||||
WB_REASON_SYNC,
|
||||
WB_REASON_PERIODIC,
|
||||
WB_REASON_LAPTOP_TIMER,
|
||||
WB_REASON_FREE_MORE_MEM,
|
||||
WB_REASON_FS_FREE_SPACE,
|
||||
/*
|
||||
* There is no bdi forker thread any more and works are done
|
||||
@@ -194,8 +193,6 @@ struct backing_dev_info {
|
||||
congested_fn *congested_fn; /* Function pointer if device is md/dm */
|
||||
void *congested_data; /* Pointer to aux data for congested func */
|
||||
|
||||
const char *name;
|
||||
|
||||
struct kref refcnt; /* Reference counter for the structure */
|
||||
unsigned int capabilities; /* Device capabilities */
|
||||
unsigned int min_ratio;
|
||||
@@ -220,6 +217,7 @@ struct backing_dev_info {
|
||||
wait_queue_head_t wb_waitq;
|
||||
|
||||
struct device *dev;
|
||||
char dev_name[64];
|
||||
struct device *owner;
|
||||
|
||||
struct timer_list laptop_mode_wb_timer;
|
||||
|
@@ -33,14 +33,10 @@ int bdi_register(struct backing_dev_info *bdi, const char *fmt, ...);
|
||||
__printf(2, 0)
|
||||
int bdi_register_va(struct backing_dev_info *bdi, const char *fmt,
|
||||
va_list args);
|
||||
int bdi_register_owner(struct backing_dev_info *bdi, struct device *owner);
|
||||
void bdi_set_owner(struct backing_dev_info *bdi, struct device *owner);
|
||||
void bdi_unregister(struct backing_dev_info *bdi);
|
||||
|
||||
struct backing_dev_info *bdi_alloc_node(gfp_t gfp_mask, int node_id);
|
||||
static inline struct backing_dev_info *bdi_alloc(gfp_t gfp_mask)
|
||||
{
|
||||
return bdi_alloc_node(gfp_mask, NUMA_NO_NODE);
|
||||
}
|
||||
struct backing_dev_info *bdi_alloc(int node_id);
|
||||
|
||||
void wb_start_background_writeback(struct bdi_writeback *wb);
|
||||
void wb_workfn(struct work_struct *work);
|
||||
@@ -505,13 +501,6 @@ static inline int bdi_rw_congested(struct backing_dev_info *bdi)
|
||||
(1 << WB_async_congested));
|
||||
}
|
||||
|
||||
extern const char *bdi_unknown_name;
|
||||
|
||||
static inline const char *bdi_dev_name(struct backing_dev_info *bdi)
|
||||
{
|
||||
if (!bdi || !bdi->dev)
|
||||
return bdi_unknown_name;
|
||||
return dev_name(bdi->dev);
|
||||
}
|
||||
const char *bdi_dev_name(struct backing_dev_info *bdi);
|
||||
|
||||
#endif /* _LINUX_BACKING_DEV_H */
|
||||
|
@@ -190,6 +190,7 @@ extern void backlight_force_update(struct backlight_device *bd,
|
||||
extern int backlight_register_notifier(struct notifier_block *nb);
|
||||
extern int backlight_unregister_notifier(struct notifier_block *nb);
|
||||
extern struct backlight_device *backlight_device_get_by_type(enum backlight_type type);
|
||||
struct backlight_device *backlight_device_get_by_name(const char *name);
|
||||
extern int backlight_device_set_brightness(struct backlight_device *bd, unsigned long brightness);
|
||||
|
||||
#define to_backlight_device(obj) container_of(obj, struct backlight_device, dev)
|
||||
|
@@ -33,6 +33,7 @@
|
||||
* @cache: log-based polynomial representation buffer
|
||||
* @elp: error locator polynomial
|
||||
* @poly_2t: temporary polynomials of degree 2t
|
||||
* @swap_bits: swap bits within data and syndrome bytes
|
||||
*/
|
||||
struct bch_control {
|
||||
unsigned int m;
|
||||
@@ -51,16 +52,18 @@ struct bch_control {
|
||||
int *cache;
|
||||
struct gf_poly *elp;
|
||||
struct gf_poly *poly_2t[4];
|
||||
bool swap_bits;
|
||||
};
|
||||
|
||||
struct bch_control *init_bch(int m, int t, unsigned int prim_poly);
|
||||
struct bch_control *bch_init(int m, int t, unsigned int prim_poly,
|
||||
bool swap_bits);
|
||||
|
||||
void free_bch(struct bch_control *bch);
|
||||
void bch_free(struct bch_control *bch);
|
||||
|
||||
void encode_bch(struct bch_control *bch, const uint8_t *data,
|
||||
void bch_encode(struct bch_control *bch, const uint8_t *data,
|
||||
unsigned int len, uint8_t *ecc);
|
||||
|
||||
int decode_bch(struct bch_control *bch, const uint8_t *data, unsigned int len,
|
||||
int bch_decode(struct bch_control *bch, const uint8_t *data, unsigned int len,
|
||||
const uint8_t *recv_ecc, const uint8_t *calc_ecc,
|
||||
const unsigned int *syn, unsigned int *errloc);
|
||||
|
||||
|
@@ -26,35 +26,27 @@ struct linux_binprm {
|
||||
unsigned long p; /* current top of mem */
|
||||
unsigned long argmin; /* rlimit marker for copy_strings() */
|
||||
unsigned int
|
||||
/* Should an execfd be passed to userspace? */
|
||||
have_execfd:1,
|
||||
|
||||
/* Use the creds of a script (see binfmt_misc) */
|
||||
execfd_creds:1,
|
||||
/*
|
||||
* True after the bprm_set_creds hook has been called once
|
||||
* (multiple calls can be made via prepare_binprm() for
|
||||
* binfmt_script/misc).
|
||||
*/
|
||||
called_set_creds:1,
|
||||
/*
|
||||
* True if most recent call to the commoncaps bprm_set_creds
|
||||
* hook (due to multiple prepare_binprm() calls from the
|
||||
* binfmt_script/misc handlers) resulted in elevated
|
||||
* privileges.
|
||||
*/
|
||||
cap_elevated:1,
|
||||
/*
|
||||
* Set by bprm_set_creds hook to indicate a privilege-gaining
|
||||
* exec has happened. Used to sanitize execution environment
|
||||
* and to set AT_SECURE auxv for glibc.
|
||||
* Set by bprm_creds_for_exec hook to indicate a
|
||||
* privilege-gaining exec has happened. Used to set
|
||||
* AT_SECURE auxv for glibc.
|
||||
*/
|
||||
secureexec:1,
|
||||
/*
|
||||
* Set by flush_old_exec, when exec_mmap has been called.
|
||||
* This is past the point of no return, when the
|
||||
* exec_update_mutex has been taken.
|
||||
* Set when errors can no longer be returned to the
|
||||
* original userspace.
|
||||
*/
|
||||
called_exec_mmap:1;
|
||||
point_of_no_return:1;
|
||||
#ifdef __alpha__
|
||||
unsigned int taso:1;
|
||||
#endif
|
||||
unsigned int recursion_depth; /* only for search_binary_handler() */
|
||||
struct file * executable; /* Executable to pass to the interpreter */
|
||||
struct file * interpreter;
|
||||
struct file * file;
|
||||
struct cred *cred; /* new credentials */
|
||||
int unsafe; /* how unsafe this exec is (mask of LSM_UNSAFE_*) */
|
||||
@@ -65,7 +57,7 @@ struct linux_binprm {
|
||||
of the time same as filename, but could be
|
||||
different for binfmt_{misc,script} */
|
||||
unsigned interp_flags;
|
||||
unsigned interp_data;
|
||||
int execfd; /* File descriptor of the executable */
|
||||
unsigned long loader, exec;
|
||||
|
||||
struct rlimit rlim_stack; /* Saved RLIMIT_STACK used during exec. */
|
||||
@@ -76,10 +68,6 @@ struct linux_binprm {
|
||||
#define BINPRM_FLAGS_ENFORCE_NONDUMP_BIT 0
|
||||
#define BINPRM_FLAGS_ENFORCE_NONDUMP (1 << BINPRM_FLAGS_ENFORCE_NONDUMP_BIT)
|
||||
|
||||
/* fd of the binary should be passed to the interpreter */
|
||||
#define BINPRM_FLAGS_EXECFD_BIT 1
|
||||
#define BINPRM_FLAGS_EXECFD (1 << BINPRM_FLAGS_EXECFD_BIT)
|
||||
|
||||
/* filename of the binary will be inaccessible after exec */
|
||||
#define BINPRM_FLAGS_PATH_INACCESSIBLE_BIT 2
|
||||
#define BINPRM_FLAGS_PATH_INACCESSIBLE (1 << BINPRM_FLAGS_PATH_INACCESSIBLE_BIT)
|
||||
@@ -123,10 +111,8 @@ static inline void insert_binfmt(struct linux_binfmt *fmt)
|
||||
|
||||
extern void unregister_binfmt(struct linux_binfmt *);
|
||||
|
||||
extern int prepare_binprm(struct linux_binprm *);
|
||||
extern int __must_check remove_arg_zero(struct linux_binprm *);
|
||||
extern int search_binary_handler(struct linux_binprm *);
|
||||
extern int flush_old_exec(struct linux_binprm * bprm);
|
||||
extern int begin_new_exec(struct linux_binprm * bprm);
|
||||
extern void setup_new_exec(struct linux_binprm * bprm);
|
||||
extern void finalize_exec(struct linux_binprm *bprm);
|
||||
extern void would_dump(struct linux_binprm *, struct file *);
|
||||
@@ -144,9 +130,7 @@ extern int setup_arg_pages(struct linux_binprm * bprm,
|
||||
extern int transfer_args_to_stack(struct linux_binprm *bprm,
|
||||
unsigned long *sp_location);
|
||||
extern int bprm_change_interp(const char *interp, struct linux_binprm *bprm);
|
||||
extern int copy_strings_kernel(int argc, const char *const *argv,
|
||||
struct linux_binprm *bprm);
|
||||
extern void install_exec_creds(struct linux_binprm *bprm);
|
||||
int copy_string_kernel(const char *arg, struct linux_binprm *bprm);
|
||||
extern void set_binfmt(struct linux_binfmt *new);
|
||||
extern ssize_t read_code(struct file *, unsigned long, loff_t, size_t);
|
||||
|
||||
|
@@ -70,7 +70,7 @@ static inline bool bio_has_data(struct bio *bio)
|
||||
return false;
|
||||
}
|
||||
|
||||
static inline bool bio_no_advance_iter(struct bio *bio)
|
||||
static inline bool bio_no_advance_iter(const struct bio *bio)
|
||||
{
|
||||
return bio_op(bio) == REQ_OP_DISCARD ||
|
||||
bio_op(bio) == REQ_OP_SECURE_ERASE ||
|
||||
@@ -138,8 +138,8 @@ static inline bool bio_next_segment(const struct bio *bio,
|
||||
#define bio_for_each_segment_all(bvl, bio, iter) \
|
||||
for (bvl = bvec_init_iter_all(&iter); bio_next_segment((bio), &iter); )
|
||||
|
||||
static inline void bio_advance_iter(struct bio *bio, struct bvec_iter *iter,
|
||||
unsigned bytes)
|
||||
static inline void bio_advance_iter(const struct bio *bio,
|
||||
struct bvec_iter *iter, unsigned int bytes)
|
||||
{
|
||||
iter->bi_sector += bytes >> 9;
|
||||
|
||||
@@ -169,6 +169,14 @@ static inline void bio_advance_iter(struct bio *bio, struct bvec_iter *iter,
|
||||
#define bio_for_each_bvec(bvl, bio, iter) \
|
||||
__bio_for_each_bvec(bvl, bio, iter, (bio)->bi_iter)
|
||||
|
||||
/*
|
||||
* Iterate over all multi-page bvecs. Drivers shouldn't use this version for the
|
||||
* same reasons as bio_for_each_segment_all().
|
||||
*/
|
||||
#define bio_for_each_bvec_all(bvl, bio, i) \
|
||||
for (i = 0, bvl = bio_first_bvec_all(bio); \
|
||||
i < (bio)->bi_vcnt; i++, bvl++) \
|
||||
|
||||
#define bio_iter_last(bvec, iter) ((iter).bi_size == (bvec).bv_len)
|
||||
|
||||
static inline unsigned bio_segments(struct bio *bio)
|
||||
@@ -319,7 +327,7 @@ struct bio_integrity_payload {
|
||||
struct work_struct bip_work; /* I/O completion */
|
||||
|
||||
struct bio_vec *bip_vec;
|
||||
struct bio_vec bip_inline_vecs[0];/* embedded bvec array */
|
||||
struct bio_vec bip_inline_vecs[];/* embedded bvec array */
|
||||
};
|
||||
|
||||
#if defined(CONFIG_BLK_DEV_INTEGRITY)
|
||||
@@ -417,6 +425,7 @@ static inline void bio_io_error(struct bio *bio)
|
||||
|
||||
static inline void bio_wouldblock_error(struct bio *bio)
|
||||
{
|
||||
bio_set_flag(bio, BIO_QUIET);
|
||||
bio->bi_status = BLK_STS_AGAIN;
|
||||
bio_endio(bio);
|
||||
}
|
||||
@@ -444,12 +453,6 @@ void bio_release_pages(struct bio *bio, bool mark_dirty);
|
||||
extern void bio_set_pages_dirty(struct bio *bio);
|
||||
extern void bio_check_pages_dirty(struct bio *bio);
|
||||
|
||||
void generic_start_io_acct(struct request_queue *q, int op,
|
||||
unsigned long sectors, struct hd_struct *part);
|
||||
void generic_end_io_acct(struct request_queue *q, int op,
|
||||
struct hd_struct *part,
|
||||
unsigned long start_time);
|
||||
|
||||
extern void bio_copy_data_iter(struct bio *dst, struct bvec_iter *dst_iter,
|
||||
struct bio *src, struct bvec_iter *src_iter);
|
||||
extern void bio_copy_data(struct bio *dst, struct bio *src);
|
||||
|
@@ -72,7 +72,7 @@ static inline int get_bitmask_order(unsigned int count)
|
||||
|
||||
static __always_inline unsigned long hweight_long(unsigned long w)
|
||||
{
|
||||
return sizeof(w) == 4 ? hweight32(w) : hweight64(w);
|
||||
return sizeof(w) == 4 ? hweight32(w) : hweight64((__u64)w);
|
||||
}
|
||||
|
||||
/**
|
||||
|
@@ -607,12 +607,14 @@ static inline bool blkcg_bio_issue_check(struct request_queue *q,
|
||||
u64_stats_update_begin(&bis->sync);
|
||||
|
||||
/*
|
||||
* If the bio is flagged with BIO_QUEUE_ENTERED it means this
|
||||
* is a split bio and we would have already accounted for the
|
||||
* size of the bio.
|
||||
* If the bio is flagged with BIO_CGROUP_ACCT it means this is a
|
||||
* split bio and we would have already accounted for the size of
|
||||
* the bio.
|
||||
*/
|
||||
if (!bio_flagged(bio, BIO_QUEUE_ENTERED))
|
||||
if (!bio_flagged(bio, BIO_CGROUP_ACCT)) {
|
||||
bio_set_flag(bio, BIO_CGROUP_ACCT);
|
||||
bis->cur.bytes[rwd] += bio->bi_iter.bi_size;
|
||||
}
|
||||
bis->cur.ios[rwd]++;
|
||||
|
||||
u64_stats_update_end(&bis->sync);
|
||||
@@ -629,6 +631,8 @@ static inline bool blkcg_bio_issue_check(struct request_queue *q,
|
||||
|
||||
static inline void blkcg_use_delay(struct blkcg_gq *blkg)
|
||||
{
|
||||
if (WARN_ON_ONCE(atomic_read(&blkg->use_delay) < 0))
|
||||
return;
|
||||
if (atomic_add_return(1, &blkg->use_delay) == 1)
|
||||
atomic_inc(&blkg->blkcg->css.cgroup->congestion_count);
|
||||
}
|
||||
@@ -637,6 +641,8 @@ static inline int blkcg_unuse_delay(struct blkcg_gq *blkg)
|
||||
{
|
||||
int old = atomic_read(&blkg->use_delay);
|
||||
|
||||
if (WARN_ON_ONCE(old < 0))
|
||||
return 0;
|
||||
if (old == 0)
|
||||
return 0;
|
||||
|
||||
@@ -661,20 +667,39 @@ static inline int blkcg_unuse_delay(struct blkcg_gq *blkg)
|
||||
return 1;
|
||||
}
|
||||
|
||||
/**
|
||||
* blkcg_set_delay - Enable allocator delay mechanism with the specified delay amount
|
||||
* @blkg: target blkg
|
||||
* @delay: delay duration in nsecs
|
||||
*
|
||||
* When enabled with this function, the delay is not decayed and must be
|
||||
* explicitly cleared with blkcg_clear_delay(). Must not be mixed with
|
||||
* blkcg_[un]use_delay() and blkcg_add_delay() usages.
|
||||
*/
|
||||
static inline void blkcg_set_delay(struct blkcg_gq *blkg, u64 delay)
|
||||
{
|
||||
int old = atomic_read(&blkg->use_delay);
|
||||
|
||||
/* We only want 1 person setting the congestion count for this blkg. */
|
||||
if (!old && atomic_cmpxchg(&blkg->use_delay, old, -1) == old)
|
||||
atomic_inc(&blkg->blkcg->css.cgroup->congestion_count);
|
||||
|
||||
atomic64_set(&blkg->delay_nsec, delay);
|
||||
}
|
||||
|
||||
/**
|
||||
* blkcg_clear_delay - Disable allocator delay mechanism
|
||||
* @blkg: target blkg
|
||||
*
|
||||
* Disable use_delay mechanism. See blkcg_set_delay().
|
||||
*/
|
||||
static inline void blkcg_clear_delay(struct blkcg_gq *blkg)
|
||||
{
|
||||
int old = atomic_read(&blkg->use_delay);
|
||||
if (!old)
|
||||
return;
|
||||
|
||||
/* We only want 1 person clearing the congestion count for this blkg. */
|
||||
while (old) {
|
||||
int cur = atomic_cmpxchg(&blkg->use_delay, old, 0);
|
||||
if (cur == old) {
|
||||
atomic_dec(&blkg->blkcg->css.cgroup->congestion_count);
|
||||
break;
|
||||
}
|
||||
old = cur;
|
||||
}
|
||||
if (old && atomic_cmpxchg(&blkg->use_delay, old, 0) == old)
|
||||
atomic_dec(&blkg->blkcg->css.cgroup->congestion_count);
|
||||
}
|
||||
|
||||
void blkcg_add_delay(struct blkcg_gq *blkg, u64 now, u64 delta);
|
||||
|
123
include/linux/blk-crypto.h
Normal file
123
include/linux/blk-crypto.h
Normal file
@@ -0,0 +1,123 @@
|
||||
/* SPDX-License-Identifier: GPL-2.0 */
|
||||
/*
|
||||
* Copyright 2019 Google LLC
|
||||
*/
|
||||
|
||||
#ifndef __LINUX_BLK_CRYPTO_H
|
||||
#define __LINUX_BLK_CRYPTO_H
|
||||
|
||||
#include <linux/types.h>
|
||||
|
||||
enum blk_crypto_mode_num {
|
||||
BLK_ENCRYPTION_MODE_INVALID,
|
||||
BLK_ENCRYPTION_MODE_AES_256_XTS,
|
||||
BLK_ENCRYPTION_MODE_AES_128_CBC_ESSIV,
|
||||
BLK_ENCRYPTION_MODE_ADIANTUM,
|
||||
BLK_ENCRYPTION_MODE_MAX,
|
||||
};
|
||||
|
||||
#define BLK_CRYPTO_MAX_KEY_SIZE 64
|
||||
/**
|
||||
* struct blk_crypto_config - an inline encryption key's crypto configuration
|
||||
* @crypto_mode: encryption algorithm this key is for
|
||||
* @data_unit_size: the data unit size for all encryption/decryptions with this
|
||||
* key. This is the size in bytes of each individual plaintext and
|
||||
* ciphertext. This is always a power of 2. It might be e.g. the
|
||||
* filesystem block size or the disk sector size.
|
||||
* @dun_bytes: the maximum number of bytes of DUN used when using this key
|
||||
*/
|
||||
struct blk_crypto_config {
|
||||
enum blk_crypto_mode_num crypto_mode;
|
||||
unsigned int data_unit_size;
|
||||
unsigned int dun_bytes;
|
||||
};
|
||||
|
||||
/**
|
||||
* struct blk_crypto_key - an inline encryption key
|
||||
* @crypto_cfg: the crypto configuration (like crypto_mode, key size) for this
|
||||
* key
|
||||
* @data_unit_size_bits: log2 of data_unit_size
|
||||
* @size: size of this key in bytes (determined by @crypto_cfg.crypto_mode)
|
||||
* @raw: the raw bytes of this key. Only the first @size bytes are used.
|
||||
*
|
||||
* A blk_crypto_key is immutable once created, and many bios can reference it at
|
||||
* the same time. It must not be freed until all bios using it have completed
|
||||
* and it has been evicted from all devices on which it may have been used.
|
||||
*/
|
||||
struct blk_crypto_key {
|
||||
struct blk_crypto_config crypto_cfg;
|
||||
unsigned int data_unit_size_bits;
|
||||
unsigned int size;
|
||||
u8 raw[BLK_CRYPTO_MAX_KEY_SIZE];
|
||||
};
|
||||
|
||||
#define BLK_CRYPTO_MAX_IV_SIZE 32
|
||||
#define BLK_CRYPTO_DUN_ARRAY_SIZE (BLK_CRYPTO_MAX_IV_SIZE / sizeof(u64))
|
||||
|
||||
/**
|
||||
* struct bio_crypt_ctx - an inline encryption context
|
||||
* @bc_key: the key, algorithm, and data unit size to use
|
||||
* @bc_dun: the data unit number (starting IV) to use
|
||||
*
|
||||
* A bio_crypt_ctx specifies that the contents of the bio will be encrypted (for
|
||||
* write requests) or decrypted (for read requests) inline by the storage device
|
||||
* or controller, or by the crypto API fallback.
|
||||
*/
|
||||
struct bio_crypt_ctx {
|
||||
const struct blk_crypto_key *bc_key;
|
||||
u64 bc_dun[BLK_CRYPTO_DUN_ARRAY_SIZE];
|
||||
};
|
||||
|
||||
#include <linux/blk_types.h>
|
||||
#include <linux/blkdev.h>
|
||||
|
||||
struct request;
|
||||
struct request_queue;
|
||||
|
||||
#ifdef CONFIG_BLK_INLINE_ENCRYPTION
|
||||
|
||||
static inline bool bio_has_crypt_ctx(struct bio *bio)
|
||||
{
|
||||
return bio->bi_crypt_context;
|
||||
}
|
||||
|
||||
void bio_crypt_set_ctx(struct bio *bio, const struct blk_crypto_key *key,
|
||||
const u64 dun[BLK_CRYPTO_DUN_ARRAY_SIZE],
|
||||
gfp_t gfp_mask);
|
||||
|
||||
bool bio_crypt_dun_is_contiguous(const struct bio_crypt_ctx *bc,
|
||||
unsigned int bytes,
|
||||
const u64 next_dun[BLK_CRYPTO_DUN_ARRAY_SIZE]);
|
||||
|
||||
int blk_crypto_init_key(struct blk_crypto_key *blk_key, const u8 *raw_key,
|
||||
enum blk_crypto_mode_num crypto_mode,
|
||||
unsigned int dun_bytes,
|
||||
unsigned int data_unit_size);
|
||||
|
||||
int blk_crypto_start_using_key(const struct blk_crypto_key *key,
|
||||
struct request_queue *q);
|
||||
|
||||
int blk_crypto_evict_key(struct request_queue *q,
|
||||
const struct blk_crypto_key *key);
|
||||
|
||||
bool blk_crypto_config_supported(struct request_queue *q,
|
||||
const struct blk_crypto_config *cfg);
|
||||
|
||||
#else /* CONFIG_BLK_INLINE_ENCRYPTION */
|
||||
|
||||
static inline bool bio_has_crypt_ctx(struct bio *bio)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
#endif /* CONFIG_BLK_INLINE_ENCRYPTION */
|
||||
|
||||
void __bio_crypt_clone(struct bio *dst, struct bio *src, gfp_t gfp_mask);
|
||||
static inline void bio_crypt_clone(struct bio *dst, struct bio *src,
|
||||
gfp_t gfp_mask)
|
||||
{
|
||||
if (bio_has_crypt_ctx(src))
|
||||
__bio_crypt_clone(dst, src, gfp_mask);
|
||||
}
|
||||
|
||||
#endif /* __LINUX_BLK_CRYPTO_H */
|
@@ -140,6 +140,8 @@ struct blk_mq_hw_ctx {
|
||||
*/
|
||||
atomic_t nr_active;
|
||||
|
||||
/** @cpuhp_online: List to store request if CPU is going to die */
|
||||
struct hlist_node cpuhp_online;
|
||||
/** @cpuhp_dead: List to store request if some CPU die. */
|
||||
struct hlist_node cpuhp_dead;
|
||||
/** @kobj: Kernel object for sysfs. */
|
||||
@@ -173,7 +175,7 @@ struct blk_mq_hw_ctx {
|
||||
* blocking (BLK_MQ_F_BLOCKING). Must be the last member - see also
|
||||
* blk_mq_hw_ctx_size().
|
||||
*/
|
||||
struct srcu_struct srcu[0];
|
||||
struct srcu_struct srcu[];
|
||||
};
|
||||
|
||||
/**
|
||||
@@ -391,6 +393,11 @@ struct blk_mq_ops {
|
||||
enum {
|
||||
BLK_MQ_F_SHOULD_MERGE = 1 << 0,
|
||||
BLK_MQ_F_TAG_SHARED = 1 << 1,
|
||||
/*
|
||||
* Set when this device requires underlying blk-mq device for
|
||||
* completing IO:
|
||||
*/
|
||||
BLK_MQ_F_STACKING = 1 << 2,
|
||||
BLK_MQ_F_BLOCKING = 1 << 5,
|
||||
BLK_MQ_F_NO_SCHED = 1 << 6,
|
||||
BLK_MQ_F_ALLOC_POLICY_START_BIT = 8,
|
||||
@@ -400,6 +407,9 @@ enum {
|
||||
BLK_MQ_S_TAG_ACTIVE = 1,
|
||||
BLK_MQ_S_SCHED_RESTART = 2,
|
||||
|
||||
/* hw queue is inactive after all its CPUs become offline */
|
||||
BLK_MQ_S_INACTIVE = 3,
|
||||
|
||||
BLK_MQ_MAX_DEPTH = 10240,
|
||||
|
||||
BLK_MQ_CPU_WORK_BATCH = 8,
|
||||
@@ -494,6 +504,7 @@ void blk_mq_requeue_request(struct request *rq, bool kick_requeue_list);
|
||||
void blk_mq_kick_requeue_list(struct request_queue *q);
|
||||
void blk_mq_delay_kick_requeue_list(struct request_queue *q, unsigned long msecs);
|
||||
bool blk_mq_complete_request(struct request *rq);
|
||||
void blk_mq_force_complete_rq(struct request *rq);
|
||||
bool blk_mq_bio_list_merge(struct request_queue *q, struct list_head *list,
|
||||
struct bio *bio, unsigned int nr_segs);
|
||||
bool blk_mq_queue_stopped(struct request_queue *q);
|
||||
@@ -508,6 +519,7 @@ void blk_mq_unquiesce_queue(struct request_queue *q);
|
||||
void blk_mq_delay_run_hw_queue(struct blk_mq_hw_ctx *hctx, unsigned long msecs);
|
||||
void blk_mq_run_hw_queue(struct blk_mq_hw_ctx *hctx, bool async);
|
||||
void blk_mq_run_hw_queues(struct request_queue *q, bool async);
|
||||
void blk_mq_delay_run_hw_queues(struct request_queue *q, unsigned long msecs);
|
||||
void blk_mq_tagset_busy_iter(struct blk_mq_tag_set *tagset,
|
||||
busy_tag_iter_fn *fn, void *priv);
|
||||
void blk_mq_tagset_wait_completed_request(struct blk_mq_tag_set *tagset);
|
||||
@@ -577,4 +589,6 @@ static inline void blk_mq_cleanup_rq(struct request *rq)
|
||||
rq->q->mq_ops->cleanup_rq(rq);
|
||||
}
|
||||
|
||||
blk_qc_t blk_mq_make_request(struct request_queue *q, struct bio *bio);
|
||||
|
||||
#endif
|
||||
|
@@ -18,6 +18,7 @@ struct block_device;
|
||||
struct io_context;
|
||||
struct cgroup_subsys_state;
|
||||
typedef void (bio_end_io_t) (struct bio *);
|
||||
struct bio_crypt_ctx;
|
||||
|
||||
/*
|
||||
* Block error status values. See block/blk-core:blk_errors for the details.
|
||||
@@ -63,6 +64,18 @@ typedef u8 __bitwise blk_status_t;
|
||||
*/
|
||||
#define BLK_STS_DEV_RESOURCE ((__force blk_status_t)13)
|
||||
|
||||
/*
|
||||
* BLK_STS_ZONE_RESOURCE is returned from the driver to the block layer if zone
|
||||
* related resources are unavailable, but the driver can guarantee the queue
|
||||
* will be rerun in the future once the resources become available again.
|
||||
*
|
||||
* This is different from BLK_STS_DEV_RESOURCE in that it explicitly references
|
||||
* a zone specific resource and IO to a different zone on the same device could
|
||||
* still be served. Examples of that are zones that are write-locked, but a read
|
||||
* to the same zone could be served.
|
||||
*/
|
||||
#define BLK_STS_ZONE_RESOURCE ((__force blk_status_t)14)
|
||||
|
||||
/**
|
||||
* blk_path_error - returns true if error may be path related
|
||||
* @error: status the request was completed with
|
||||
@@ -173,6 +186,11 @@ struct bio {
|
||||
u64 bi_iocost_cost;
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#ifdef CONFIG_BLK_INLINE_ENCRYPTION
|
||||
struct bio_crypt_ctx *bi_crypt_context;
|
||||
#endif
|
||||
|
||||
union {
|
||||
#if defined(CONFIG_BLK_DEV_INTEGRITY)
|
||||
struct bio_integrity_payload *bi_integrity; /* data integrity */
|
||||
@@ -198,7 +216,7 @@ struct bio {
|
||||
* double allocations for a small number of bio_vecs. This member
|
||||
* MUST obviously be kept at the very end of the bio.
|
||||
*/
|
||||
struct bio_vec bi_inline_vecs[0];
|
||||
struct bio_vec bi_inline_vecs[];
|
||||
};
|
||||
|
||||
#define BIO_RESET_BYTES offsetof(struct bio, bi_max_vecs)
|
||||
@@ -220,7 +238,7 @@ enum {
|
||||
* throttling rules. Don't do it again. */
|
||||
BIO_TRACE_COMPLETION, /* bio_endio() should trace the final completion
|
||||
* of this bio. */
|
||||
BIO_QUEUE_ENTERED, /* can use blk_queue_enter_live() */
|
||||
BIO_CGROUP_ACCT, /* has been accounted to a cgroup */
|
||||
BIO_TRACKED, /* set if bio goes through the rq_qos path */
|
||||
BIO_FLAG_LAST
|
||||
};
|
||||
@@ -296,6 +314,8 @@ enum req_opf {
|
||||
REQ_OP_ZONE_CLOSE = 11,
|
||||
/* Transition a zone to full */
|
||||
REQ_OP_ZONE_FINISH = 12,
|
||||
/* write data at the current zone write pointer */
|
||||
REQ_OP_ZONE_APPEND = 13,
|
||||
|
||||
/* SCSI passthrough using struct scsi_request */
|
||||
REQ_OP_SCSI_IN = 32,
|
||||
@@ -323,7 +343,6 @@ enum req_flag_bits {
|
||||
__REQ_RAHEAD, /* read ahead, can fail anytime */
|
||||
__REQ_BACKGROUND, /* background IO */
|
||||
__REQ_NOWAIT, /* Don't wait if request will block */
|
||||
__REQ_NOWAIT_INLINE, /* Return would-block error inline */
|
||||
/*
|
||||
* When a shared kthread needs to issue a bio for a cgroup, doing
|
||||
* so synchronously can lead to priority inversions as the kthread
|
||||
@@ -358,7 +377,6 @@ enum req_flag_bits {
|
||||
#define REQ_RAHEAD (1ULL << __REQ_RAHEAD)
|
||||
#define REQ_BACKGROUND (1ULL << __REQ_BACKGROUND)
|
||||
#define REQ_NOWAIT (1ULL << __REQ_NOWAIT)
|
||||
#define REQ_NOWAIT_INLINE (1ULL << __REQ_NOWAIT_INLINE)
|
||||
#define REQ_CGROUP_PUNT (1ULL << __REQ_CGROUP_PUNT)
|
||||
|
||||
#define REQ_NOUNMAP (1ULL << __REQ_NOUNMAP)
|
||||
|
@@ -43,6 +43,7 @@ struct pr_ops;
|
||||
struct rq_qos;
|
||||
struct blk_queue_stats;
|
||||
struct blk_stat_callback;
|
||||
struct blk_keyslot_manager;
|
||||
|
||||
#define BLKDEV_MIN_RQ 4
|
||||
#define BLKDEV_MAX_RQ 128 /* Default maximum */
|
||||
@@ -82,8 +83,6 @@ typedef __u32 __bitwise req_flags_t;
|
||||
/* set for "ide_preempt" requests and also for requests for which the SCSI
|
||||
"quiesce" state must be ignored. */
|
||||
#define RQF_PREEMPT ((__force req_flags_t)(1 << 8))
|
||||
/* contains copies of user pages */
|
||||
#define RQF_COPY_USER ((__force req_flags_t)(1 << 9))
|
||||
/* vaguely specified driver internal error. Ignored by the block layer */
|
||||
#define RQF_FAILED ((__force req_flags_t)(1 << 10))
|
||||
/* don't warn about errors */
|
||||
@@ -223,11 +222,14 @@ struct request {
|
||||
unsigned short nr_integrity_segments;
|
||||
#endif
|
||||
|
||||
#ifdef CONFIG_BLK_INLINE_ENCRYPTION
|
||||
struct bio_crypt_ctx *crypt_ctx;
|
||||
struct blk_ksm_keyslot *crypt_keyslot;
|
||||
#endif
|
||||
|
||||
unsigned short write_hint;
|
||||
unsigned short ioprio;
|
||||
|
||||
unsigned int extra_len; /* length of alignment and padding */
|
||||
|
||||
enum mq_rq_state state;
|
||||
refcount_t ref;
|
||||
|
||||
@@ -290,7 +292,6 @@ struct blk_queue_ctx;
|
||||
typedef blk_qc_t (make_request_fn) (struct request_queue *q, struct bio *bio);
|
||||
|
||||
struct bio_vec;
|
||||
typedef int (dma_drain_needed_fn)(struct request *);
|
||||
|
||||
enum blk_eh_timer_return {
|
||||
BLK_EH_DONE, /* drivers has completed the command */
|
||||
@@ -336,6 +337,7 @@ struct queue_limits {
|
||||
unsigned int max_hw_discard_sectors;
|
||||
unsigned int max_write_same_sectors;
|
||||
unsigned int max_write_zeroes_sectors;
|
||||
unsigned int max_zone_append_sectors;
|
||||
unsigned int discard_granularity;
|
||||
unsigned int discard_alignment;
|
||||
|
||||
@@ -361,7 +363,8 @@ unsigned int blkdev_nr_zones(struct gendisk *disk);
|
||||
extern int blkdev_zone_mgmt(struct block_device *bdev, enum req_opf op,
|
||||
sector_t sectors, sector_t nr_sectors,
|
||||
gfp_t gfp_mask);
|
||||
extern int blk_revalidate_disk_zones(struct gendisk *disk);
|
||||
int blk_revalidate_disk_zones(struct gendisk *disk,
|
||||
void (*update_driver_data)(struct gendisk *disk));
|
||||
|
||||
extern int blkdev_report_zones_ioctl(struct block_device *bdev, fmode_t mode,
|
||||
unsigned int cmd, unsigned long arg);
|
||||
@@ -399,7 +402,6 @@ struct request_queue {
|
||||
struct rq_qos *rq_qos;
|
||||
|
||||
make_request_fn *make_request_fn;
|
||||
dma_drain_needed_fn *dma_drain_needed;
|
||||
|
||||
const struct blk_mq_ops *mq_ops;
|
||||
|
||||
@@ -469,11 +471,14 @@ struct request_queue {
|
||||
*/
|
||||
unsigned long nr_requests; /* Max # of requests */
|
||||
|
||||
unsigned int dma_drain_size;
|
||||
void *dma_drain_buffer;
|
||||
unsigned int dma_pad_mask;
|
||||
unsigned int dma_alignment;
|
||||
|
||||
#ifdef CONFIG_BLK_INLINE_ENCRYPTION
|
||||
/* Inline crypto capabilities */
|
||||
struct blk_keyslot_manager *ksm;
|
||||
#endif
|
||||
|
||||
unsigned int rq_timeout;
|
||||
int poll_nsec;
|
||||
|
||||
@@ -729,6 +734,16 @@ static inline unsigned int blk_queue_nr_zones(struct request_queue *q)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
static inline bool blk_queue_zone_is_seq(struct request_queue *q,
|
||||
sector_t sector)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
static inline unsigned int blk_queue_zone_no(struct request_queue *q,
|
||||
sector_t sector)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
#endif /* CONFIG_BLK_DEV_ZONED */
|
||||
|
||||
static inline bool rq_is_sync(struct request *rq)
|
||||
@@ -747,6 +762,9 @@ static inline bool rq_mergeable(struct request *rq)
|
||||
if (req_op(rq) == REQ_OP_WRITE_ZEROES)
|
||||
return false;
|
||||
|
||||
if (req_op(rq) == REQ_OP_ZONE_APPEND)
|
||||
return false;
|
||||
|
||||
if (rq->cmd_flags & REQ_NOMERGE_FLAGS)
|
||||
return false;
|
||||
if (rq->rq_flags & RQF_NOMERGE_FLAGS)
|
||||
@@ -1081,6 +1099,8 @@ extern void blk_queue_max_write_same_sectors(struct request_queue *q,
|
||||
extern void blk_queue_max_write_zeroes_sectors(struct request_queue *q,
|
||||
unsigned int max_write_same_sectors);
|
||||
extern void blk_queue_logical_block_size(struct request_queue *, unsigned int);
|
||||
extern void blk_queue_max_zone_append_sectors(struct request_queue *q,
|
||||
unsigned int max_zone_append_sectors);
|
||||
extern void blk_queue_physical_block_size(struct request_queue *, unsigned int);
|
||||
extern void blk_queue_alignment_offset(struct request_queue *q,
|
||||
unsigned int alignment);
|
||||
@@ -1099,9 +1119,6 @@ extern void disk_stack_limits(struct gendisk *disk, struct block_device *bdev,
|
||||
sector_t offset);
|
||||
extern void blk_queue_stack_limits(struct request_queue *t, struct request_queue *b);
|
||||
extern void blk_queue_update_dma_pad(struct request_queue *, unsigned int);
|
||||
extern int blk_queue_dma_drain(struct request_queue *q,
|
||||
dma_drain_needed_fn *dma_drain_needed,
|
||||
void *buf, unsigned int size);
|
||||
extern void blk_queue_segment_boundary(struct request_queue *, unsigned long);
|
||||
extern void blk_queue_virt_boundary(struct request_queue *, unsigned long);
|
||||
extern void blk_queue_dma_alignment(struct request_queue *, int);
|
||||
@@ -1138,7 +1155,15 @@ static inline unsigned short blk_rq_nr_discard_segments(struct request *rq)
|
||||
return max_t(unsigned short, rq->nr_phys_segments, 1);
|
||||
}
|
||||
|
||||
extern int blk_rq_map_sg(struct request_queue *, struct request *, struct scatterlist *);
|
||||
int __blk_rq_map_sg(struct request_queue *q, struct request *rq,
|
||||
struct scatterlist *sglist, struct scatterlist **last_sg);
|
||||
static inline int blk_rq_map_sg(struct request_queue *q, struct request *rq,
|
||||
struct scatterlist *sglist)
|
||||
{
|
||||
struct scatterlist *last_sg = NULL;
|
||||
|
||||
return __blk_rq_map_sg(q, rq, sglist, &last_sg);
|
||||
}
|
||||
extern void blk_dump_rq_flags(struct request *, char *);
|
||||
extern long nr_blockdev_pages(void);
|
||||
|
||||
@@ -1206,7 +1231,9 @@ static inline bool blk_needs_flush_plug(struct task_struct *tsk)
|
||||
!list_empty(&plug->cb_list));
|
||||
}
|
||||
|
||||
extern int blkdev_issue_flush(struct block_device *, gfp_t, sector_t *);
|
||||
extern void blk_io_schedule(void);
|
||||
|
||||
int blkdev_issue_flush(struct block_device *, gfp_t);
|
||||
extern int blkdev_issue_write_same(struct block_device *bdev, sector_t sector,
|
||||
sector_t nr_sects, gfp_t gfp_mask, struct page *page);
|
||||
|
||||
@@ -1293,6 +1320,11 @@ static inline unsigned int queue_max_segment_size(const struct request_queue *q)
|
||||
return q->limits.max_segment_size;
|
||||
}
|
||||
|
||||
static inline unsigned int queue_max_zone_append_sectors(const struct request_queue *q)
|
||||
{
|
||||
return q->limits.max_zone_append_sectors;
|
||||
}
|
||||
|
||||
static inline unsigned queue_logical_block_size(const struct request_queue *q)
|
||||
{
|
||||
int retval = 512;
|
||||
@@ -1551,6 +1583,12 @@ struct blk_integrity *bdev_get_integrity(struct block_device *bdev)
|
||||
return blk_get_integrity(bdev->bd_disk);
|
||||
}
|
||||
|
||||
static inline bool
|
||||
blk_integrity_queue_supports_integrity(struct request_queue *q)
|
||||
{
|
||||
return q->integrity.profile;
|
||||
}
|
||||
|
||||
static inline bool blk_integrity_rq(struct request *rq)
|
||||
{
|
||||
return rq->cmd_flags & REQ_INTEGRITY;
|
||||
@@ -1631,6 +1669,11 @@ static inline struct blk_integrity *blk_get_integrity(struct gendisk *disk)
|
||||
{
|
||||
return NULL;
|
||||
}
|
||||
static inline bool
|
||||
blk_integrity_queue_supports_integrity(struct request_queue *q)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
static inline int blk_integrity_compare(struct gendisk *a, struct gendisk *b)
|
||||
{
|
||||
return 0;
|
||||
@@ -1682,6 +1725,25 @@ static inline struct bio_vec *rq_integrity_vec(struct request *rq)
|
||||
|
||||
#endif /* CONFIG_BLK_DEV_INTEGRITY */
|
||||
|
||||
#ifdef CONFIG_BLK_INLINE_ENCRYPTION
|
||||
|
||||
bool blk_ksm_register(struct blk_keyslot_manager *ksm, struct request_queue *q);
|
||||
|
||||
void blk_ksm_unregister(struct request_queue *q);
|
||||
|
||||
#else /* CONFIG_BLK_INLINE_ENCRYPTION */
|
||||
|
||||
static inline bool blk_ksm_register(struct blk_keyslot_manager *ksm,
|
||||
struct request_queue *q)
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
static inline void blk_ksm_unregister(struct request_queue *q) { }
|
||||
|
||||
#endif /* CONFIG_BLK_INLINE_ENCRYPTION */
|
||||
|
||||
|
||||
struct block_device_operations {
|
||||
int (*open) (struct block_device *, fmode_t);
|
||||
void (*release) (struct gendisk *, fmode_t);
|
||||
@@ -1719,6 +1781,7 @@ extern int bdev_write_page(struct block_device *, sector_t, struct page *,
|
||||
|
||||
#ifdef CONFIG_BLK_DEV_ZONED
|
||||
bool blk_req_needs_zone_write_lock(struct request *rq);
|
||||
bool blk_req_zone_write_trylock(struct request *rq);
|
||||
void __blk_req_zone_write_lock(struct request *rq);
|
||||
void __blk_req_zone_write_unlock(struct request *rq);
|
||||
|
||||
@@ -1809,8 +1872,7 @@ static inline bool blk_needs_flush_plug(struct task_struct *tsk)
|
||||
return false;
|
||||
}
|
||||
|
||||
static inline int blkdev_issue_flush(struct block_device *bdev, gfp_t gfp_mask,
|
||||
sector_t *error_sector)
|
||||
static inline int blkdev_issue_flush(struct block_device *bdev, gfp_t gfp_mask)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
@@ -1830,4 +1892,32 @@ static inline void blk_wake_io_task(struct task_struct *waiter)
|
||||
wake_up_process(waiter);
|
||||
}
|
||||
|
||||
#ifdef CONFIG_BLOCK
|
||||
unsigned long disk_start_io_acct(struct gendisk *disk, unsigned int sectors,
|
||||
unsigned int op);
|
||||
void disk_end_io_acct(struct gendisk *disk, unsigned int op,
|
||||
unsigned long start_time);
|
||||
|
||||
/**
|
||||
* bio_start_io_acct - start I/O accounting for bio based drivers
|
||||
* @bio: bio to start account for
|
||||
*
|
||||
* Returns the start time that should be passed back to bio_end_io_acct().
|
||||
*/
|
||||
static inline unsigned long bio_start_io_acct(struct bio *bio)
|
||||
{
|
||||
return disk_start_io_acct(bio->bi_disk, bio_sectors(bio), bio_op(bio));
|
||||
}
|
||||
|
||||
/**
|
||||
* bio_end_io_acct - end I/O accounting for bio based drivers
|
||||
* @bio: bio to end account for
|
||||
* @start: start time returned by bio_start_io_acct()
|
||||
*/
|
||||
static inline void bio_end_io_acct(struct bio *bio, unsigned long start_time)
|
||||
{
|
||||
return disk_end_io_acct(bio->bi_disk, bio_op(bio), start_time);
|
||||
}
|
||||
#endif /* CONFIG_BLOCK */
|
||||
|
||||
#endif
|
||||
|
@@ -57,8 +57,6 @@ struct bpf_cgroup_link {
|
||||
enum bpf_attach_type type;
|
||||
};
|
||||
|
||||
extern const struct bpf_link_ops bpf_cgroup_link_lops;
|
||||
|
||||
struct bpf_prog_list {
|
||||
struct list_head node;
|
||||
struct bpf_prog *prog;
|
||||
@@ -100,8 +98,6 @@ int __cgroup_bpf_attach(struct cgroup *cgrp,
|
||||
int __cgroup_bpf_detach(struct cgroup *cgrp, struct bpf_prog *prog,
|
||||
struct bpf_cgroup_link *link,
|
||||
enum bpf_attach_type type);
|
||||
int __cgroup_bpf_replace(struct cgroup *cgrp, struct bpf_cgroup_link *link,
|
||||
struct bpf_prog *new_prog);
|
||||
int __cgroup_bpf_query(struct cgroup *cgrp, const union bpf_attr *attr,
|
||||
union bpf_attr __user *uattr);
|
||||
|
||||
@@ -112,8 +108,6 @@ int cgroup_bpf_attach(struct cgroup *cgrp,
|
||||
u32 flags);
|
||||
int cgroup_bpf_detach(struct cgroup *cgrp, struct bpf_prog *prog,
|
||||
enum bpf_attach_type type);
|
||||
int cgroup_bpf_replace(struct bpf_link *link, struct bpf_prog *old_prog,
|
||||
struct bpf_prog *new_prog);
|
||||
int cgroup_bpf_query(struct cgroup *cgrp, const union bpf_attr *attr,
|
||||
union bpf_attr __user *uattr);
|
||||
|
||||
@@ -138,8 +132,7 @@ int __cgroup_bpf_check_dev_permission(short dev_type, u32 major, u32 minor,
|
||||
|
||||
int __cgroup_bpf_run_filter_sysctl(struct ctl_table_header *head,
|
||||
struct ctl_table *table, int write,
|
||||
void __user *buf, size_t *pcount,
|
||||
loff_t *ppos, void **new_buf,
|
||||
void **buf, size_t *pcount, loff_t *ppos,
|
||||
enum bpf_attach_type type);
|
||||
|
||||
int __cgroup_bpf_run_filter_setsockopt(struct sock *sock, int *level,
|
||||
@@ -302,12 +295,12 @@ int bpf_percpu_cgroup_storage_update(struct bpf_map *map, void *key,
|
||||
})
|
||||
|
||||
|
||||
#define BPF_CGROUP_RUN_PROG_SYSCTL(head, table, write, buf, count, pos, nbuf) \
|
||||
#define BPF_CGROUP_RUN_PROG_SYSCTL(head, table, write, buf, count, pos) \
|
||||
({ \
|
||||
int __ret = 0; \
|
||||
if (cgroup_bpf_enabled) \
|
||||
__ret = __cgroup_bpf_run_filter_sysctl(head, table, write, \
|
||||
buf, count, pos, nbuf, \
|
||||
buf, count, pos, \
|
||||
BPF_CGROUP_SYSCTL); \
|
||||
__ret; \
|
||||
})
|
||||
@@ -354,7 +347,6 @@ int cgroup_bpf_prog_query(const union bpf_attr *attr,
|
||||
#else
|
||||
|
||||
struct bpf_prog;
|
||||
struct bpf_link;
|
||||
struct cgroup_bpf {};
|
||||
static inline int cgroup_bpf_inherit(struct cgroup *cgrp) { return 0; }
|
||||
static inline void cgroup_bpf_offline(struct cgroup *cgrp) {}
|
||||
@@ -378,13 +370,6 @@ static inline int cgroup_bpf_link_attach(const union bpf_attr *attr,
|
||||
return -EINVAL;
|
||||
}
|
||||
|
||||
static inline int cgroup_bpf_replace(struct bpf_link *link,
|
||||
struct bpf_prog *old_prog,
|
||||
struct bpf_prog *new_prog)
|
||||
{
|
||||
return -EINVAL;
|
||||
}
|
||||
|
||||
static inline int cgroup_bpf_prog_query(const union bpf_attr *attr,
|
||||
union bpf_attr __user *uattr)
|
||||
{
|
||||
@@ -411,6 +396,7 @@ static inline int bpf_percpu_cgroup_storage_update(struct bpf_map *map,
|
||||
}
|
||||
|
||||
#define cgroup_bpf_enabled (0)
|
||||
#define BPF_CGROUP_RUN_SA_PROG_LOCK(sk, uaddr, type, t_ctx) ({ 0; })
|
||||
#define BPF_CGROUP_PRE_CONNECT_ENABLED(sk) (0)
|
||||
#define BPF_CGROUP_RUN_PROG_INET_INGRESS(sk,skb) ({ 0; })
|
||||
#define BPF_CGROUP_RUN_PROG_INET_EGRESS(sk,skb) ({ 0; })
|
||||
@@ -429,7 +415,7 @@ static inline int bpf_percpu_cgroup_storage_update(struct bpf_map *map,
|
||||
#define BPF_CGROUP_RUN_PROG_UDP6_RECVMSG_LOCK(sk, uaddr) ({ 0; })
|
||||
#define BPF_CGROUP_RUN_PROG_SOCK_OPS(sock_ops) ({ 0; })
|
||||
#define BPF_CGROUP_RUN_PROG_DEVICE_CGROUP(type,major,minor,access) ({ 0; })
|
||||
#define BPF_CGROUP_RUN_PROG_SYSCTL(head,table,write,buf,count,pos,nbuf) ({ 0; })
|
||||
#define BPF_CGROUP_RUN_PROG_SYSCTL(head,table,write,buf,count,pos) ({ 0; })
|
||||
#define BPF_CGROUP_GETSOCKOPT_MAX_OPTLEN(optlen) ({ 0; })
|
||||
#define BPF_CGROUP_RUN_PROG_GETSOCKOPT(sock, level, optname, optval, \
|
||||
optlen, max_optlen, retval) ({ retval; })
|
||||
|
64
include/linux/bpf-netns.h
Normal file
64
include/linux/bpf-netns.h
Normal file
@@ -0,0 +1,64 @@
|
||||
/* SPDX-License-Identifier: GPL-2.0 */
|
||||
#ifndef _BPF_NETNS_H
|
||||
#define _BPF_NETNS_H
|
||||
|
||||
#include <linux/mutex.h>
|
||||
#include <uapi/linux/bpf.h>
|
||||
|
||||
enum netns_bpf_attach_type {
|
||||
NETNS_BPF_INVALID = -1,
|
||||
NETNS_BPF_FLOW_DISSECTOR = 0,
|
||||
MAX_NETNS_BPF_ATTACH_TYPE
|
||||
};
|
||||
|
||||
static inline enum netns_bpf_attach_type
|
||||
to_netns_bpf_attach_type(enum bpf_attach_type attach_type)
|
||||
{
|
||||
switch (attach_type) {
|
||||
case BPF_FLOW_DISSECTOR:
|
||||
return NETNS_BPF_FLOW_DISSECTOR;
|
||||
default:
|
||||
return NETNS_BPF_INVALID;
|
||||
}
|
||||
}
|
||||
|
||||
/* Protects updates to netns_bpf */
|
||||
extern struct mutex netns_bpf_mutex;
|
||||
|
||||
union bpf_attr;
|
||||
struct bpf_prog;
|
||||
|
||||
#ifdef CONFIG_NET
|
||||
int netns_bpf_prog_query(const union bpf_attr *attr,
|
||||
union bpf_attr __user *uattr);
|
||||
int netns_bpf_prog_attach(const union bpf_attr *attr,
|
||||
struct bpf_prog *prog);
|
||||
int netns_bpf_prog_detach(const union bpf_attr *attr);
|
||||
int netns_bpf_link_create(const union bpf_attr *attr,
|
||||
struct bpf_prog *prog);
|
||||
#else
|
||||
static inline int netns_bpf_prog_query(const union bpf_attr *attr,
|
||||
union bpf_attr __user *uattr)
|
||||
{
|
||||
return -EOPNOTSUPP;
|
||||
}
|
||||
|
||||
static inline int netns_bpf_prog_attach(const union bpf_attr *attr,
|
||||
struct bpf_prog *prog)
|
||||
{
|
||||
return -EOPNOTSUPP;
|
||||
}
|
||||
|
||||
static inline int netns_bpf_prog_detach(const union bpf_attr *attr)
|
||||
{
|
||||
return -EOPNOTSUPP;
|
||||
}
|
||||
|
||||
static inline int netns_bpf_link_create(const union bpf_attr *attr,
|
||||
struct bpf_prog *prog)
|
||||
{
|
||||
return -EOPNOTSUPP;
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif /* _BPF_NETNS_H */
|
@@ -19,6 +19,7 @@
|
||||
#include <linux/mutex.h>
|
||||
#include <linux/module.h>
|
||||
#include <linux/kallsyms.h>
|
||||
#include <linux/capability.h>
|
||||
|
||||
struct bpf_verifier_env;
|
||||
struct bpf_verifier_log;
|
||||
@@ -31,6 +32,7 @@ struct seq_file;
|
||||
struct btf;
|
||||
struct btf_type;
|
||||
struct exception_table_entry;
|
||||
struct seq_operations;
|
||||
|
||||
extern struct idr btf_idr;
|
||||
extern spinlock_t btf_idr_lock;
|
||||
@@ -88,6 +90,8 @@ struct bpf_map_ops {
|
||||
int (*map_direct_value_meta)(const struct bpf_map *map,
|
||||
u64 imm, u32 *off);
|
||||
int (*map_mmap)(struct bpf_map *map, struct vm_area_struct *vma);
|
||||
__poll_t (*map_poll)(struct bpf_map *map, struct file *filp,
|
||||
struct poll_table_struct *pts);
|
||||
};
|
||||
|
||||
struct bpf_map_memory {
|
||||
@@ -118,7 +122,7 @@ struct bpf_map {
|
||||
struct bpf_map_memory memory;
|
||||
char name[BPF_OBJ_NAME_LEN];
|
||||
u32 btf_vmlinux_value_type_id;
|
||||
bool unpriv_array;
|
||||
bool bypass_spec_v1;
|
||||
bool frozen; /* write-once; write-protected by freeze_mutex */
|
||||
/* 22 bytes hole */
|
||||
|
||||
@@ -242,6 +246,9 @@ enum bpf_arg_type {
|
||||
ARG_PTR_TO_LONG, /* pointer to long */
|
||||
ARG_PTR_TO_SOCKET, /* pointer to bpf_sock (fullsock) */
|
||||
ARG_PTR_TO_BTF_ID, /* pointer to in-kernel struct */
|
||||
ARG_PTR_TO_ALLOC_MEM, /* pointer to dynamically allocated memory */
|
||||
ARG_PTR_TO_ALLOC_MEM_OR_NULL, /* pointer to dynamically allocated memory or NULL */
|
||||
ARG_CONST_ALLOC_SIZE_OR_ZERO, /* number of allocated bytes requested */
|
||||
};
|
||||
|
||||
/* type of values returned from helper functions */
|
||||
@@ -253,6 +260,7 @@ enum bpf_return_type {
|
||||
RET_PTR_TO_SOCKET_OR_NULL, /* returns a pointer to a socket or NULL */
|
||||
RET_PTR_TO_TCP_SOCK_OR_NULL, /* returns a pointer to a tcp_sock or NULL */
|
||||
RET_PTR_TO_SOCK_COMMON_OR_NULL, /* returns a pointer to a sock_common or NULL */
|
||||
RET_PTR_TO_ALLOC_MEM_OR_NULL, /* returns a pointer to dynamically allocated memory or NULL */
|
||||
};
|
||||
|
||||
/* eBPF function prototype used by verifier to allow BPF_CALLs from eBPF programs
|
||||
@@ -319,6 +327,9 @@ enum bpf_reg_type {
|
||||
PTR_TO_TP_BUFFER, /* reg points to a writable raw tp's buffer */
|
||||
PTR_TO_XDP_SOCK, /* reg points to struct xdp_sock */
|
||||
PTR_TO_BTF_ID, /* reg points to kernel struct */
|
||||
PTR_TO_BTF_ID_OR_NULL, /* reg points to kernel struct or NULL */
|
||||
PTR_TO_MEM, /* reg points to valid memory region */
|
||||
PTR_TO_MEM_OR_NULL, /* reg points to valid memory region or NULL */
|
||||
};
|
||||
|
||||
/* The information passed from prog-specific *_is_valid_access
|
||||
@@ -641,6 +652,12 @@ struct bpf_jit_poke_descriptor {
|
||||
u16 reason;
|
||||
};
|
||||
|
||||
/* reg_type info for ctx arguments */
|
||||
struct bpf_ctx_arg_aux {
|
||||
u32 offset;
|
||||
enum bpf_reg_type reg_type;
|
||||
};
|
||||
|
||||
struct bpf_prog_aux {
|
||||
atomic64_t refcnt;
|
||||
u32 used_map_cnt;
|
||||
@@ -652,6 +669,8 @@ struct bpf_prog_aux {
|
||||
u32 func_cnt; /* used by non-func prog as the number of func progs */
|
||||
u32 func_idx; /* 0 for non-func prog, the index in func array for func prog */
|
||||
u32 attach_btf_id; /* in-kernel BTF type id to attach to */
|
||||
u32 ctx_arg_info_size;
|
||||
const struct bpf_ctx_arg_aux *ctx_arg_info;
|
||||
struct bpf_prog *linked_prog;
|
||||
bool verifier_zext; /* Zero extensions has been inserted by verifier. */
|
||||
bool offload_requested;
|
||||
@@ -987,6 +1006,7 @@ _out: \
|
||||
|
||||
#ifdef CONFIG_BPF_SYSCALL
|
||||
DECLARE_PER_CPU(int, bpf_prog_active);
|
||||
extern struct mutex bpf_stats_enabled_mutex;
|
||||
|
||||
/*
|
||||
* Block execution of BPF programs attached to instrumentation (perf,
|
||||
@@ -1020,15 +1040,18 @@ static inline void bpf_enable_instrumentation(void)
|
||||
|
||||
extern const struct file_operations bpf_map_fops;
|
||||
extern const struct file_operations bpf_prog_fops;
|
||||
extern const struct file_operations bpf_iter_fops;
|
||||
|
||||
#define BPF_PROG_TYPE(_id, _name, prog_ctx_type, kern_ctx_type) \
|
||||
extern const struct bpf_prog_ops _name ## _prog_ops; \
|
||||
extern const struct bpf_verifier_ops _name ## _verifier_ops;
|
||||
#define BPF_MAP_TYPE(_id, _ops) \
|
||||
extern const struct bpf_map_ops _ops;
|
||||
#define BPF_LINK_TYPE(_id, _name)
|
||||
#include <linux/bpf_types.h>
|
||||
#undef BPF_PROG_TYPE
|
||||
#undef BPF_MAP_TYPE
|
||||
#undef BPF_LINK_TYPE
|
||||
|
||||
extern const struct bpf_prog_ops bpf_offload_prog_ops;
|
||||
extern const struct bpf_verifier_ops tc_cls_act_analyzer_ops;
|
||||
@@ -1077,29 +1100,59 @@ int generic_map_update_batch(struct bpf_map *map,
|
||||
int generic_map_delete_batch(struct bpf_map *map,
|
||||
const union bpf_attr *attr,
|
||||
union bpf_attr __user *uattr);
|
||||
struct bpf_map *bpf_map_get_curr_or_next(u32 *id);
|
||||
|
||||
extern int sysctl_unprivileged_bpf_disabled;
|
||||
|
||||
static inline bool bpf_allow_ptr_leaks(void)
|
||||
{
|
||||
return perfmon_capable();
|
||||
}
|
||||
|
||||
static inline bool bpf_bypass_spec_v1(void)
|
||||
{
|
||||
return perfmon_capable();
|
||||
}
|
||||
|
||||
static inline bool bpf_bypass_spec_v4(void)
|
||||
{
|
||||
return perfmon_capable();
|
||||
}
|
||||
|
||||
int bpf_map_new_fd(struct bpf_map *map, int flags);
|
||||
int bpf_prog_new_fd(struct bpf_prog *prog);
|
||||
|
||||
struct bpf_link {
|
||||
atomic64_t refcnt;
|
||||
u32 id;
|
||||
enum bpf_link_type type;
|
||||
const struct bpf_link_ops *ops;
|
||||
struct bpf_prog *prog;
|
||||
struct work_struct work;
|
||||
};
|
||||
|
||||
struct bpf_link_primer {
|
||||
struct bpf_link *link;
|
||||
struct file *file;
|
||||
int fd;
|
||||
u32 id;
|
||||
};
|
||||
|
||||
struct bpf_link_ops {
|
||||
void (*release)(struct bpf_link *link);
|
||||
void (*dealloc)(struct bpf_link *link);
|
||||
|
||||
int (*update_prog)(struct bpf_link *link, struct bpf_prog *new_prog,
|
||||
struct bpf_prog *old_prog);
|
||||
void (*show_fdinfo)(const struct bpf_link *link, struct seq_file *seq);
|
||||
int (*fill_link_info)(const struct bpf_link *link,
|
||||
struct bpf_link_info *info);
|
||||
};
|
||||
|
||||
void bpf_link_init(struct bpf_link *link, const struct bpf_link_ops *ops,
|
||||
struct bpf_prog *prog);
|
||||
void bpf_link_cleanup(struct bpf_link *link, struct file *link_file,
|
||||
int link_fd);
|
||||
void bpf_link_init(struct bpf_link *link, enum bpf_link_type type,
|
||||
const struct bpf_link_ops *ops, struct bpf_prog *prog);
|
||||
int bpf_link_prime(struct bpf_link *link, struct bpf_link_primer *primer);
|
||||
int bpf_link_settle(struct bpf_link_primer *primer);
|
||||
void bpf_link_cleanup(struct bpf_link_primer *primer);
|
||||
void bpf_link_inc(struct bpf_link *link);
|
||||
void bpf_link_put(struct bpf_link *link);
|
||||
int bpf_link_new_fd(struct bpf_link *link);
|
||||
@@ -1109,6 +1162,40 @@ struct bpf_link *bpf_link_get_from_fd(u32 ufd);
|
||||
int bpf_obj_pin_user(u32 ufd, const char __user *pathname);
|
||||
int bpf_obj_get_user(const char __user *pathname, int flags);
|
||||
|
||||
#define BPF_ITER_FUNC_PREFIX "bpf_iter_"
|
||||
#define DEFINE_BPF_ITER_FUNC(target, args...) \
|
||||
extern int bpf_iter_ ## target(args); \
|
||||
int __init bpf_iter_ ## target(args) { return 0; }
|
||||
|
||||
typedef int (*bpf_iter_init_seq_priv_t)(void *private_data);
|
||||
typedef void (*bpf_iter_fini_seq_priv_t)(void *private_data);
|
||||
|
||||
#define BPF_ITER_CTX_ARG_MAX 2
|
||||
struct bpf_iter_reg {
|
||||
const char *target;
|
||||
const struct seq_operations *seq_ops;
|
||||
bpf_iter_init_seq_priv_t init_seq_private;
|
||||
bpf_iter_fini_seq_priv_t fini_seq_private;
|
||||
u32 seq_priv_size;
|
||||
u32 ctx_arg_info_size;
|
||||
struct bpf_ctx_arg_aux ctx_arg_info[BPF_ITER_CTX_ARG_MAX];
|
||||
};
|
||||
|
||||
struct bpf_iter_meta {
|
||||
__bpf_md_ptr(struct seq_file *, seq);
|
||||
u64 session_id;
|
||||
u64 seq_num;
|
||||
};
|
||||
|
||||
int bpf_iter_reg_target(const struct bpf_iter_reg *reg_info);
|
||||
void bpf_iter_unreg_target(const struct bpf_iter_reg *reg_info);
|
||||
bool bpf_iter_prog_supported(struct bpf_prog *prog);
|
||||
int bpf_iter_link_attach(const union bpf_attr *attr, struct bpf_prog *prog);
|
||||
int bpf_iter_new_fd(struct bpf_link *link);
|
||||
bool bpf_link_is_iter(struct bpf_link *link);
|
||||
struct bpf_prog *bpf_iter_get_info(struct bpf_iter_meta *meta, bool in_stop);
|
||||
int bpf_iter_run_prog(struct bpf_prog *prog, void *ctx);
|
||||
|
||||
int bpf_percpu_hash_copy(struct bpf_map *map, void *key, void *value);
|
||||
int bpf_percpu_array_copy(struct bpf_map *map, void *key, void *value);
|
||||
int bpf_percpu_hash_update(struct bpf_map *map, void *key, void *value,
|
||||
@@ -1163,6 +1250,7 @@ int dev_map_enqueue(struct bpf_dtab_netdev *dst, struct xdp_buff *xdp,
|
||||
struct net_device *dev_rx);
|
||||
int dev_map_generic_redirect(struct bpf_dtab_netdev *dst, struct sk_buff *skb,
|
||||
struct bpf_prog *xdp_prog);
|
||||
bool dev_map_can_have_prog(struct bpf_map *map);
|
||||
|
||||
struct bpf_cpu_map_entry *__cpu_map_lookup_elem(struct bpf_map *map, u32 key);
|
||||
void __cpu_map_flush(void);
|
||||
@@ -1215,6 +1303,7 @@ int btf_check_type_match(struct bpf_verifier_env *env, struct bpf_prog *prog,
|
||||
|
||||
struct bpf_prog *bpf_prog_by_id(u32 id);
|
||||
|
||||
const struct bpf_func_proto *bpf_base_func_proto(enum bpf_func_id func_id);
|
||||
#else /* !CONFIG_BPF_SYSCALL */
|
||||
static inline struct bpf_prog *bpf_prog_get(u32 ufd)
|
||||
{
|
||||
@@ -1275,6 +1364,10 @@ static inline struct net_device *__dev_map_hash_lookup_elem(struct bpf_map *map
|
||||
{
|
||||
return NULL;
|
||||
}
|
||||
static inline bool dev_map_can_have_prog(struct bpf_map *map)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
static inline void __dev_flush(void)
|
||||
{
|
||||
@@ -1365,6 +1458,12 @@ static inline struct bpf_prog *bpf_prog_by_id(u32 id)
|
||||
{
|
||||
return ERR_PTR(-ENOTSUPP);
|
||||
}
|
||||
|
||||
static inline const struct bpf_func_proto *
|
||||
bpf_base_func_proto(enum bpf_func_id func_id)
|
||||
{
|
||||
return NULL;
|
||||
}
|
||||
#endif /* CONFIG_BPF_SYSCALL */
|
||||
|
||||
static inline struct bpf_prog *bpf_prog_get_type(u32 ufd,
|
||||
@@ -1502,6 +1601,7 @@ extern const struct bpf_func_proto bpf_get_smp_processor_id_proto;
|
||||
extern const struct bpf_func_proto bpf_get_numa_node_id_proto;
|
||||
extern const struct bpf_func_proto bpf_tail_call_proto;
|
||||
extern const struct bpf_func_proto bpf_ktime_get_ns_proto;
|
||||
extern const struct bpf_func_proto bpf_ktime_get_boot_ns_proto;
|
||||
extern const struct bpf_func_proto bpf_get_current_pid_tgid_proto;
|
||||
extern const struct bpf_func_proto bpf_get_current_uid_gid_proto;
|
||||
extern const struct bpf_func_proto bpf_get_current_comm_proto;
|
||||
@@ -1523,13 +1623,23 @@ extern const struct bpf_func_proto bpf_strtoul_proto;
|
||||
extern const struct bpf_func_proto bpf_tcp_sock_proto;
|
||||
extern const struct bpf_func_proto bpf_jiffies64_proto;
|
||||
extern const struct bpf_func_proto bpf_get_ns_current_pid_tgid_proto;
|
||||
extern const struct bpf_func_proto bpf_event_output_data_proto;
|
||||
extern const struct bpf_func_proto bpf_ringbuf_output_proto;
|
||||
extern const struct bpf_func_proto bpf_ringbuf_reserve_proto;
|
||||
extern const struct bpf_func_proto bpf_ringbuf_submit_proto;
|
||||
extern const struct bpf_func_proto bpf_ringbuf_discard_proto;
|
||||
extern const struct bpf_func_proto bpf_ringbuf_query_proto;
|
||||
|
||||
const struct bpf_func_proto *bpf_tracing_func_proto(
|
||||
enum bpf_func_id func_id, const struct bpf_prog *prog);
|
||||
|
||||
const struct bpf_func_proto *tracing_prog_func_proto(
|
||||
enum bpf_func_id func_id, const struct bpf_prog *prog);
|
||||
|
||||
/* Shared helpers among cBPF and eBPF. */
|
||||
void bpf_user_rnd_init_once(void);
|
||||
u64 bpf_user_rnd_u32(u64 r1, u64 r2, u64 r3, u64 r4, u64 r5);
|
||||
u64 bpf_get_raw_cpu_id(u64 r1, u64 r2, u64 r3, u64 r4, u64 r5);
|
||||
|
||||
#if defined(CONFIG_NET)
|
||||
bool bpf_sock_common_is_valid_access(int off, int size,
|
||||
|
@@ -118,3 +118,14 @@ BPF_MAP_TYPE(BPF_MAP_TYPE_STACK, stack_map_ops)
|
||||
#if defined(CONFIG_BPF_JIT)
|
||||
BPF_MAP_TYPE(BPF_MAP_TYPE_STRUCT_OPS, bpf_struct_ops_map_ops)
|
||||
#endif
|
||||
BPF_MAP_TYPE(BPF_MAP_TYPE_RINGBUF, ringbuf_map_ops)
|
||||
|
||||
BPF_LINK_TYPE(BPF_LINK_TYPE_RAW_TRACEPOINT, raw_tracepoint)
|
||||
BPF_LINK_TYPE(BPF_LINK_TYPE_TRACING, tracing)
|
||||
#ifdef CONFIG_CGROUP_BPF
|
||||
BPF_LINK_TYPE(BPF_LINK_TYPE_CGROUP, cgroup)
|
||||
#endif
|
||||
BPF_LINK_TYPE(BPF_LINK_TYPE_ITER, iter)
|
||||
#ifdef CONFIG_NET
|
||||
BPF_LINK_TYPE(BPF_LINK_TYPE_NETNS, netns)
|
||||
#endif
|
||||
|
@@ -54,6 +54,8 @@ struct bpf_reg_state {
|
||||
|
||||
u32 btf_id; /* for PTR_TO_BTF_ID */
|
||||
|
||||
u32 mem_size; /* for PTR_TO_MEM | PTR_TO_MEM_OR_NULL */
|
||||
|
||||
/* Max size from any of the above. */
|
||||
unsigned long raw;
|
||||
};
|
||||
@@ -63,6 +65,8 @@ struct bpf_reg_state {
|
||||
* offset, so they can share range knowledge.
|
||||
* For PTR_TO_MAP_VALUE_OR_NULL this is used to share which map value we
|
||||
* came from, when one is tested for != NULL.
|
||||
* For PTR_TO_MEM_OR_NULL this is used to identify memory allocation
|
||||
* for the purpose of tracking that it's freed.
|
||||
* For PTR_TO_SOCKET this is used to share which pointers retain the
|
||||
* same reference to the socket, to determine proper reference freeing.
|
||||
*/
|
||||
@@ -375,6 +379,9 @@ struct bpf_verifier_env {
|
||||
u32 used_map_cnt; /* number of used maps */
|
||||
u32 id_gen; /* used to generate unique reg IDs */
|
||||
bool allow_ptr_leaks;
|
||||
bool bpf_capable;
|
||||
bool bypass_spec_v1;
|
||||
bool bypass_spec_v4;
|
||||
bool seen_direct_write;
|
||||
struct bpf_insn_aux_data *insn_aux_data; /* array of per-insn state */
|
||||
const struct bpf_line_info *prev_linfo;
|
||||
|
@@ -15,7 +15,9 @@
|
||||
#define PHY_ID_BCMAC131 0x0143bc70
|
||||
#define PHY_ID_BCM5481 0x0143bca0
|
||||
#define PHY_ID_BCM5395 0x0143bcf0
|
||||
#define PHY_ID_BCM53125 0x03625f20
|
||||
#define PHY_ID_BCM54810 0x03625d00
|
||||
#define PHY_ID_BCM54811 0x03625cc0
|
||||
#define PHY_ID_BCM5482 0x0143bcb0
|
||||
#define PHY_ID_BCM5411 0x00206070
|
||||
#define PHY_ID_BCM5421 0x002060e0
|
||||
@@ -24,6 +26,7 @@
|
||||
#define PHY_ID_BCM5461 0x002060c0
|
||||
#define PHY_ID_BCM54612E 0x03625e60
|
||||
#define PHY_ID_BCM54616S 0x03625d10
|
||||
#define PHY_ID_BCM54140 0xae025009
|
||||
#define PHY_ID_BCM57780 0x03625d90
|
||||
#define PHY_ID_BCM89610 0x03625cd0
|
||||
|
||||
@@ -114,6 +117,14 @@
|
||||
#define MII_BCM54XX_SHD_VAL(x) ((x & 0x1f) << 10)
|
||||
#define MII_BCM54XX_SHD_DATA(x) ((x & 0x3ff) << 0)
|
||||
|
||||
#define MII_BCM54XX_RDB_ADDR 0x1e
|
||||
#define MII_BCM54XX_RDB_DATA 0x1f
|
||||
|
||||
/* legacy access control via rdb/expansion register */
|
||||
#define BCM54XX_RDB_REG0087 0x0087
|
||||
#define BCM54XX_EXP_REG7E (MII_BCM54XX_EXP_SEL_ER + 0x7E)
|
||||
#define BCM54XX_ACCESS_MODE_LEGACY_EN BIT(15)
|
||||
|
||||
/*
|
||||
* AUXILIARY CONTROL SHADOW ACCESS REGISTERS. (PHY REG 0x18)
|
||||
*/
|
||||
@@ -245,6 +256,7 @@
|
||||
#define BCM54810_EXP_BROADREACH_LRE_MISC_CTL_EN (1 << 0)
|
||||
#define BCM54810_SHD_CLK_CTL 0x3
|
||||
#define BCM54810_SHD_CLK_CTL_GTXCLK_EN (1 << 9)
|
||||
#define BCM54810_SHD_SCR3_TRDDAPD 0x0100
|
||||
|
||||
/* BCM54612E Registers */
|
||||
#define BCM54612E_EXP_SPARE0 (MII_BCM54XX_EXP_SEL_ETC + 0x34)
|
||||
@@ -289,4 +301,51 @@
|
||||
#define MII_BRCM_CORE_EXPB0 0xB0
|
||||
#define MII_BRCM_CORE_EXPB1 0xB1
|
||||
|
||||
/* Enhanced Cable Diagnostics */
|
||||
#define BCM54XX_RDB_ECD_CTRL 0x2a0
|
||||
#define BCM54XX_EXP_ECD_CTRL (MII_BCM54XX_EXP_SEL_ER + 0xc0)
|
||||
|
||||
#define BCM54XX_ECD_CTRL_CABLE_TYPE_CAT3 1 /* CAT3 or worse */
|
||||
#define BCM54XX_ECD_CTRL_CABLE_TYPE_CAT5 0 /* CAT5 or better */
|
||||
#define BCM54XX_ECD_CTRL_CABLE_TYPE_MASK BIT(0) /* cable type */
|
||||
#define BCM54XX_ECD_CTRL_INVALID BIT(3) /* invalid result */
|
||||
#define BCM54XX_ECD_CTRL_UNIT_CM 0 /* centimeters */
|
||||
#define BCM54XX_ECD_CTRL_UNIT_M 1 /* meters */
|
||||
#define BCM54XX_ECD_CTRL_UNIT_MASK BIT(10) /* cable length unit */
|
||||
#define BCM54XX_ECD_CTRL_IN_PROGRESS BIT(11) /* test in progress */
|
||||
#define BCM54XX_ECD_CTRL_BREAK_LINK BIT(12) /* unconnect link
|
||||
* during test
|
||||
*/
|
||||
#define BCM54XX_ECD_CTRL_CROSS_SHORT_DIS BIT(13) /* disable inter-pair
|
||||
* short check
|
||||
*/
|
||||
#define BCM54XX_ECD_CTRL_RUN BIT(15) /* run immediate */
|
||||
|
||||
#define BCM54XX_RDB_ECD_FAULT_TYPE 0x2a1
|
||||
#define BCM54XX_EXP_ECD_FAULT_TYPE (MII_BCM54XX_EXP_SEL_ER + 0xc1)
|
||||
#define BCM54XX_ECD_FAULT_TYPE_INVALID 0x0
|
||||
#define BCM54XX_ECD_FAULT_TYPE_OK 0x1
|
||||
#define BCM54XX_ECD_FAULT_TYPE_OPEN 0x2
|
||||
#define BCM54XX_ECD_FAULT_TYPE_SAME_SHORT 0x3 /* short same pair */
|
||||
#define BCM54XX_ECD_FAULT_TYPE_CROSS_SHORT 0x4 /* short different pairs */
|
||||
#define BCM54XX_ECD_FAULT_TYPE_BUSY 0x9
|
||||
#define BCM54XX_ECD_FAULT_TYPE_PAIR_D_MASK GENMASK(3, 0)
|
||||
#define BCM54XX_ECD_FAULT_TYPE_PAIR_C_MASK GENMASK(7, 4)
|
||||
#define BCM54XX_ECD_FAULT_TYPE_PAIR_B_MASK GENMASK(11, 8)
|
||||
#define BCM54XX_ECD_FAULT_TYPE_PAIR_A_MASK GENMASK(15, 12)
|
||||
#define BCM54XX_ECD_PAIR_A_LENGTH_RESULTS 0x2a2
|
||||
#define BCM54XX_ECD_PAIR_B_LENGTH_RESULTS 0x2a3
|
||||
#define BCM54XX_ECD_PAIR_C_LENGTH_RESULTS 0x2a4
|
||||
#define BCM54XX_ECD_PAIR_D_LENGTH_RESULTS 0x2a5
|
||||
|
||||
#define BCM54XX_RDB_ECD_PAIR_A_LENGTH_RESULTS 0x2a2
|
||||
#define BCM54XX_EXP_ECD_PAIR_A_LENGTH_RESULTS (MII_BCM54XX_EXP_SEL_ER + 0xc2)
|
||||
#define BCM54XX_RDB_ECD_PAIR_B_LENGTH_RESULTS 0x2a3
|
||||
#define BCM54XX_EXP_ECD_PAIR_B_LENGTH_RESULTS (MII_BCM54XX_EXP_SEL_ER + 0xc3)
|
||||
#define BCM54XX_RDB_ECD_PAIR_C_LENGTH_RESULTS 0x2a4
|
||||
#define BCM54XX_EXP_ECD_PAIR_C_LENGTH_RESULTS (MII_BCM54XX_EXP_SEL_ER + 0xc4)
|
||||
#define BCM54XX_RDB_ECD_PAIR_D_LENGTH_RESULTS 0x2a5
|
||||
#define BCM54XX_EXP_ECD_PAIR_D_LENGTH_RESULTS (MII_BCM54XX_EXP_SEL_ER + 0xc5)
|
||||
#define BCM54XX_ECD_LENGTH_RESULTS_INVALID 0xffff
|
||||
|
||||
#endif /* _LINUX_BRCMPHY_H */
|
||||
|
@@ -4,7 +4,29 @@
|
||||
|
||||
#include <linux/types.h>
|
||||
|
||||
void *bsearch(const void *key, const void *base, size_t num, size_t size,
|
||||
cmp_func_t cmp);
|
||||
static __always_inline
|
||||
void *__inline_bsearch(const void *key, const void *base, size_t num, size_t size, cmp_func_t cmp)
|
||||
{
|
||||
const char *pivot;
|
||||
int result;
|
||||
|
||||
while (num > 0) {
|
||||
pivot = base + (num >> 1) * size;
|
||||
result = cmp(key, pivot);
|
||||
|
||||
if (result == 0)
|
||||
return (void *)pivot;
|
||||
|
||||
if (result > 0) {
|
||||
base = pivot + size;
|
||||
num--;
|
||||
}
|
||||
num >>= 1;
|
||||
}
|
||||
|
||||
return NULL;
|
||||
}
|
||||
|
||||
extern void *bsearch(const void *key, const void *base, size_t num, size_t size, cmp_func_t cmp);
|
||||
|
||||
#endif /* _LINUX_BSEARCH_H */
|
||||
|
@@ -189,6 +189,8 @@ struct buffer_head *__getblk_gfp(struct block_device *bdev, sector_t block,
|
||||
void __brelse(struct buffer_head *);
|
||||
void __bforget(struct buffer_head *);
|
||||
void __breadahead(struct block_device *, sector_t block, unsigned int size);
|
||||
void __breadahead_gfp(struct block_device *, sector_t block, unsigned int size,
|
||||
gfp_t gfp);
|
||||
struct buffer_head *__bread_gfp(struct block_device *,
|
||||
sector_t block, unsigned size, gfp_t gfp);
|
||||
void invalidate_bh_lrus(void);
|
||||
@@ -270,14 +272,6 @@ void buffer_init(void);
|
||||
* inline definitions
|
||||
*/
|
||||
|
||||
static inline void attach_page_buffers(struct page *page,
|
||||
struct buffer_head *head)
|
||||
{
|
||||
get_page(page);
|
||||
SetPagePrivate(page);
|
||||
set_page_private(page, (unsigned long)head);
|
||||
}
|
||||
|
||||
static inline void get_bh(struct buffer_head *bh)
|
||||
{
|
||||
atomic_inc(&bh->b_count);
|
||||
@@ -319,6 +313,12 @@ sb_breadahead(struct super_block *sb, sector_t block)
|
||||
__breadahead(sb->s_bdev, block, sb->s_blocksize);
|
||||
}
|
||||
|
||||
static inline void
|
||||
sb_breadahead_unmovable(struct super_block *sb, sector_t block)
|
||||
{
|
||||
__breadahead_gfp(sb->s_bdev, block, sb->s_blocksize, 0);
|
||||
}
|
||||
|
||||
static inline struct buffer_head *
|
||||
sb_getblk(struct super_block *sb, sector_t block)
|
||||
{
|
||||
|
@@ -12,8 +12,17 @@
|
||||
#include <linux/errno.h>
|
||||
#include <linux/mm.h>
|
||||
|
||||
/*
|
||||
* was unsigned short, but we might as well be ready for > 64kB I/O pages
|
||||
/**
|
||||
* struct bio_vec - a contiguous range of physical memory addresses
|
||||
* @bv_page: First page associated with the address range.
|
||||
* @bv_len: Number of bytes in the address range.
|
||||
* @bv_offset: Start of the address range relative to the start of @bv_page.
|
||||
*
|
||||
* The following holds for a bvec if n * PAGE_SIZE < bv_offset + bv_len:
|
||||
*
|
||||
* nth_page(@bv_page, n) == @bv_page + n
|
||||
*
|
||||
* This holds because page_is_mergeable() checks the above property.
|
||||
*/
|
||||
struct bio_vec {
|
||||
struct page *bv_page;
|
||||
|
@@ -15,8 +15,14 @@
|
||||
|
||||
/*
|
||||
* __read_mostly is used to keep rarely changing variables out of frequently
|
||||
* updated cachelines. If an architecture doesn't support it, ignore the
|
||||
* hint.
|
||||
* updated cachelines. Its use should be reserved for data that is used
|
||||
* frequently in hot paths. Performance traces can help decide when to use
|
||||
* this. You want __read_mostly data to be tightly packed, so that in the
|
||||
* best case multiple frequently read variables for a hot path will be next
|
||||
* to each other in order to reduce the number of cachelines needed to
|
||||
* execute a critical path. We should be mindful and selective of its use.
|
||||
* ie: if you're going to use it please supply a *good* justification in your
|
||||
* commit log
|
||||
*/
|
||||
#ifndef __read_mostly
|
||||
#define __read_mostly
|
||||
|
@@ -189,7 +189,7 @@ struct __packed pucan_rx_msg {
|
||||
u8 client;
|
||||
__le16 flags;
|
||||
__le32 can_id;
|
||||
u8 d[0];
|
||||
u8 d[];
|
||||
};
|
||||
|
||||
/* uCAN error types */
|
||||
@@ -266,7 +266,7 @@ struct __packed pucan_tx_msg {
|
||||
u8 client;
|
||||
__le16 flags;
|
||||
__le32 can_id;
|
||||
u8 d[0];
|
||||
u8 d[];
|
||||
};
|
||||
|
||||
/* build the cmd opcode_channel field with respect to the correct endianness */
|
||||
|
@@ -251,6 +251,15 @@ extern bool privileged_wrt_inode_uidgid(struct user_namespace *ns, const struct
|
||||
extern bool capable_wrt_inode_uidgid(const struct inode *inode, int cap);
|
||||
extern bool file_ns_capable(const struct file *file, struct user_namespace *ns, int cap);
|
||||
extern bool ptracer_capable(struct task_struct *tsk, struct user_namespace *ns);
|
||||
static inline bool perfmon_capable(void)
|
||||
{
|
||||
return capable(CAP_PERFMON) || capable(CAP_SYS_ADMIN);
|
||||
}
|
||||
|
||||
static inline bool bpf_capable(void)
|
||||
{
|
||||
return capable(CAP_BPF) || capable(CAP_SYS_ADMIN);
|
||||
}
|
||||
|
||||
/* audit system wants to get cap info from files as well */
|
||||
extern int get_vfs_caps_from_disk(const struct dentry *dentry, struct cpu_vfs_cap_data *cpu_caps);
|
||||
|
@@ -94,6 +94,11 @@ struct cdrom_device_ops {
|
||||
struct packet_command *);
|
||||
};
|
||||
|
||||
int cdrom_multisession(struct cdrom_device_info *cdi,
|
||||
struct cdrom_multisession *info);
|
||||
int cdrom_read_tocentry(struct cdrom_device_info *cdi,
|
||||
struct cdrom_tocentry *entry);
|
||||
|
||||
/* the general block_device operations structure: */
|
||||
extern int cdrom_open(struct cdrom_device_info *cdi, struct block_device *bdev,
|
||||
fmode_t mode);
|
||||
@@ -104,7 +109,7 @@ extern unsigned int cdrom_check_events(struct cdrom_device_info *cdi,
|
||||
unsigned int clearing);
|
||||
extern int cdrom_media_changed(struct cdrom_device_info *);
|
||||
|
||||
extern int register_cdrom(struct cdrom_device_info *cdi);
|
||||
extern int register_cdrom(struct gendisk *disk, struct cdrom_device_info *cdi);
|
||||
extern void unregister_cdrom(struct cdrom_device_info *cdi);
|
||||
|
||||
typedef struct {
|
||||
|
@@ -53,6 +53,8 @@ struct ceph_options {
|
||||
unsigned long osd_keepalive_timeout; /* jiffies */
|
||||
unsigned long osd_request_timeout; /* jiffies */
|
||||
|
||||
u32 osd_req_flags; /* CEPH_OSD_FLAG_*, applied to each OSD request */
|
||||
|
||||
/*
|
||||
* any type that can't be simply compared or doesn't need
|
||||
* to be compared should go beyond this point,
|
||||
@@ -64,6 +66,7 @@ struct ceph_options {
|
||||
int num_mon;
|
||||
char *name;
|
||||
struct ceph_crypto_key *key;
|
||||
struct rb_root crush_locs;
|
||||
};
|
||||
|
||||
/*
|
||||
@@ -188,7 +191,7 @@ static inline int calc_pages_for(u64 off, u64 len)
|
||||
#define RB_CMP3WAY(a, b) ((a) < (b) ? -1 : (a) > (b))
|
||||
|
||||
#define DEFINE_RB_INSDEL_FUNCS2(name, type, keyfld, cmpexp, keyexp, nodefld) \
|
||||
static void insert_##name(struct rb_root *root, type *t) \
|
||||
static bool __insert_##name(struct rb_root *root, type *t) \
|
||||
{ \
|
||||
struct rb_node **n = &root->rb_node; \
|
||||
struct rb_node *parent = NULL; \
|
||||
@@ -206,11 +209,17 @@ static void insert_##name(struct rb_root *root, type *t) \
|
||||
else if (cmp > 0) \
|
||||
n = &(*n)->rb_right; \
|
||||
else \
|
||||
BUG(); \
|
||||
return false; \
|
||||
} \
|
||||
\
|
||||
rb_link_node(&t->nodefld, parent, n); \
|
||||
rb_insert_color(&t->nodefld, root); \
|
||||
return true; \
|
||||
} \
|
||||
static void __maybe_unused insert_##name(struct rb_root *root, type *t) \
|
||||
{ \
|
||||
if (!__insert_##name(root, t)) \
|
||||
BUG(); \
|
||||
} \
|
||||
static void erase_##name(struct rb_root *root, type *t) \
|
||||
{ \
|
||||
|
@@ -19,7 +19,7 @@ struct ceph_monmap {
|
||||
struct ceph_fsid fsid;
|
||||
u32 epoch;
|
||||
u32 num_mon;
|
||||
struct ceph_entity_inst mon_inst[0];
|
||||
struct ceph_entity_inst mon_inst[];
|
||||
};
|
||||
|
||||
struct ceph_mon_client;
|
||||
|
@@ -8,6 +8,7 @@
|
||||
#include <linux/mempool.h>
|
||||
#include <linux/rbtree.h>
|
||||
#include <linux/refcount.h>
|
||||
#include <linux/ktime.h>
|
||||
|
||||
#include <linux/ceph/types.h>
|
||||
#include <linux/ceph/osdmap.h>
|
||||
@@ -135,6 +136,7 @@ struct ceph_osd_req_op {
|
||||
struct {
|
||||
u64 expected_object_size;
|
||||
u64 expected_write_size;
|
||||
u32 flags; /* CEPH_OSD_OP_ALLOC_HINT_FLAG_* */
|
||||
} alloc_hint;
|
||||
struct {
|
||||
u64 snapid;
|
||||
@@ -164,6 +166,7 @@ struct ceph_osd_request_target {
|
||||
bool recovery_deletes;
|
||||
|
||||
unsigned int flags; /* CEPH_OSD_FLAG_* */
|
||||
bool used_replica;
|
||||
bool paused;
|
||||
|
||||
u32 epoch;
|
||||
@@ -213,6 +216,8 @@ struct ceph_osd_request {
|
||||
/* internal */
|
||||
unsigned long r_stamp; /* jiffies, send or check time */
|
||||
unsigned long r_start_stamp; /* jiffies */
|
||||
ktime_t r_start_latency; /* ktime_t */
|
||||
ktime_t r_end_latency; /* ktime_t */
|
||||
int r_attempts;
|
||||
u32 r_map_dne_bound;
|
||||
|
||||
@@ -468,7 +473,8 @@ extern int osd_req_op_xattr_init(struct ceph_osd_request *osd_req, unsigned int
|
||||
extern void osd_req_op_alloc_hint_init(struct ceph_osd_request *osd_req,
|
||||
unsigned int which,
|
||||
u64 expected_object_size,
|
||||
u64 expected_write_size);
|
||||
u64 expected_write_size,
|
||||
u32 flags);
|
||||
|
||||
extern struct ceph_osd_request *ceph_osdc_alloc_request(struct ceph_osd_client *osdc,
|
||||
struct ceph_snap_context *snapc,
|
||||
|
@@ -302,9 +302,26 @@ bool ceph_pg_to_primary_shard(struct ceph_osdmap *osdmap,
|
||||
int ceph_pg_to_acting_primary(struct ceph_osdmap *osdmap,
|
||||
const struct ceph_pg *raw_pgid);
|
||||
|
||||
struct crush_loc {
|
||||
char *cl_type_name;
|
||||
char *cl_name;
|
||||
};
|
||||
|
||||
struct crush_loc_node {
|
||||
struct rb_node cl_node;
|
||||
struct crush_loc cl_loc; /* pointers into cl_data */
|
||||
char cl_data[];
|
||||
};
|
||||
|
||||
int ceph_parse_crush_location(char *crush_location, struct rb_root *locs);
|
||||
int ceph_compare_crush_locs(struct rb_root *locs1, struct rb_root *locs2);
|
||||
void ceph_clear_crush_locs(struct rb_root *locs);
|
||||
|
||||
int ceph_get_crush_locality(struct ceph_osdmap *osdmap, int id,
|
||||
struct rb_root *locs);
|
||||
|
||||
extern struct ceph_pg_pool_info *ceph_pg_pool_by_id(struct ceph_osdmap *map,
|
||||
u64 id);
|
||||
|
||||
extern const char *ceph_pg_pool_name_by_id(struct ceph_osdmap *map, u64 id);
|
||||
extern int ceph_pg_poolid_by_name(struct ceph_osdmap *map, const char *name);
|
||||
u64 ceph_pg_pool_flags(struct ceph_osdmap *map, u64 id);
|
||||
|
@@ -464,6 +464,19 @@ enum {
|
||||
|
||||
const char *ceph_osd_watch_op_name(int o);
|
||||
|
||||
enum {
|
||||
CEPH_OSD_ALLOC_HINT_FLAG_SEQUENTIAL_WRITE = 1,
|
||||
CEPH_OSD_ALLOC_HINT_FLAG_RANDOM_WRITE = 2,
|
||||
CEPH_OSD_ALLOC_HINT_FLAG_SEQUENTIAL_READ = 4,
|
||||
CEPH_OSD_ALLOC_HINT_FLAG_RANDOM_READ = 8,
|
||||
CEPH_OSD_ALLOC_HINT_FLAG_APPEND_ONLY = 16,
|
||||
CEPH_OSD_ALLOC_HINT_FLAG_IMMUTABLE = 32,
|
||||
CEPH_OSD_ALLOC_HINT_FLAG_SHORTLIVED = 64,
|
||||
CEPH_OSD_ALLOC_HINT_FLAG_LONGLIVED = 128,
|
||||
CEPH_OSD_ALLOC_HINT_FLAG_COMPRESSIBLE = 256,
|
||||
CEPH_OSD_ALLOC_HINT_FLAG_INCOMPRESSIBLE = 512,
|
||||
};
|
||||
|
||||
enum {
|
||||
CEPH_OSD_BACKOFF_OP_BLOCK = 1,
|
||||
CEPH_OSD_BACKOFF_OP_ACK_BLOCK = 2,
|
||||
@@ -517,6 +530,7 @@ struct ceph_osd_op {
|
||||
struct {
|
||||
__le64 expected_object_size;
|
||||
__le64 expected_write_size;
|
||||
__le32 flags; /* CEPH_OSD_OP_ALLOC_HINT_FLAG_* */
|
||||
} __attribute__ ((packed)) alloc_hint;
|
||||
struct {
|
||||
__le64 snapid;
|
||||
|
@@ -131,6 +131,9 @@ extern void tegra210_set_sata_pll_seq_sw(bool state);
|
||||
extern void tegra210_put_utmipll_in_iddq(void);
|
||||
extern void tegra210_put_utmipll_out_iddq(void);
|
||||
extern int tegra210_clk_handle_mbist_war(unsigned int id);
|
||||
extern void tegra210_clk_emc_dll_enable(bool flag);
|
||||
extern void tegra210_clk_emc_dll_update_setting(u32 emc_dll_src_value);
|
||||
extern void tegra210_clk_emc_update_setting(u32 emc_src_value);
|
||||
|
||||
struct clk;
|
||||
|
||||
@@ -143,4 +146,28 @@ void tegra20_clk_set_emc_round_callback(tegra20_clk_emc_round_cb *round_cb,
|
||||
void *cb_arg);
|
||||
int tegra20_clk_prepare_emc_mc_same_freq(struct clk *emc_clk, bool same);
|
||||
|
||||
struct tegra210_clk_emc_config {
|
||||
unsigned long rate;
|
||||
bool same_freq;
|
||||
u32 value;
|
||||
|
||||
unsigned long parent_rate;
|
||||
u8 parent;
|
||||
};
|
||||
|
||||
struct tegra210_clk_emc_provider {
|
||||
struct module *owner;
|
||||
struct device *dev;
|
||||
|
||||
struct tegra210_clk_emc_config *configs;
|
||||
unsigned int num_configs;
|
||||
|
||||
int (*set_rate)(struct device *dev,
|
||||
const struct tegra210_clk_emc_config *config);
|
||||
};
|
||||
|
||||
int tegra210_clk_emc_attach(struct clk *clk,
|
||||
struct tegra210_clk_emc_provider *provider);
|
||||
void tegra210_clk_emc_detach(struct clk *clk);
|
||||
|
||||
#endif /* __LINUX_CLK_TEGRA_H_ */
|
||||
|
@@ -86,7 +86,7 @@ static inline unsigned long compact_gap(unsigned int order)
|
||||
#ifdef CONFIG_COMPACTION
|
||||
extern int sysctl_compact_memory;
|
||||
extern int sysctl_compaction_handler(struct ctl_table *table, int write,
|
||||
void __user *buffer, size_t *length, loff_t *ppos);
|
||||
void *buffer, size_t *length, loff_t *ppos);
|
||||
extern int sysctl_extfrag_threshold;
|
||||
extern int sysctl_compact_unevictable_allowed;
|
||||
|
||||
@@ -97,7 +97,7 @@ extern enum compact_result try_to_compact_pages(gfp_t gfp_mask,
|
||||
struct page **page);
|
||||
extern void reset_isolation_suitable(pg_data_t *pgdat);
|
||||
extern enum compact_result compaction_suitable(struct zone *zone, int order,
|
||||
unsigned int alloc_flags, int classzone_idx);
|
||||
unsigned int alloc_flags, int highest_zoneidx);
|
||||
|
||||
extern void defer_compaction(struct zone *zone, int order);
|
||||
extern bool compaction_deferred(struct zone *zone, int order);
|
||||
@@ -182,7 +182,7 @@ bool compaction_zonelist_suitable(struct alloc_context *ac, int order,
|
||||
|
||||
extern int kcompactd_run(int nid);
|
||||
extern void kcompactd_stop(int nid);
|
||||
extern void wakeup_kcompactd(pg_data_t *pgdat, int order, int classzone_idx);
|
||||
extern void wakeup_kcompactd(pg_data_t *pgdat, int order, int highest_zoneidx);
|
||||
|
||||
#else
|
||||
static inline void reset_isolation_suitable(pg_data_t *pgdat)
|
||||
@@ -190,7 +190,7 @@ static inline void reset_isolation_suitable(pg_data_t *pgdat)
|
||||
}
|
||||
|
||||
static inline enum compact_result compaction_suitable(struct zone *zone, int order,
|
||||
int alloc_flags, int classzone_idx)
|
||||
int alloc_flags, int highest_zoneidx)
|
||||
{
|
||||
return COMPACT_SKIPPED;
|
||||
}
|
||||
@@ -232,7 +232,8 @@ static inline void kcompactd_stop(int nid)
|
||||
{
|
||||
}
|
||||
|
||||
static inline void wakeup_kcompactd(pg_data_t *pgdat, int order, int classzone_idx)
|
||||
static inline void wakeup_kcompactd(pg_data_t *pgdat,
|
||||
int order, int highest_zoneidx)
|
||||
{
|
||||
}
|
||||
|
||||
|
@@ -402,8 +402,15 @@ long compat_get_bitmap(unsigned long *mask, const compat_ulong_t __user *umask,
|
||||
unsigned long bitmap_size);
|
||||
long compat_put_bitmap(compat_ulong_t __user *umask, unsigned long *mask,
|
||||
unsigned long bitmap_size);
|
||||
int copy_siginfo_from_user32(kernel_siginfo_t *to, const struct compat_siginfo __user *from);
|
||||
int copy_siginfo_to_user32(struct compat_siginfo __user *to, const kernel_siginfo_t *from);
|
||||
void copy_siginfo_to_external32(struct compat_siginfo *to,
|
||||
const struct kernel_siginfo *from);
|
||||
int copy_siginfo_from_user32(kernel_siginfo_t *to,
|
||||
const struct compat_siginfo __user *from);
|
||||
int __copy_siginfo_to_user32(struct compat_siginfo __user *to,
|
||||
const kernel_siginfo_t *from);
|
||||
#ifndef copy_siginfo_to_user32
|
||||
#define copy_siginfo_to_user32 __copy_siginfo_to_user32
|
||||
#endif
|
||||
int get_compat_sigevent(struct sigevent *event,
|
||||
const struct compat_sigevent __user *u_event);
|
||||
|
||||
|
@@ -42,3 +42,7 @@
|
||||
* compilers, like ICC.
|
||||
*/
|
||||
#define barrier() __asm__ __volatile__("" : : : "memory")
|
||||
|
||||
#if __has_feature(shadow_call_stack)
|
||||
# define __noscs __attribute__((__no_sanitize__("shadow-call-stack")))
|
||||
#endif
|
||||
|
@@ -10,7 +10,8 @@
|
||||
+ __GNUC_MINOR__ * 100 \
|
||||
+ __GNUC_PATCHLEVEL__)
|
||||
|
||||
#if GCC_VERSION < 40600
|
||||
/* https://gcc.gnu.org/bugzilla/show_bug.cgi?id=58145 */
|
||||
#if GCC_VERSION < 40800
|
||||
# error Sorry, your compiler is too old - please upgrade it.
|
||||
#endif
|
||||
|
||||
@@ -126,9 +127,7 @@
|
||||
#if defined(CONFIG_ARCH_USE_BUILTIN_BSWAP) && !defined(__CHECKER__)
|
||||
#define __HAVE_BUILTIN_BSWAP32__
|
||||
#define __HAVE_BUILTIN_BSWAP64__
|
||||
#if GCC_VERSION >= 40800
|
||||
#define __HAVE_BUILTIN_BSWAP16__
|
||||
#endif
|
||||
#endif /* CONFIG_ARCH_USE_BUILTIN_BSWAP && !__CHECKER__ */
|
||||
|
||||
#if GCC_VERSION >= 70000
|
||||
|
@@ -120,12 +120,65 @@ void ftrace_likely_update(struct ftrace_likely_data *f, int val,
|
||||
/* Annotate a C jump table to allow objtool to follow the code flow */
|
||||
#define __annotate_jump_table __section(.rodata..c_jump_table)
|
||||
|
||||
#ifdef CONFIG_DEBUG_ENTRY
|
||||
/* Begin/end of an instrumentation safe region */
|
||||
#define instrumentation_begin() ({ \
|
||||
asm volatile("%c0:\n\t" \
|
||||
".pushsection .discard.instr_begin\n\t" \
|
||||
".long %c0b - .\n\t" \
|
||||
".popsection\n\t" : : "i" (__COUNTER__)); \
|
||||
})
|
||||
|
||||
/*
|
||||
* Because instrumentation_{begin,end}() can nest, objtool validation considers
|
||||
* _begin() a +1 and _end() a -1 and computes a sum over the instructions.
|
||||
* When the value is greater than 0, we consider instrumentation allowed.
|
||||
*
|
||||
* There is a problem with code like:
|
||||
*
|
||||
* noinstr void foo()
|
||||
* {
|
||||
* instrumentation_begin();
|
||||
* ...
|
||||
* if (cond) {
|
||||
* instrumentation_begin();
|
||||
* ...
|
||||
* instrumentation_end();
|
||||
* }
|
||||
* bar();
|
||||
* instrumentation_end();
|
||||
* }
|
||||
*
|
||||
* If instrumentation_end() would be an empty label, like all the other
|
||||
* annotations, the inner _end(), which is at the end of a conditional block,
|
||||
* would land on the instruction after the block.
|
||||
*
|
||||
* If we then consider the sum of the !cond path, we'll see that the call to
|
||||
* bar() is with a 0-value, even though, we meant it to happen with a positive
|
||||
* value.
|
||||
*
|
||||
* To avoid this, have _end() be a NOP instruction, this ensures it will be
|
||||
* part of the condition block and does not escape.
|
||||
*/
|
||||
#define instrumentation_end() ({ \
|
||||
asm volatile("%c0: nop\n\t" \
|
||||
".pushsection .discard.instr_end\n\t" \
|
||||
".long %c0b - .\n\t" \
|
||||
".popsection\n\t" : : "i" (__COUNTER__)); \
|
||||
})
|
||||
#endif /* CONFIG_DEBUG_ENTRY */
|
||||
|
||||
#else
|
||||
#define annotate_reachable()
|
||||
#define annotate_unreachable()
|
||||
#define __annotate_jump_table
|
||||
#endif
|
||||
|
||||
#ifndef instrumentation_begin
|
||||
#define instrumentation_begin() do { } while(0)
|
||||
#define instrumentation_end() do { } while(0)
|
||||
#endif
|
||||
|
||||
#ifndef ASM_UNREACHABLE
|
||||
# define ASM_UNREACHABLE
|
||||
#endif
|
||||
@@ -177,60 +230,6 @@ void ftrace_likely_update(struct ftrace_likely_data *f, int val,
|
||||
# define __UNIQUE_ID(prefix) __PASTE(__PASTE(__UNIQUE_ID_, prefix), __LINE__)
|
||||
#endif
|
||||
|
||||
#include <uapi/linux/types.h>
|
||||
|
||||
#define __READ_ONCE_SIZE \
|
||||
({ \
|
||||
switch (size) { \
|
||||
case 1: *(__u8 *)res = *(volatile __u8 *)p; break; \
|
||||
case 2: *(__u16 *)res = *(volatile __u16 *)p; break; \
|
||||
case 4: *(__u32 *)res = *(volatile __u32 *)p; break; \
|
||||
case 8: *(__u64 *)res = *(volatile __u64 *)p; break; \
|
||||
default: \
|
||||
barrier(); \
|
||||
__builtin_memcpy((void *)res, (const void *)p, size); \
|
||||
barrier(); \
|
||||
} \
|
||||
})
|
||||
|
||||
static __always_inline
|
||||
void __read_once_size(const volatile void *p, void *res, int size)
|
||||
{
|
||||
__READ_ONCE_SIZE;
|
||||
}
|
||||
|
||||
#ifdef CONFIG_KASAN
|
||||
/*
|
||||
* We can't declare function 'inline' because __no_sanitize_address confilcts
|
||||
* with inlining. Attempt to inline it may cause a build failure.
|
||||
* https://gcc.gnu.org/bugzilla/show_bug.cgi?id=67368
|
||||
* '__maybe_unused' allows us to avoid defined-but-not-used warnings.
|
||||
*/
|
||||
# define __no_kasan_or_inline __no_sanitize_address notrace __maybe_unused
|
||||
#else
|
||||
# define __no_kasan_or_inline __always_inline
|
||||
#endif
|
||||
|
||||
static __no_kasan_or_inline
|
||||
void __read_once_size_nocheck(const volatile void *p, void *res, int size)
|
||||
{
|
||||
__READ_ONCE_SIZE;
|
||||
}
|
||||
|
||||
static __always_inline void __write_once_size(volatile void *p, void *res, int size)
|
||||
{
|
||||
switch (size) {
|
||||
case 1: *(volatile __u8 *)p = *(__u8 *)res; break;
|
||||
case 2: *(volatile __u16 *)p = *(__u16 *)res; break;
|
||||
case 4: *(volatile __u32 *)p = *(__u32 *)res; break;
|
||||
case 8: *(volatile __u64 *)p = *(__u64 *)res; break;
|
||||
default:
|
||||
barrier();
|
||||
__builtin_memcpy((void *)p, (const void *)res, size);
|
||||
barrier();
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
* Prevent the compiler from merging or refetching reads or writes. The
|
||||
* compiler is also forbidden from reordering successive instances of
|
||||
@@ -240,11 +239,7 @@ static __always_inline void __write_once_size(volatile void *p, void *res, int s
|
||||
* statements.
|
||||
*
|
||||
* These two macros will also work on aggregate data types like structs or
|
||||
* unions. If the size of the accessed data type exceeds the word size of
|
||||
* the machine (e.g., 32 bits or 64 bits) READ_ONCE() and WRITE_ONCE() will
|
||||
* fall back to memcpy(). There's at least two memcpy()s: one for the
|
||||
* __builtin_memcpy() and then one for the macro doing the copy of variable
|
||||
* - '__u' allocated on the stack.
|
||||
* unions.
|
||||
*
|
||||
* Their two major use cases are: (1) Mediating communication between
|
||||
* process-level code and irq/NMI handlers, all running on the same CPU,
|
||||
@@ -256,23 +251,69 @@ static __always_inline void __write_once_size(volatile void *p, void *res, int s
|
||||
#include <asm/barrier.h>
|
||||
#include <linux/kasan-checks.h>
|
||||
|
||||
#define __READ_ONCE(x, check) \
|
||||
/*
|
||||
* Use __READ_ONCE() instead of READ_ONCE() if you do not require any
|
||||
* atomicity or dependency ordering guarantees. Note that this may result
|
||||
* in tears!
|
||||
*/
|
||||
#define __READ_ONCE(x) (*(const volatile __unqual_scalar_typeof(x) *)&(x))
|
||||
|
||||
#define __READ_ONCE_SCALAR(x) \
|
||||
({ \
|
||||
union { typeof(x) __val; char __c[1]; } __u; \
|
||||
if (check) \
|
||||
__read_once_size(&(x), __u.__c, sizeof(x)); \
|
||||
else \
|
||||
__read_once_size_nocheck(&(x), __u.__c, sizeof(x)); \
|
||||
smp_read_barrier_depends(); /* Enforce dependency ordering from x */ \
|
||||
__u.__val; \
|
||||
__unqual_scalar_typeof(x) __x = __READ_ONCE(x); \
|
||||
smp_read_barrier_depends(); \
|
||||
(typeof(x))__x; \
|
||||
})
|
||||
#define READ_ONCE(x) __READ_ONCE(x, 1)
|
||||
|
||||
#define READ_ONCE(x) \
|
||||
({ \
|
||||
compiletime_assert_rwonce_type(x); \
|
||||
__READ_ONCE_SCALAR(x); \
|
||||
})
|
||||
|
||||
#define __WRITE_ONCE(x, val) \
|
||||
do { \
|
||||
*(volatile typeof(x) *)&(x) = (val); \
|
||||
} while (0)
|
||||
|
||||
#define WRITE_ONCE(x, val) \
|
||||
do { \
|
||||
compiletime_assert_rwonce_type(x); \
|
||||
__WRITE_ONCE(x, val); \
|
||||
} while (0)
|
||||
|
||||
#ifdef CONFIG_KASAN
|
||||
/*
|
||||
* We can't declare function 'inline' because __no_sanitize_address conflicts
|
||||
* with inlining. Attempt to inline it may cause a build failure.
|
||||
* https://gcc.gnu.org/bugzilla/show_bug.cgi?id=67368
|
||||
* '__maybe_unused' allows us to avoid defined-but-not-used warnings.
|
||||
*/
|
||||
# define __no_kasan_or_inline __no_sanitize_address notrace __maybe_unused
|
||||
#else
|
||||
# define __no_kasan_or_inline __always_inline
|
||||
#endif
|
||||
|
||||
static __no_kasan_or_inline
|
||||
unsigned long __read_once_word_nocheck(const void *addr)
|
||||
{
|
||||
return __READ_ONCE(*(unsigned long *)addr);
|
||||
}
|
||||
|
||||
/*
|
||||
* Use READ_ONCE_NOCHECK() instead of READ_ONCE() if you need
|
||||
* to hide memory access from KASAN.
|
||||
* Use READ_ONCE_NOCHECK() instead of READ_ONCE() if you need to load a
|
||||
* word from memory atomically but without telling KASAN. This is usually
|
||||
* used by unwinding code when walking the stack of a running process.
|
||||
*/
|
||||
#define READ_ONCE_NOCHECK(x) __READ_ONCE(x, 0)
|
||||
#define READ_ONCE_NOCHECK(x) \
|
||||
({ \
|
||||
unsigned long __x; \
|
||||
compiletime_assert(sizeof(x) == sizeof(__x), \
|
||||
"Unsupported access size for READ_ONCE_NOCHECK()."); \
|
||||
__x = __read_once_word_nocheck(&(x)); \
|
||||
smp_read_barrier_depends(); \
|
||||
(typeof(x))__x; \
|
||||
})
|
||||
|
||||
static __no_kasan_or_inline
|
||||
unsigned long read_word_at_a_time(const void *addr)
|
||||
@@ -281,14 +322,6 @@ unsigned long read_word_at_a_time(const void *addr)
|
||||
return *(unsigned long *)addr;
|
||||
}
|
||||
|
||||
#define WRITE_ONCE(x, val) \
|
||||
({ \
|
||||
union { typeof(x) __val; char __c[1]; } __u = \
|
||||
{ .__val = (__force typeof(x)) (val) }; \
|
||||
__write_once_size(&(x), __u.__c, sizeof(x)); \
|
||||
__u.__val; \
|
||||
})
|
||||
|
||||
#endif /* __KERNEL__ */
|
||||
|
||||
/*
|
||||
@@ -353,7 +386,23 @@ static inline void *offset_to_ptr(const int *off)
|
||||
compiletime_assert(__native_word(t), \
|
||||
"Need native word sized stores/loads for atomicity.")
|
||||
|
||||
/*
|
||||
* Yes, this permits 64-bit accesses on 32-bit architectures. These will
|
||||
* actually be atomic in some cases (namely Armv7 + LPAE), but for others we
|
||||
* rely on the access being split into 2x32-bit accesses for a 32-bit quantity
|
||||
* (e.g. a virtual address) and a strong prevailing wind.
|
||||
*/
|
||||
#define compiletime_assert_rwonce_type(t) \
|
||||
compiletime_assert(__native_word(t) || sizeof(t) == sizeof(long long), \
|
||||
"Unsupported access size for {READ,WRITE}_ONCE().")
|
||||
|
||||
/* &a[0] degrades to a pointer: a different type from an array */
|
||||
#define __must_be_array(a) BUILD_BUG_ON_ZERO(__same_type((a), &(a)[0]))
|
||||
|
||||
/*
|
||||
* This is needed in functions which generate the stack canary, see
|
||||
* arch/x86/kernel/smpboot.c::start_secondary() for an example.
|
||||
*/
|
||||
#define prevent_tail_call_optimization() mb()
|
||||
|
||||
#endif /* __LINUX_COMPILER_H */
|
||||
|
@@ -118,6 +118,10 @@ struct ftrace_likely_data {
|
||||
#define notrace __attribute__((__no_instrument_function__))
|
||||
#endif
|
||||
|
||||
/* Section for code which can't be instrumented at all */
|
||||
#define noinstr \
|
||||
noinline notrace __attribute((__section__(".noinstr.text")))
|
||||
|
||||
/*
|
||||
* it doesn't make sense on ARM (currently the only user of __naked)
|
||||
* to trace naked functions because then mcount is called without
|
||||
@@ -193,6 +197,10 @@ struct ftrace_likely_data {
|
||||
# define randomized_struct_fields_end
|
||||
#endif
|
||||
|
||||
#ifndef __noscs
|
||||
# define __noscs
|
||||
#endif
|
||||
|
||||
#ifndef asm_volatile_goto
|
||||
#define asm_volatile_goto(x...) asm goto(x)
|
||||
#endif
|
||||
@@ -210,6 +218,53 @@ struct ftrace_likely_data {
|
||||
/* Are two types/vars the same type (ignoring qualifiers)? */
|
||||
#define __same_type(a, b) __builtin_types_compatible_p(typeof(a), typeof(b))
|
||||
|
||||
/*
|
||||
* __unqual_scalar_typeof(x) - Declare an unqualified scalar type, leaving
|
||||
* non-scalar types unchanged.
|
||||
*/
|
||||
#if (defined(CONFIG_CC_IS_GCC) && CONFIG_GCC_VERSION < 40900) || defined(__CHECKER__)
|
||||
/*
|
||||
* We build this out of a couple of helper macros in a vain attempt to
|
||||
* help you keep your lunch down while reading it.
|
||||
*/
|
||||
#define __pick_scalar_type(x, type, otherwise) \
|
||||
__builtin_choose_expr(__same_type(x, type), (type)0, otherwise)
|
||||
|
||||
/*
|
||||
* 'char' is not type-compatible with either 'signed char' or 'unsigned char',
|
||||
* so we include the naked type here as well as the signed/unsigned variants.
|
||||
*/
|
||||
#define __pick_integer_type(x, type, otherwise) \
|
||||
__pick_scalar_type(x, type, \
|
||||
__pick_scalar_type(x, unsigned type, \
|
||||
__pick_scalar_type(x, signed type, otherwise)))
|
||||
|
||||
#define __unqual_scalar_typeof(x) typeof( \
|
||||
__pick_integer_type(x, char, \
|
||||
__pick_integer_type(x, short, \
|
||||
__pick_integer_type(x, int, \
|
||||
__pick_integer_type(x, long, \
|
||||
__pick_integer_type(x, long long, x))))))
|
||||
#else
|
||||
/*
|
||||
* If supported, prefer C11 _Generic for better compile-times. As above, 'char'
|
||||
* is not type-compatible with 'signed char', and we define a separate case.
|
||||
*/
|
||||
#define __scalar_type_to_expr_cases(type) \
|
||||
unsigned type: (unsigned type)0, \
|
||||
signed type: (signed type)0
|
||||
|
||||
#define __unqual_scalar_typeof(x) typeof( \
|
||||
_Generic((x), \
|
||||
char: (char)0, \
|
||||
__scalar_type_to_expr_cases(char), \
|
||||
__scalar_type_to_expr_cases(short), \
|
||||
__scalar_type_to_expr_cases(int), \
|
||||
__scalar_type_to_expr_cases(long), \
|
||||
__scalar_type_to_expr_cases(long long), \
|
||||
default: (x)))
|
||||
#endif
|
||||
|
||||
/* Is this type a native word size -- useful for atomic operations */
|
||||
#define __native_word(t) \
|
||||
(sizeof(t) == sizeof(char) || sizeof(t) == sizeof(short) || \
|
||||
|
@@ -13,7 +13,7 @@
|
||||
*
|
||||
* configfs Copyright (C) 2005 Oracle. All rights reserved.
|
||||
*
|
||||
* Please read Documentation/filesystems/configfs/configfs.txt before using
|
||||
* Please read Documentation/filesystems/configfs.rst before using
|
||||
* the configfs interface, ESPECIALLY the parts about reference counts and
|
||||
* item destructors.
|
||||
*/
|
||||
|
@@ -134,7 +134,7 @@ static inline int con_debug_leave(void)
|
||||
*/
|
||||
|
||||
#define CON_PRINTBUFFER (1)
|
||||
#define CON_CONSDEV (2) /* Last on the command line */
|
||||
#define CON_CONSDEV (2) /* Preferred console, /dev/console */
|
||||
#define CON_ENABLED (4)
|
||||
#define CON_BOOT (8)
|
||||
#define CON_ANYTIME (16) /* Safe to call when cpu is offline */
|
||||
|
@@ -33,13 +33,13 @@ static inline void user_exit(void)
|
||||
}
|
||||
|
||||
/* Called with interrupts disabled. */
|
||||
static inline void user_enter_irqoff(void)
|
||||
static __always_inline void user_enter_irqoff(void)
|
||||
{
|
||||
if (context_tracking_enabled())
|
||||
__context_tracking_enter(CONTEXT_USER);
|
||||
|
||||
}
|
||||
static inline void user_exit_irqoff(void)
|
||||
static __always_inline void user_exit_irqoff(void)
|
||||
{
|
||||
if (context_tracking_enabled())
|
||||
__context_tracking_exit(CONTEXT_USER);
|
||||
@@ -75,7 +75,7 @@ static inline void exception_exit(enum ctx_state prev_ctx)
|
||||
* is enabled. If context tracking is disabled, returns
|
||||
* CONTEXT_DISABLED. This should be used primarily for debugging.
|
||||
*/
|
||||
static inline enum ctx_state ct_state(void)
|
||||
static __always_inline enum ctx_state ct_state(void)
|
||||
{
|
||||
return context_tracking_enabled() ?
|
||||
this_cpu_read(context_tracking.state) : CONTEXT_DISABLED;
|
||||
@@ -101,12 +101,14 @@ static inline void context_tracking_init(void) { }
|
||||
|
||||
#ifdef CONFIG_VIRT_CPU_ACCOUNTING_GEN
|
||||
/* must be called with irqs disabled */
|
||||
static inline void guest_enter_irqoff(void)
|
||||
static __always_inline void guest_enter_irqoff(void)
|
||||
{
|
||||
instrumentation_begin();
|
||||
if (vtime_accounting_enabled_this_cpu())
|
||||
vtime_guest_enter(current);
|
||||
else
|
||||
current->flags |= PF_VCPU;
|
||||
instrumentation_end();
|
||||
|
||||
if (context_tracking_enabled())
|
||||
__context_tracking_enter(CONTEXT_GUEST);
|
||||
@@ -118,39 +120,48 @@ static inline void guest_enter_irqoff(void)
|
||||
* one time slice). Lets treat guest mode as quiescent state, just like
|
||||
* we do with user-mode execution.
|
||||
*/
|
||||
if (!context_tracking_enabled_this_cpu())
|
||||
if (!context_tracking_enabled_this_cpu()) {
|
||||
instrumentation_begin();
|
||||
rcu_virt_note_context_switch(smp_processor_id());
|
||||
instrumentation_end();
|
||||
}
|
||||
}
|
||||
|
||||
static inline void guest_exit_irqoff(void)
|
||||
static __always_inline void guest_exit_irqoff(void)
|
||||
{
|
||||
if (context_tracking_enabled())
|
||||
__context_tracking_exit(CONTEXT_GUEST);
|
||||
|
||||
instrumentation_begin();
|
||||
if (vtime_accounting_enabled_this_cpu())
|
||||
vtime_guest_exit(current);
|
||||
else
|
||||
current->flags &= ~PF_VCPU;
|
||||
instrumentation_end();
|
||||
}
|
||||
|
||||
#else
|
||||
static inline void guest_enter_irqoff(void)
|
||||
static __always_inline void guest_enter_irqoff(void)
|
||||
{
|
||||
/*
|
||||
* This is running in ioctl context so its safe
|
||||
* to assume that it's the stime pending cputime
|
||||
* to flush.
|
||||
*/
|
||||
instrumentation_begin();
|
||||
vtime_account_kernel(current);
|
||||
current->flags |= PF_VCPU;
|
||||
rcu_virt_note_context_switch(smp_processor_id());
|
||||
instrumentation_end();
|
||||
}
|
||||
|
||||
static inline void guest_exit_irqoff(void)
|
||||
static __always_inline void guest_exit_irqoff(void)
|
||||
{
|
||||
instrumentation_begin();
|
||||
/* Flush the guest cputime we spent on the guest */
|
||||
vtime_account_kernel(current);
|
||||
current->flags &= ~PF_VCPU;
|
||||
instrumentation_end();
|
||||
}
|
||||
#endif /* CONFIG_VIRT_CPU_ACCOUNTING_GEN */
|
||||
|
||||
|
@@ -26,12 +26,12 @@ struct context_tracking {
|
||||
extern struct static_key_false context_tracking_key;
|
||||
DECLARE_PER_CPU(struct context_tracking, context_tracking);
|
||||
|
||||
static inline bool context_tracking_enabled(void)
|
||||
static __always_inline bool context_tracking_enabled(void)
|
||||
{
|
||||
return static_branch_unlikely(&context_tracking_key);
|
||||
}
|
||||
|
||||
static inline bool context_tracking_enabled_cpu(int cpu)
|
||||
static __always_inline bool context_tracking_enabled_cpu(int cpu)
|
||||
{
|
||||
return context_tracking_enabled() && per_cpu(context_tracking.active, cpu);
|
||||
}
|
||||
@@ -41,7 +41,7 @@ static inline bool context_tracking_enabled_this_cpu(void)
|
||||
return context_tracking_enabled() && __this_cpu_read(context_tracking.active);
|
||||
}
|
||||
|
||||
static inline bool context_tracking_in_user(void)
|
||||
static __always_inline bool context_tracking_in_user(void)
|
||||
{
|
||||
return __this_cpu_read(context_tracking.state) == CONTEXT_USER;
|
||||
}
|
||||
|
@@ -22,4 +22,8 @@ extern void do_coredump(const kernel_siginfo_t *siginfo);
|
||||
static inline void do_coredump(const kernel_siginfo_t *siginfo) {}
|
||||
#endif
|
||||
|
||||
extern int core_uses_pid;
|
||||
extern char core_pattern[];
|
||||
extern unsigned int core_pipe_limit;
|
||||
|
||||
#endif /* _LINUX_COREDUMP_H */
|
||||
|
@@ -100,10 +100,12 @@ union coresight_dev_subtype {
|
||||
};
|
||||
|
||||
/**
|
||||
* struct coresight_platform_data - data harvested from the DT specification
|
||||
* @nr_inport: number of input ports for this component.
|
||||
* @nr_outport: number of output ports for this component.
|
||||
* @conns: Array of nr_outport connections from this component
|
||||
* struct coresight_platform_data - data harvested from the firmware
|
||||
* specification.
|
||||
*
|
||||
* @nr_inport: Number of elements for the input connections.
|
||||
* @nr_outport: Number of elements for the output connections.
|
||||
* @conns: Sparse array of nr_outport connections from this component.
|
||||
*/
|
||||
struct coresight_platform_data {
|
||||
int nr_inport;
|
||||
@@ -140,12 +142,28 @@ struct coresight_desc {
|
||||
* @chid_fwnode: remote component's fwnode handle.
|
||||
* @child_dev: a @coresight_device representation of the component
|
||||
connected to @outport.
|
||||
* @link: Representation of the connection as a sysfs link.
|
||||
*/
|
||||
struct coresight_connection {
|
||||
int outport;
|
||||
int child_port;
|
||||
struct fwnode_handle *child_fwnode;
|
||||
struct coresight_device *child_dev;
|
||||
struct coresight_sysfs_link *link;
|
||||
};
|
||||
|
||||
/**
|
||||
* struct coresight_sysfs_link - representation of a connection in sysfs.
|
||||
* @orig: Originating (master) coresight device for the link.
|
||||
* @orig_name: Name to use for the link orig->target.
|
||||
* @target: Target (slave) coresight device for the link.
|
||||
* @target_name: Name to use for the link target->orig.
|
||||
*/
|
||||
struct coresight_sysfs_link {
|
||||
struct coresight_device *orig;
|
||||
const char *orig_name;
|
||||
struct coresight_device *target;
|
||||
const char *target_name;
|
||||
};
|
||||
|
||||
/**
|
||||
@@ -165,6 +183,9 @@ struct coresight_connection {
|
||||
* @ea: Device attribute for sink representation under PMU directory.
|
||||
* @ect_dev: Associated cross trigger device. Not part of the trace data
|
||||
* path or connections.
|
||||
* @nr_links: number of sysfs links created to other components from this
|
||||
* device. These will appear in the "connections" group.
|
||||
* @has_conns_grp: Have added a "connections" group for sysfs links.
|
||||
*/
|
||||
struct coresight_device {
|
||||
struct coresight_platform_data *pdata;
|
||||
@@ -180,6 +201,9 @@ struct coresight_device {
|
||||
struct dev_ext_attribute *ea;
|
||||
/* cross trigger handling */
|
||||
struct coresight_device *ect_dev;
|
||||
/* sysfs links between components */
|
||||
int nr_links;
|
||||
bool has_conns_grp;
|
||||
};
|
||||
|
||||
/*
|
||||
|
@@ -521,6 +521,15 @@ struct cper_sec_pcie {
|
||||
u8 aer_info[96];
|
||||
};
|
||||
|
||||
/* Firmware Error Record Reference, UEFI v2.7 sec N.2.10 */
|
||||
struct cper_sec_fw_err_rec_ref {
|
||||
u8 record_type;
|
||||
u8 revision;
|
||||
u8 reserved[6];
|
||||
u64 record_identifier;
|
||||
guid_t record_identifier_guid;
|
||||
};
|
||||
|
||||
/* Reset to default packing */
|
||||
#pragma pack()
|
||||
|
||||
|
@@ -144,18 +144,8 @@ static inline void get_online_cpus(void) { cpus_read_lock(); }
|
||||
static inline void put_online_cpus(void) { cpus_read_unlock(); }
|
||||
|
||||
#ifdef CONFIG_PM_SLEEP_SMP
|
||||
int __freeze_secondary_cpus(int primary, bool suspend);
|
||||
static inline int freeze_secondary_cpus(int primary)
|
||||
{
|
||||
return __freeze_secondary_cpus(primary, true);
|
||||
}
|
||||
|
||||
static inline int disable_nonboot_cpus(void)
|
||||
{
|
||||
return __freeze_secondary_cpus(0, false);
|
||||
}
|
||||
|
||||
void enable_nonboot_cpus(void);
|
||||
extern int freeze_secondary_cpus(int primary);
|
||||
extern void thaw_secondary_cpus(void);
|
||||
|
||||
static inline int suspend_disable_secondary_cpus(void)
|
||||
{
|
||||
@@ -168,12 +158,11 @@ static inline int suspend_disable_secondary_cpus(void)
|
||||
}
|
||||
static inline void suspend_enable_secondary_cpus(void)
|
||||
{
|
||||
return enable_nonboot_cpus();
|
||||
return thaw_secondary_cpus();
|
||||
}
|
||||
|
||||
#else /* !CONFIG_PM_SLEEP_SMP */
|
||||
static inline int disable_nonboot_cpus(void) { return 0; }
|
||||
static inline void enable_nonboot_cpus(void) {}
|
||||
static inline void thaw_secondary_cpus(void) {}
|
||||
static inline int suspend_disable_secondary_cpus(void) { return 0; }
|
||||
static inline void suspend_enable_secondary_cpus(void) { }
|
||||
#endif /* !CONFIG_PM_SLEEP_SMP */
|
||||
|
@@ -28,7 +28,7 @@ struct cpu_rmap {
|
||||
struct {
|
||||
u16 index;
|
||||
u16 dist;
|
||||
} near[0];
|
||||
} near[];
|
||||
};
|
||||
#define CPU_RMAP_DIST_INF 0xffff
|
||||
|
||||
|
@@ -330,7 +330,7 @@ struct cpufreq_driver {
|
||||
*
|
||||
* get_intermediate should return a stable intermediate frequency
|
||||
* platform wants to switch to and target_intermediate() should set CPU
|
||||
* to to that frequency, before jumping to the frequency corresponding
|
||||
* to that frequency, before jumping to the frequency corresponding
|
||||
* to 'index'. Core will take care of sending notifications and driver
|
||||
* doesn't have to handle them in target_intermediate() or
|
||||
* target_index().
|
||||
@@ -367,7 +367,7 @@ struct cpufreq_driver {
|
||||
|
||||
/* platform specific boost support code */
|
||||
bool boost_enabled;
|
||||
int (*set_boost)(int state);
|
||||
int (*set_boost)(struct cpufreq_policy *policy, int state);
|
||||
};
|
||||
|
||||
/* flags */
|
||||
|
@@ -142,6 +142,7 @@ enum cpuhp_state {
|
||||
CPUHP_AP_ARM_XEN_STARTING,
|
||||
CPUHP_AP_ARM_KVMPV_STARTING,
|
||||
CPUHP_AP_ARM_CORESIGHT_STARTING,
|
||||
CPUHP_AP_ARM_CORESIGHT_CTI_STARTING,
|
||||
CPUHP_AP_ARM64_ISNDEP_STARTING,
|
||||
CPUHP_AP_SMPCFD_DYING,
|
||||
CPUHP_AP_X86_TBOOT_DYING,
|
||||
@@ -152,6 +153,7 @@ enum cpuhp_state {
|
||||
CPUHP_AP_SMPBOOT_THREADS,
|
||||
CPUHP_AP_X86_VDSO_VMA_ONLINE,
|
||||
CPUHP_AP_IRQ_AFFINITY_ONLINE,
|
||||
CPUHP_AP_BLK_MQ_ONLINE,
|
||||
CPUHP_AP_ARM_MVEBU_SYNC_CLOCKS,
|
||||
CPUHP_AP_X86_INTEL_EPB_ONLINE,
|
||||
CPUHP_AP_PERF_ONLINE,
|
||||
|
@@ -5,9 +5,10 @@
|
||||
#include <linux/kexec.h>
|
||||
#include <linux/proc_fs.h>
|
||||
#include <linux/elf.h>
|
||||
#include <linux/pgtable.h>
|
||||
#include <uapi/linux/vmcore.h>
|
||||
|
||||
#include <asm/pgtable.h> /* for pgprot_t */
|
||||
#include <linux/pgtable.h> /* for pgprot_t */
|
||||
|
||||
#ifdef CONFIG_CRASH_DUMP
|
||||
#define ELFCORE_ADDR_MAX (-1ULL)
|
||||
@@ -97,8 +98,6 @@ extern void unregister_oldmem_pfn_is_ram(void);
|
||||
static inline bool is_kdump_kernel(void) { return 0; }
|
||||
#endif /* CONFIG_CRASH_DUMP */
|
||||
|
||||
extern unsigned long saved_max_pfn;
|
||||
|
||||
/* Device Dump information to be filled by drivers */
|
||||
struct vmcoredd_data {
|
||||
char dump_name[VMCOREDD_MAX_NAME_BYTES]; /* Unique name of the dump */
|
||||
|
@@ -87,7 +87,7 @@ struct crush_rule_mask {
|
||||
struct crush_rule {
|
||||
__u32 len;
|
||||
struct crush_rule_mask mask;
|
||||
struct crush_rule_step steps[0];
|
||||
struct crush_rule_step steps[];
|
||||
};
|
||||
|
||||
#define crush_rule_size(len) (sizeof(struct crush_rule) + \
|
||||
@@ -301,6 +301,12 @@ struct crush_map {
|
||||
|
||||
__u32 *choose_tries;
|
||||
#else
|
||||
/* device/bucket type id -> type name (CrushWrapper::type_map) */
|
||||
struct rb_root type_names;
|
||||
|
||||
/* device/bucket id -> name (CrushWrapper::name_map) */
|
||||
struct rb_root names;
|
||||
|
||||
/* CrushWrapper::choose_args */
|
||||
struct rb_root choose_args;
|
||||
#endif
|
||||
@@ -342,4 +348,10 @@ struct crush_work {
|
||||
struct crush_work_bucket **work; /* Per-bucket working store */
|
||||
};
|
||||
|
||||
#ifdef __KERNEL__
|
||||
/* osdmap.c */
|
||||
void clear_crush_names(struct rb_root *root);
|
||||
void clear_choose_args(struct crush_map *c);
|
||||
#endif
|
||||
|
||||
#endif
|
||||
|
@@ -1,14 +0,0 @@
|
||||
/* SPDX-License-Identifier: GPL-2.0 */
|
||||
#ifndef __CRYPTOHASH_H
|
||||
#define __CRYPTOHASH_H
|
||||
|
||||
#include <uapi/linux/types.h>
|
||||
|
||||
#define SHA_DIGEST_WORDS 5
|
||||
#define SHA_MESSAGE_BYTES (512 /*bits*/ / 8)
|
||||
#define SHA_WORKSPACE_WORDS 16
|
||||
|
||||
void sha_init(__u32 *buf);
|
||||
void sha_transform(__u32 *digest, const char *data, __u32 *W);
|
||||
|
||||
#endif
|
9
include/linux/dasd_mod.h
Normal file
9
include/linux/dasd_mod.h
Normal file
@@ -0,0 +1,9 @@
|
||||
/* SPDX-License-Identifier: GPL-2.0 */
|
||||
#ifndef DASD_MOD_H
|
||||
#define DASD_MOD_H
|
||||
|
||||
#include <asm/dasd.h>
|
||||
|
||||
extern int dasd_biodasdinfo(struct gendisk *disk, dasd_information2_t *info);
|
||||
|
||||
#endif
|
@@ -5,7 +5,6 @@
|
||||
#include <linux/fs.h>
|
||||
#include <linux/mm.h>
|
||||
#include <linux/radix-tree.h>
|
||||
#include <asm/pgtable.h>
|
||||
|
||||
/* Flag for synchronous flush */
|
||||
#define DAXDEV_F_SYNC (1UL << 0)
|
||||
|
@@ -177,6 +177,8 @@ struct dentry_operations {
|
||||
|
||||
#define DCACHE_REFERENCED 0x00000040 /* Recently used, don't discard. */
|
||||
|
||||
#define DCACHE_DONTCACHE 0x00000080 /* Purge from memory on final dput() */
|
||||
|
||||
#define DCACHE_CANT_MOUNT 0x00000100
|
||||
#define DCACHE_GENOCIDE 0x00000200
|
||||
#define DCACHE_SHRINK_LIST 0x00000400
|
||||
|
@@ -12,7 +12,7 @@ extern int debug_locks __read_mostly;
|
||||
extern int debug_locks_silent __read_mostly;
|
||||
|
||||
|
||||
static inline int __debug_locks_off(void)
|
||||
static __always_inline int __debug_locks_off(void)
|
||||
{
|
||||
return xchg(&debug_locks, 0);
|
||||
}
|
||||
|
@@ -103,8 +103,8 @@ void debugfs_create_u8(const char *name, umode_t mode, struct dentry *parent,
|
||||
u8 *value);
|
||||
void debugfs_create_u16(const char *name, umode_t mode, struct dentry *parent,
|
||||
u16 *value);
|
||||
struct dentry *debugfs_create_u32(const char *name, umode_t mode,
|
||||
struct dentry *parent, u32 *value);
|
||||
void debugfs_create_u32(const char *name, umode_t mode, struct dentry *parent,
|
||||
u32 *value);
|
||||
void debugfs_create_u64(const char *name, umode_t mode, struct dentry *parent,
|
||||
u64 *value);
|
||||
struct dentry *debugfs_create_ulong(const char *name, umode_t mode,
|
||||
@@ -250,12 +250,8 @@ static inline void debugfs_create_u8(const char *name, umode_t mode,
|
||||
static inline void debugfs_create_u16(const char *name, umode_t mode,
|
||||
struct dentry *parent, u16 *value) { }
|
||||
|
||||
static inline struct dentry *debugfs_create_u32(const char *name, umode_t mode,
|
||||
struct dentry *parent,
|
||||
u32 *value)
|
||||
{
|
||||
return ERR_PTR(-ENODEV);
|
||||
}
|
||||
static inline void debugfs_create_u32(const char *name, umode_t mode,
|
||||
struct dentry *parent, u32 *value) { }
|
||||
|
||||
static inline void debugfs_create_u64(const char *name, umode_t mode,
|
||||
struct dentry *parent, u64 *value) { }
|
||||
|
@@ -65,4 +65,15 @@ static inline void ssleep(unsigned int seconds)
|
||||
msleep(seconds * 1000);
|
||||
}
|
||||
|
||||
/* see Documentation/timers/timers-howto.rst for the thresholds */
|
||||
static inline void fsleep(unsigned long usecs)
|
||||
{
|
||||
if (usecs <= 10)
|
||||
udelay(usecs);
|
||||
else if (usecs <= 20000)
|
||||
usleep_range(usecs, 2 * usecs);
|
||||
else
|
||||
msleep(DIV_ROUND_UP(usecs, 1000));
|
||||
}
|
||||
|
||||
#endif /* defined(_LINUX_DELAY_H) */
|
||||
|
@@ -109,7 +109,8 @@ void _dev_info(const struct device *dev, const char *fmt, ...)
|
||||
#define dev_info(dev, fmt, ...) \
|
||||
_dev_info(dev, dev_fmt(fmt), ##__VA_ARGS__)
|
||||
|
||||
#if defined(CONFIG_DYNAMIC_DEBUG)
|
||||
#if defined(CONFIG_DYNAMIC_DEBUG) || \
|
||||
(defined(CONFIG_DYNAMIC_DEBUG_CORE) && defined(DYNAMIC_DEBUG_MODULE))
|
||||
#define dev_dbg(dev, fmt, ...) \
|
||||
dynamic_dev_dbg(dev, dev_fmt(fmt), ##__VA_ARGS__)
|
||||
#elif defined(DEBUG)
|
||||
@@ -181,7 +182,8 @@ do { \
|
||||
dev_level_ratelimited(dev_notice, dev, fmt, ##__VA_ARGS__)
|
||||
#define dev_info_ratelimited(dev, fmt, ...) \
|
||||
dev_level_ratelimited(dev_info, dev, fmt, ##__VA_ARGS__)
|
||||
#if defined(CONFIG_DYNAMIC_DEBUG)
|
||||
#if defined(CONFIG_DYNAMIC_DEBUG) || \
|
||||
(defined(CONFIG_DYNAMIC_DEBUG_CORE) && defined(DYNAMIC_DEBUG_MODULE))
|
||||
/* descriptor check is first to prevent flooding with "callbacks suppressed" */
|
||||
#define dev_dbg_ratelimited(dev, fmt, ...) \
|
||||
do { \
|
||||
|
@@ -332,6 +332,8 @@ void *dm_per_bio_data(struct bio *bio, size_t data_size);
|
||||
struct bio *dm_bio_from_per_bio_data(void *data, size_t data_size);
|
||||
unsigned dm_bio_get_target_bio_nr(const struct bio *bio);
|
||||
|
||||
u64 dm_start_time_ns_from_clone(struct bio *bio);
|
||||
|
||||
int dm_register_target(struct target_type *t);
|
||||
void dm_unregister_target(struct target_type *t);
|
||||
|
||||
@@ -557,13 +559,8 @@ void *dm_vcalloc(unsigned long nmemb, unsigned long elem_size);
|
||||
#define DMINFO(fmt, ...) pr_info(DM_FMT(fmt), ##__VA_ARGS__)
|
||||
#define DMINFO_LIMIT(fmt, ...) pr_info_ratelimited(DM_FMT(fmt), ##__VA_ARGS__)
|
||||
|
||||
#ifdef CONFIG_DM_DEBUG
|
||||
#define DMDEBUG(fmt, ...) printk(KERN_DEBUG DM_FMT(fmt), ##__VA_ARGS__)
|
||||
#define DMDEBUG(fmt, ...) pr_debug(DM_FMT(fmt), ##__VA_ARGS__)
|
||||
#define DMDEBUG_LIMIT(fmt, ...) pr_debug_ratelimited(DM_FMT(fmt), ##__VA_ARGS__)
|
||||
#else
|
||||
#define DMDEBUG(fmt, ...) no_printk(fmt, ##__VA_ARGS__)
|
||||
#define DMDEBUG_LIMIT(fmt, ...) no_printk(fmt, ##__VA_ARGS__)
|
||||
#endif
|
||||
|
||||
#define DMEMIT(x...) sz += ((sz >= maxlen) ? \
|
||||
0 : scnprintf(result + sz, maxlen - sz, x))
|
||||
|
@@ -884,10 +884,6 @@ extern bool device_is_bound(struct device *dev);
|
||||
/*
|
||||
* Easy functions for dynamically creating devices on the fly
|
||||
*/
|
||||
extern __printf(5, 0)
|
||||
struct device *device_create_vargs(struct class *cls, struct device *parent,
|
||||
dev_t devt, void *drvdata,
|
||||
const char *fmt, va_list vargs);
|
||||
extern __printf(5, 6)
|
||||
struct device *device_create(struct class *cls, struct device *parent,
|
||||
dev_t devt, void *drvdata,
|
||||
|
@@ -1,6 +1,5 @@
|
||||
/* SPDX-License-Identifier: GPL-2.0 */
|
||||
#include <linux/fs.h>
|
||||
#include <linux/bpf-cgroup.h>
|
||||
|
||||
#define DEVCG_ACC_MKNOD 1
|
||||
#define DEVCG_ACC_READ 2
|
||||
@@ -11,16 +10,10 @@
|
||||
#define DEVCG_DEV_CHAR 2
|
||||
#define DEVCG_DEV_ALL 4 /* this represents all devices */
|
||||
|
||||
#ifdef CONFIG_CGROUP_DEVICE
|
||||
int devcgroup_check_permission(short type, u32 major, u32 minor,
|
||||
short access);
|
||||
#else
|
||||
static inline int devcgroup_check_permission(short type, u32 major, u32 minor,
|
||||
short access)
|
||||
{ return 0; }
|
||||
#endif
|
||||
|
||||
#if defined(CONFIG_CGROUP_DEVICE) || defined(CONFIG_CGROUP_BPF)
|
||||
int devcgroup_check_permission(short type, u32 major, u32 minor,
|
||||
short access);
|
||||
static inline int devcgroup_inode_permission(struct inode *inode, int mask)
|
||||
{
|
||||
short type, access = 0;
|
||||
@@ -51,6 +44,9 @@ static inline int devcgroup_inode_mknod(int mode, dev_t dev)
|
||||
if (!S_ISBLK(mode) && !S_ISCHR(mode))
|
||||
return 0;
|
||||
|
||||
if (S_ISCHR(mode) && dev == WHITEOUT_DEV)
|
||||
return 0;
|
||||
|
||||
if (S_ISBLK(mode))
|
||||
type = DEVCG_DEV_BLOCK;
|
||||
else
|
||||
@@ -61,6 +57,9 @@ static inline int devcgroup_inode_mknod(int mode, dev_t dev)
|
||||
}
|
||||
|
||||
#else
|
||||
static inline int devcgroup_check_permission(short type, u32 major, u32 minor,
|
||||
short access)
|
||||
{ return 0; }
|
||||
static inline int devcgroup_inode_permission(struct inode *inode, int mask)
|
||||
{ return 0; }
|
||||
static inline int devcgroup_inode_mknod(int mode, dev_t dev)
|
||||
|
@@ -29,7 +29,7 @@ struct pubkey_hdr {
|
||||
uint32_t timestamp; /* key made, always 0 for now */
|
||||
uint8_t algo;
|
||||
uint8_t nmpi;
|
||||
char mpi[0];
|
||||
char mpi[];
|
||||
} __packed;
|
||||
|
||||
struct signature_hdr {
|
||||
@@ -39,7 +39,7 @@ struct signature_hdr {
|
||||
uint8_t hash;
|
||||
uint8_t keyid[8];
|
||||
uint8_t nmpi;
|
||||
char mpi[0];
|
||||
char mpi[];
|
||||
} __packed;
|
||||
|
||||
#if defined(CONFIG_SIGNATURE) || defined(CONFIG_SIGNATURE_MODULE)
|
||||
|
@@ -7,7 +7,7 @@ struct linux_dirent64 {
|
||||
s64 d_off;
|
||||
unsigned short d_reclen;
|
||||
unsigned char d_type;
|
||||
char d_name[0];
|
||||
char d_name[];
|
||||
};
|
||||
|
||||
#endif
|
||||
|
@@ -118,6 +118,11 @@ int dm_bufio_write_dirty_buffers(struct dm_bufio_client *c);
|
||||
*/
|
||||
int dm_bufio_issue_flush(struct dm_bufio_client *c);
|
||||
|
||||
/*
|
||||
* Send a discard request to the underlying device.
|
||||
*/
|
||||
int dm_bufio_issue_discard(struct dm_bufio_client *c, sector_t block, sector_t count);
|
||||
|
||||
/*
|
||||
* Like dm_bufio_release but also move the buffer to the new
|
||||
* block. dm_bufio_write_dirty_buffers is needed to commit the new block.
|
||||
@@ -131,6 +136,13 @@ void dm_bufio_release_move(struct dm_buffer *b, sector_t new_block);
|
||||
*/
|
||||
void dm_bufio_forget(struct dm_bufio_client *c, sector_t block);
|
||||
|
||||
/*
|
||||
* Free the given range of buffers.
|
||||
* This is just a hint, if the buffer is in use or dirty, this function
|
||||
* does nothing.
|
||||
*/
|
||||
void dm_bufio_forget_buffers(struct dm_bufio_client *c, sector_t block, sector_t n_blocks);
|
||||
|
||||
/*
|
||||
* Set the minimum number of buffers before cleanup happens.
|
||||
*/
|
||||
|
@@ -329,13 +329,20 @@ struct dma_buf {
|
||||
|
||||
/**
|
||||
* struct dma_buf_attach_ops - importer operations for an attachment
|
||||
* @move_notify: [optional] notification that the DMA-buf is moving
|
||||
*
|
||||
* Attachment operations implemented by the importer.
|
||||
*/
|
||||
struct dma_buf_attach_ops {
|
||||
/**
|
||||
* @move_notify
|
||||
* @allow_peer2peer:
|
||||
*
|
||||
* If this is set to true the importer must be able to handle peer
|
||||
* resources without struct pages.
|
||||
*/
|
||||
bool allow_peer2peer;
|
||||
|
||||
/**
|
||||
* @move_notify: [optional] notification that the DMA-buf is moving
|
||||
*
|
||||
* If this callback is provided the framework can avoid pinning the
|
||||
* backing store while mappings exists.
|
||||
@@ -362,6 +369,7 @@ struct dma_buf_attach_ops {
|
||||
* @node: list of dma_buf_attachment, protected by dma_resv lock of the dmabuf.
|
||||
* @sgt: cached mapping.
|
||||
* @dir: direction of cached mapping.
|
||||
* @peer2peer: true if the importer can handle peer resources without pages.
|
||||
* @priv: exporter specific attachment data.
|
||||
* @importer_ops: importer operations for this attachment, if provided
|
||||
* dma_buf_map/unmap_attachment() must be called with the dma_resv lock held.
|
||||
@@ -382,6 +390,7 @@ struct dma_buf_attachment {
|
||||
struct list_head node;
|
||||
struct sg_table *sgt;
|
||||
enum dma_data_direction dir;
|
||||
bool peer2peer;
|
||||
const struct dma_buf_attach_ops *importer_ops;
|
||||
void *importer_priv;
|
||||
void *priv;
|
||||
|
@@ -67,6 +67,8 @@ static inline bool dma_capable(struct device *dev, dma_addr_t addr, size_t size,
|
||||
}
|
||||
|
||||
u64 dma_direct_get_required_mask(struct device *dev);
|
||||
gfp_t dma_direct_optimal_gfp_mask(struct device *dev, u64 dma_mask,
|
||||
u64 *phys_mask);
|
||||
void *dma_direct_alloc(struct device *dev, size_t size, dma_addr_t *dma_handle,
|
||||
gfp_t gfp, unsigned long attrs);
|
||||
void dma_direct_free(struct device *dev, size_t size, void *cpu_addr,
|
||||
|
@@ -609,6 +609,86 @@ static inline void dma_sync_single_range_for_device(struct device *dev,
|
||||
return dma_sync_single_for_device(dev, addr + offset, size, dir);
|
||||
}
|
||||
|
||||
/**
|
||||
* dma_map_sgtable - Map the given buffer for DMA
|
||||
* @dev: The device for which to perform the DMA operation
|
||||
* @sgt: The sg_table object describing the buffer
|
||||
* @dir: DMA direction
|
||||
* @attrs: Optional DMA attributes for the map operation
|
||||
*
|
||||
* Maps a buffer described by a scatterlist stored in the given sg_table
|
||||
* object for the @dir DMA operation by the @dev device. After success the
|
||||
* ownership for the buffer is transferred to the DMA domain. One has to
|
||||
* call dma_sync_sgtable_for_cpu() or dma_unmap_sgtable() to move the
|
||||
* ownership of the buffer back to the CPU domain before touching the
|
||||
* buffer by the CPU.
|
||||
*
|
||||
* Returns 0 on success or -EINVAL on error during mapping the buffer.
|
||||
*/
|
||||
static inline int dma_map_sgtable(struct device *dev, struct sg_table *sgt,
|
||||
enum dma_data_direction dir, unsigned long attrs)
|
||||
{
|
||||
int nents;
|
||||
|
||||
nents = dma_map_sg_attrs(dev, sgt->sgl, sgt->orig_nents, dir, attrs);
|
||||
if (nents <= 0)
|
||||
return -EINVAL;
|
||||
sgt->nents = nents;
|
||||
return 0;
|
||||
}
|
||||
|
||||
/**
|
||||
* dma_unmap_sgtable - Unmap the given buffer for DMA
|
||||
* @dev: The device for which to perform the DMA operation
|
||||
* @sgt: The sg_table object describing the buffer
|
||||
* @dir: DMA direction
|
||||
* @attrs: Optional DMA attributes for the unmap operation
|
||||
*
|
||||
* Unmaps a buffer described by a scatterlist stored in the given sg_table
|
||||
* object for the @dir DMA operation by the @dev device. After this function
|
||||
* the ownership of the buffer is transferred back to the CPU domain.
|
||||
*/
|
||||
static inline void dma_unmap_sgtable(struct device *dev, struct sg_table *sgt,
|
||||
enum dma_data_direction dir, unsigned long attrs)
|
||||
{
|
||||
dma_unmap_sg_attrs(dev, sgt->sgl, sgt->orig_nents, dir, attrs);
|
||||
}
|
||||
|
||||
/**
|
||||
* dma_sync_sgtable_for_cpu - Synchronize the given buffer for CPU access
|
||||
* @dev: The device for which to perform the DMA operation
|
||||
* @sgt: The sg_table object describing the buffer
|
||||
* @dir: DMA direction
|
||||
*
|
||||
* Performs the needed cache synchronization and moves the ownership of the
|
||||
* buffer back to the CPU domain, so it is safe to perform any access to it
|
||||
* by the CPU. Before doing any further DMA operations, one has to transfer
|
||||
* the ownership of the buffer back to the DMA domain by calling the
|
||||
* dma_sync_sgtable_for_device().
|
||||
*/
|
||||
static inline void dma_sync_sgtable_for_cpu(struct device *dev,
|
||||
struct sg_table *sgt, enum dma_data_direction dir)
|
||||
{
|
||||
dma_sync_sg_for_cpu(dev, sgt->sgl, sgt->orig_nents, dir);
|
||||
}
|
||||
|
||||
/**
|
||||
* dma_sync_sgtable_for_device - Synchronize the given buffer for DMA
|
||||
* @dev: The device for which to perform the DMA operation
|
||||
* @sgt: The sg_table object describing the buffer
|
||||
* @dir: DMA direction
|
||||
*
|
||||
* Performs the needed cache synchronization and moves the ownership of the
|
||||
* buffer back to the DMA domain, so it is safe to perform the DMA operation.
|
||||
* Once finished, one has to call dma_sync_sgtable_for_cpu() or
|
||||
* dma_unmap_sgtable().
|
||||
*/
|
||||
static inline void dma_sync_sgtable_for_device(struct device *dev,
|
||||
struct sg_table *sgt, enum dma_data_direction dir)
|
||||
{
|
||||
dma_sync_sg_for_device(dev, sgt->sgl, sgt->orig_nents, dir);
|
||||
}
|
||||
|
||||
#define dma_map_single(d, a, s, r) dma_map_single_attrs(d, a, s, r, 0)
|
||||
#define dma_unmap_single(d, a, s, r) dma_unmap_single_attrs(d, a, s, r, 0)
|
||||
#define dma_map_sg(d, s, n, r) dma_map_sg_attrs(d, s, n, r, 0)
|
||||
@@ -630,9 +710,9 @@ void *dma_common_pages_remap(struct page **pages, size_t size,
|
||||
pgprot_t prot, const void *caller);
|
||||
void dma_common_free_remap(void *cpu_addr, size_t size);
|
||||
|
||||
bool dma_in_atomic_pool(void *start, size_t size);
|
||||
void *dma_alloc_from_pool(size_t size, struct page **ret_page, gfp_t flags);
|
||||
bool dma_free_from_pool(void *start, size_t size);
|
||||
void *dma_alloc_from_pool(struct device *dev, size_t size,
|
||||
struct page **ret_page, gfp_t flags);
|
||||
bool dma_free_from_pool(struct device *dev, void *start, size_t size);
|
||||
|
||||
int
|
||||
dma_common_get_sgtable(struct device *dev, struct sg_table *sgt, void *cpu_addr,
|
||||
|
@@ -3,7 +3,7 @@
|
||||
#define _LINUX_DMA_NONCOHERENT_H 1
|
||||
|
||||
#include <linux/dma-mapping.h>
|
||||
#include <asm/pgtable.h>
|
||||
#include <linux/pgtable.h>
|
||||
|
||||
#ifdef CONFIG_ARCH_HAS_DMA_COHERENCE_H
|
||||
#include <asm/dma-coherence.h>
|
||||
|
@@ -83,9 +83,9 @@ enum dma_transfer_direction {
|
||||
/**
|
||||
* Interleaved Transfer Request
|
||||
* ----------------------------
|
||||
* A chunk is collection of contiguous bytes to be transfered.
|
||||
* A chunk is collection of contiguous bytes to be transferred.
|
||||
* The gap(in bytes) between two chunks is called inter-chunk-gap(ICG).
|
||||
* ICGs may or maynot change between chunks.
|
||||
* ICGs may or may not change between chunks.
|
||||
* A FRAME is the smallest series of contiguous {chunk,icg} pairs,
|
||||
* that when repeated an integral number of times, specifies the transfer.
|
||||
* A transfer template is specification of a Frame, the number of times
|
||||
@@ -341,13 +341,11 @@ struct dma_chan {
|
||||
* @chan: driver channel device
|
||||
* @device: sysfs device
|
||||
* @dev_id: parent dma_device dev_id
|
||||
* @idr_ref: reference count to gate release of dma_device dev_id
|
||||
*/
|
||||
struct dma_chan_dev {
|
||||
struct dma_chan *chan;
|
||||
struct device device;
|
||||
int dev_id;
|
||||
atomic_t *idr_ref;
|
||||
};
|
||||
|
||||
/**
|
||||
@@ -835,6 +833,8 @@ struct dma_device {
|
||||
int dev_id;
|
||||
struct device *dev;
|
||||
struct module *owner;
|
||||
struct ida chan_ida;
|
||||
struct mutex chan_mutex; /* to protect chan_ida */
|
||||
|
||||
u32 src_addr_widths;
|
||||
u32 dst_addr_widths;
|
||||
@@ -1069,7 +1069,7 @@ static inline int dmaengine_terminate_all(struct dma_chan *chan)
|
||||
* dmaengine_synchronize() needs to be called before it is safe to free
|
||||
* any memory that is accessed by previously submitted descriptors or before
|
||||
* freeing any resources accessed from within the completion callback of any
|
||||
* perviously submitted descriptors.
|
||||
* previously submitted descriptors.
|
||||
*
|
||||
* This function can be called from atomic context as well as from within a
|
||||
* complete callback of a descriptor submitted on the same channel.
|
||||
@@ -1091,7 +1091,7 @@ static inline int dmaengine_terminate_async(struct dma_chan *chan)
|
||||
*
|
||||
* Synchronizes to the DMA channel termination to the current context. When this
|
||||
* function returns it is guaranteed that all transfers for previously issued
|
||||
* descriptors have stopped and and it is safe to free the memory assoicated
|
||||
* descriptors have stopped and it is safe to free the memory associated
|
||||
* with them. Furthermore it is guaranteed that all complete callback functions
|
||||
* for a previously submitted descriptor have finished running and it is safe to
|
||||
* free resources accessed from within the complete callbacks.
|
||||
|
@@ -12,11 +12,31 @@ struct sk_buff;
|
||||
struct net_device;
|
||||
struct packet_type;
|
||||
|
||||
struct dsa_8021q_crosschip_link {
|
||||
struct list_head list;
|
||||
int port;
|
||||
struct dsa_switch *other_ds;
|
||||
int other_port;
|
||||
refcount_t refcount;
|
||||
};
|
||||
|
||||
#define DSA_8021Q_N_SUBVLAN 8
|
||||
|
||||
#if IS_ENABLED(CONFIG_NET_DSA_TAG_8021Q)
|
||||
|
||||
int dsa_port_setup_8021q_tagging(struct dsa_switch *ds, int index,
|
||||
bool enabled);
|
||||
|
||||
int dsa_8021q_crosschip_bridge_join(struct dsa_switch *ds, int port,
|
||||
struct dsa_switch *other_ds,
|
||||
int other_port,
|
||||
struct list_head *crosschip_links);
|
||||
|
||||
int dsa_8021q_crosschip_bridge_leave(struct dsa_switch *ds, int port,
|
||||
struct dsa_switch *other_ds,
|
||||
int other_port,
|
||||
struct list_head *crosschip_links);
|
||||
|
||||
struct sk_buff *dsa_8021q_xmit(struct sk_buff *skb, struct net_device *netdev,
|
||||
u16 tpid, u16 tci);
|
||||
|
||||
@@ -24,10 +44,16 @@ u16 dsa_8021q_tx_vid(struct dsa_switch *ds, int port);
|
||||
|
||||
u16 dsa_8021q_rx_vid(struct dsa_switch *ds, int port);
|
||||
|
||||
u16 dsa_8021q_rx_vid_subvlan(struct dsa_switch *ds, int port, u16 subvlan);
|
||||
|
||||
int dsa_8021q_rx_switch_id(u16 vid);
|
||||
|
||||
int dsa_8021q_rx_source_port(u16 vid);
|
||||
|
||||
u16 dsa_8021q_rx_subvlan(u16 vid);
|
||||
|
||||
bool vid_is_dsa_8021q(u16 vid);
|
||||
|
||||
#else
|
||||
|
||||
int dsa_port_setup_8021q_tagging(struct dsa_switch *ds, int index,
|
||||
@@ -36,6 +62,22 @@ int dsa_port_setup_8021q_tagging(struct dsa_switch *ds, int index,
|
||||
return 0;
|
||||
}
|
||||
|
||||
int dsa_8021q_crosschip_bridge_join(struct dsa_switch *ds, int port,
|
||||
struct dsa_switch *other_ds,
|
||||
int other_port,
|
||||
struct list_head *crosschip_links)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
||||
int dsa_8021q_crosschip_bridge_leave(struct dsa_switch *ds, int port,
|
||||
struct dsa_switch *other_ds,
|
||||
int other_port,
|
||||
struct list_head *crosschip_links)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
||||
struct sk_buff *dsa_8021q_xmit(struct sk_buff *skb, struct net_device *netdev,
|
||||
u16 tpid, u16 tci)
|
||||
{
|
||||
@@ -52,6 +94,11 @@ u16 dsa_8021q_rx_vid(struct dsa_switch *ds, int port)
|
||||
return 0;
|
||||
}
|
||||
|
||||
u16 dsa_8021q_rx_vid_subvlan(struct dsa_switch *ds, int port, u16 subvlan)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
||||
int dsa_8021q_rx_switch_id(u16 vid)
|
||||
{
|
||||
return 0;
|
||||
@@ -62,6 +109,16 @@ int dsa_8021q_rx_source_port(u16 vid)
|
||||
return 0;
|
||||
}
|
||||
|
||||
u16 dsa_8021q_rx_subvlan(u16 vid)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
||||
bool vid_is_dsa_8021q(u16 vid)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
#endif /* IS_ENABLED(CONFIG_NET_DSA_TAG_8021Q) */
|
||||
|
||||
#endif /* _NET_DSA_8021Q_H */
|
||||
|
@@ -9,6 +9,7 @@
|
||||
|
||||
#include <linux/skbuff.h>
|
||||
#include <linux/etherdevice.h>
|
||||
#include <linux/dsa/8021q.h>
|
||||
#include <net/dsa.h>
|
||||
|
||||
#define ETH_P_SJA1105 ETH_P_DSA_8021Q
|
||||
@@ -53,12 +54,14 @@ struct sja1105_skb_cb {
|
||||
((struct sja1105_skb_cb *)DSA_SKB_CB_PRIV(skb))
|
||||
|
||||
struct sja1105_port {
|
||||
u16 subvlan_map[DSA_8021Q_N_SUBVLAN];
|
||||
struct kthread_worker *xmit_worker;
|
||||
struct kthread_work xmit_work;
|
||||
struct sk_buff_head xmit_queue;
|
||||
struct sja1105_tagger_data *data;
|
||||
struct dsa_port *dp;
|
||||
bool hwts_tx_en;
|
||||
u16 xmit_tpid;
|
||||
};
|
||||
|
||||
#endif /* _NET_DSA_SJA1105_H */
|
||||
|
@@ -48,7 +48,7 @@ struct _ddebug {
|
||||
|
||||
|
||||
|
||||
#if defined(CONFIG_DYNAMIC_DEBUG)
|
||||
#if defined(CONFIG_DYNAMIC_DEBUG_CORE)
|
||||
int ddebug_add_module(struct _ddebug *tab, unsigned int n,
|
||||
const char *modname);
|
||||
extern int ddebug_remove_module(const char *mod_name);
|
||||
|
@@ -39,6 +39,7 @@
|
||||
#define EFI_WRITE_PROTECTED ( 8 | (1UL << (BITS_PER_LONG-1)))
|
||||
#define EFI_OUT_OF_RESOURCES ( 9 | (1UL << (BITS_PER_LONG-1)))
|
||||
#define EFI_NOT_FOUND (14 | (1UL << (BITS_PER_LONG-1)))
|
||||
#define EFI_TIMEOUT (18 | (1UL << (BITS_PER_LONG-1)))
|
||||
#define EFI_ABORTED (21 | (1UL << (BITS_PER_LONG-1)))
|
||||
#define EFI_SECURITY_VIOLATION (26 | (1UL << (BITS_PER_LONG-1)))
|
||||
|
||||
@@ -379,8 +380,8 @@ typedef union {
|
||||
|
||||
typedef struct {
|
||||
efi_guid_t guid;
|
||||
const char *name;
|
||||
unsigned long *ptr;
|
||||
const char name[16];
|
||||
} efi_config_table_type_t;
|
||||
|
||||
#define EFI_SYSTEM_TABLE_SIGNATURE ((u64)0x5453595320494249ULL)
|
||||
@@ -426,6 +427,7 @@ typedef struct {
|
||||
u32 tables;
|
||||
} efi_system_table_32_t;
|
||||
|
||||
typedef union efi_simple_text_input_protocol efi_simple_text_input_protocol_t;
|
||||
typedef union efi_simple_text_output_protocol efi_simple_text_output_protocol_t;
|
||||
|
||||
typedef union {
|
||||
@@ -434,7 +436,7 @@ typedef union {
|
||||
unsigned long fw_vendor; /* physical addr of CHAR16 vendor string */
|
||||
u32 fw_revision;
|
||||
unsigned long con_in_handle;
|
||||
unsigned long con_in;
|
||||
efi_simple_text_input_protocol_t *con_in;
|
||||
unsigned long con_out_handle;
|
||||
efi_simple_text_output_protocol_t *con_out;
|
||||
unsigned long stderr_handle;
|
||||
@@ -1245,4 +1247,6 @@ struct linux_efi_memreserve {
|
||||
|
||||
void __init efi_arch_mem_reserve(phys_addr_t addr, u64 size);
|
||||
|
||||
char *efi_systab_show_arch(char *str);
|
||||
|
||||
#endif /* _LINUX_EFI_H */
|
||||
|
@@ -39,7 +39,7 @@ struct elevator_mq_ops {
|
||||
void (*request_merged)(struct request_queue *, struct request *, enum elv_merge);
|
||||
void (*requests_merged)(struct request_queue *, struct request *, struct request *);
|
||||
void (*limit_depth)(unsigned int, struct blk_mq_alloc_data *);
|
||||
void (*prepare_request)(struct request *, struct bio *bio);
|
||||
void (*prepare_request)(struct request *);
|
||||
void (*finish_request)(struct request *);
|
||||
void (*insert_requests)(struct blk_mq_hw_ctx *, struct list_head *, bool);
|
||||
struct request *(*dispatch_request)(struct blk_mq_hw_ctx *);
|
||||
|
@@ -2,6 +2,7 @@
|
||||
#ifndef _LINUX_ELF_H
|
||||
#define _LINUX_ELF_H
|
||||
|
||||
#include <linux/types.h>
|
||||
#include <asm/elf.h>
|
||||
#include <uapi/linux/elf.h>
|
||||
|
||||
@@ -21,6 +22,9 @@
|
||||
SET_PERSONALITY(ex)
|
||||
#endif
|
||||
|
||||
#define ELF32_GNU_PROPERTY_ALIGN 4
|
||||
#define ELF64_GNU_PROPERTY_ALIGN 8
|
||||
|
||||
#if ELF_CLASS == ELFCLASS32
|
||||
|
||||
extern Elf32_Dyn _DYNAMIC [];
|
||||
@@ -31,6 +35,7 @@ extern Elf32_Dyn _DYNAMIC [];
|
||||
#define elf_addr_t Elf32_Off
|
||||
#define Elf_Half Elf32_Half
|
||||
#define Elf_Word Elf32_Word
|
||||
#define ELF_GNU_PROPERTY_ALIGN ELF32_GNU_PROPERTY_ALIGN
|
||||
|
||||
#else
|
||||
|
||||
@@ -42,6 +47,7 @@ extern Elf64_Dyn _DYNAMIC [];
|
||||
#define elf_addr_t Elf64_Off
|
||||
#define Elf_Half Elf64_Half
|
||||
#define Elf_Word Elf64_Word
|
||||
#define ELF_GNU_PROPERTY_ALIGN ELF64_GNU_PROPERTY_ALIGN
|
||||
|
||||
#endif
|
||||
|
||||
@@ -56,4 +62,41 @@ static inline int elf_coredump_extra_notes_write(struct coredump_params *cprm) {
|
||||
extern int elf_coredump_extra_notes_size(void);
|
||||
extern int elf_coredump_extra_notes_write(struct coredump_params *cprm);
|
||||
#endif
|
||||
|
||||
/*
|
||||
* NT_GNU_PROPERTY_TYPE_0 header:
|
||||
* Keep this internal until/unless there is an agreed UAPI definition.
|
||||
* pr_type values (GNU_PROPERTY_*) are public and defined in the UAPI header.
|
||||
*/
|
||||
struct gnu_property {
|
||||
u32 pr_type;
|
||||
u32 pr_datasz;
|
||||
};
|
||||
|
||||
struct arch_elf_state;
|
||||
|
||||
#ifndef CONFIG_ARCH_USE_GNU_PROPERTY
|
||||
static inline int arch_parse_elf_property(u32 type, const void *data,
|
||||
size_t datasz, bool compat,
|
||||
struct arch_elf_state *arch)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
#else
|
||||
extern int arch_parse_elf_property(u32 type, const void *data, size_t datasz,
|
||||
bool compat, struct arch_elf_state *arch);
|
||||
#endif
|
||||
|
||||
#ifdef CONFIG_ARCH_HAVE_ELF_PROT
|
||||
int arch_elf_adjust_prot(int prot, const struct arch_elf_state *state,
|
||||
bool has_interp, bool is_interp);
|
||||
#else
|
||||
static inline int arch_elf_adjust_prot(int prot,
|
||||
const struct arch_elf_state *state,
|
||||
bool has_interp, bool is_interp)
|
||||
{
|
||||
return prot;
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif /* _LINUX_ELF_H */
|
||||
|
@@ -54,7 +54,7 @@
|
||||
.popsection ;
|
||||
|
||||
#define ELFNOTE(name, type, desc) \
|
||||
ELFNOTE_START(name, type, "") \
|
||||
ELFNOTE_START(name, type, "a") \
|
||||
desc ; \
|
||||
ELFNOTE_END
|
||||
|
||||
|
@@ -101,7 +101,7 @@ struct enclosure_device {
|
||||
struct device edev;
|
||||
struct enclosure_component_callbacks *cb;
|
||||
int components;
|
||||
struct enclosure_component component[0];
|
||||
struct enclosure_component component[];
|
||||
};
|
||||
|
||||
static inline struct enclosure_device *
|
||||
|
@@ -36,7 +36,7 @@ struct em_cap_state {
|
||||
struct em_perf_domain {
|
||||
struct em_cap_state *table;
|
||||
int nr_cap_states;
|
||||
unsigned long cpus[0];
|
||||
unsigned long cpus[];
|
||||
};
|
||||
|
||||
#ifdef CONFIG_ENERGY_MODEL
|
||||
|
@@ -20,6 +20,7 @@
|
||||
#include <linux/if_ether.h>
|
||||
#include <linux/netdevice.h>
|
||||
#include <linux/random.h>
|
||||
#include <linux/crc32.h>
|
||||
#include <asm/unaligned.h>
|
||||
#include <asm/bitsperlong.h>
|
||||
|
||||
@@ -265,6 +266,17 @@ static inline void eth_hw_addr_random(struct net_device *dev)
|
||||
eth_random_addr(dev->dev_addr);
|
||||
}
|
||||
|
||||
/**
|
||||
* eth_hw_addr_crc - Calculate CRC from netdev_hw_addr
|
||||
* @ha: pointer to hardware address
|
||||
*
|
||||
* Calculate CRC from a hardware address as basis for filter hashes.
|
||||
*/
|
||||
static inline u32 eth_hw_addr_crc(struct netdev_hw_addr *ha)
|
||||
{
|
||||
return ether_crc(ETH_ALEN, ha->addr);
|
||||
}
|
||||
|
||||
/**
|
||||
* ether_addr_copy - Copy an Ethernet address
|
||||
* @dst: Pointer to a six-byte array Ethernet address destination
|
||||
|
@@ -35,7 +35,7 @@ struct compat_ethtool_rxnfc {
|
||||
compat_u64 data;
|
||||
struct compat_ethtool_rx_flow_spec fs;
|
||||
u32 rule_cnt;
|
||||
u32 rule_locs[0];
|
||||
u32 rule_locs[];
|
||||
};
|
||||
|
||||
#endif /* CONFIG_COMPAT */
|
||||
@@ -462,7 +462,7 @@ int ethtool_check_ops(const struct ethtool_ops *ops);
|
||||
|
||||
struct ethtool_rx_flow_rule {
|
||||
struct flow_rule *rule;
|
||||
unsigned long priv[0];
|
||||
unsigned long priv[];
|
||||
};
|
||||
|
||||
struct ethtool_rx_flow_spec_input {
|
||||
|
@@ -14,4 +14,58 @@ enum ethtool_multicast_groups {
|
||||
ETHNL_MCGRP_MONITOR,
|
||||
};
|
||||
|
||||
struct phy_device;
|
||||
|
||||
#if IS_ENABLED(CONFIG_ETHTOOL_NETLINK)
|
||||
int ethnl_cable_test_alloc(struct phy_device *phydev, u8 cmd);
|
||||
void ethnl_cable_test_free(struct phy_device *phydev);
|
||||
void ethnl_cable_test_finished(struct phy_device *phydev);
|
||||
int ethnl_cable_test_result(struct phy_device *phydev, u8 pair, u8 result);
|
||||
int ethnl_cable_test_fault_length(struct phy_device *phydev, u8 pair, u32 cm);
|
||||
int ethnl_cable_test_amplitude(struct phy_device *phydev, u8 pair, s16 mV);
|
||||
int ethnl_cable_test_pulse(struct phy_device *phydev, u16 mV);
|
||||
int ethnl_cable_test_step(struct phy_device *phydev, u32 first, u32 last,
|
||||
u32 step);
|
||||
#else
|
||||
static inline int ethnl_cable_test_alloc(struct phy_device *phydev, u8 cmd)
|
||||
{
|
||||
return -EOPNOTSUPP;
|
||||
}
|
||||
|
||||
static inline void ethnl_cable_test_free(struct phy_device *phydev)
|
||||
{
|
||||
}
|
||||
|
||||
static inline void ethnl_cable_test_finished(struct phy_device *phydev)
|
||||
{
|
||||
}
|
||||
static inline int ethnl_cable_test_result(struct phy_device *phydev, u8 pair,
|
||||
u8 result)
|
||||
{
|
||||
return -EOPNOTSUPP;
|
||||
}
|
||||
|
||||
static inline int ethnl_cable_test_fault_length(struct phy_device *phydev,
|
||||
u8 pair, u32 cm)
|
||||
{
|
||||
return -EOPNOTSUPP;
|
||||
}
|
||||
|
||||
static inline int ethnl_cable_test_amplitude(struct phy_device *phydev,
|
||||
u8 pair, s16 mV)
|
||||
{
|
||||
return -EOPNOTSUPP;
|
||||
}
|
||||
|
||||
static inline int ethnl_cable_test_pulse(struct phy_device *phydev, u16 mV)
|
||||
{
|
||||
return -EOPNOTSUPP;
|
||||
}
|
||||
|
||||
static inline int ethnl_cable_test_step(struct phy_device *phydev, u32 first,
|
||||
u32 last, u32 step)
|
||||
{
|
||||
return -EOPNOTSUPP;
|
||||
}
|
||||
#endif /* IS_ENABLED(CONFIG_ETHTOOL_NETLINK) */
|
||||
#endif /* _LINUX_ETHTOOL_NETLINK_H_ */
|
||||
|
@@ -47,8 +47,7 @@
|
||||
* Directory entry modification events - reported only to directory
|
||||
* where entry is modified and not to a watching parent.
|
||||
*/
|
||||
#define FANOTIFY_DIRENT_EVENTS (FAN_MOVE | FAN_CREATE | FAN_DELETE | \
|
||||
FAN_DIR_MODIFY)
|
||||
#define FANOTIFY_DIRENT_EVENTS (FAN_MOVE | FAN_CREATE | FAN_DELETE)
|
||||
|
||||
/* Events that can only be reported with data type FSNOTIFY_EVENT_INODE */
|
||||
#define FANOTIFY_INODE_EVENTS (FANOTIFY_DIRENT_EVENTS | \
|
||||
|
25
include/linux/fiemap.h
Normal file
25
include/linux/fiemap.h
Normal file
@@ -0,0 +1,25 @@
|
||||
/* SPDX-License-Identifier: GPL-2.0 */
|
||||
#ifndef _LINUX_FIEMAP_H
|
||||
#define _LINUX_FIEMAP_H 1
|
||||
|
||||
#include <uapi/linux/fiemap.h>
|
||||
#include <linux/fs.h>
|
||||
|
||||
struct fiemap_extent_info {
|
||||
unsigned int fi_flags; /* Flags as passed from user */
|
||||
unsigned int fi_extents_mapped; /* Number of mapped extents */
|
||||
unsigned int fi_extents_max; /* Size of fiemap_extent array */
|
||||
struct fiemap_extent __user *fi_extents_start; /* Start of
|
||||
fiemap_extent array */
|
||||
};
|
||||
|
||||
int fiemap_prep(struct inode *inode, struct fiemap_extent_info *fieinfo,
|
||||
u64 start, u64 *len, u32 supported_flags);
|
||||
int fiemap_fill_next_extent(struct fiemap_extent_info *info, u64 logical,
|
||||
u64 phys, u64 len, u32 flags);
|
||||
|
||||
int generic_block_fiemap(struct inode *inode,
|
||||
struct fiemap_extent_info *fieinfo, u64 start, u64 len,
|
||||
get_block_t *get_block);
|
||||
|
||||
#endif /* _LINUX_FIEMAP_H 1 */
|
@@ -94,4 +94,6 @@ extern void fd_install(unsigned int fd, struct file *file);
|
||||
extern void flush_delayed_fput(void);
|
||||
extern void __fput_sync(struct file *);
|
||||
|
||||
extern unsigned int sysctl_nr_open_min, sysctl_nr_open_max;
|
||||
|
||||
#endif /* __LINUX_FILE_H */
|
||||
|
@@ -16,11 +16,11 @@
|
||||
#include <linux/workqueue.h>
|
||||
#include <linux/sched.h>
|
||||
#include <linux/capability.h>
|
||||
#include <linux/cryptohash.h>
|
||||
#include <linux/set_memory.h>
|
||||
#include <linux/kallsyms.h>
|
||||
#include <linux/if_vlan.h>
|
||||
#include <linux/vmalloc.h>
|
||||
#include <crypto/sha.h>
|
||||
|
||||
#include <net/sch_generic.h>
|
||||
|
||||
@@ -545,10 +545,8 @@ struct bpf_prog {
|
||||
unsigned int (*bpf_func)(const void *ctx,
|
||||
const struct bpf_insn *insn);
|
||||
/* Instructions for interpreter */
|
||||
union {
|
||||
struct sock_filter insns[0];
|
||||
struct bpf_insn insnsi[0];
|
||||
};
|
||||
struct sock_filter insns[0];
|
||||
struct bpf_insn insnsi[];
|
||||
};
|
||||
|
||||
struct sk_filter {
|
||||
@@ -746,7 +744,7 @@ static inline u32 bpf_prog_insn_size(const struct bpf_prog *prog)
|
||||
static inline u32 bpf_prog_tag_scratch_size(const struct bpf_prog *prog)
|
||||
{
|
||||
return round_up(bpf_prog_insn_size(prog) +
|
||||
sizeof(__be64) + 1, SHA_MESSAGE_BYTES);
|
||||
sizeof(__be64) + 1, SHA1_BLOCK_SIZE);
|
||||
}
|
||||
|
||||
static inline unsigned int bpf_prog_size(unsigned int proglen)
|
||||
@@ -863,8 +861,6 @@ int bpf_prog_create(struct bpf_prog **pfp, struct sock_fprog_kern *fprog);
|
||||
int bpf_prog_create_from_user(struct bpf_prog **pfp, struct sock_fprog *fprog,
|
||||
bpf_aux_classic_check_t trans, bool save_orig);
|
||||
void bpf_prog_destroy(struct bpf_prog *fp);
|
||||
const struct bpf_func_proto *
|
||||
bpf_base_func_proto(enum bpf_func_id func_id);
|
||||
|
||||
int sk_attach_filter(struct sock_fprog *fprog, struct sock *sk);
|
||||
int sk_attach_bpf(u32 ufd, struct sock *sk);
|
||||
|
@@ -12,7 +12,6 @@
|
||||
struct firmware {
|
||||
size_t size;
|
||||
const u8 *data;
|
||||
struct page **pages;
|
||||
|
||||
/* firmware loader private fields */
|
||||
void *priv;
|
||||
|
@@ -11,7 +11,6 @@
|
||||
#define _SC_SCI_H
|
||||
|
||||
#include <linux/firmware/imx/ipc.h>
|
||||
#include <linux/firmware/imx/types.h>
|
||||
|
||||
#include <linux/firmware/imx/svc/misc.h>
|
||||
#include <linux/firmware/imx/svc/pm.h>
|
||||
|
@@ -1,65 +0,0 @@
|
||||
/* SPDX-License-Identifier: GPL-2.0+ */
|
||||
/*
|
||||
* Copyright (C) 2016 Freescale Semiconductor, Inc.
|
||||
* Copyright 2017~2018 NXP
|
||||
*
|
||||
* Header file containing types used across multiple service APIs.
|
||||
*/
|
||||
|
||||
#ifndef _SC_TYPES_H
|
||||
#define _SC_TYPES_H
|
||||
|
||||
/*
|
||||
* This type is used to indicate a control.
|
||||
*/
|
||||
enum imx_sc_ctrl {
|
||||
IMX_SC_C_TEMP = 0,
|
||||
IMX_SC_C_TEMP_HI = 1,
|
||||
IMX_SC_C_TEMP_LOW = 2,
|
||||
IMX_SC_C_PXL_LINK_MST1_ADDR = 3,
|
||||
IMX_SC_C_PXL_LINK_MST2_ADDR = 4,
|
||||
IMX_SC_C_PXL_LINK_MST_ENB = 5,
|
||||
IMX_SC_C_PXL_LINK_MST1_ENB = 6,
|
||||
IMX_SC_C_PXL_LINK_MST2_ENB = 7,
|
||||
IMX_SC_C_PXL_LINK_SLV1_ADDR = 8,
|
||||
IMX_SC_C_PXL_LINK_SLV2_ADDR = 9,
|
||||
IMX_SC_C_PXL_LINK_MST_VLD = 10,
|
||||
IMX_SC_C_PXL_LINK_MST1_VLD = 11,
|
||||
IMX_SC_C_PXL_LINK_MST2_VLD = 12,
|
||||
IMX_SC_C_SINGLE_MODE = 13,
|
||||
IMX_SC_C_ID = 14,
|
||||
IMX_SC_C_PXL_CLK_POLARITY = 15,
|
||||
IMX_SC_C_LINESTATE = 16,
|
||||
IMX_SC_C_PCIE_G_RST = 17,
|
||||
IMX_SC_C_PCIE_BUTTON_RST = 18,
|
||||
IMX_SC_C_PCIE_PERST = 19,
|
||||
IMX_SC_C_PHY_RESET = 20,
|
||||
IMX_SC_C_PXL_LINK_RATE_CORRECTION = 21,
|
||||
IMX_SC_C_PANIC = 22,
|
||||
IMX_SC_C_PRIORITY_GROUP = 23,
|
||||
IMX_SC_C_TXCLK = 24,
|
||||
IMX_SC_C_CLKDIV = 25,
|
||||
IMX_SC_C_DISABLE_50 = 26,
|
||||
IMX_SC_C_DISABLE_125 = 27,
|
||||
IMX_SC_C_SEL_125 = 28,
|
||||
IMX_SC_C_MODE = 29,
|
||||
IMX_SC_C_SYNC_CTRL0 = 30,
|
||||
IMX_SC_C_KACHUNK_CNT = 31,
|
||||
IMX_SC_C_KACHUNK_SEL = 32,
|
||||
IMX_SC_C_SYNC_CTRL1 = 33,
|
||||
IMX_SC_C_DPI_RESET = 34,
|
||||
IMX_SC_C_MIPI_RESET = 35,
|
||||
IMX_SC_C_DUAL_MODE = 36,
|
||||
IMX_SC_C_VOLTAGE = 37,
|
||||
IMX_SC_C_PXL_LINK_SEL = 38,
|
||||
IMX_SC_C_OFS_SEL = 39,
|
||||
IMX_SC_C_OFS_AUDIO = 40,
|
||||
IMX_SC_C_OFS_PERIPH = 41,
|
||||
IMX_SC_C_OFS_IRQ = 42,
|
||||
IMX_SC_C_RST0 = 43,
|
||||
IMX_SC_C_RST1 = 44,
|
||||
IMX_SC_C_SEL0 = 45,
|
||||
IMX_SC_C_LAST
|
||||
};
|
||||
|
||||
#endif /* _SC_TYPES_H */
|
@@ -54,32 +54,25 @@
|
||||
* Secure monitor software doesn't recognize the request.
|
||||
*
|
||||
* INTEL_SIP_SMC_STATUS_OK:
|
||||
* FPGA configuration completed successfully,
|
||||
* In case of FPGA configuration write operation, it means secure monitor
|
||||
* software can accept the next chunk of FPGA configuration data.
|
||||
* Secure monitor software accepts the service client's request.
|
||||
*
|
||||
* INTEL_SIP_SMC_FPGA_CONFIG_STATUS_BUSY:
|
||||
* In case of FPGA configuration write operation, it means secure monitor
|
||||
* software is still processing previous data & can't accept the next chunk
|
||||
* of data. Service driver needs to issue
|
||||
* INTEL_SIP_SMC_FPGA_CONFIG_COMPLETED_WRITE call to query the
|
||||
* completed block(s).
|
||||
* INTEL_SIP_SMC_STATUS_BUSY:
|
||||
* Secure monitor software is still processing service client's request.
|
||||
*
|
||||
* INTEL_SIP_SMC_FPGA_CONFIG_STATUS_ERROR:
|
||||
* There is error during the FPGA configuration process.
|
||||
* INTEL_SIP_SMC_STATUS_REJECTED:
|
||||
* Secure monitor software reject the service client's request.
|
||||
*
|
||||
* INTEL_SIP_SMC_REG_ERROR:
|
||||
* There is error during a read or write operation of the protected registers.
|
||||
* INTEL_SIP_SMC_STATUS_ERROR:
|
||||
* There is error during the process of service request.
|
||||
*
|
||||
* INTEL_SIP_SMC_RSU_ERROR:
|
||||
* There is error during a remote status update.
|
||||
* There is error during the process of remote status update request.
|
||||
*/
|
||||
#define INTEL_SIP_SMC_RETURN_UNKNOWN_FUNCTION 0xFFFFFFFF
|
||||
#define INTEL_SIP_SMC_STATUS_OK 0x0
|
||||
#define INTEL_SIP_SMC_FPGA_CONFIG_STATUS_BUSY 0x1
|
||||
#define INTEL_SIP_SMC_FPGA_CONFIG_STATUS_REJECTED 0x2
|
||||
#define INTEL_SIP_SMC_FPGA_CONFIG_STATUS_ERROR 0x4
|
||||
#define INTEL_SIP_SMC_REG_ERROR 0x5
|
||||
#define INTEL_SIP_SMC_STATUS_BUSY 0x1
|
||||
#define INTEL_SIP_SMC_STATUS_REJECTED 0x2
|
||||
#define INTEL_SIP_SMC_STATUS_ERROR 0x4
|
||||
#define INTEL_SIP_SMC_RSU_ERROR 0x7
|
||||
|
||||
/**
|
||||
@@ -95,7 +88,7 @@
|
||||
* a2-7: not used.
|
||||
*
|
||||
* Return status:
|
||||
* a0: INTEL_SIP_SMC_STATUS_OK, or INTEL_SIP_SMC_FPGA_CONFIG_STATUS_ERROR.
|
||||
* a0: INTEL_SIP_SMC_STATUS_OK, or INTEL_SIP_SMC_STATUS_ERROR.
|
||||
* a1-3: not used.
|
||||
*/
|
||||
#define INTEL_SIP_SMC_FUNCID_FPGA_CONFIG_START 1
|
||||
@@ -115,8 +108,8 @@
|
||||
* a3-7: not used.
|
||||
*
|
||||
* Return status:
|
||||
* a0: INTEL_SIP_SMC_STATUS_OK, INTEL_SIP_SMC_FPGA_CONFIG_STATUS_BUSY or
|
||||
* INTEL_SIP_SMC_FPGA_CONFIG_STATUS_ERROR.
|
||||
* a0: INTEL_SIP_SMC_STATUS_OK, INTEL_SIP_SMC_STATUS_BUSY or
|
||||
* INTEL_SIP_SMC_STATUS_ERROR.
|
||||
* a1: 64bit physical address of 1st completed memory block if any completed
|
||||
* block, otherwise zero value.
|
||||
* a2: 64bit physical address of 2nd completed memory block if any completed
|
||||
@@ -133,15 +126,15 @@
|
||||
*
|
||||
* Sync call used by service driver at EL1 to track the completed write
|
||||
* transactions. This request is called after INTEL_SIP_SMC_FPGA_CONFIG_WRITE
|
||||
* call returns INTEL_SIP_SMC_FPGA_CONFIG_STATUS_BUSY.
|
||||
* call returns INTEL_SIP_SMC_STATUS_BUSY.
|
||||
*
|
||||
* Call register usage:
|
||||
* a0: INTEL_SIP_SMC_FPGA_CONFIG_COMPLETED_WRITE.
|
||||
* a1-7: not used.
|
||||
*
|
||||
* Return status:
|
||||
* a0: INTEL_SIP_SMC_STATUS_OK, INTEL_SIP_SMC_FPGA_CONFIG_STATUS_BUSY or
|
||||
* INTEL_SIP_SMC_FPGA_CONFIG_STATUS_ERROR.
|
||||
* a0: INTEL_SIP_SMC_STATUS_OK, INTEL_SIP_SMC_FPGA_BUSY or
|
||||
* INTEL_SIP_SMC_STATUS_ERROR.
|
||||
* a1: 64bit physical address of 1st completed memory block.
|
||||
* a2: 64bit physical address of 2nd completed memory block if
|
||||
* any completed block, otherwise zero value.
|
||||
@@ -164,8 +157,8 @@ INTEL_SIP_SMC_FAST_CALL_VAL(INTEL_SIP_SMC_FUNCID_FPGA_CONFIG_COMPLETED_WRITE)
|
||||
* a1-7: not used.
|
||||
*
|
||||
* Return status:
|
||||
* a0: INTEL_SIP_SMC_STATUS_OK, INTEL_SIP_SMC_FPGA_CONFIG_STATUS_BUSY or
|
||||
* INTEL_SIP_SMC_FPGA_CONFIG_STATUS_ERROR.
|
||||
* a0: INTEL_SIP_SMC_STATUS_OK, INTEL_SIP_SMC_STATUS_BUSY or
|
||||
* INTEL_SIP_SMC_STATUS_ERROR.
|
||||
* a1-3: not used.
|
||||
*/
|
||||
#define INTEL_SIP_SMC_FUNCID_FPGA_CONFIG_ISDONE 4
|
||||
@@ -183,7 +176,7 @@ INTEL_SIP_SMC_FAST_CALL_VAL(INTEL_SIP_SMC_FUNCID_FPGA_CONFIG_COMPLETED_WRITE)
|
||||
* a1-7: not used.
|
||||
*
|
||||
* Return status:
|
||||
* a0: INTEL_SIP_SMC_STATUS_OK or INTEL_SIP_SMC_FPGA_CONFIG_STATUS_ERROR.
|
||||
* a0: INTEL_SIP_SMC_STATUS_OK or INTEL_SIP_SMC_STATUS_ERROR.
|
||||
* a1: start of physical address of reserved memory block.
|
||||
* a2: size of reserved memory block.
|
||||
* a3: not used.
|
||||
@@ -203,7 +196,7 @@ INTEL_SIP_SMC_FAST_CALL_VAL(INTEL_SIP_SMC_FUNCID_FPGA_CONFIG_COMPLETED_WRITE)
|
||||
* a1-7: not used.
|
||||
*
|
||||
* Return status:
|
||||
* a0: INTEL_SIP_SMC_STATUS_OK or INTEL_SIP_SMC_FPGA_CONFIG_STATUS_ERROR.
|
||||
* a0: INTEL_SIP_SMC_STATUS_OK or INTEL_SIP_SMC_STATUS_ERROR.
|
||||
* a1-3: not used.
|
||||
*/
|
||||
#define INTEL_SIP_SMC_FUNCID_FPGA_CONFIG_LOOPBACK 6
|
||||
|
@@ -18,45 +18,37 @@
|
||||
/**
|
||||
* Status of the sent command, in bit number
|
||||
*
|
||||
* SVC_COMMAND_STATUS_RECONFIG_REQUEST_OK:
|
||||
* Secure firmware accepts the request of FPGA reconfiguration.
|
||||
* SVC_STATUS_OK:
|
||||
* Secure firmware accepts the request issued by one of service clients.
|
||||
*
|
||||
* SVC_STATUS_RECONFIG_BUFFER_SUBMITTED:
|
||||
* Service client successfully submits FPGA configuration
|
||||
* data buffer to secure firmware.
|
||||
* SVC_STATUS_BUFFER_SUBMITTED:
|
||||
* Service client successfully submits data buffer to secure firmware.
|
||||
*
|
||||
* SVC_COMMAND_STATUS_RECONFIG_BUFFER_DONE:
|
||||
* SVC_STATUS_BUFFER_DONE:
|
||||
* Secure firmware completes data process, ready to accept the
|
||||
* next WRITE transaction.
|
||||
*
|
||||
* SVC_COMMAND_STATUS_RECONFIG_COMPLETED:
|
||||
* Secure firmware completes FPGA configuration successfully, FPGA should
|
||||
* be in user mode.
|
||||
* SVC_STATUS_COMPLETED:
|
||||
* Secure firmware completes service request successfully. In case of
|
||||
* FPGA configuration, FPGA should be in user mode.
|
||||
*
|
||||
* SVC_COMMAND_STATUS_RECONFIG_BUSY:
|
||||
* FPGA configuration is still in process.
|
||||
* SVC_COMMAND_STATUS_BUSY:
|
||||
* Service request is still in process.
|
||||
*
|
||||
* SVC_COMMAND_STATUS_RECONFIG_ERROR:
|
||||
* Error encountered during FPGA configuration.
|
||||
* SVC_COMMAND_STATUS_ERROR:
|
||||
* Error encountered during the process of the service request.
|
||||
*
|
||||
* SVC_STATUS_RSU_OK:
|
||||
* Secure firmware accepts the request of remote status update (RSU).
|
||||
*
|
||||
* SVC_STATUS_RSU_ERROR:
|
||||
* Error encountered during remote system update.
|
||||
*
|
||||
* SVC_STATUS_RSU_NO_SUPPORT:
|
||||
* Secure firmware doesn't support RSU retry or notify feature.
|
||||
* SVC_STATUS_NO_SUPPORT:
|
||||
* Secure firmware doesn't support requested features such as RSU retry
|
||||
* or RSU notify.
|
||||
*/
|
||||
#define SVC_STATUS_RECONFIG_REQUEST_OK 0
|
||||
#define SVC_STATUS_RECONFIG_BUFFER_SUBMITTED 1
|
||||
#define SVC_STATUS_RECONFIG_BUFFER_DONE 2
|
||||
#define SVC_STATUS_RECONFIG_COMPLETED 3
|
||||
#define SVC_STATUS_RECONFIG_BUSY 4
|
||||
#define SVC_STATUS_RECONFIG_ERROR 5
|
||||
#define SVC_STATUS_RSU_OK 6
|
||||
#define SVC_STATUS_RSU_ERROR 7
|
||||
#define SVC_STATUS_RSU_NO_SUPPORT 8
|
||||
#define SVC_STATUS_OK 0
|
||||
#define SVC_STATUS_BUFFER_SUBMITTED 1
|
||||
#define SVC_STATUS_BUFFER_DONE 2
|
||||
#define SVC_STATUS_COMPLETED 3
|
||||
#define SVC_STATUS_BUSY 4
|
||||
#define SVC_STATUS_ERROR 5
|
||||
#define SVC_STATUS_NO_SUPPORT 6
|
||||
|
||||
/**
|
||||
* Flag bit for COMMAND_RECONFIG
|
||||
@@ -84,32 +76,29 @@ struct stratix10_svc_chan;
|
||||
* @COMMAND_NOOP: do 'dummy' request for integration/debug/trouble-shooting
|
||||
*
|
||||
* @COMMAND_RECONFIG: ask for FPGA configuration preparation, return status
|
||||
* is SVC_STATUS_RECONFIG_REQUEST_OK
|
||||
* is SVC_STATUS_OK
|
||||
*
|
||||
* @COMMAND_RECONFIG_DATA_SUBMIT: submit buffer(s) of bit-stream data for the
|
||||
* FPGA configuration, return status is SVC_STATUS_RECONFIG_BUFFER_SUBMITTED,
|
||||
* or SVC_STATUS_RECONFIG_ERROR
|
||||
* FPGA configuration, return status is SVC_STATUS_SUBMITTED or SVC_STATUS_ERROR
|
||||
*
|
||||
* @COMMAND_RECONFIG_DATA_CLAIM: check the status of the configuration, return
|
||||
* status is SVC_STATUS_RECONFIG_COMPLETED, or SVC_STATUS_RECONFIG_BUSY, or
|
||||
* SVC_STATUS_RECONFIG_ERROR
|
||||
* status is SVC_STATUS_COMPLETED, or SVC_STATUS_BUSY, or SVC_STATUS_ERROR
|
||||
*
|
||||
* @COMMAND_RECONFIG_STATUS: check the status of the configuration, return
|
||||
* status is SVC_STATUS_RECONFIG_COMPLETED, or SVC_STATUS_RECONFIG_BUSY, or
|
||||
* SVC_STATUS_RECONFIG_ERROR
|
||||
* status is SVC_STATUS_COMPLETED, or SVC_STATUS_BUSY, or SVC_STATUS_ERROR
|
||||
*
|
||||
* @COMMAND_RSU_STATUS: request remote system update boot log, return status
|
||||
* is log data or SVC_STATUS_RSU_ERROR
|
||||
*
|
||||
* @COMMAND_RSU_UPDATE: set the offset of the bitstream to boot after reboot,
|
||||
* return status is SVC_STATUS_RSU_OK or SVC_STATUS_RSU_ERROR
|
||||
* return status is SVC_STATUS_OK or SVC_STATUS_ERROR
|
||||
*
|
||||
* @COMMAND_RSU_NOTIFY: report the status of hard processor system
|
||||
* software to firmware, return status is SVC_STATUS_RSU_OK or
|
||||
* SVC_STATUS_RSU_ERROR
|
||||
* software to firmware, return status is SVC_STATUS_OK or
|
||||
* SVC_STATUS_ERROR
|
||||
*
|
||||
* @COMMAND_RSU_RETRY: query firmware for the current image's retry counter,
|
||||
* return status is SVC_STATUS_RSU_OK or SVC_STATUS_RSU_ERROR
|
||||
* return status is SVC_STATUS_OK or SVC_STATUS_ERROR
|
||||
*/
|
||||
enum stratix10_svc_command_code {
|
||||
COMMAND_NOOP = 0,
|
||||
|
@@ -32,6 +32,7 @@
|
||||
#define TF_PM_MODE_LP1_NO_MC_CLK 2
|
||||
#define TF_PM_MODE_LP2 3
|
||||
#define TF_PM_MODE_LP2_NOFLUSH_L2 4
|
||||
#define TF_PM_MODE_NONE 5
|
||||
|
||||
struct trusted_foundations_platform_data {
|
||||
unsigned int version_major;
|
||||
|
@@ -42,6 +42,8 @@
|
||||
|
||||
#define ZYNQMP_PM_MAX_QOS 100U
|
||||
|
||||
#define GSS_NUM_REGS (4)
|
||||
|
||||
/* Node capabilities */
|
||||
#define ZYNQMP_PM_CAPABILITY_ACCESS 0x1U
|
||||
#define ZYNQMP_PM_CAPABILITY_CONTEXT 0x2U
|
||||
@@ -62,6 +64,7 @@
|
||||
|
||||
enum pm_api_id {
|
||||
PM_GET_API_VERSION = 1,
|
||||
PM_SYSTEM_SHUTDOWN = 12,
|
||||
PM_REQUEST_NODE = 13,
|
||||
PM_RELEASE_NODE,
|
||||
PM_SET_REQUIREMENT,
|
||||
@@ -107,6 +110,12 @@ enum pm_ioctl_id {
|
||||
IOCTL_GET_PLL_FRAC_MODE,
|
||||
IOCTL_SET_PLL_FRAC_DATA,
|
||||
IOCTL_GET_PLL_FRAC_DATA,
|
||||
IOCTL_WRITE_GGS = 12,
|
||||
IOCTL_READ_GGS = 13,
|
||||
IOCTL_WRITE_PGGS = 14,
|
||||
IOCTL_READ_PGGS = 15,
|
||||
/* Set healthy bit value */
|
||||
IOCTL_SET_BOOT_HEALTH_STATUS = 17,
|
||||
};
|
||||
|
||||
enum pm_query_id {
|
||||
@@ -279,6 +288,18 @@ enum dll_reset_type {
|
||||
PM_DLL_RESET_PULSE,
|
||||
};
|
||||
|
||||
enum zynqmp_pm_shutdown_type {
|
||||
ZYNQMP_PM_SHUTDOWN_TYPE_SHUTDOWN,
|
||||
ZYNQMP_PM_SHUTDOWN_TYPE_RESET,
|
||||
ZYNQMP_PM_SHUTDOWN_TYPE_SETSCOPE_ONLY,
|
||||
};
|
||||
|
||||
enum zynqmp_pm_shutdown_subtype {
|
||||
ZYNQMP_PM_SHUTDOWN_SUBTYPE_SUBSYSTEM,
|
||||
ZYNQMP_PM_SHUTDOWN_SUBTYPE_PS_ONLY,
|
||||
ZYNQMP_PM_SHUTDOWN_SUBTYPE_SYSTEM,
|
||||
};
|
||||
|
||||
/**
|
||||
* struct zynqmp_pm_query_data - PM query data
|
||||
* @qid: query ID
|
||||
@@ -293,49 +314,199 @@ struct zynqmp_pm_query_data {
|
||||
u32 arg3;
|
||||
};
|
||||
|
||||
struct zynqmp_eemi_ops {
|
||||
int (*get_api_version)(u32 *version);
|
||||
int (*get_chipid)(u32 *idcode, u32 *version);
|
||||
int (*fpga_load)(const u64 address, const u32 size, const u32 flags);
|
||||
int (*fpga_get_status)(u32 *value);
|
||||
int (*query_data)(struct zynqmp_pm_query_data qdata, u32 *out);
|
||||
int (*clock_enable)(u32 clock_id);
|
||||
int (*clock_disable)(u32 clock_id);
|
||||
int (*clock_getstate)(u32 clock_id, u32 *state);
|
||||
int (*clock_setdivider)(u32 clock_id, u32 divider);
|
||||
int (*clock_getdivider)(u32 clock_id, u32 *divider);
|
||||
int (*clock_setrate)(u32 clock_id, u64 rate);
|
||||
int (*clock_getrate)(u32 clock_id, u64 *rate);
|
||||
int (*clock_setparent)(u32 clock_id, u32 parent_id);
|
||||
int (*clock_getparent)(u32 clock_id, u32 *parent_id);
|
||||
int (*ioctl)(u32 node_id, u32 ioctl_id, u32 arg1, u32 arg2, u32 *out);
|
||||
int (*reset_assert)(const enum zynqmp_pm_reset reset,
|
||||
const enum zynqmp_pm_reset_action assert_flag);
|
||||
int (*reset_get_status)(const enum zynqmp_pm_reset reset, u32 *status);
|
||||
int (*init_finalize)(void);
|
||||
int (*set_suspend_mode)(u32 mode);
|
||||
int (*request_node)(const u32 node,
|
||||
const u32 capabilities,
|
||||
const u32 qos,
|
||||
const enum zynqmp_pm_request_ack ack);
|
||||
int (*release_node)(const u32 node);
|
||||
int (*set_requirement)(const u32 node,
|
||||
const u32 capabilities,
|
||||
const u32 qos,
|
||||
const enum zynqmp_pm_request_ack ack);
|
||||
int (*aes)(const u64 address, u32 *out);
|
||||
};
|
||||
|
||||
int zynqmp_pm_invoke_fn(u32 pm_api_id, u32 arg0, u32 arg1,
|
||||
u32 arg2, u32 arg3, u32 *ret_payload);
|
||||
|
||||
#if IS_REACHABLE(CONFIG_ZYNQMP_FIRMWARE)
|
||||
const struct zynqmp_eemi_ops *zynqmp_pm_get_eemi_ops(void);
|
||||
int zynqmp_pm_get_api_version(u32 *version);
|
||||
int zynqmp_pm_get_chipid(u32 *idcode, u32 *version);
|
||||
int zynqmp_pm_query_data(struct zynqmp_pm_query_data qdata, u32 *out);
|
||||
int zynqmp_pm_clock_enable(u32 clock_id);
|
||||
int zynqmp_pm_clock_disable(u32 clock_id);
|
||||
int zynqmp_pm_clock_getstate(u32 clock_id, u32 *state);
|
||||
int zynqmp_pm_clock_setdivider(u32 clock_id, u32 divider);
|
||||
int zynqmp_pm_clock_getdivider(u32 clock_id, u32 *divider);
|
||||
int zynqmp_pm_clock_setrate(u32 clock_id, u64 rate);
|
||||
int zynqmp_pm_clock_getrate(u32 clock_id, u64 *rate);
|
||||
int zynqmp_pm_clock_setparent(u32 clock_id, u32 parent_id);
|
||||
int zynqmp_pm_clock_getparent(u32 clock_id, u32 *parent_id);
|
||||
int zynqmp_pm_set_pll_frac_mode(u32 clk_id, u32 mode);
|
||||
int zynqmp_pm_get_pll_frac_mode(u32 clk_id, u32 *mode);
|
||||
int zynqmp_pm_set_pll_frac_data(u32 clk_id, u32 data);
|
||||
int zynqmp_pm_get_pll_frac_data(u32 clk_id, u32 *data);
|
||||
int zynqmp_pm_set_sd_tapdelay(u32 node_id, u32 type, u32 value);
|
||||
int zynqmp_pm_sd_dll_reset(u32 node_id, u32 type);
|
||||
int zynqmp_pm_reset_assert(const enum zynqmp_pm_reset reset,
|
||||
const enum zynqmp_pm_reset_action assert_flag);
|
||||
int zynqmp_pm_reset_get_status(const enum zynqmp_pm_reset reset, u32 *status);
|
||||
int zynqmp_pm_init_finalize(void);
|
||||
int zynqmp_pm_set_suspend_mode(u32 mode);
|
||||
int zynqmp_pm_request_node(const u32 node, const u32 capabilities,
|
||||
const u32 qos, const enum zynqmp_pm_request_ack ack);
|
||||
int zynqmp_pm_release_node(const u32 node);
|
||||
int zynqmp_pm_set_requirement(const u32 node, const u32 capabilities,
|
||||
const u32 qos,
|
||||
const enum zynqmp_pm_request_ack ack);
|
||||
int zynqmp_pm_aes_engine(const u64 address, u32 *out);
|
||||
int zynqmp_pm_fpga_load(const u64 address, const u32 size, const u32 flags);
|
||||
int zynqmp_pm_fpga_get_status(u32 *value);
|
||||
int zynqmp_pm_write_ggs(u32 index, u32 value);
|
||||
int zynqmp_pm_read_ggs(u32 index, u32 *value);
|
||||
int zynqmp_pm_write_pggs(u32 index, u32 value);
|
||||
int zynqmp_pm_read_pggs(u32 index, u32 *value);
|
||||
int zynqmp_pm_system_shutdown(const u32 type, const u32 subtype);
|
||||
int zynqmp_pm_set_boot_health_status(u32 value);
|
||||
#else
|
||||
static inline struct zynqmp_eemi_ops *zynqmp_pm_get_eemi_ops(void)
|
||||
{
|
||||
return ERR_PTR(-ENODEV);
|
||||
}
|
||||
static inline int zynqmp_pm_get_api_version(u32 *version)
|
||||
{
|
||||
return -ENODEV;
|
||||
}
|
||||
static inline int zynqmp_pm_get_chipid(u32 *idcode, u32 *version)
|
||||
{
|
||||
return -ENODEV;
|
||||
}
|
||||
static inline int zynqmp_pm_query_data(struct zynqmp_pm_query_data qdata,
|
||||
u32 *out)
|
||||
{
|
||||
return -ENODEV;
|
||||
}
|
||||
static inline int zynqmp_pm_clock_enable(u32 clock_id)
|
||||
{
|
||||
return -ENODEV;
|
||||
}
|
||||
static inline int zynqmp_pm_clock_disable(u32 clock_id)
|
||||
{
|
||||
return -ENODEV;
|
||||
}
|
||||
static inline int zynqmp_pm_clock_getstate(u32 clock_id, u32 *state)
|
||||
{
|
||||
return -ENODEV;
|
||||
}
|
||||
static inline int zynqmp_pm_clock_setdivider(u32 clock_id, u32 divider)
|
||||
{
|
||||
return -ENODEV;
|
||||
}
|
||||
static inline int zynqmp_pm_clock_getdivider(u32 clock_id, u32 *divider)
|
||||
{
|
||||
return -ENODEV;
|
||||
}
|
||||
static inline int zynqmp_pm_clock_setrate(u32 clock_id, u64 rate)
|
||||
{
|
||||
return -ENODEV;
|
||||
}
|
||||
static inline int zynqmp_pm_clock_getrate(u32 clock_id, u64 *rate)
|
||||
{
|
||||
return -ENODEV;
|
||||
}
|
||||
static inline int zynqmp_pm_clock_setparent(u32 clock_id, u32 parent_id)
|
||||
{
|
||||
return -ENODEV;
|
||||
}
|
||||
static inline int zynqmp_pm_clock_getparent(u32 clock_id, u32 *parent_id)
|
||||
{
|
||||
return -ENODEV;
|
||||
}
|
||||
static inline int zynqmp_pm_set_pll_frac_mode(u32 clk_id, u32 mode)
|
||||
{
|
||||
return -ENODEV;
|
||||
}
|
||||
static inline int zynqmp_pm_get_pll_frac_mode(u32 clk_id, u32 *mode)
|
||||
{
|
||||
return -ENODEV;
|
||||
}
|
||||
static inline int zynqmp_pm_set_pll_frac_data(u32 clk_id, u32 data)
|
||||
{
|
||||
return -ENODEV;
|
||||
}
|
||||
static inline int zynqmp_pm_get_pll_frac_data(u32 clk_id, u32 *data)
|
||||
{
|
||||
return -ENODEV;
|
||||
}
|
||||
static inline int zynqmp_pm_set_sd_tapdelay(u32 node_id, u32 type, u32 value)
|
||||
{
|
||||
return -ENODEV;
|
||||
}
|
||||
static inline int zynqmp_pm_sd_dll_reset(u32 node_id, u32 type)
|
||||
{
|
||||
return -ENODEV;
|
||||
}
|
||||
static inline int zynqmp_pm_reset_assert(const enum zynqmp_pm_reset reset,
|
||||
const enum zynqmp_pm_reset_action assert_flag)
|
||||
{
|
||||
return -ENODEV;
|
||||
}
|
||||
static inline int zynqmp_pm_reset_get_status(const enum zynqmp_pm_reset reset,
|
||||
u32 *status)
|
||||
{
|
||||
return -ENODEV;
|
||||
}
|
||||
static inline int zynqmp_pm_init_finalize(void)
|
||||
{
|
||||
return -ENODEV;
|
||||
}
|
||||
static inline int zynqmp_pm_set_suspend_mode(u32 mode)
|
||||
{
|
||||
return -ENODEV;
|
||||
}
|
||||
static inline int zynqmp_pm_request_node(const u32 node, const u32 capabilities,
|
||||
const u32 qos,
|
||||
const enum zynqmp_pm_request_ack ack)
|
||||
{
|
||||
return -ENODEV;
|
||||
}
|
||||
static inline int zynqmp_pm_release_node(const u32 node)
|
||||
{
|
||||
return -ENODEV;
|
||||
}
|
||||
static inline int zynqmp_pm_set_requirement(const u32 node,
|
||||
const u32 capabilities,
|
||||
const u32 qos,
|
||||
const enum zynqmp_pm_request_ack ack)
|
||||
{
|
||||
return -ENODEV;
|
||||
}
|
||||
static inline int zynqmp_pm_aes_engine(const u64 address, u32 *out)
|
||||
{
|
||||
return -ENODEV;
|
||||
}
|
||||
static inline int zynqmp_pm_fpga_load(const u64 address, const u32 size,
|
||||
const u32 flags)
|
||||
{
|
||||
return -ENODEV;
|
||||
}
|
||||
static inline int zynqmp_pm_fpga_get_status(u32 *value)
|
||||
{
|
||||
return -ENODEV;
|
||||
}
|
||||
static inline int zynqmp_pm_write_ggs(u32 index, u32 value)
|
||||
{
|
||||
return -ENODEV;
|
||||
}
|
||||
static inline int zynqmp_pm_read_ggs(u32 index, u32 *value)
|
||||
{
|
||||
return -ENODEV;
|
||||
}
|
||||
static inline int zynqmp_pm_write_pggs(u32 index, u32 value)
|
||||
{
|
||||
return -ENODEV;
|
||||
}
|
||||
static inline int zynqmp_pm_read_pggs(u32 index, u32 *value)
|
||||
{
|
||||
return -ENODEV;
|
||||
}
|
||||
static inline int zynqmp_pm_system_shutdown(const u32 type, const u32 subtype)
|
||||
{
|
||||
return -ENODEV;
|
||||
}
|
||||
static inline int zynqmp_pm_set_boot_health_status(u32 value)
|
||||
{
|
||||
return -ENODEV;
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif /* __FIRMWARE_ZYNQMP_H__ */
|
||||
|
@@ -11,9 +11,13 @@
|
||||
#ifndef ADI_AXI_COMMON_H_
|
||||
#define ADI_AXI_COMMON_H_
|
||||
|
||||
#define ADI_AXI_REG_VERSION 0x0000
|
||||
#define ADI_AXI_REG_VERSION 0x0000
|
||||
|
||||
#define ADI_AXI_PCORE_VER(major, minor, patch) \
|
||||
(((major) << 16) | ((minor) << 8) | (patch))
|
||||
|
||||
#define ADI_AXI_PCORE_VER_MAJOR(version) (((version) >> 16) & 0xff)
|
||||
#define ADI_AXI_PCORE_VER_MINOR(version) (((version) >> 8) & 0xff)
|
||||
#define ADI_AXI_PCORE_VER_PATCH(version) ((version) & 0xff)
|
||||
|
||||
#endif /* ADI_AXI_COMMON_H_ */
|
||||
|
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user