Received: by 2002:a05:6a10:206:0:0:0:0 with SMTP id 6csp910855pxj; Thu, 27 May 2021 14:46:57 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyZ6h2V5ukkLcLw61W8rt0+lbMq19Q/W3HadIhjOs+1zyghiE13PPlShlzA1Dy9t332GPXy X-Received: by 2002:a05:6602:1223:: with SMTP id z3mr4505026iot.97.1622152016982; Thu, 27 May 2021 14:46:56 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1622152016; cv=none; d=google.com; s=arc-20160816; b=Rs1ca7kw+vUD9R6WIwsWWMfHsClM853Wchj1f6bEY77uUnCR8CoGv1k/+P6G1rZWiV XZTzR7o5tSViHBdvz4ALcX+HwcU7e5LDiqRC6gH0gpzOIkePn4g9Urgx1x5qWpruAcCg Gs58qmPDSek2JmEP3ZWwPqcuIhmDKC1RyH0gJCmp+sd8yizsAI7U/9D5JObNMhMmiIym jLeKhHr1jDxXRsDmti4Jzxz/+jggfjSRBcFt9jU7nkUvDx49VyxsSeUZmwzMMD1e29ze pJp1KwKb/5Dir6ZyLkKLkJdX7n8Muwqa0z7H0+I7ztK+apyWlNJgX0nUF5ooQc78l7eC PeKg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=jcxPwenXfvV4UOqOX4AiZ+QdPUoJEoZ3RYr1i0o4IcQ=; b=IXj3mXdLqkxUE9dremm+w1v486aU5CqKevLfgAQvfBkvhWkRAOGmDaifCeqMibAdPz BaBzing5z+W8Kfuv5Ug9pIC+2ie0MfD/2AWGFA1O1GJ5l3+7Ppp2pF2dqEtc6cXGKvHo dDqrQp9cAnpRukoy2smYBGNFnawgNITSkIHs4TRie6TrNC+CBVh756q6oV73kdw/7lcN +kJknUg8PK1H04iaLu4pIzO0zB5XN/Xc4BIbZsflk7GPj4powBPueFYEntZqo9QRmilc 5WaTtFtDGBnQ9jZNNiEp16spChhYzO/dDX+krS77JN/lcoVyABUTK5Tt8Ji8srI+kOuF hOeA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=imgnBM9Q; 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=NONE dis=NONE) header.from=linuxfoundation.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id f9si3083417ilj.155.2021.05.27.14.46.43; Thu, 27 May 2021 14:46:56 -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=@linuxfoundation.org header.s=korg header.b=imgnBM9Q; 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=NONE dis=NONE) header.from=linuxfoundation.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S237116AbhE0PQI (ORCPT + 99 others); Thu, 27 May 2021 11:16:08 -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 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@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();