On Thu, Aug 08 2024 at 09:33, Linus Torvalds wrote: > On Thu, 8 Aug 2024 at 09:12, Thomas Gleixner <tglx@xxxxxxxxxxxxx> wrote: >> It uses $$divU which is at $$divoI + 0x250. I validated that in the >> disassembly. > > Well, that does support "maybe we have a page crosser issue", but it's > not quite at the delayed branch. > > Because that would mean that $$divU starts at 0x41218ec0, and that > means that there are 80 instructions from the start of $$divU to the > end of that 0x41218xxx page. > > And if I counted instructions right (I don't have a disassembler, so > I'm just looking at the libgcc sources), that puts the page crosser > not quite at the delayed branch slot, but it does put it somewhere > roughly at or around > > ds temp,arg1,temp /* 29th divide step */ > addc retreg,retreg,retreg /* shift retreg with/into carry */ > > so it's around the last few bits of the result. The ones we get wrong. > > Which is intriguing, but honestly, I don't see how we could get itlb > misses horribly wrong and not crash left and right. Here is the disassembly from my latest crashing debug kernel which shifts it up a couple of pages. Add 0x10 or sub 0x20 to make it work. 4121dec0: 37 21 3f ff ldo -1(r25),r1 4121dec4: 08 39 22 00 and,= r25,r1,r0 4121dec8: e8 00 00 88 b,l 4121df14 <$$divoI+0x2a4>,r0 4121decc: b3 20 20 00 addi,tc,= 0,r25,r0 4121ded0: 08 1a 02 5d copy r26,ret1 4121ded4: d3 21 39 f0 extrw,u,= r25,15,16,r1 4121ded8: d3 bd 19 f0 extrw,u ret1,15,16,ret1 4121dedc: 08 39 02 59 or r25,r1,r25 4121dee0: 34 1a 01 98 ldi cc,r26 4121dee4: d3 21 3a f8 extrw,u,= r25,23,8,r1 4121dee8: d3 bd 1a e8 extrw,u ret1,23,24,ret1 4121deec: 08 39 02 59 or r25,r1,r25 4121def0: 34 01 01 54 ldi aa,r1 4121def4: d3 20 3b 7c extrw,u,= r25,27,4,r0 4121def8: d3 bd 1b 64 extrw,u ret1,27,28,ret1 4121defc: 0b 59 22 00 and,= r25,r26,r0 4121df00: d3 bd 1b a2 extrw,u ret1,29,30,ret1 4121df04: 08 39 22 00 and,= r25,r1,r0 4121df08: d3 bd 1b c1 extrw,u ret1,30,31,ret1 4121df0c: e8 40 c0 02 bv,n r0(rp) 4121df10: 08 00 02 40 nop 4121df18: 97 21 00 00 subi 0,r25,r1 4121df1c: 08 20 04 40 ds r0,r1,r0 4121df20: 0b 5a 06 1d add r26,r26,ret1 4121df24: 0b 20 04 41 ds r0,r25,r1 4121df28: 0b bd 07 1d add,c ret1,ret1,ret1 4121df2c: 0b 21 04 41 ds r1,r25,r1 4121df30: 0b bd 07 1d add,c ret1,ret1,ret1 4121df34: 0b 21 04 41 ds r1,r25,r1 4121df38: 0b bd 07 1d add,c ret1,ret1,ret1 4121df3c: 0b 21 04 41 ds r1,r25,r1 4121df40: 0b bd 07 1d add,c ret1,ret1,ret1 4121df44: 0b 21 04 41 ds r1,r25,r1 4121df48: 0b bd 07 1d add,c ret1,ret1,ret1 4121df4c: 0b 21 04 41 ds r1,r25,r1 4121df50: 0b bd 07 1d add,c ret1,ret1,ret1 4121df54: 0b 21 04 41 ds r1,r25,r1 4121df58: 0b bd 07 1d add,c ret1,ret1,ret1 4121df5c: 0b 21 04 41 ds r1,r25,r1 4121df60: 0b bd 07 1d add,c ret1,ret1,ret1 4121df64: 0b 21 04 41 ds r1,r25,r1 4121df68: 0b bd 07 1d add,c ret1,ret1,ret1 4121df6c: 0b 21 04 41 ds r1,r25,r1 4121df70: 0b bd 07 1d add,c ret1,ret1,ret1 4121df74: 0b 21 04 41 ds r1,r25,r1 4121df78: 0b bd 07 1d add,c ret1,ret1,ret1 4121df7c: 0b 21 04 41 ds r1,r25,r1 4121df80: 0b bd 07 1d add,c ret1,ret1,ret1 4121df84: 0b 21 04 41 ds r1,r25,r1 4121df88: 0b bd 07 1d add,c ret1,ret1,ret1 4121df8c: 0b 21 04 41 ds r1,r25,r1 4121df90: 0b bd 07 1d add,c ret1,ret1,ret1 4121df94: 0b 21 04 41 ds r1,r25,r1 4121df98: 0b bd 07 1d add,c ret1,ret1,ret1 4121df9c: 0b 21 04 41 ds r1,r25,r1 4121dfa0: 0b bd 07 1d add,c ret1,ret1,ret1 4121dfa4: 0b 21 04 41 ds r1,r25,r1 4121dfa8: 0b bd 07 1d add,c ret1,ret1,ret1 4121dfac: 0b 21 04 41 ds r1,r25,r1 4121dfb0: 0b bd 07 1d add,c ret1,ret1,ret1 4121dfb4: 0b 21 04 41 ds r1,r25,r1 4121dfb8: 0b bd 07 1d add,c ret1,ret1,ret1 4121dfbc: 0b 21 04 41 ds r1,r25,r1 4121dfc0: 0b bd 07 1d add,c ret1,ret1,ret1 4121dfc4: 0b 21 04 41 ds r1,r25,r1 4121dfc8: 0b bd 07 1d add,c ret1,ret1,ret1 4121dfcc: 0b 21 04 41 ds r1,r25,r1 4121dfd0: 0b bd 07 1d add,c ret1,ret1,ret1 4121dfd4: 0b 21 04 41 ds r1,r25,r1 4121dfd8: 0b bd 07 1d add,c ret1,ret1,ret1 4121dfdc: 0b 21 04 41 ds r1,r25,r1 4121dfe0: 0b bd 07 1d add,c ret1,ret1,ret1 4121dfe4: 0b 21 04 41 ds r1,r25,r1 4121dfe8: 0b bd 07 1d add,c ret1,ret1,ret1 4121dfec: 0b 21 04 41 ds r1,r25,r1 4121dff0: 0b bd 07 1d add,c ret1,ret1,ret1 4121dff4: 0b 21 04 41 ds r1,r25,r1 4121dff8: 0b bd 07 1d add,c ret1,ret1,ret1 4121dffc: 0b 21 04 41 ds r1,r25,r1 4121e000: 0b bd 07 1d add,c ret1,ret1,ret1 4121e004: 0b 21 04 41 ds r1,r25,r1 4121e008: 0b bd 07 1d add,c ret1,ret1,ret1 4121e00c: 0b 21 04 41 ds r1,r25,r1 4121e010: 0b bd 07 1d add,c ret1,ret1,ret1 4121e014: 0b 21 04 41 ds r1,r25,r1 4121e018: 0b bd 07 1d add,c ret1,ret1,ret1 4121e01c: 0b 21 04 41 ds r1,r25,r1 4121e020: e8 40 c0 00 bv r0(rp) 4121e024: 0b bd 07 1d add,c ret1,ret1,ret1 4121e028: f3 20 0c 00 depd,* r0,31,32,r25 4121e02c: 8f 20 61 10 cmpib,> 0,r25,4121e0bc <$$divoI+0x44c> 4121e030: 08 00 02 40 nop 4121e034: e8 19 40 00 blr r25,r0 4121e038: 08 00 02 40 nop 4121e03c: b3 20 20 00 addi,tc,= 0,r25,r0 4121e040: 08 00 02 40 nop 4121e044: e8 40 c0 00 bv r0(rp) 4121e048: 08 1a 02 5d copy r26,ret1 4121e04c: e8 40 c0 00 bv r0(rp) 4121e050: d3 5d 1b c1 extrw,u r26,30,31,ret1 4121e054: e8 00 01 c2 b,l,n 4121e13c <$$divI_16+0x3c>,r0 4121e058: 08 00 02 40 nop 4121e05c: e8 40 c0 00 bv r0(rp) 4121e060: d3 5d 1b a2 extrw,u r26,29,30,ret1 4121e064: e8 00 02 2a b,l,n 4121e180 <$$divI_16+0x80>,r0 4121e068: 08 00 02 40 nop 4121e06c: e8 00 02 aa b,l,n 4121e1c8 <$$divI_16+0xc8>,r0 4121e070: 08 00 02 40 nop 4121e074: e8 00 06 9a b,l,n 4121e3c8 <$$divU_17+0xbc>,r0 4121e078: 08 00 02 40 nop 4121e07c: e8 40 c0 00 bv r0(rp) 4121e080: d3 5d 1b 83 extrw,u r26,28,29,ret1 4121e084: e8 00 07 12 b,l,n 4121e414 <$$divU_17+0x108>,r0 4121e088: 08 00 02 40 nop 4121e08c: e8 00 02 9a b,l,n 4121e1e0 <$$divI_16+0xe0>,r0 4121e090: 08 00 02 40 nop 4121e094: e8 1f 1d 0d b,l 4121df20 <$$divoI+0x2b0>,r0 4121e098: 08 20 04 40 ds r0,r1,r0 4121e09c: e8 00 03 fa b,l,n 4121e2a0 <$$divI_16+0x1a0>,r0 4121e0a0: 08 00 02 40 nop 4121e0a4: e8 1f 1c ed b,l 4121df20 <$$divoI+0x2b0>,r0 4121e0a8: 08 20 04 40 ds r0,r1,r0 4121e0ac: e8 00 07 02 b,l,n 4121e434 <$$divU_17+0x128>,r0 4121e0b0: 08 00 02 40 nop 4121e0b4: e8 00 04 22 b,l,n 4121e2cc <$$divI_16+0x1cc>,r0 4121e0b8: 08 00 02 40 nop 4121e0bc: 0b 3a 04 00 sub r26,r25,r0 4121e0c0: e8 40 c0 00 bv r0(rp) 4121e0c4: 08 00 07 1d add,c r0,r0,ret1