[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <CAHk-=wj5cOA+fbGeV15kvwe6YGT54Wsk8F2UGoekVQLTPJz_pw@mail.gmail.com>
Date: Wed, 13 Jul 2022 11:33:22 -0700
From: Linus Torvalds <torvalds@...ux-foundation.org>
To: Guenter Roeck <linux@...ck-us.net>,
Peter Zijlstra <peterz@...radead.org>,
Borislav Petkov <bp@...e.de>
Cc: Naresh Kamboju <naresh.kamboju@...aro.org>,
Greg Kroah-Hartman <gregkh@...uxfoundation.org>,
kvm list <kvm@...r.kernel.org>,
Linux Kernel Mailing List <linux-kernel@...r.kernel.org>,
stable <stable@...r.kernel.org>,
Andrew Morton <akpm@...ux-foundation.org>,
Shuah Khan <shuah@...nel.org>, patches@...nelci.org,
lkft-triage@...ts.linaro.org, Pavel Machek <pavel@...x.de>,
Jon Hunter <jonathanh@...dia.com>,
Florian Fainelli <f.fainelli@...il.com>,
Sudip Mukherjee <sudipm.mukherjee@...il.com>,
Slade Watkins <slade@...dewatkins.com>,
Sean Christopherson <seanjc@...gle.com>,
Paolo Bonzini <pbonzini@...hat.com>,
Thomas Gleixner <tglx@...utronix.de>,
Ingo Molnar <mingo@...hat.com>,
Dave Hansen <dave.hansen@...ux.intel.com>,
X86 ML <x86@...nel.org>, "H. Peter Anvin" <hpa@...or.com>,
Alex Bennée <alex.bennee@...aro.org>,
Anders Roxell <anders.roxell@...aro.org>
Subject: Re: [PATCH 5.15 00/78] 5.15.55-rc1 review
On Wed, Jul 13, 2022 at 6:34 AM Guenter Roeck <linux@...ck-us.net> wrote:
>
> Looking into the log, I don't think that message is related to the crash.
>
> ...
> [ 105.653777] Modules linked in: x86_pkg_temp_thermal
> [ 105.902123] ---[ end trace cec99cae36bcbfd7 ]---
> [ 105.902124] RIP: 0010:xaddw_ax_dx+0x9/0x10 <--- crash
> [ 105.902126] Code: 00 0f bb d0 c3 cc cc cc cc 48 0f bb d0 c3 cc cc
Yeah, the code you snipped, shows
20: 66 0f c1 d0 xadd %dx,%ax
24: c3 ret
25: cc int3
26: cc int3
27: cc int3
28: cc int3
29:* 0f 1f 80 00 00 00 00 nopl 0x0(%rax) <-- trapping instruction
30: 0f c1 d0 xadd %edx,%eax
33: c3 ret
34: cc int3
35: cc int3
36: cc int3
37: cc int3
38: 48 0f c1 d0 xadd %rdx,%rax
3c: c3 ret
3d: cc int3
and that's a bit odd.
It says "xaddw_ax_dx+0x9/0x10", but I think somebody jumped to
"xaddw_ax_dx+8", hit the 'int3', and the RIP points to the next
instruction (because that's how int3 works).
And the fastop code says:
* fastop functions have a special calling convention:
...
* Moreover, they are all exactly FASTOP_SIZE bytes long,
but that is clearly *NOT* the case for xaddw_ax_dx, because it's 16
bytes in size, and the other ones are 8 bytes. That's where the "nopl"
comes from: it's the alignment instruction to the next fastop
function.
Compare that to the word-sized 'xaddl' case rigth afterwards: that one
*is* just 8 bytes in size, so the 64-byte 'xaddq' comes 8 bytes aftrer
it, and there's no 7-byte padding nop-instruction.
So I think that that is where the "xaddw_ax_dx+8" comes from: some
code assumes that FASTOP_SIZE is 8, but that xaddw_ax_dx case was
actually 9 bytes and thus got that "int3 + padding" in the next 8
bytes.
The whole kvm x86 emulation thiing is quite complicated and has lots
of instruction size #defines and magic.
I'm not familiar enough with it to go "Ahh, it's obviously XYZ", but
I'm sure PeterZ and Borislav know exactly what's going on.
Linus
Powered by blists - more mailing lists