From patchwork Thu May 27 15:13:05 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Greg Kroah-Hartman X-Patchwork-Id: 449456 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=-19.1 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_CR_TRAILER, INCLUDES_PATCH, MAILING_LIST_MULTI, SPF_HELO_NONE, SPF_PASS, URIBL_BLOCKED, USER_AGENT_GIT autolearn=ham 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 027B8C4708A for ; Thu, 27 May 2021 15:14:10 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id D9CBD613C0 for ; Thu, 27 May 2021 15:14:09 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S237031AbhE0PPk (ORCPT ); Thu, 27 May 2021 11:15:40 -0400 Received: from mail.kernel.org ([198.145.29.99]:44148 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234529AbhE0PPS (ORCPT ); Thu, 27 May 2021 11:15:18 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id AC4FF613BC; Thu, 27 May 2021 15:13:44 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1622128425; bh=RbCEK6ccn0oTLf0QFVOVnwMqU7Rq2+6/+3Ywgym2t6o=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=imgnBM9QKEGWkVYZceTvnRrBfO5ZuqnsnNDKPBbKnEcLONeVDjt+mdDIVkXtKRDFo 6K8DqdFQBBjdZwaKLGvHCgAfd5YiU9rwGXi+9wiuB/JV02/q0pC37svBkkB871Pulx A/oPYDm5q1nJPN1uKCUPll2cfPrf8HUrNDdM+xX0= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Thomas Gleixner , Wanpeng Li , Sean Christopherson Subject: [PATCH 5.12 4/7] context_tracking: Move guest exit context tracking to separate helpers Date: Thu, 27 May 2021 17:13:05 +0200 Message-Id: <20210527151139.383232838@linuxfoundation.org> X-Mailer: git-send-email 2.31.1 In-Reply-To: <20210527151139.241267495@linuxfoundation.org> References: <20210527151139.241267495@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: stable@vger.kernel.org From: Wanpeng Li commit 866a6dadbb027b2955a7ae00bab9705d382def12 upstream. Provide separate context tracking helpers for guest exit, the standalone helpers will be called separately by KVM x86 in later patches to fix tick-based accounting. Suggested-by: Thomas Gleixner Signed-off-by: Wanpeng Li Co-developed-by: Sean Christopherson Signed-off-by: Sean Christopherson Signed-off-by: Thomas Gleixner Link: https://lore.kernel.org/r/20210505002735.1684165-2-seanjc@google.com Signed-off-by: Greg Kroah-Hartman --- include/linux/context_tracking.h | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) --- a/include/linux/context_tracking.h +++ b/include/linux/context_tracking.h @@ -131,10 +131,15 @@ static __always_inline void guest_enter_ } } -static __always_inline void guest_exit_irqoff(void) +static __always_inline void context_tracking_guest_exit(void) { if (context_tracking_enabled()) __context_tracking_exit(CONTEXT_GUEST); +} + +static __always_inline void guest_exit_irqoff(void) +{ + context_tracking_guest_exit(); instrumentation_begin(); if (vtime_accounting_enabled_this_cpu()) @@ -159,6 +164,8 @@ static __always_inline void guest_enter_ instrumentation_end(); } +static __always_inline void context_tracking_guest_exit(void) { } + static __always_inline void guest_exit_irqoff(void) { instrumentation_begin();