From: David Miller <davem@davemloft.net>
To: daniel@iogearbox.net
Cc: tglx@linutronix.de, keescook@chromium.org, labbott@redhat.com,
torvalds@linux-foundation.org, mingo@kernel.org, hpa@zytor.com,
fengguang.wu@intel.com, netdev@vger.kernel.org,
linux-kernel@vger.kernel.org, lkp@01.org, ast@fb.com,
x86@kernel.org
Subject: Re: [net/bpf] 3051bf36c2 BUG: unable to handle kernel paging request at 0000a7cf
Date: Thu, 09 Mar 2017 10:08:30 -0800 (PST) [thread overview]
Message-ID: <20170309.100830.994695882061843653.davem@davemloft.net> (raw)
In-Reply-To: <58C19607.6000605@iogearbox.net>
From: Daniel Borkmann <daniel@iogearbox.net>
Date: Thu, 09 Mar 2017 18:51:03 +0100
> I added some debugging around __native_flush_tlb_global_irq_disabled()
> and if I understand it correctly, the idea of cr4 is that we need to
> toggle X86_CR4_PGE in order to trigger a TLB flush.
>
> What I see is that original cr4 is 0x610. The cpu_tlbstate.cr4 is
> consistent to native_read_cr4() and since cr4 is != 0, it tells me
> based on the comment in native_read_cr4() that cr4 seems to be
> supported. Thus, meaning we end up with writing ...
>
> native_write_cr4(0x610);
> native_write_cr4(0x610);
>
> ... twice, and this just doesn't trigger the desired TLB flush. I
> changed the code into the following ...
>
> cr4 = this_cpu_read(cpu_tlbstate.cr4);
> /* clear PGE */
> - native_write_cr4(cr4 & ~X86_CR4_PGE);
> + native_write_cr4(cr4 ^ X86_CR4_PGE);
> /* write old PGE again and flush TLBs */
> native_write_cr4(cr4);
>
> ... and the test cases seem to be working for me now with "-cpu
> kvm64",
> so that seems to trigger the TLB we were missing.
Great detective work Daniel.
next prev parent reply other threads:[~2017-03-09 18:08 UTC|newest]
Thread overview: 32+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-03-01 12:54 [net/bpf] 3051bf36c2 BUG: unable to handle kernel paging request at 0000a7cf Fengguang Wu
2017-03-02 20:23 ` Fengguang Wu
2017-03-02 20:40 ` Daniel Borkmann
2017-03-08 19:25 ` Linus Torvalds
2017-03-08 22:27 ` Daniel Borkmann
2017-03-08 22:36 ` Kees Cook
2017-03-08 22:51 ` Daniel Borkmann
2017-03-08 23:55 ` Laura Abbott
2017-03-09 5:36 ` Kees Cook
2017-03-09 13:04 ` Daniel Borkmann
2017-03-09 13:10 ` Thomas Gleixner
2017-03-09 13:25 ` Daniel Borkmann
2017-03-09 14:49 ` Thomas Gleixner
2017-03-09 17:51 ` Daniel Borkmann
2017-03-09 18:08 ` David Miller [this message]
2017-03-09 18:10 ` Linus Torvalds
2017-03-09 18:15 ` Linus Torvalds
2017-03-09 18:31 ` Daniel Borkmann
2017-03-09 21:32 ` Daniel Borkmann
2017-03-09 21:55 ` Borislav Petkov
2017-03-09 22:07 ` Borislav Petkov
2017-03-09 22:11 ` Daniel Borkmann
2017-03-09 22:48 ` Borislav Petkov
2017-03-09 23:26 ` Linus Torvalds
2017-03-09 23:44 ` Borislav Petkov
2017-03-10 0:13 ` Daniel Borkmann
2017-03-12 21:40 ` Borislav Petkov
2017-03-09 14:53 ` Daniel Borkmann
2017-03-09 17:48 ` Linus Torvalds
2017-03-08 22:43 ` Linus Torvalds
2017-03-09 1:34 ` Fengguang Wu
2017-03-09 13:09 ` Thomas Gleixner
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=20170309.100830.994695882061843653.davem@davemloft.net \
--to=davem@davemloft.net \
--cc=ast@fb.com \
--cc=daniel@iogearbox.net \
--cc=fengguang.wu@intel.com \
--cc=hpa@zytor.com \
--cc=keescook@chromium.org \
--cc=labbott@redhat.com \
--cc=linux-kernel@vger.kernel.org \
--cc=lkp@01.org \
--cc=mingo@kernel.org \
--cc=netdev@vger.kernel.org \
--cc=tglx@linutronix.de \
--cc=torvalds@linux-foundation.org \
--cc=x86@kernel.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;
as well as URLs for NNTP newsgroup(s).