Skip to content

Commit 75c9e98

Browse files
committed
Minor changes done to harmonize with Linux kernel v6.12
1 parent 9ff7a2d commit 75c9e98

File tree

9 files changed

+93
-13
lines changed

9 files changed

+93
-13
lines changed

config/HARMONIZED_LINUX_VERSION

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
6.11
1+
6.12

config/PROGRAM_VERSION

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
1.5.0
1+
1.6.0

src/kernel/include/linux/bits.h

Lines changed: 15 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -49,16 +49,24 @@
4949
#define GENMASK_INPUT_CHECK(h, l) 0
5050
#endif
5151

52-
#define __GENMASK(h, l) \
53-
(((~UL(0)) - (UL(1) << (l)) + 1) & \
54-
(~UL(0) >> (BITS_PER_LONG - 1 - (h))))
5552
#define GENMASK(h, l) \
5653
(GENMASK_INPUT_CHECK(h, l) + __GENMASK(h, l))
57-
58-
#define __GENMASK_ULL(h, l) \
59-
(((~ULL(0)) - (ULL(1) << (l)) + 1) & \
60-
(~ULL(0) >> (BITS_PER_LONG_LONG - 1 - (h))))
6154
#define GENMASK_ULL(h, l) \
6255
(GENMASK_INPUT_CHECK(h, l) + __GENMASK_ULL(h, l))
6356

57+
#if !defined(__ASSEMBLY__)
58+
/*
59+
* Missing asm support
60+
*
61+
* __GENMASK_U128() depends on _BIT128() which would not work
62+
* in the asm code, as it shifts an 'unsigned __init128' data
63+
* type instead of direct representation of 128 bit constants
64+
* such as long and unsigned long. The fundamental problem is
65+
* that a 128 bit constant will get silently truncated by the
66+
* gcc compiler.
67+
*/
68+
#define GENMASK_U128(h, l) \
69+
(GENMASK_INPUT_CHECK(h, l) + __GENMASK_U128(h, l))
70+
#endif
71+
6472
#endif /* __LINUX_BITS_H */

src/kernel/include/linux/compiler.h

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -159,7 +159,7 @@ void ftrace_likely_update(struct ftrace_likely_data *f, int val,
159159
#define annotate_unreachable() __annotate_unreachable(__COUNTER__)
160160

161161
/* Annotate a C jump table to allow objtool to follow the code flow */
162-
#define __annotate_jump_table __section(".rodata..c_jump_table")
162+
#define __annotate_jump_table __section(".rodata..c_jump_table,\"a\",@progbits #")
163163

164164
#else /* !CONFIG_OBJTOOL */
165165
#define annotate_reachable()
@@ -268,6 +268,9 @@ static inline void *offset_to_ptr(const int *off)
268268
/* &a[0] degrades to a pointer: a different type from an array */
269269
#define __must_be_array(a) BUILD_BUG_ON_ZERO(__same_type((a), &(a)[0]))
270270

271+
/* Require C Strings (i.e. NUL-terminated) lack the "nonstring" attribute. */
272+
#define __must_be_cstr(p) BUILD_BUG_ON_ZERO(__annotated(p, nonstring))
273+
271274
/*
272275
* This returns a constant expression while determining if an argument is
273276
* a constant expression, most importantly without evaluating the argument.

src/kernel/include/linux/delay.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -106,7 +106,7 @@ void usleep_range_state(unsigned long min, unsigned long max,
106106

107107
static inline void usleep_range(unsigned long min, unsigned long max) {
108108
#ifdef __QNX__
109-
udelay(min); /* TODO: check this; currently just using usleep min */
109+
udelay(min); /* TODO: check this; currently just using udelay min */
110110
#else
111111
usleep_range_state(min, max, TASK_UNINTERRUPTIBLE);
112112
#endif

src/kernel/include/linux/err.h

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -63,6 +63,9 @@ static inline void * __must_check ERR_PTR(long error)
6363
return (void *) error;
6464
}
6565

66+
/* Return the pointer in the percpu address space. */
67+
#define ERR_PTR_PCPU(error) ((void __percpu *)(unsigned long)ERR_PTR(error))
68+
6669
/**
6770
* PTR_ERR - Extract the error code from an error pointer.
6871
* @ptr: An error pointer.
@@ -73,6 +76,9 @@ static inline long __must_check PTR_ERR(__force const void *ptr)
7376
return (long) ptr;
7477
}
7578

79+
/* Read an error pointer from the percpu address space. */
80+
#define PTR_ERR_PCPU(ptr) (PTR_ERR((const void *)(__force const unsigned long)(ptr)))
81+
7682
/**
7783
* IS_ERR - Detect an error pointer.
7884
* @ptr: The pointer to check.
@@ -83,6 +89,9 @@ static inline bool __must_check IS_ERR(__force const void *ptr)
8389
return IS_ERR_VALUE((unsigned long)ptr);
8490
}
8591

92+
/* Read an error pointer from the percpu address space. */
93+
#define IS_ERR_PCPU(ptr) (IS_ERR((const void *)(__force const unsigned long)(ptr)))
94+
8695
/**
8796
* IS_ERR_OR_NULL - Detect an error pointer or a null pointer.
8897
* @ptr: The pointer to check.

src/kernel/include/linux/pci_ids.h

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -604,6 +604,7 @@
604604
#define PCI_DEVICE_ID_AMD_19H_M78H_DF_F3 0x12fb
605605
#define PCI_DEVICE_ID_AMD_1AH_M00H_DF_F3 0x12c3
606606
#define PCI_DEVICE_ID_AMD_1AH_M20H_DF_F3 0x16fb
607+
#define PCI_DEVICE_ID_AMD_1AH_M60H_DF_F3 0x124b
607608
#define PCI_DEVICE_ID_AMD_1AH_M70H_DF_F3 0x12bb
608609
#define PCI_DEVICE_ID_AMD_MI200_DF_F3 0x14d3
609610
#define PCI_DEVICE_ID_AMD_MI300_DF_F3 0x152b
@@ -2685,6 +2686,8 @@
26852686
#define PCI_DEVICE_ID_DCI_PCCOM8 0x0002
26862687
#define PCI_DEVICE_ID_DCI_PCCOM2 0x0004
26872688

2689+
#define PCI_VENDOR_ID_GLENFLY 0x6766
2690+
26882691
#define PCI_VENDOR_ID_INTEL 0x8086
26892692
#define PCI_DEVICE_ID_INTEL_EESSC 0x0008
26902693
#define PCI_DEVICE_ID_INTEL_HDA_CML_LP 0x02c8
@@ -2730,6 +2733,9 @@
27302733
#define PCI_DEVICE_ID_INTEL_82815_MC 0x1130
27312734
#define PCI_DEVICE_ID_INTEL_82815_CGC 0x1132
27322735
#define PCI_DEVICE_ID_INTEL_SST_TNG 0x119a
2736+
#define PCI_DEVICE_ID_INTEL_DSA_GNRD 0x11fb
2737+
#define PCI_DEVICE_ID_INTEL_DSA_DMR 0x1212
2738+
#define PCI_DEVICE_ID_INTEL_IAA_DMR 0x1216
27332739
#define PCI_DEVICE_ID_INTEL_82092AA_0 0x1221
27342740
#define PCI_DEVICE_ID_INTEL_82437 0x122d
27352741
#define PCI_DEVICE_ID_INTEL_82371FB_0 0x122e

src/kernel/include/uapi/linux/const.h

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,23 @@
5252
#define _BITUL(x) (_UL(1) << (x))
5353
#define _BITULL(x) (_ULL(1) << (x))
5454

55+
#if !defined(__ASSEMBLY__)
56+
/*
57+
* Missing asm support
58+
*
59+
* __BIT128() would not work in the asm code, as it shifts an
60+
* 'unsigned __init128' data type as direct representation of
61+
* 128 bit constants is not supported in the gcc compiler, as
62+
* they get silently truncated.
63+
*
64+
* TODO: Please revisit this implementation when gcc compiler
65+
* starts representing 128 bit constants directly like long
66+
* and unsigned long etc. Subsequently drop the comment for
67+
* GENMASK_U128() which would then start supporting asm code.
68+
*/
69+
#define _BIT128(x) ((unsigned __int128)(1) << (x))
70+
#endif
71+
5572
#define __ALIGN_KERNEL(x, a) __ALIGN_KERNEL_MASK(x, (__typeof__(x))(a) - 1)
5673
#define __ALIGN_KERNEL_MASK(x, mask) (((x) + (mask)) & ~(mask))
5774

src/kernel/include/uapi/linux/pci_regs.h

Lines changed: 39 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -656,9 +656,11 @@
656656
#define PCI_EXP_RTCTL_SENFEE 0x0002 /* System Error on Non-Fatal Error */
657657
#define PCI_EXP_RTCTL_SEFEE 0x0004 /* System Error on Fatal Error */
658658
#define PCI_EXP_RTCTL_PMEIE 0x0008 /* PME Interrupt Enable */
659-
#define PCI_EXP_RTCTL_CRSSVE 0x0010 /* CRS Software Visibility Enable */
659+
#define PCI_EXP_RTCTL_RRS_SVE 0x0010 /* Config RRS Software Visibility Enable */
660+
#define PCI_EXP_RTCTL_CRSSVE PCI_EXP_RTCTL_RRS_SVE /* compatibility */
660661
#define PCI_EXP_RTCAP 0x1e /* Root Capabilities */
661-
#define PCI_EXP_RTCAP_CRSVIS 0x0001 /* CRS Software Visibility capability */
662+
#define PCI_EXP_RTCAP_RRS_SV 0x0001 /* Config RRS Software Visibility */
663+
#define PCI_EXP_RTCAP_CRSVIS PCI_EXP_RTCAP_RRS_SV /* compatibility */
662664
#define PCI_EXP_RTSTA 0x20 /* Root Status */
663665
#define PCI_EXP_RTSTA_PME_RQ_ID 0x0000ffff /* PME Requester ID */
664666
#define PCI_EXP_RTSTA_PME 0x00010000 /* PME status */
@@ -762,6 +764,7 @@
762764
#define PCI_EXT_CAP_ID_DVSEC 0x23 /* Designated Vendor-Specific */
763765
#define PCI_EXT_CAP_ID_DLF 0x25 /* Data Link Feature */
764766
#define PCI_EXT_CAP_ID_PL_16GT 0x26 /* Physical Layer 16.0 GT/s */
767+
#define PCI_EXT_CAP_ID_NPEM 0x29 /* Native PCIe Enclosure Management */
765768
#define PCI_EXT_CAP_ID_PL_32GT 0x2A /* Physical Layer 32.0 GT/s */
766769
#define PCI_EXT_CAP_ID_DOE 0x2E /* Data Object Exchange */
767770
#define PCI_EXT_CAP_ID_MAX PCI_EXT_CAP_ID_DOE
@@ -1143,6 +1146,40 @@
11431146
#define PCI_PL_16GT_LE_CTRL_USP_TX_PRESET_MASK 0x000000F0
11441147
#define PCI_PL_16GT_LE_CTRL_USP_TX_PRESET_SHIFT 4
11451148

1149+
/* Native PCIe Enclosure Management */
1150+
#define PCI_NPEM_CAP 0x04 /* NPEM capability register */
1151+
#define PCI_NPEM_CAP_CAPABLE 0x00000001 /* NPEM Capable */
1152+
1153+
#define PCI_NPEM_CTRL 0x08 /* NPEM control register */
1154+
#define PCI_NPEM_CTRL_ENABLE 0x00000001 /* NPEM Enable */
1155+
1156+
/*
1157+
* Native PCIe Enclosure Management indication bits and Reset command bit
1158+
* are corresponding for capability and control registers.
1159+
*/
1160+
#define PCI_NPEM_CMD_RESET 0x00000002 /* Reset Command */
1161+
#define PCI_NPEM_IND_OK 0x00000004 /* OK */
1162+
#define PCI_NPEM_IND_LOCATE 0x00000008 /* Locate */
1163+
#define PCI_NPEM_IND_FAIL 0x00000010 /* Fail */
1164+
#define PCI_NPEM_IND_REBUILD 0x00000020 /* Rebuild */
1165+
#define PCI_NPEM_IND_PFA 0x00000040 /* Predicted Failure Analysis */
1166+
#define PCI_NPEM_IND_HOTSPARE 0x00000080 /* Hot Spare */
1167+
#define PCI_NPEM_IND_ICA 0x00000100 /* In Critical Array */
1168+
#define PCI_NPEM_IND_IFA 0x00000200 /* In Failed Array */
1169+
#define PCI_NPEM_IND_IDT 0x00000400 /* Device Type */
1170+
#define PCI_NPEM_IND_DISABLED 0x00000800 /* Disabled */
1171+
#define PCI_NPEM_IND_SPEC_0 0x01000000
1172+
#define PCI_NPEM_IND_SPEC_1 0x02000000
1173+
#define PCI_NPEM_IND_SPEC_2 0x04000000
1174+
#define PCI_NPEM_IND_SPEC_3 0x08000000
1175+
#define PCI_NPEM_IND_SPEC_4 0x10000000
1176+
#define PCI_NPEM_IND_SPEC_5 0x20000000
1177+
#define PCI_NPEM_IND_SPEC_6 0x40000000
1178+
#define PCI_NPEM_IND_SPEC_7 0x80000000
1179+
1180+
#define PCI_NPEM_STATUS 0x0c /* NPEM status register */
1181+
#define PCI_NPEM_STATUS_CC 0x00000001 /* Command Completed */
1182+
11461183
/* Data Object Exchange */
11471184
#define PCI_DOE_CAP 0x04 /* DOE Capabilities Register */
11481185
#define PCI_DOE_CAP_INT_SUP 0x00000001 /* Interrupt Support */

0 commit comments

Comments
 (0)