From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-3.8 required=3.0 tests=HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,SIGNED_OFF_BY,SPF_HELO_NONE,SPF_PASS autolearn=no autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id D7F0BC10DCE for ; Tue, 24 Mar 2020 23:22:17 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id B750320663 for ; Tue, 24 Mar 2020 23:22:17 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727117AbgCXXWQ (ORCPT ); Tue, 24 Mar 2020 19:22:16 -0400 Received: from Galois.linutronix.de ([193.142.43.55]:46567 "EHLO Galois.linutronix.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726212AbgCXXWQ (ORCPT ); Tue, 24 Mar 2020 19:22:16 -0400 Received: from p5de0bf0b.dip0.t-ipconnect.de ([93.224.191.11] helo=nanos.tec.linutronix.de) by Galois.linutronix.de with esmtpsa (TLS1.2:DHE_RSA_AES_256_CBC_SHA256:256) (Exim 4.80) (envelope-from ) id 1jGsra-0007qx-Pt; Wed, 25 Mar 2020 00:21:39 +0100 Received: by nanos.tec.linutronix.de (Postfix, from userid 1000) id 367BC100C51; Wed, 25 Mar 2020 00:21:38 +0100 (CET) From: Thomas Gleixner To: Peter Zijlstra Cc: LKML , x86@kernel.org, Paul McKenney , Josh Poimboeuf , "Joel Fernandes \(Google\)" , "Steven Rostedt \(VMware\)" , Masami Hiramatsu , Alexei Starovoitov , Frederic Weisbecker , Mathieu Desnoyers , Brian Gerst , Juergen Gross , Alexandre Chartre , Paolo Bonzini , kvm@vger.kernel.org, Tom Lendacky Subject: Re: [RESEND][patch V3 19/23] x86/kvm/vmx: Add hardirq tracing to guest enter/exit In-Reply-To: <20200324230320.GX2452@worktop.programming.kicks-ass.net> References: <20200320175956.033706968@linutronix.de> <20200320180034.297670977@linutronix.de> <20200324230320.GX2452@worktop.programming.kicks-ass.net> Date: Wed, 25 Mar 2020 00:21:38 +0100 Message-ID: <87o8slz6d9.fsf@nanos.tec.linutronix.de> MIME-Version: 1.0 Content-Type: text/plain X-Linutronix-Spam-Score: -1.0 X-Linutronix-Spam-Level: - X-Linutronix-Spam-Status: No , -1.0 points, 5.0 required, ALL_TRUSTED=-1,SHORTCIRCUIT=-0.0001 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Peter Zijlstra writes: > On Fri, Mar 20, 2020 at 07:00:15PM +0100, Thomas Gleixner wrote: >> The VMX code does not track hard interrupt state correctly. The state in >> tracing and lockdep is 'OFF' all the way during guest mode. From the host >> point of view this is wrong because the VMENTER reenables interrupts like a >> return to user space and VMENTER disables them again like an entry from >> user space. >> >> Make it do exactly the same thing as enter/exit user mode does. >> >> Signed-off-by: Thomas Gleixner > > This patch (and the SVM counterpart) result in: > > ERROR: "lockdep_hardirqs_on" [arch/x86/kvm/kvm-amd.ko] undefined! > ERROR: "lockdep_hardirqs_off" [arch/x86/kvm/kvm-amd.ko] undefined! > ERROR: "__trace_hardirqs_off" [arch/x86/kvm/kvm-amd.ko] undefined! > ERROR: "lockdep_hardirqs_on_prepare" [arch/x86/kvm/kvm-amd.ko] undefined! > ERROR: "__trace_hardirqs_on" [arch/x86/kvm/kvm-amd.ko] undefined! > ERROR: "lockdep_hardirqs_on" [arch/x86/kvm/kvm-intel.ko] undefined! > ERROR: "lockdep_hardirqs_off" [arch/x86/kvm/kvm-intel.ko] undefined! > ERROR: "__trace_hardirqs_off" [arch/x86/kvm/kvm-intel.ko] undefined! > ERROR: "lockdep_hardirqs_on_prepare" [arch/x86/kvm/kvm-intel.ko] undefined! > ERROR: "__trace_hardirqs_on" [arch/x86/kvm/kvm-intel.ko] undefined! > > on allmodconfig. > > I suppose them things need an EXPORT_SYMBOL_GPL() on them. Indeed.