Page MenuHomeFreeBSD

x86: bump MAX_APIC_ID to 512
ClosedPublic

Authored by royger on Aug 7 2017, 10:23 AM.

Details

Summary

Introduce a new define to take int account the xAPIC ID limit, for
systems where x2APIC is not available/reliable.

Also change some of the usages of the APIC ID to use an unsigned int
(which is the correct storage type to deal with x2APIC IDs as found in
x2APIC MADT entries).

This allows booting FreeBSD on a box with 256 CPUs and APIC IDs up to
295:

FreeBSD/SMP: Multiprocessor System Detected: 256 CPUs
FreeBSD/SMP: 1 package(s) x 64 core(s) x 4 hardware threads
Package HW ID = 0
Core HW ID = 0

		CPU0 (BSP): APIC ID: 0
		CPU1 (AP/HT): APIC ID: 1
		CPU2 (AP/HT): APIC ID: 2
		CPU3 (AP/HT): APIC ID: 3

Core HW ID = 1

		CPU4 (AP): APIC ID: 4
		CPU5 (AP/HT): APIC ID: 5
		CPU6 (AP/HT): APIC ID: 6
		CPU7 (AP/HT): APIC ID: 7

Core HW ID = 2

		CPU8 (AP): APIC ID: 8
		CPU9 (AP/HT): APIC ID: 9
		CPU10 (AP/HT): APIC ID: 10
		CPU11 (AP/HT): APIC ID: 11

Core HW ID = 3

		CPU12 (AP): APIC ID: 12
		CPU13 (AP/HT): APIC ID: 13
		CPU14 (AP/HT): APIC ID: 14
		CPU15 (AP/HT): APIC ID: 15

Core HW ID = 4

		CPU16 (AP): APIC ID: 16
		CPU17 (AP/HT): APIC ID: 17
		CPU18 (AP/HT): APIC ID: 18
		CPU19 (AP/HT): APIC ID: 19

Core HW ID = 5

		CPU20 (AP): APIC ID: 20
		CPU21 (AP/HT): APIC ID: 21
		CPU22 (AP/HT): APIC ID: 22
		CPU23 (AP/HT): APIC ID: 23

Core HW ID = 6

		CPU24 (AP): APIC ID: 24
		CPU25 (AP/HT): APIC ID: 25
		CPU26 (AP/HT): APIC ID: 26
		CPU27 (AP/HT): APIC ID: 27

Core HW ID = 7

		CPU28 (AP): APIC ID: 28
		CPU29 (AP/HT): APIC ID: 29
		CPU30 (AP/HT): APIC ID: 30
		CPU31 (AP/HT): APIC ID: 31

Core HW ID = 10

		CPU32 (AP): APIC ID: 40
		CPU33 (AP/HT): APIC ID: 41
		CPU34 (AP/HT): APIC ID: 42
		CPU35 (AP/HT): APIC ID: 43

Core HW ID = 11

		CPU36 (AP): APIC ID: 44
		CPU37 (AP/HT): APIC ID: 45
		CPU38 (AP/HT): APIC ID: 46
		CPU39 (AP/HT): APIC ID: 47

Core HW ID = 12

		CPU40 (AP): APIC ID: 48
		CPU41 (AP/HT): APIC ID: 49
		CPU42 (AP/HT): APIC ID: 50
		CPU43 (AP/HT): APIC ID: 51

Core HW ID = 13

		CPU44 (AP): APIC ID: 52
		CPU45 (AP/HT): APIC ID: 53
		CPU46 (AP/HT): APIC ID: 54
		CPU47 (AP/HT): APIC ID: 55

Core HW ID = 14

		CPU48 (AP): APIC ID: 56
		CPU49 (AP/HT): APIC ID: 57
		CPU50 (AP/HT): APIC ID: 58
		CPU51 (AP/HT): APIC ID: 59

Core HW ID = 15

		CPU52 (AP): APIC ID: 60
		CPU53 (AP/HT): APIC ID: 61
		CPU54 (AP/HT): APIC ID: 62
		CPU55 (AP/HT): APIC ID: 63

Core HW ID = 18

		CPU56 (AP): APIC ID: 72
		CPU57 (AP/HT): APIC ID: 73
		CPU58 (AP/HT): APIC ID: 74
		CPU59 (AP/HT): APIC ID: 75

Core HW ID = 19

		CPU60 (AP): APIC ID: 76
		CPU61 (AP/HT): APIC ID: 77
		CPU62 (AP/HT): APIC ID: 78
		CPU63 (AP/HT): APIC ID: 79

Core HW ID = 22

		CPU64 (AP): APIC ID: 88
		CPU65 (AP/HT): APIC ID: 89
		CPU66 (AP/HT): APIC ID: 90
		CPU67 (AP/HT): APIC ID: 91

Core HW ID = 23

		CPU68 (AP): APIC ID: 92
		CPU69 (AP/HT): APIC ID: 93
		CPU70 (AP/HT): APIC ID: 94
		CPU71 (AP/HT): APIC ID: 95

Core HW ID = 24

		CPU72 (AP): APIC ID: 96
		CPU73 (AP/HT): APIC ID: 97
		CPU74 (AP/HT): APIC ID: 98
		CPU75 (AP/HT): APIC ID: 99

Core HW ID = 25

		CPU76 (AP): APIC ID: 100
		CPU77 (AP/HT): APIC ID: 101
		CPU78 (AP/HT): APIC ID: 102
		CPU79 (AP/HT): APIC ID: 103

Core HW ID = 26

		CPU80 (AP): APIC ID: 104
		CPU81 (AP/HT): APIC ID: 105
		CPU82 (AP/HT): APIC ID: 106
		CPU83 (AP/HT): APIC ID: 107

Core HW ID = 27

		CPU84 (AP): APIC ID: 108
		CPU85 (AP/HT): APIC ID: 109
		CPU86 (AP/HT): APIC ID: 110
		CPU87 (AP/HT): APIC ID: 111

Core HW ID = 28

		CPU88 (AP): APIC ID: 112
		CPU89 (AP/HT): APIC ID: 113
		CPU90 (AP/HT): APIC ID: 114
		CPU91 (AP/HT): APIC ID: 115

Core HW ID = 29

		CPU92 (AP): APIC ID: 116
		CPU93 (AP/HT): APIC ID: 117
		CPU94 (AP/HT): APIC ID: 118
		CPU95 (AP/HT): APIC ID: 119

Core HW ID = 30

		CPU96 (AP): APIC ID: 120
		CPU97 (AP/HT): APIC ID: 121
		CPU98 (AP/HT): APIC ID: 122
		CPU99 (AP/HT): APIC ID: 123

Core HW ID = 31

		CPU100 (AP): APIC ID: 124
		CPU101 (AP/HT): APIC ID: 125
		CPU102 (AP/HT): APIC ID: 126
		CPU103 (AP/HT): APIC ID: 127

Core HW ID = 32

		CPU104 (AP): APIC ID: 128
		CPU105 (AP/HT): APIC ID: 129
		CPU106 (AP/HT): APIC ID: 130
		CPU107 (AP/HT): APIC ID: 131

Core HW ID = 33

		CPU108 (AP): APIC ID: 132
		CPU109 (AP/HT): APIC ID: 133
		CPU110 (AP/HT): APIC ID: 134
		CPU111 (AP/HT): APIC ID: 135

Core HW ID = 34

		CPU112 (AP): APIC ID: 136
		CPU113 (AP/HT): APIC ID: 137
		CPU114 (AP/HT): APIC ID: 138
		CPU115 (AP/HT): APIC ID: 139

Core HW ID = 35

		CPU116 (AP): APIC ID: 140
		CPU117 (AP/HT): APIC ID: 141
		CPU118 (AP/HT): APIC ID: 142
		CPU119 (AP/HT): APIC ID: 143

Core HW ID = 36

		CPU120 (AP): APIC ID: 144
		CPU121 (AP/HT): APIC ID: 145
		CPU122 (AP/HT): APIC ID: 146
		CPU123 (AP/HT): APIC ID: 147

Core HW ID = 37

		CPU124 (AP): APIC ID: 148
		CPU125 (AP/HT): APIC ID: 149
		CPU126 (AP/HT): APIC ID: 150
		CPU127 (AP/HT): APIC ID: 151

Core HW ID = 38

		CPU128 (AP): APIC ID: 152
		CPU129 (AP/HT): APIC ID: 153
		CPU130 (AP/HT): APIC ID: 154
		CPU131 (AP/HT): APIC ID: 155

Core HW ID = 39

		CPU132 (AP): APIC ID: 156
		CPU133 (AP/HT): APIC ID: 157
		CPU134 (AP/HT): APIC ID: 158
		CPU135 (AP/HT): APIC ID: 159

Core HW ID = 40

		CPU136 (AP): APIC ID: 160
		CPU137 (AP/HT): APIC ID: 161
		CPU138 (AP/HT): APIC ID: 162
		CPU139 (AP/HT): APIC ID: 163

Core HW ID = 41

		CPU140 (AP): APIC ID: 164
		CPU141 (AP/HT): APIC ID: 165
		CPU142 (AP/HT): APIC ID: 166
		CPU143 (AP/HT): APIC ID: 167

Core HW ID = 42

		CPU144 (AP): APIC ID: 168
		CPU145 (AP/HT): APIC ID: 169
		CPU146 (AP/HT): APIC ID: 170
		CPU147 (AP/HT): APIC ID: 171

Core HW ID = 43

		CPU148 (AP): APIC ID: 172
		CPU149 (AP/HT): APIC ID: 173
		CPU150 (AP/HT): APIC ID: 174
		CPU151 (AP/HT): APIC ID: 175

Core HW ID = 44

		CPU152 (AP): APIC ID: 176
		CPU153 (AP/HT): APIC ID: 177
		CPU154 (AP/HT): APIC ID: 178
		CPU155 (AP/HT): APIC ID: 179

Core HW ID = 45

		CPU156 (AP): APIC ID: 180
		CPU157 (AP/HT): APIC ID: 181
		CPU158 (AP/HT): APIC ID: 182
		CPU159 (AP/HT): APIC ID: 183

Core HW ID = 48

		CPU160 (AP): APIC ID: 192
		CPU161 (AP/HT): APIC ID: 193
		CPU162 (AP/HT): APIC ID: 194
		CPU163 (AP/HT): APIC ID: 195

Core HW ID = 49

		CPU164 (AP): APIC ID: 196
		CPU165 (AP/HT): APIC ID: 197
		CPU166 (AP/HT): APIC ID: 198
		CPU167 (AP/HT): APIC ID: 199

Core HW ID = 50

		CPU168 (AP): APIC ID: 200
		CPU169 (AP/HT): APIC ID: 201
		CPU170 (AP/HT): APIC ID: 202
		CPU171 (AP/HT): APIC ID: 203

Core HW ID = 51

		CPU172 (AP): APIC ID: 204
		CPU173 (AP/HT): APIC ID: 205
		CPU174 (AP/HT): APIC ID: 206
		CPU175 (AP/HT): APIC ID: 207

Core HW ID = 52

		CPU176 (AP): APIC ID: 208
		CPU177 (AP/HT): APIC ID: 209
		CPU178 (AP/HT): APIC ID: 210
		CPU179 (AP/HT): APIC ID: 211

Core HW ID = 53

		CPU180 (AP): APIC ID: 212
		CPU181 (AP/HT): APIC ID: 213
		CPU182 (AP/HT): APIC ID: 214
		CPU183 (AP/HT): APIC ID: 215

Core HW ID = 54

		CPU184 (AP): APIC ID: 216
		CPU185 (AP/HT): APIC ID: 217
		CPU186 (AP/HT): APIC ID: 218
		CPU187 (AP/HT): APIC ID: 219

Core HW ID = 55

		CPU188 (AP): APIC ID: 220
		CPU189 (AP/HT): APIC ID: 221
		CPU190 (AP/HT): APIC ID: 222
		CPU191 (AP/HT): APIC ID: 223

Core HW ID = 56

		CPU192 (AP): APIC ID: 224
		CPU193 (AP/HT): APIC ID: 225
		CPU194 (AP/HT): APIC ID: 226
		CPU195 (AP/HT): APIC ID: 227

Core HW ID = 57

		CPU196 (AP): APIC ID: 228
		CPU197 (AP/HT): APIC ID: 229
		CPU198 (AP/HT): APIC ID: 230
		CPU199 (AP/HT): APIC ID: 231

Core HW ID = 58

		CPU200 (AP): APIC ID: 232
		CPU201 (AP/HT): APIC ID: 233
		CPU202 (AP/HT): APIC ID: 234
		CPU203 (AP/HT): APIC ID: 235

Core HW ID = 59

		CPU204 (AP): APIC ID: 236
		CPU205 (AP/HT): APIC ID: 237
		CPU206 (AP/HT): APIC ID: 238
		CPU207 (AP/HT): APIC ID: 239

Core HW ID = 60

		CPU208 (AP): APIC ID: 240
		CPU209 (AP/HT): APIC ID: 241
		CPU210 (AP/HT): APIC ID: 242
		CPU211 (AP/HT): APIC ID: 243

Core HW ID = 61

		CPU212 (AP): APIC ID: 244
		CPU213 (AP/HT): APIC ID: 245
		CPU214 (AP/HT): APIC ID: 246
		CPU215 (AP/HT): APIC ID: 247

Core HW ID = 62

		CPU216 (AP): APIC ID: 248
		CPU217 (AP/HT): APIC ID: 249
		CPU218 (AP/HT): APIC ID: 250
		CPU219 (AP/HT): APIC ID: 251

Core HW ID = 63

		CPU220 (AP): APIC ID: 252
		CPU221 (AP/HT): APIC ID: 253
		CPU222 (AP/HT): APIC ID: 254
		CPU223 (AP/HT): APIC ID: 255

Core HW ID = 64

		CPU224 (AP): APIC ID: 256
		CPU225 (AP/HT): APIC ID: 257
		CPU226 (AP/HT): APIC ID: 258
		CPU227 (AP/HT): APIC ID: 259

Core HW ID = 65

		CPU228 (AP): APIC ID: 260
		CPU229 (AP/HT): APIC ID: 261
		CPU230 (AP/HT): APIC ID: 262
		CPU231 (AP/HT): APIC ID: 263

Core HW ID = 68

		CPU232 (AP): APIC ID: 272
		CPU233 (AP/HT): APIC ID: 273
		CPU234 (AP/HT): APIC ID: 274
		CPU235 (AP/HT): APIC ID: 275

Core HW ID = 69

		CPU236 (AP): APIC ID: 276
		CPU237 (AP/HT): APIC ID: 277
		CPU238 (AP/HT): APIC ID: 278
		CPU239 (AP/HT): APIC ID: 279

Core HW ID = 70

		CPU240 (AP): APIC ID: 280
		CPU241 (AP/HT): APIC ID: 281
		CPU242 (AP/HT): APIC ID: 282
		CPU243 (AP/HT): APIC ID: 283

Core HW ID = 71

		CPU244 (AP): APIC ID: 284
		CPU245 (AP/HT): APIC ID: 285
		CPU246 (AP/HT): APIC ID: 286
		CPU247 (AP/HT): APIC ID: 287

Core HW ID = 72

		CPU248 (AP): APIC ID: 288
		CPU249 (AP/HT): APIC ID: 289
		CPU250 (AP/HT): APIC ID: 290
		CPU251 (AP/HT): APIC ID: 291

Core HW ID = 73

		CPU252 (AP): APIC ID: 292
		CPU253 (AP/HT): APIC ID: 293
		CPU254 (AP/HT): APIC ID: 294
		CPU255 (AP/HT): APIC ID: 295

Submitted by: kib

Diff Detail

Repository
rS FreeBSD src repository - subversion
Lint
Lint Not Applicable
Unit
Tests Not Applicable

Event Timeline

This revision is now accepted and ready to land.Aug 7 2017, 11:09 AM
This revision was automatically updated to reflect the committed changes.