Received: by 2002:a05:6a10:17d3:0:0:0:0 with SMTP id hz19csp1181815pxb; Thu, 15 Apr 2021 16:38:07 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxKzQrqAfiBBLUpz35HH97Sz57slQSo8NOiLrt1CcA/uLem3Ag4cIhQHVMPSc9jkhl/k2Fx X-Received: by 2002:a17:906:80d6:: with SMTP id a22mr5822413ejx.277.1618529887112; Thu, 15 Apr 2021 16:38:07 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1618529887; cv=none; d=google.com; s=arc-20160816; b=BGQHlRoJZfWAQyOR5VyalmSGh0N4cnI+smV6kFVh/BpRRsVjI3GRKxRUO+DTCxBoYq 7ONrnqlvs5PCBauuCGayoULKD5fXMJHvq/Wl1a92bVMejFEPKyCAH5Jn5sZxqPSuHtlJ 0fQFfIHmk7gtZ4+5LoBSZV/97R3oOTcpnsULICGheiI4Fq2YFIw0sidSTiR8tvcIt6hq BYROgbZRextKivLEzmVVMw7aPtViNkxjOT7aH4SwsD66B23O74D66xgcxepSsMpF6PLj iTDggwmE/G/x0CpZMw5lKoBMuKDqcAKE7zbBsacxPxeDpX8dlWTkw10OW1iQTvYUR3rw 8VVg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:from:subject:references:mime-version :message-id:in-reply-to:date:reply-to:dkim-signature; bh=2rHkFHcKdsKtPlphUZSPjmFsPrJ5FQMml9mM0e4W7Zc=; b=BByqdaO8n3186URdfO7djueVx5qSNQ1U9/KhgW28xT9qMn3hHl3pNm7hPybDLmtzMV gidDZBxEleLpxgn3ENHhEhDO5++cLDl0Gh5d820LvPQrGfrNkfULrDtSCWw+gbNgR+5i YB+qkx0K5QBdoqwVTmlU5uHx0DqosUs5YxSFhZin5E/ln2CQ+3ubUwy1lUNk73Qi10qi WIl3abvNZFMxkGxQFg3mqeH24vabHbvW7DFWixxOTq0H0/qZVjs/YkRRLQ6s3R9cowAk IcRWo8O9LhuIIorb5wdvXvp3ofYJA/vIVqRR76N1ncfPA8gXbnPPkGXEmlVZ5wqWY822 l32w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@google.com header.s=20161025 header.b=Sdv8k1Id; 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=REJECT sp=REJECT dis=NONE) header.from=google.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id f19si4636800edd.510.2021.04.15.16.37.42; Thu, 15 Apr 2021 16:38:07 -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=@google.com header.s=20161025 header.b=Sdv8k1Id; 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=REJECT sp=REJECT dis=NONE) header.from=google.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S236724AbhDOWVo (ORCPT + 99 others); Thu, 15 Apr 2021 18:21:44 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:57136 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S236723AbhDOWVl (ORCPT ); Thu, 15 Apr 2021 18:21:41 -0400 Received: from mail-yb1-xb4a.google.com (mail-yb1-xb4a.google.com [IPv6:2607:f8b0:4864:20::b4a]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id BDA01C061756 for ; Thu, 15 Apr 2021 15:21:16 -0700 (PDT) Received: by mail-yb1-xb4a.google.com with SMTP id u128so3935392ybf.12 for ; Thu, 15 Apr 2021 15:21:16 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20161025; h=reply-to:date:in-reply-to:message-id:mime-version:references :subject:from:to:cc; bh=2rHkFHcKdsKtPlphUZSPjmFsPrJ5FQMml9mM0e4W7Zc=; b=Sdv8k1IdZLOeBzPcIHjmgwJvr30lVQhykx0hvcsxfUl49I6CdmrwLkVbh3hV+Ki+lU 9FgNVGTL6AhKmBPLLJsOtFvFnVAmd9es66AmtmX93zsZySZKpzLCQcstWKqR18p9xu1V A4SAYuvwFCZj+IFvJs55MwqCJ3rSkkS8OincKBNAMhgM9zYj7ywd9/eNQQk8yr2ATmah fXun1sJdo3rL8im+W9tt+twTRmtH/ASLsnxpA84IpCEoOfjOfsRXmg8gMsxVBKugvghq /EQcpFNjuzdNG9gjvw1gOUYvKGfYWCL1jr88Kg0XSNlF0/0+spGD+TtUWO2AwUlYXQst i2TQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:reply-to:date:in-reply-to:message-id :mime-version:references:subject:from:to:cc; bh=2rHkFHcKdsKtPlphUZSPjmFsPrJ5FQMml9mM0e4W7Zc=; b=kMaFEZKFrFJcb3dq4Ln6qo0PSz7ba7i7ch8q9Wl6CYK7mEK4ybR2nLPdouYx35IZvD yBXBkJQ2NP98Mex16Lu1FyMMPPfj2bWKWWc5apoM0VqKSdaqnZpmv+0/K2G2Cna3gGC7 JKT7Nl0MgC6yC+L5ijrsV/HMEnP8TYYoH8YawTzVbov/DUhLZNXgYiVZ7e/GFMU/8Nl+ PCVCWrKYEepX05WcpfY8Zb1dw1KCbaIs7Sl5apXNlYNIKJaQDsiLuSTaZJyCyOJEZxJb hfbXUl9nN/HMqFSgyLiJ8ot0gNmthjhHejGacDPZqztCvKZykMo1kOkrE9U2uB0F5ZMO /sOg== X-Gm-Message-State: AOAM533ry+GpcrJSLZF6KZbQ7cns/Otgn/xmzprlRamPAdnPnIrtAZIF yHql0w3fGJvNbXgiuuq+REavuKyJYPw= X-Received: from seanjc798194.pdx.corp.google.com ([2620:15c:f:10:6c93:ada0:6bbf:e7db]) (user=seanjc job=sendgmr) by 2002:a25:e6c7:: with SMTP id d190mr6937056ybh.394.1618525275978; Thu, 15 Apr 2021 15:21:15 -0700 (PDT) Reply-To: Sean Christopherson Date: Thu, 15 Apr 2021 15:20:58 -0700 In-Reply-To: <20210415222106.1643837-1-seanjc@google.com> Message-Id: <20210415222106.1643837-2-seanjc@google.com> Mime-Version: 1.0 References: <20210415222106.1643837-1-seanjc@google.com> X-Mailer: git-send-email 2.31.1.368.gbe11c130af-goog Subject: [PATCH v3 1/9] context_tracking: Move guest exit context tracking to separate helpers From: Sean Christopherson To: Paolo Bonzini Cc: Sean Christopherson , Vitaly Kuznetsov , Wanpeng Li , Jim Mattson , Joerg Roedel , kvm@vger.kernel.org, linux-kernel@vger.kernel.org, Thomas Gleixner , Michael Tokarev , Christian Borntraeger Content-Type: text/plain; charset="UTF-8" Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Wanpeng Li 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 Cc: Thomas Gleixner Cc: Sean Christopherson Cc: Michael Tokarev Cc: Christian Borntraeger Signed-off-by: Wanpeng Li Co-developed-by: Sean Christopherson Signed-off-by: Sean Christopherson --- include/linux/context_tracking.h | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/include/linux/context_tracking.h b/include/linux/context_tracking.h index bceb06498521..200d30cb3a82 100644 --- a/include/linux/context_tracking.h +++ b/include/linux/context_tracking.h @@ -131,10 +131,15 @@ static __always_inline void guest_enter_irqoff(void) } } -static __always_inline void guest_exit_irqoff(void) +static __always_inline void context_tracking_guest_exit_irqoff(void) { if (context_tracking_enabled()) __context_tracking_exit(CONTEXT_GUEST); +} + +static __always_inline void guest_exit_irqoff(void) +{ + context_tracking_guest_exit_irqoff(); instrumentation_begin(); if (vtime_accounting_enabled_this_cpu()) @@ -159,6 +164,8 @@ static __always_inline void guest_enter_irqoff(void) instrumentation_end(); } +static __always_inline void context_tracking_guest_exit_irqoff(void) { } + static __always_inline void guest_exit_irqoff(void) { instrumentation_begin(); -- 2.31.1.368.gbe11c130af-goog