Received: by 2002:a05:6a10:206:0:0:0:0 with SMTP id 6csp2130379pxj; Thu, 20 May 2021 00:22:22 -0700 (PDT) X-Google-Smtp-Source: ABdhPJz8rAp3O7WNz5iz9TPRURxW9DYlzkFZZKfg9cp+RWY5dlYpBwDKJbCrtwsL4vyZPyXehX4y X-Received: by 2002:a05:6602:3426:: with SMTP id n38mr3424906ioz.3.1621495342083; Thu, 20 May 2021 00:22:22 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1621495342; cv=none; d=google.com; s=arc-20160816; b=xdOOSHC8MNMBgfY455y4VWSPW6WaPRVdpQ0Qt9p3iEboW4NffYUPnfJfL2WbBtXTTp civQTtEo/08XK39u1iIOv7F9+jfvsV+iWB/4jzLG3t7sMzYnDx5xS5F5aSj21FAA2A+9 A30gaDTTZsFXPQlPZDX4IAcYoCFbKUe+gEIM/PppQwpdEAXACYaSi0LXW5HfclJ7onJI vc9P91EX33tYAvN7aYuLkLgEPLg+fn2wE0LMIJxopgpgw4P8w3gP6Vt3FoTUxoIB5lgj /vt1MV2nWu3+sMfMuLRBZE7IQgrmZmeLUqHn2r69lviiWasMIFOoY4id6C5zhV8TX2ya vGYw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:mime-version:message-id:date:references :in-reply-to:subject:cc:to:dkim-signature:dkim-signature:from; bh=qqmyVIWAAm2Cj5GHyXknQl6bxyBJXy6YDxRpreKA3xk=; b=uY7I9vmmGxmtjhdcvKc9iNHzYAKVIEALmySneu1xbwAQ3sA1xSdXWm9zTCQh8Uq9X8 oaFCCKyCDaCYt8Jq2ukCfXdlk02H4YowmameKaWliSC75DpGQ3QncB1lm+Do7cyBgAQi R2cY+0LrlH32gR+/jGjUK1f41OZQu9z29RmBtkOyrn2dSdS1oeVsJcDhvE+hIwfidsSw Y64dpEMlP+gAYgW7XrH6SWEAzd5MkWIb2U6xJj9ONI6A4wYNmPmWVDiZHsQMiX2+9k5I Y1BE39kJZw2+nKXSFsaLoCWocc68Ty5B1pttTwIGSnKr8xQPvLS1vw75wGruqJNcmb/T g+cw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linutronix.de header.s=2020 header.b=ml5djzl2; dkim=neutral (no key) header.i=@linutronix.de header.s=2020e header.b=H7iFbqGO; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=linutronix.de Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id i14si1784178ilq.76.2021.05.20.00.22.09; Thu, 20 May 2021 00:22:22 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@linutronix.de header.s=2020 header.b=ml5djzl2; dkim=neutral (no key) header.i=@linutronix.de header.s=2020e header.b=H7iFbqGO; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=linutronix.de Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230448AbhETHWr (ORCPT + 99 others); Thu, 20 May 2021 03:22:47 -0400 Received: from Galois.linutronix.de ([193.142.43.55]:44938 "EHLO galois.linutronix.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229536AbhETHWq (ORCPT ); Thu, 20 May 2021 03:22:46 -0400 From: Thomas Gleixner DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020; t=1621495284; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=qqmyVIWAAm2Cj5GHyXknQl6bxyBJXy6YDxRpreKA3xk=; b=ml5djzl2nyTQz6MkOLRFP1bCQ7RaOMgJAYbvJI3UPj40TlxIf3ays7pYTfjybCFsskuizQ X9sybAooVjzIWJW/Y9kNPB6DeUoH6B1qiCW8qBr5J94Ns5CnPAg6PzAdVrE7f7UdTaWwBg 0GjaG1RrlsZRLipvdFoz8ONWXDf+xKQOQwbGFgZ3arnP9g7r/qGVcyaufimEOEoaQFt59O cYs0h9Khn22GoZMU09he8wl8KdHcyGtPJOQK6FK5wWtHSxDkUbJ8CsKgcsWHPvDwUDFk48 gh0uA20UVABISh/weZGIbDk4R1P5Oc3Xto94ftENStHZE9j/9i6FlktsxoGuzg== DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020e; t=1621495284; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=qqmyVIWAAm2Cj5GHyXknQl6bxyBJXy6YDxRpreKA3xk=; b=H7iFbqGOGXYo7ItWW71QFiL7Ikj7LGEDD7K4rZQJBLybpyEX060Emzqhu09fmvipbjn2JX MA1EHhF76BIIaEBQ== To: Stefano De Venuto , linux-kernel@vger.kernel.org Cc: pbonzini@redhat.com, seanjc@google.com, vkuznets@redhat.com, wanpengli@tencent.com, jmattson@google.com, x86@kernel.org, hpa@zytor.com, kvm@vger.kernel.org, rostedt@goodmis.org, y.karadz@gmail.com, Stefano De Venuto , Dario Faggioli Subject: Re: [PATCH] Move VMEnter and VMExit tracepoints closer to the actual event In-Reply-To: <20210519182303.2790-1-stefano.devenuto99@gmail.com> References: <20210519182303.2790-1-stefano.devenuto99@gmail.com> Date: Thu, 20 May 2021 09:21:24 +0200 Message-ID: <875yzddg5n.ffs@nanos.tec.linutronix.de> MIME-Version: 1.0 Content-Type: text/plain Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, May 19 2021 at 20:23, Stefano De Venuto wrote: > diff --git a/arch/x86/kvm/svm/svm.c b/arch/x86/kvm/svm/svm.c > index 05eca131eaf2..c77d4866e239 100644 > --- a/arch/x86/kvm/svm/svm.c > +++ b/arch/x86/kvm/svm/svm.c > @@ -3275,8 +3275,6 @@ static int handle_exit(struct kvm_vcpu *vcpu, fastpath_t exit_fastpath) > struct kvm_run *kvm_run = vcpu->run; > u32 exit_code = svm->vmcb->control.exit_code; > > - trace_kvm_exit(exit_code, vcpu, KVM_ISA_SVM); > - > /* SEV-ES guests must use the CR write traps to track CR registers. */ > if (!sev_es_guest(vcpu->kvm)) { > if (!svm_is_intercept(svm, INTERCEPT_CR0_WRITE)) > @@ -3707,6 +3705,8 @@ static noinstr void svm_vcpu_enter_exit(struct kvm_vcpu *vcpu) > > kvm_guest_enter_irqoff(); > > + trace_kvm_entry(vcpu); No. This violates the noinstr rules and will make objtool complain on a full validation run. So this wants to be: + instrumentation_begin(); + trace_kvm_entry(vcpu); + instrumentation_end(); kvm_guest_enter_irqoff(); and on the exit side the trace wants to be post kvm_guest_exit_irqoff(). Thanks, tglx