cachepc-linux

Fork of AMDESE/linux with modifications for CachePC side-channel attack
git clone https://git.sinitax.com/sinitax/cachepc-linux
Log | Files | Refs | README | LICENSE | sfeed.txt

ceph_features.h (8887B)


      1/* SPDX-License-Identifier: GPL-2.0 */
      2#ifndef __CEPH_FEATURES
      3#define __CEPH_FEATURES
      4
      5/*
      6 * Each time we reclaim bits for reuse we need to specify another bit
      7 * that, if present, indicates we have the new incarnation of that
      8 * feature.  Base case is 1 (first use).
      9 */
     10#define CEPH_FEATURE_INCARNATION_1 (0ull)
     11#define CEPH_FEATURE_INCARNATION_2 (1ull<<57)              // SERVER_JEWEL
     12#define CEPH_FEATURE_INCARNATION_3 ((1ull<<57)|(1ull<<28)) // SERVER_MIMIC
     13
     14#define DEFINE_CEPH_FEATURE(bit, incarnation, name)			\
     15	static const uint64_t __maybe_unused CEPH_FEATURE_##name = (1ULL<<bit);		\
     16	static const uint64_t __maybe_unused CEPH_FEATUREMASK_##name =			\
     17		(1ULL<<bit | CEPH_FEATURE_INCARNATION_##incarnation);
     18
     19/* this bit is ignored but still advertised by release *when* */
     20#define DEFINE_CEPH_FEATURE_DEPRECATED(bit, incarnation, name, when) \
     21	static const uint64_t __maybe_unused DEPRECATED_CEPH_FEATURE_##name = (1ULL<<bit);	\
     22	static const uint64_t __maybe_unused DEPRECATED_CEPH_FEATUREMASK_##name =		\
     23		(1ULL<<bit | CEPH_FEATURE_INCARNATION_##incarnation);
     24
     25/*
     26 * this bit is ignored by release *unused* and not advertised by
     27 * release *unadvertised*
     28 */
     29#define DEFINE_CEPH_FEATURE_RETIRED(bit, inc, name, unused, unadvertised)
     30
     31
     32/*
     33 * test for a feature.  this test is safer than a typical mask against
     34 * the bit because it ensures that we have the bit AND the marker for the
     35 * bit's incarnation.  this must be used in any case where the features
     36 * bits may include an old meaning of the bit.
     37 */
     38#define CEPH_HAVE_FEATURE(x, name)			\
     39	(((x) & (CEPH_FEATUREMASK_##name)) == (CEPH_FEATUREMASK_##name))
     40
     41
     42/*
     43 * Notes on deprecation:
     44 *
     45 * A *major* release is a release through which all upgrades must pass
     46 * (e.g., jewel).  For example, no pre-jewel server will ever talk to
     47 * a post-jewel server (mon, osd, etc).
     48 *
     49 * For feature bits used *only* on the server-side:
     50 *
     51 *  - In the first phase we indicate that a feature is DEPRECATED as of
     52 *    a particular release.  This is the first major release X (say,
     53 *    jewel) that does not depend on its peers advertising the feature.
     54 *    That is, it safely assumes its peers all have the feature.  We
     55 *    indicate this with the DEPRECATED macro.  For example,
     56 *
     57 *      DEFINE_CEPH_FEATURE_DEPRECATED( 2, 1, MONCLOCKCHECK, JEWEL)
     58 *
     59 *    because 10.2.z (jewel) did not care if its peers advertised this
     60 *    feature bit.
     61 *
     62 *  - In the second phase we stop advertising the bit and call it
     63 *    RETIRED.  This can normally be done in the *next* major release
     64 *    following the one in which we marked the feature DEPRECATED.  In
     65 *    the above example, for 12.0.z (luminous) we can say:
     66 *
     67 *      DEFINE_CEPH_FEATURE_RETIRED( 2, 1, MONCLOCKCHECK, JEWEL, LUMINOUS)
     68 *
     69 *  - The bit can be reused in the first post-luminous release, 13.0.z
     70 *    (m).
     71 *
     72 * This ensures that no two versions who have different meanings for
     73 * the bit ever speak to each other.
     74 */
     75
     76DEFINE_CEPH_FEATURE( 0, 1, UID)
     77DEFINE_CEPH_FEATURE( 1, 1, NOSRCADDR)
     78DEFINE_CEPH_FEATURE_RETIRED( 2, 1, MONCLOCKCHECK, JEWEL, LUMINOUS)
     79DEFINE_CEPH_FEATURE( 2, 3, SERVER_NAUTILUS)
     80DEFINE_CEPH_FEATURE( 3, 1, FLOCK)
     81DEFINE_CEPH_FEATURE( 4, 1, SUBSCRIBE2)
     82DEFINE_CEPH_FEATURE( 5, 1, MONNAMES)
     83DEFINE_CEPH_FEATURE( 6, 1, RECONNECT_SEQ)
     84DEFINE_CEPH_FEATURE( 7, 1, DIRLAYOUTHASH)
     85DEFINE_CEPH_FEATURE( 8, 1, OBJECTLOCATOR)
     86DEFINE_CEPH_FEATURE( 9, 1, PGID64)
     87DEFINE_CEPH_FEATURE(10, 1, INCSUBOSDMAP)
     88DEFINE_CEPH_FEATURE(11, 1, PGPOOL3)
     89DEFINE_CEPH_FEATURE(12, 1, OSDREPLYMUX)
     90DEFINE_CEPH_FEATURE(13, 1, OSDENC)
     91DEFINE_CEPH_FEATURE_RETIRED(14, 1, OMAP, HAMMER, JEWEL)
     92DEFINE_CEPH_FEATURE(14, 2, SERVER_KRAKEN)
     93DEFINE_CEPH_FEATURE(15, 1, MONENC)
     94DEFINE_CEPH_FEATURE_RETIRED(16, 1, QUERY_T, JEWEL, LUMINOUS)
     95
     96DEFINE_CEPH_FEATURE_RETIRED(17, 1, INDEP_PG_MAP, JEWEL, LUMINOUS)
     97
     98DEFINE_CEPH_FEATURE(18, 1, CRUSH_TUNABLES)
     99DEFINE_CEPH_FEATURE_RETIRED(19, 1, CHUNKY_SCRUB, JEWEL, LUMINOUS)
    100
    101DEFINE_CEPH_FEATURE_RETIRED(20, 1, MON_NULLROUTE, JEWEL, LUMINOUS)
    102
    103DEFINE_CEPH_FEATURE_RETIRED(21, 1, MON_GV, HAMMER, JEWEL)
    104DEFINE_CEPH_FEATURE(21, 2, SERVER_LUMINOUS)
    105DEFINE_CEPH_FEATURE(21, 2, RESEND_ON_SPLIT)  // overlap
    106DEFINE_CEPH_FEATURE(21, 2, RADOS_BACKOFF)    // overlap
    107DEFINE_CEPH_FEATURE(21, 2, OSDMAP_PG_UPMAP)  // overlap
    108DEFINE_CEPH_FEATURE(21, 2, CRUSH_CHOOSE_ARGS) // overlap
    109DEFINE_CEPH_FEATURE_RETIRED(22, 1, BACKFILL_RESERVATION, JEWEL, LUMINOUS)
    110
    111DEFINE_CEPH_FEATURE(23, 1, MSG_AUTH)
    112DEFINE_CEPH_FEATURE_RETIRED(24, 1, RECOVERY_RESERVATION, JEWEL, LUNINOUS)
    113
    114DEFINE_CEPH_FEATURE(25, 1, CRUSH_TUNABLES2)
    115DEFINE_CEPH_FEATURE(26, 1, CREATEPOOLID)
    116DEFINE_CEPH_FEATURE(27, 1, REPLY_CREATE_INODE)
    117DEFINE_CEPH_FEATURE_RETIRED(28, 1, OSD_HBMSGS, HAMMER, JEWEL)
    118DEFINE_CEPH_FEATURE(28, 2, SERVER_MIMIC)
    119DEFINE_CEPH_FEATURE(29, 1, MDSENC)
    120DEFINE_CEPH_FEATURE(30, 1, OSDHASHPSPOOL)
    121DEFINE_CEPH_FEATURE(31, 1, MON_SINGLE_PAXOS)  // deprecate me
    122DEFINE_CEPH_FEATURE_RETIRED(32, 1, OSD_SNAPMAPPER, JEWEL, LUMINOUS)
    123
    124DEFINE_CEPH_FEATURE_RETIRED(33, 1, MON_SCRUB, JEWEL, LUMINOUS)
    125
    126DEFINE_CEPH_FEATURE_RETIRED(34, 1, OSD_PACKED_RECOVERY, JEWEL, LUMINOUS)
    127
    128DEFINE_CEPH_FEATURE(35, 1, OSD_CACHEPOOL)
    129DEFINE_CEPH_FEATURE(36, 1, CRUSH_V2)
    130DEFINE_CEPH_FEATURE(37, 1, EXPORT_PEER)
    131DEFINE_CEPH_FEATURE(38, 1, OSD_ERASURE_CODES)
    132DEFINE_CEPH_FEATURE(38, 1, OSD_OSD_TMAP2OMAP) // overlap
    133DEFINE_CEPH_FEATURE(39, 1, OSDMAP_ENC)
    134DEFINE_CEPH_FEATURE(40, 1, MDS_INLINE_DATA)
    135DEFINE_CEPH_FEATURE(41, 1, CRUSH_TUNABLES3)
    136DEFINE_CEPH_FEATURE(41, 1, OSD_PRIMARY_AFFINITY) // overlap
    137DEFINE_CEPH_FEATURE(42, 1, MSGR_KEEPALIVE2)
    138DEFINE_CEPH_FEATURE(43, 1, OSD_POOLRESEND)
    139DEFINE_CEPH_FEATURE(44, 1, ERASURE_CODE_PLUGINS_V2)
    140DEFINE_CEPH_FEATURE_RETIRED(45, 1, OSD_SET_ALLOC_HINT, JEWEL, LUMINOUS)
    141
    142DEFINE_CEPH_FEATURE(46, 1, OSD_FADVISE_FLAGS)
    143DEFINE_CEPH_FEATURE_RETIRED(46, 1, OSD_REPOP, JEWEL, LUMINOUS) // overlap
    144DEFINE_CEPH_FEATURE_RETIRED(46, 1, OSD_OBJECT_DIGEST, JEWEL, LUMINOUS) // overlap
    145DEFINE_CEPH_FEATURE_RETIRED(46, 1, OSD_TRANSACTION_MAY_LAYOUT, JEWEL, LUMINOUS) // overlap
    146
    147DEFINE_CEPH_FEATURE(47, 1, MDS_QUOTA)
    148DEFINE_CEPH_FEATURE(48, 1, CRUSH_V4)
    149DEFINE_CEPH_FEATURE_RETIRED(49, 1, OSD_MIN_SIZE_RECOVERY, JEWEL, LUMINOUS)
    150DEFINE_CEPH_FEATURE_RETIRED(49, 1, OSD_PROXY_FEATURES, JEWEL, LUMINOUS) // overlap
    151
    152DEFINE_CEPH_FEATURE(50, 1, MON_METADATA)
    153DEFINE_CEPH_FEATURE(51, 1, OSD_BITWISE_HOBJ_SORT)
    154DEFINE_CEPH_FEATURE(52, 1, OSD_PROXY_WRITE_FEATURES)
    155DEFINE_CEPH_FEATURE(53, 1, ERASURE_CODE_PLUGINS_V3)
    156DEFINE_CEPH_FEATURE(54, 1, OSD_HITSET_GMT)
    157DEFINE_CEPH_FEATURE(55, 1, HAMMER_0_94_4)
    158DEFINE_CEPH_FEATURE(56, 1, NEW_OSDOP_ENCODING)
    159DEFINE_CEPH_FEATURE(57, 1, MON_STATEFUL_SUB)
    160DEFINE_CEPH_FEATURE(57, 1, MON_ROUTE_OSDMAP) // overlap
    161DEFINE_CEPH_FEATURE(57, 1, OSDSUBOP_NO_SNAPCONTEXT) // overlap
    162DEFINE_CEPH_FEATURE(57, 1, SERVER_JEWEL) // overlap
    163DEFINE_CEPH_FEATURE(58, 1, CRUSH_TUNABLES5)
    164DEFINE_CEPH_FEATURE(58, 1, NEW_OSDOPREPLY_ENCODING) // overlap
    165DEFINE_CEPH_FEATURE(58, 1, FS_FILE_LAYOUT_V2) // overlap
    166DEFINE_CEPH_FEATURE(59, 1, FS_BTIME)
    167DEFINE_CEPH_FEATURE(59, 1, FS_CHANGE_ATTR) // overlap
    168DEFINE_CEPH_FEATURE(59, 1, MSG_ADDR2) // overlap
    169DEFINE_CEPH_FEATURE(60, 1, OSD_RECOVERY_DELETES) // *do not share this bit*
    170DEFINE_CEPH_FEATURE(61, 1, CEPHX_V2)             // *do not share this bit*
    171
    172DEFINE_CEPH_FEATURE(62, 1, RESERVED)           // do not use; used as a sentinal
    173DEFINE_CEPH_FEATURE_DEPRECATED(63, 1, RESERVED_BROKEN, LUMINOUS) // client-facing
    174
    175
    176/*
    177 * Features supported.
    178 */
    179#define CEPH_FEATURES_SUPPORTED_DEFAULT		\
    180	(CEPH_FEATURE_NOSRCADDR |		\
    181	 CEPH_FEATURE_SERVER_NAUTILUS |		\
    182	 CEPH_FEATURE_FLOCK |			\
    183	 CEPH_FEATURE_SUBSCRIBE2 |		\
    184	 CEPH_FEATURE_MONNAMES |		\
    185	 CEPH_FEATURE_RECONNECT_SEQ |		\
    186	 CEPH_FEATURE_DIRLAYOUTHASH |		\
    187	 CEPH_FEATURE_PGID64 |			\
    188	 CEPH_FEATURE_PGPOOL3 |			\
    189	 CEPH_FEATURE_OSDENC |			\
    190	 CEPH_FEATURE_MONENC |			\
    191	 CEPH_FEATURE_CRUSH_TUNABLES |		\
    192	 CEPH_FEATURE_SERVER_LUMINOUS |		\
    193	 CEPH_FEATURE_RESEND_ON_SPLIT |		\
    194	 CEPH_FEATURE_RADOS_BACKOFF |		\
    195	 CEPH_FEATURE_OSDMAP_PG_UPMAP |		\
    196	 CEPH_FEATURE_CRUSH_CHOOSE_ARGS |	\
    197	 CEPH_FEATURE_MSG_AUTH |		\
    198	 CEPH_FEATURE_CRUSH_TUNABLES2 |		\
    199	 CEPH_FEATURE_REPLY_CREATE_INODE |	\
    200	 CEPH_FEATURE_SERVER_MIMIC |		\
    201	 CEPH_FEATURE_MDSENC |			\
    202	 CEPH_FEATURE_OSDHASHPSPOOL |		\
    203	 CEPH_FEATURE_OSD_CACHEPOOL |		\
    204	 CEPH_FEATURE_CRUSH_V2 |		\
    205	 CEPH_FEATURE_EXPORT_PEER |		\
    206	 CEPH_FEATURE_OSDMAP_ENC |		\
    207	 CEPH_FEATURE_MDS_INLINE_DATA |		\
    208	 CEPH_FEATURE_CRUSH_TUNABLES3 |		\
    209	 CEPH_FEATURE_OSD_PRIMARY_AFFINITY |	\
    210	 CEPH_FEATURE_MSGR_KEEPALIVE2 |		\
    211	 CEPH_FEATURE_OSD_POOLRESEND |		\
    212	 CEPH_FEATURE_MDS_QUOTA |		\
    213	 CEPH_FEATURE_CRUSH_V4 |		\
    214	 CEPH_FEATURE_NEW_OSDOP_ENCODING |	\
    215	 CEPH_FEATURE_SERVER_JEWEL |		\
    216	 CEPH_FEATURE_MON_STATEFUL_SUB |	\
    217	 CEPH_FEATURE_CRUSH_TUNABLES5 |		\
    218	 CEPH_FEATURE_NEW_OSDOPREPLY_ENCODING |	\
    219	 CEPH_FEATURE_MSG_ADDR2 |		\
    220	 CEPH_FEATURE_CEPHX_V2)
    221
    222#define CEPH_FEATURES_REQUIRED_DEFAULT	0
    223
    224#endif