perf/x86: Apply more accurate check on hypervisor platform
authorZhenzhong Duan <zhenzhong.duan@oracle.com>
Thu, 25 Jul 2019 02:39:26 +0000 (10:39 +0800)
committerIngo Molnar <mingo@kernel.org>
Thu, 25 Jul 2019 13:41:30 +0000 (15:41 +0200)
commit5ea3f6fb37b79da33ac9211df336fd2b9f47c39f
treeb94e2d75c66c7c6986302f60a3bf2a347dc225a8
parent3b238a64c3009fed36eaea1af629d9377759d87d
perf/x86: Apply more accurate check on hypervisor platform

check_msr is used to fix a bug report in guest where KVM doesn't support
LBR MSR and cause #GP.

The msr check is bypassed on real HW to workaround a false failure,
see commit d0e1a507bdc7 ("perf/x86/intel: Disable check_msr for real HW")

When running a guest with CONFIG_HYPERVISOR_GUEST not set or "nopv"
enabled, current check isn't enough and #GP could trigger.

Signed-off-by: Zhenzhong Duan <zhenzhong.duan@oracle.com>
Signed-off-by: Peter Zijlstra (Intel) <peterz@infradead.org>
Cc: Alexander Shishkin <alexander.shishkin@linux.intel.com>
Cc: Arnaldo Carvalho de Melo <acme@kernel.org>
Cc: Boris Ostrovsky <boris.ostrovsky@oracle.com>
Cc: Borislav Petkov <bp@alien8.de>
Cc: Jiri Olsa <jolsa@redhat.com>
Cc: Juergen Gross <jgross@suse.com>
Cc: Linus Torvalds <torvalds@linux-foundation.org>
Cc: Namhyung Kim <namhyung@kernel.org>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Thomas Gleixner <tglx@linutronix.de>
Link: https://lkml.kernel.org/r/1564022366-18293-1-git-send-email-zhenzhong.duan@oracle.com
Signed-off-by: Ingo Molnar <mingo@kernel.org>
arch/x86/events/intel/core.c