Skip to content

Commit dc65f95

Browse files
author
Delphix Engineering
committed
Merge branch 'refs/heads/upstream-HEAD' into repo-HEAD
2 parents 8731370 + 32d240d commit dc65f95

10 files changed

+39
-22
lines changed

src/addrxlat/x86_64.c

Lines changed: 25 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -108,21 +108,30 @@
108108
/** End of direct physical mapping in Linux between 2.6.11 and 2.6.27 */
109109
#define LINUX_DIRECTMAP_END_2_6_11 0xffffc0ffffffffff
110110

111-
/** Start of direct physical mapping in Linux 2.6.27+ */
111+
/** Start of direct physical mapping in Linux between 2.6.27 and 2.6.31 */
112112
#define LINUX_DIRECTMAP_START_2_6_27 0xffff880000000000
113113
/** End of direct physical mapping in Linux between 2.6.27 and 2.6.31 */
114114
#define LINUX_DIRECTMAP_END_2_6_27 0xffffc0ffffffffff
115115

116-
/** Start of direct physical mapping in Linux 2.6.31+ */
116+
/** Start of direct physical mapping in Linux between 2.6.31 and 4.2 */
117117
#define LINUX_DIRECTMAP_START_2_6_31 LINUX_DIRECTMAP_START_2_6_27
118-
/** End of direct physical mapping in Linux 2.6.31+ */
118+
/** End of direct physical mapping in Linux between 2.6.31 and 4.2 */
119119
#define LINUX_DIRECTMAP_END_2_6_31 0xffffc7ffffffffff
120120

121-
/** Start of direct physical mapping with 5-level paging */
122-
#define LINUX_DIRECTMAP_START_5LEVEL 0xff11000000000000
121+
/** Start of direct physical mapping in Linux 4.2+ */
122+
#define LINUX_DIRECTMAP_START_4_2 0xffff888000000000
123+
/** End of direct physical mapping in Linux 4.2+ */
124+
#define LINUX_DIRECTMAP_END_4_2 0xffffc8ffffffffff
123125

124-
/** End of direct physical mapping with 5-level paging */
125-
#define LINUX_DIRECTMAP_END_5LEVEL 0xff90ffffffffffff
126+
/** Start of direct physical mapping with 5-level paging before 4.2 */
127+
#define LINUX_DIRECTMAP_START_5L 0xff10000000000000
128+
/** End of direct physical mapping with 5-level paging before 4.2 */
129+
#define LINUX_DIRECTMAP_END_5L 0xff8fffffffffffff
130+
131+
/** Start of direct physical mapping with 5-level paging in 4.2+ */
132+
#define LINUX_DIRECTMAP_START_5L_4_2 0xff11000000000000
133+
/** End of direct physical mapping with 5-level paging in 4.2+ */
134+
#define LINUX_DIRECTMAP_END_5L_4_2 0xff90ffffffffffff
126135

127136
/** AMD64 (Intel 64) page table step function.
128137
* @param step Current step state.
@@ -306,11 +315,11 @@ linux_directmap_by_pgt(struct sys_region *rgn,
306315
}
307316

308317
if (step.meth->param.pgt.pf.nfields == 6) {
309-
rgn->first = LINUX_DIRECTMAP_START_5LEVEL;
310-
end = LINUX_DIRECTMAP_END_5LEVEL;
318+
rgn->first = LINUX_DIRECTMAP_START_5L;
319+
end = LINUX_DIRECTMAP_END_5L_4_2;
311320
} else {
312321
rgn->first = LINUX_DIRECTMAP_START_2_6_31;
313-
end = LINUX_DIRECTMAP_END_2_6_31;
322+
end = LINUX_DIRECTMAP_END_4_2;
314323
}
315324
status = lowest_mapped(&step, &rgn->first, end);
316325
if (status == ADDRXLAT_OK) {
@@ -404,11 +413,14 @@ set_pgt_fallback(addrxlat_sys_t *sys, addrxlat_sys_meth_t idx)
404413
static addrxlat_status
405414
linux_rdirect_map(struct os_init_data *ctl)
406415
{
407-
/** Possible direct mapping locations (if not randomized). */
416+
/** Possible direct mapping locations (if not randomized).
417+
* Try more recent kernels first.
418+
*/
408419
static const addrxlat_addr_t fixed_loc[] = {
409-
LINUX_DIRECTMAP_START_2_6_0,
410-
LINUX_DIRECTMAP_START_2_6_11,
420+
LINUX_DIRECTMAP_START_4_2,
411421
LINUX_DIRECTMAP_START_2_6_31,
422+
LINUX_DIRECTMAP_START_2_6_11,
423+
LINUX_DIRECTMAP_START_2_6_0,
412424
};
413425

414426
struct sys_region layout[2];

tests/xlat-linux-x86_64-2.6.27-cr3-xen.data

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
0000000000000000*500
1111
# direct mapping (768M)
1212
@0x401af880
13-
000000003ff86067 0000000000000000*128
13+
000000003ff86067 0000000000000000*238
1414
@0x3ff86000
1515
000000003ff85067
1616
0000000000000000*511

tests/xlat-linux-x86_64-2.6.27-nover.data

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
# direct mapping (64G)
99
@0x1e10880
1010
000000000221b067
11-
0000000000000000*127
11+
0000000000000000*238
1212
@0x221b000
1313
80000000000001e3*64+40000000
1414
0000000000000000*448

tests/xlat-linux-x86_64-2.6.31-cr3.data

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@
1010
# direct mapping (64T)
1111
@0x2e10880
1212
000000000221b067*128+1000
13+
0000000000000000*68
1314
@0x221b000
1415
80000000000001e3*65536+40000000
1516
# 2.6.31+ VMEMMAP

tests/xlat-linux-x86_64-2.6.31-kvaddr.data

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
# direct mapping (62T)
1111
@0xffffffff81e10880
1212
000000000221b067*124+1000
13-
0000000000000000*4
13+
0000000000000000*72
1414
@0xffff88000221b000
1515
80000000000001e3*65536+40000000
1616
# 2.6.31+ VMEMMAP

tests/xlat-linux-x86_64-2.6.31-nover-reloc.data

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@
88
# direct mapping (64T)
99
@0x2e10880
1010
000000000221b067*128+1000
11+
0000000000000000*68
1112
@0x221b000
1213
80000000000001e3*65536+40000000
1314
# 2.6.31+ VMEMMAP

tests/xlat-linux-x86_64-2.6.31-nover-xen.data

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
00000000010001e1
88
# direct mapping (2G)
99
@0x1e10880
10-
000000000221b067 0000000000000000*128
10+
000000000221b067 0000000000000000*195
1111
@0x221b000
1212
000000000221c067 000000000221d067
1313
0000000000000000*510

tests/xlat-linux-x86_64-2.6.31-nover.data

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@
88
# direct mapping (64T)
99
@0x1e10880
1010
000000000221b067*128+1000
11+
0000000000000000*68
1112
@0x221b000
1213
80000000000001e3*65536+40000000
1314
# 2.6.31+ VMEMMAP

tests/xlat-linux-x86_64-4.13-nover.data

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,9 @@
77
00000000250001e1
88
# direct mapping (64T)
99
@0x25c09880
10+
0000000000000000
1011
00000000263cb067*128+1000
12+
0000000000000000*67
1113
@0x263cb000
1214
80000000000001e3*65536+40000000
1315
# 2.6.31+ VMEMMAP

tests/xlat-linux-x86_64-4.13-nover.expect

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -7,15 +7,15 @@
77

88
@direct: LINEAR
99
target_as=KPHYSADDR
10-
off=0x780000000000
10+
off=0x778000000000
1111

1212
@ktext: LINEAR
1313
target_as=KPHYSADDR
1414
off=0xa4000000
1515

1616
@rdirect: LINEAR
1717
target_as=KVADDR
18-
off=0xffff880000000000
18+
off=0xffff888000000000
1919

2020
@machphys_kphys: LINEAR
2121
target_as=KPHYSADDR
@@ -33,9 +33,9 @@ ffff800000000000-ffffffffffffffff: @rootpgt
3333
KV -> PHYS:
3434
0-7fffffffffff: @rootpgt
3535
800000000000-ffff7fffffffffff: NONE
36-
ffff800000000000-ffff87ffffffffff: @rootpgt
37-
ffff880000000000-ffffc7ffffffffff: @direct
38-
ffffc80000000000-ffffffff81c08fff: @rootpgt
36+
ffff800000000000-ffff887fffffffff: @rootpgt
37+
ffff888000000000-ffffc87fffffffff: @direct
38+
ffffc88000000000-ffffffff81c08fff: @rootpgt
3939
ffffffff81c09000-ffffffff81c09fff: @ktext
4040
ffffffff81c0a000-ffffffffffffffff: @rootpgt
4141

0 commit comments

Comments
 (0)