From patchwork Fri Nov 19 10:21:16 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Nicolas Saenz Julienne X-Patchwork-Id: 12693113 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 8B20DC433F5 for ; Fri, 19 Nov 2021 10:23:18 +0000 (UTC) Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 5BEAC61B6F for ; Fri, 19 Nov 2021 10:23:18 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.1 mail.kernel.org 5BEAC61B6F Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=redhat.com Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:Message-Id:Date:Subject:Cc :To:From:Reply-To:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:In-Reply-To:References: List-Owner; bh=cD/BttqAfcXadD1vIXIWRM2r/wx0p+q0favmGorHXWc=; b=L8AeYK/W7xkY4u Qaxg1fvfkxQopHiXYMdGdlp+2FMHT6zINgPnpIrQ2Nc0YV64snLXsz0xNE9pbgmp0vGbx0y/pv51v NKXlHdJcxQWhtlp1yg2L1sADI3tikmVORNhjuaUlyQQVMNFcmOgBy4xC0PpH2CbydV2y2CPpm40vu 1Ox4l6cDk/NLE/FJEU6WOnrsgtNboYmPy0pVm39hkhhgz2FK2dp5FuAKHtTEiD5TMbrUGutXoIamJ tkW68rtsFoKEJ2xA4rp1n5tx61FI9GA9vPEWI9eNr550PSqYUZ+6dmBkVcCMRBCtFIJdOc3Gq0beZ TiVAn8/xvIlLSIe+vxUQ==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1mo11l-00A5ma-5N; Fri, 19 Nov 2021 10:21:53 +0000 Received: from us-smtp-delivery-124.mimecast.com ([170.10.129.124]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1mo11g-00A5jy-Lb for linux-arm-kernel@lists.infradead.org; Fri, 19 Nov 2021 10:21:50 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1637317305; 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: content-transfer-encoding:content-transfer-encoding; bh=yoOG1diMi0E/SvfVXv5alhyBNgdiAvTA9EtQDMJObdw=; b=SDVhLq68NSwH6f0zG6J06jcycbXs1CaQzUpPgizH0x+JxE2Q3wrNeQS9Hst1lBC0csvGku CBvvvivR9MF2ZMcEdeJNpjD0kI0x4Q1qxJomlJZv/tNm2a5rLRBloePC44oSzS9SSTpdWy qH1JOSTQ9OmJeRHzsWrZESbGnieMYHQ= Received: from mail-wr1-f72.google.com (mail-wr1-f72.google.com [209.85.221.72]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-289-PRUcqn-EO3ymltM-Nblz8w-1; Fri, 19 Nov 2021 05:21:44 -0500 X-MC-Unique: PRUcqn-EO3ymltM-Nblz8w-1 Received: by mail-wr1-f72.google.com with SMTP id u4-20020a5d4684000000b0017c8c1de97dso1672052wrq.16 for ; Fri, 19 Nov 2021 02:21:44 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=yoOG1diMi0E/SvfVXv5alhyBNgdiAvTA9EtQDMJObdw=; b=3aixhh4Yi3gapOAidKzUTtpgxfu+GY2ykaUkm7lJBzKOpt81BJLqLA1g8fyrsL7GG/ bHhOQOD4jKSonPrk/sVTu599aote33XOXBtHkX7ndsCkTgtfVIJ2gkk3od6xr1LHhIVc XnySpjaM3Vcjrp6NdeA9fZqvmWKwIX/3K8CI3mioMLgqlyfgDBMflj+lAOhEpLJjqFTf S70W5vQGR3hdzvtO41x0chaU6qqBLNxW/+smM6YGx0xAHPq9GCZIwnSLLqgOU5BfFw+P 9OWG+G07UcAUfgif/QwTdgmB2x6D3G0TS5wJX4LnBlJECqd76PDFunNN64r6sAPTyPmI MXgA== X-Gm-Message-State: AOAM532HpAdXqPI8uPWVaA9KKVTyIuhJ+mtzp+NAPVTlFhRg+H9gE8jZ 6l2tyNemFaN8A8tfjBqtR7qE+hKbBkQRMLUHKmpxnc0zpwSCOFASxThN0IByxPaYjnIux+LddAY emB6SxtxztZGlQftVR8T+qU7scLsUCfDt6q8i/Fu8bx4muIRN2/fjutSz/sy3V1/PjcG5WMTOHA IRX2zz1xmPcU0= X-Received: by 2002:a5d:63ca:: with SMTP id c10mr5840319wrw.124.1637317303350; Fri, 19 Nov 2021 02:21:43 -0800 (PST) X-Google-Smtp-Source: ABdhPJwihTxczM5jqGJYFo9iUlthuKo/r0hHx/63+SRDngLpAOgUraQ7o+CZyQaRivyiAucHPrBPCQ== X-Received: by 2002:a5d:63ca:: with SMTP id c10mr5840286wrw.124.1637317303163; Fri, 19 Nov 2021 02:21:43 -0800 (PST) Received: from vian.redhat.com ([2a0c:5a80:3c10:3400:3c70:6643:6e71:7eae]) by smtp.gmail.com with ESMTPSA id k27sm14336026wms.41.2021.11.19.02.21.42 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 19 Nov 2021 02:21:42 -0800 (PST) From: Nicolas Saenz Julienne To: linux-arm-kernel@lists.infradead.org, maz@kernel.org, rostedt@goodmis.org Cc: james.morse@arm.com, alexandru.elisei@arm.com, suzuki.poulose@arm.com, catalin.marinas@arm.com, will@kernel.org, nsaenzju@redhat.com, linux-kernel@vger.kernel.org, kvmarm@lists.cs.columbia.edu, mingo@redhat.com, mtosatti@redhat.com, nilal@redhat.com Subject: [RFC PATCH 0/2] KVM: arm64: Host/Guest trace syncronization Date: Fri, 19 Nov 2021 11:21:16 +0100 Message-Id: <20211119102117.22304-1-nsaenzju@redhat.com> X-Mailer: git-send-email 2.33.1 MIME-Version: 1.0 Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=nsaenzju@redhat.com X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20211119_022148_802502_AA581401 X-CRM114-Status: GOOD ( 12.53 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org This small series introduces the necessary infrastructure to be able to syncronize host and guest traces. The approach I'm following is a bit biased since I tried to replicate the methods I've been using in the past with x86. This was tested on an Ampere Mt. Jade based machine. --- Nicolas Saenz Julienne (2): arm64/tracing: add cntvct based trace clock KVM: arm64: export cntvoff in debugfs arch/arm64/include/asm/kvm_host.h | 1 + arch/arm64/include/asm/trace_clock.h | 12 ++++++++++++ arch/arm64/kernel/Makefile | 2 +- arch/arm64/kernel/trace_clock.c | 12 ++++++++++++ arch/arm64/kvm/Makefile | 2 +- arch/arm64/kvm/arch_timer.c | 2 +- arch/arm64/kvm/debugfs.c | 25 +++++++++++++++++++++++++ include/kvm/arm_arch_timer.h | 3 +++ 8 files changed, 56 insertions(+), 3 deletions(-) create mode 100644 arch/arm64/include/asm/trace_clock.h create mode 100644 arch/arm64/kernel/trace_clock.c create mode 100644 arch/arm64/kvm/debugfs.c