linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
From: Borislav Petkov <bp@suse.de>
To: Linus Torvalds <torvalds@linux-foundation.org>
Cc: Bob Peterson <rpeterso@redhat.com>,
	Andy Lutomirski <luto@amacapital.net>,
	Andreas Gruenbacher <agruenba@redhat.com>,
	Peter Zijlstra <peterz@infradead.org>,
	Andy Lutomirski <luto@kernel.org>,
	LKML <linux-kernel@vger.kernel.org>,
	Steven Whitehouse <swhiteho@redhat.com>,
	Mel Gorman <mgorman@techsingularity.net>,
	linux-mm <linux-mm@kvack.org>
Subject: Re: CONFIG_VMAP_STACK, on-stack struct, and wake_up_bit
Date: Thu, 27 Oct 2016 00:45:16 +0200	[thread overview]
Message-ID: <20161026224516.4npimwrsxdui27k2@pd.tnic> (raw)
In-Reply-To: <CA+55aFxfb-kY40P4HgYnhehx--TuwV7K7C4J4jdx9nan7u0s1A@mail.gmail.com>

On Wed, Oct 26, 2016 at 02:30:49PM -0700, Linus Torvalds wrote:
> Ok, similar issue, I think - passing a non-1:1 address to __phys_addr().
> 
> But the call trace has nothing to do with gfs2 or the bitlocks:
> 
> > [    2.504561] Call Trace:
> > [    2.507005]   save_microcode_in_initrd_amd+0x31/0x106
> > [    2.513778]   save_microcode_in_initrd+0x3c/0x45
> > [    2.526110]   do_one_initcall+0x50/0x180
> > [    2.531756]   ? set_debug_rodata+0x12/0x12
> > [    2.537573]   kernel_init_freeable+0x194/0x230
> > [    2.543740]   ? rest_init+0x80/0x80
> > [    2.548952]   kernel_init+0xe/0x100
> > [    2.554164]   ret_from_fork+0x25/0x30
> 
> I think this might be the
> 
>         cont    = __pa(container);
> 
> line in save_microcode_in_initrd_amd().
> 
> I see that Borislav is busy with some x86/microcode patches, I suspect
> he already hit this. Adding Borislav to the cc.

Hmm, I guess that fires because that container thing is a static pointer
so it is >= PAGE_OFFSET. But I might be wrong, it is too late here for
brain to work.

In any case, looking at his Code:

   0:   48 89 f8                mov    %rdi,%rax
   3:   72 28                   jb     0x2d
   5:   48 2b 05 7b a0 dc 00    sub    0xdca07b(%rip),%rax        # 0xdca087
   c:   48 05 00 00 00 80       add    $0xffffffff80000000,%rax
  12:   48 39 c7                cmp    %rax,%rdi
  				^^^^^^^^^^^^^^^^

it could be this comparison here:

RAX: fffff39132a822fc, RDI: ffff8800b2a822fc

  15:   72 14                   jb     0x2b

... which sends us to the UD2.

  17:   0f b6 0d 6a 75 ee 00    movzbl 0xee756a(%rip),%ecx        # 0xee7588

We might end up at 0x2b from here too - that's !phys_addr_valid(x) - but
ECX is 0 while it should be 36...

  1e:   48 89 c2                mov    %rax,%rdx
  21:   48 d3 ea                shr    %cl,%rdx
  24:   48 85 d2                test   %rdx,%rdx
  27:   75 02                   jne    0x2b
  29:   5d                      pop    %rbp
  2a:   c3                      retq   
  2b:*  0f 0b                   ud2             <-- trapping instruction
  2d:   48 03 05 7b 5b da 00    add    0xda5b7b(%rip),%rax        # 0xda5baf
  34:   48 81 ff ff ff ff 3f    cmp    $0x3fffffff,%rdi
  3b:   76 ec                   jbe    0x29
  3d:   0f 0b                   ud2    
  3f:   0f                      .byte 0xf

But again, I could be already sleeping and this could be me talking in
my sleep so don't take it too seriously.

In any case, this code was flaky and fragile for many reasons and it is
why this whole wankery is gone in the microcode loader now.

> Can you re-try without the AMD microcode driver for now?

Yeah, just boot with "dis_ucode_ldr".

-- 
Regards/Gruss,
    Boris.

SUSE Linux GmbH, GF: Felix ImendA?rffer, Jane Smithard, Graham Norton, HRB 21284 (AG NA 1/4 rnberg)
-- 

--
To unsubscribe, send a message with 'unsubscribe linux-mm' in
the body to majordomo@kvack.org.  For more info on Linux MM,
see: http://www.linux-mm.org/ .
Don't email: <a href=mailto:"dont@kvack.org"> email@kvack.org </a>

  reply	other threads:[~2016-10-26 22:45 UTC|newest]

Thread overview: 27+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <CAHc6FU4e5sueLi7pfeXnSbuuvnc5PaU3xo5Hnn=SvzmQ+ZOEeg@mail.gmail.com>
     [not found] ` <CALCETrUt+4ojyscJT1AFN5Zt3mKY0rrxcXMBOUUJzzLMWXFXHg@mail.gmail.com>
2016-10-26 16:32   ` Linus Torvalds
2016-10-26 17:15     ` Linus Torvalds
2016-10-26 17:58       ` Linus Torvalds
2016-10-26 18:04         ` Bob Peterson
2016-10-26 18:10           ` Linus Torvalds
2016-10-26 19:11             ` Bob Peterson
2016-10-26 21:01             ` Bob Peterson
2016-10-26 21:30               ` Linus Torvalds
2016-10-26 22:45                 ` Borislav Petkov [this message]
2016-10-26 23:13               ` Borislav Petkov
2016-10-27  0:37                 ` Bob Peterson
2016-10-27 12:36                   ` Borislav Petkov
2016-10-27 18:51                     ` Bob Peterson
2016-10-27 19:19                       ` Borislav Petkov
2016-10-27 21:03                         ` Bob Peterson
2016-10-27 21:19                           ` Borislav Petkov
2016-10-28  8:37                     ` [tip:x86/urgent] x86/microcode/AMD: Fix more fallout from CONFIG_RANDOMIZE_MEMORY=y tip-bot for Borislav Petkov
2016-10-26 20:31       ` CONFIG_VMAP_STACK, on-stack struct, and wake_up_bit Mel Gorman
2016-10-26 21:26         ` Linus Torvalds
2016-10-26 22:03           ` Mel Gorman
2016-10-26 22:09             ` Linus Torvalds
2016-10-26 23:07               ` Mel Gorman
2016-10-27  8:08                 ` Peter Zijlstra
2016-10-27  9:07                   ` Mel Gorman
2016-10-27  9:44                     ` Peter Zijlstra
2016-10-27  9:59                       ` Mel Gorman
2016-10-27 11:56                   ` Nicholas Piggin

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20161026224516.4npimwrsxdui27k2@pd.tnic \
    --to=bp@suse.de \
    --cc=agruenba@redhat.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mm@kvack.org \
    --cc=luto@amacapital.net \
    --cc=luto@kernel.org \
    --cc=mgorman@techsingularity.net \
    --cc=peterz@infradead.org \
    --cc=rpeterso@redhat.com \
    --cc=swhiteho@redhat.com \
    --cc=torvalds@linux-foundation.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox