From mboxrd@z Thu Jan 1 00:00:00 1970 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=-15.8 required=3.0 tests=BAYES_00,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 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 5EE1EC433E1 for ; Tue, 30 Mar 2021 16:52:49 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 30777619CB for ; Tue, 30 Mar 2021 16:52:49 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232480AbhC3QwZ (ORCPT ); Tue, 30 Mar 2021 12:52:25 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:48592 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232656AbhC3QwJ (ORCPT ); Tue, 30 Mar 2021 12:52:09 -0400 Received: from mail-io1-xd33.google.com (mail-io1-xd33.google.com [IPv6:2607:f8b0:4864:20::d33]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 87251C061574 for ; Tue, 30 Mar 2021 09:52:09 -0700 (PDT) Received: by mail-io1-xd33.google.com with SMTP id n198so17197387iod.0 for ; Tue, 30 Mar 2021 09:52:09 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=KkAtFBgJyVrb9iuHnJExd0NJVK4yAFyTjJdaicBUnRw=; b=LAH4582+NwnCxqqe3+3sIP97xXc+BUkqqnvowuPgY9Iz4kONSGAQJUWEHtxLk+aI8l GEEB/arsdC3uv34zdRSwjrsexcA5bfXhqmfsxQGVJQeA6ALu++oTk4uU9lGgjGhKvqvX T6r31KQXcBbCdNMnnAMPdbQ0ORrLTkeCblpQ2yv0ZA4JA5eU8L6TFUmsLXYu6nKh9HAP j1xW7br0Z5pA7Itr1SNaiNps+APovmRNWrqSEH6++81C0sbbLqKIeS04aa65iduy3kBi O6HsENhq+/Bh3qW8PC2tbx7nUTCni0PPPdj2JryUft10R79qUTGiYRw94BGHCvn3JFvq GKQA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=KkAtFBgJyVrb9iuHnJExd0NJVK4yAFyTjJdaicBUnRw=; b=X8k7T7euPw4spqoK6JlSB9mKB/X68+1UbRmEpPonnecinbIC5Bre7gz9UwEDMynecU ncogpV0l7Qmk2tFpYmTYgu3lMY3Rvx3skuDRCzH8lWyNjhgLeEN0d1m2CRmAEWEDPcVc /SAsK56hvYdGEY7aMnyRKYDBbt6Wcy0rR6Y/4mX29Sa8Xf2iCVayJjIUUy8bhiQ/MaMg TOKnir+sjReDi0idkBMJ+wRDtq27zDcHBuJdNTcNwZonpWgVlPkK6DeJ1gHHErSlKQNC kmnedMZUXu6wYbYiPWqQwdEOfYYXQfGJJRv1GzGymIH5VguE+NcGY87Vj3Wrn5UXBYs4 8z6A== X-Gm-Message-State: AOAM532fKDVt0P21WjWObLQmX4IOsNV5GEKzLXVwdashtWoeAsRKZ4hS lF6poa5bY6yLfPU/sxVLu+P14kbXj7w6TTjuXhVOdw== X-Google-Smtp-Source: ABdhPJyhBSaSMSZBcI2tiOVk3QJARoK9ZRlec1tWbobBP699R0NB9KE3gmV5jf5UDq8fQYvwbUwftVm14LrVLEykqL4= X-Received: by 2002:a05:6638:1390:: with SMTP id w16mr30240526jad.83.1617123128593; Tue, 30 Mar 2021 09:52:08 -0700 (PDT) MIME-Version: 1.0 References: <20210323120647.454211-1-suzuki.poulose@arm.com> <20210323120647.454211-8-suzuki.poulose@arm.com> <20210326165550.GC2009902@xps15> <20210330152314.GA2329603@xps15> In-Reply-To: From: Mathieu Poirier Date: Tue, 30 Mar 2021 10:51:57 -0600 Message-ID: Subject: Re: [PATCH v5 07/19] arm64: kvm: Enable access to TRBE support for host To: Greg KH Cc: Suzuki K Poulose , Marc Zyngier , Catalin Marinas , linux-arm-kernel , Linux Kernel Mailing List , Coresight ML , Mike Leach , Leo Yan , Anshuman Khandual , Will Deacon , Mark Rutland Content-Type: text/plain; charset="UTF-8" Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, 30 Mar 2021 at 10:47, Greg KH wrote: > > On Tue, Mar 30, 2021 at 10:33:51AM -0600, Mathieu Poirier wrote: > > On Tue, 30 Mar 2021 at 09:35, Greg KH wrote: > > > > > > On Tue, Mar 30, 2021 at 09:23:14AM -0600, Mathieu Poirier wrote: > > > > On Tue, Mar 30, 2021 at 11:38:18AM +0100, Suzuki K Poulose wrote: > > > > > On 26/03/2021 16:55, Mathieu Poirier wrote: > > > > > > On Tue, Mar 23, 2021 at 12:06:35PM +0000, Suzuki K Poulose wrote: > > > > > > > For a nvhe host, the EL2 must allow the EL1&0 translation > > > > > > > regime for TraceBuffer (MDCR_EL2.E2TB == 0b11). This must > > > > > > > be saved/restored over a trip to the guest. Also, before > > > > > > > entering the guest, we must flush any trace data if the > > > > > > > TRBE was enabled. And we must prohibit the generation > > > > > > > of trace while we are in EL1 by clearing the TRFCR_EL1. > > > > > > > > > > > > > > For vhe, the EL2 must prevent the EL1 access to the Trace > > > > > > > Buffer. > > > > > > > > > > > > > > Cc: Will Deacon > > > > > > > Cc: Catalin Marinas > > > > > > > Cc: Marc Zyngier > > > > > > > Cc: Mark Rutland > > > > > > > Cc: Anshuman Khandual > > > > > > > Acked-by: Mathieu Poirier > > > > > > > Signed-off-by: Suzuki K Poulose > > > > > > > --- > > > > > > > arch/arm64/include/asm/el2_setup.h | 13 +++++++++ > > > > > > > arch/arm64/include/asm/kvm_arm.h | 2 ++ > > > > > > > arch/arm64/include/asm/kvm_host.h | 2 ++ > > > > > > > arch/arm64/kernel/hyp-stub.S | 3 ++- > > > > > > > arch/arm64/kvm/debug.c | 6 ++--- > > > > > > > arch/arm64/kvm/hyp/nvhe/debug-sr.c | 42 ++++++++++++++++++++++++++++++ > > > > > > > arch/arm64/kvm/hyp/nvhe/switch.c | 1 + > > > > > > > 7 files changed, 65 insertions(+), 4 deletions(-) > > > > > > > > > > > > > > > > > > > Marc - do you want me to pick up this one? > > > > > > > > > > I think the kvmarm tree is the best route for this patch, given the amount > > > > > of changes the tree is going through, in the areas this patch > > > > > touches. Or else there would be conflicts with merging. And this patch > > > > > depends on the patches from this series that were queued. > > > > > > > > > > Here is the depency tree : > > > > > > > > > > a) kvm-arm fixes for debug (Patch 1, 2) & SPE save-restore fix (queued in > > > > > v5.12-rc3) > > > > > > > > > > b) TRBE defintions and Trace synchronization barrier (Patches 5 & 6) > > > > > > > > > > c) kvm-arm TRBE host support (Patch 7) > > > > > > > > > > d) TRBE driver support (and the ETE changes) > > > > > > > > > > > > > > > (c) code merge depends on -> (a) + (b) > > > > > (d) build (no conflicts) depends on -> (b) > > > > > > > > > > > > > > > Now (d) has an indirect dependency on (c) for operational correctness at > > > > > runtime. > > > > > So, if : > > > > > > > > > > kvmarm tree picks up : b + c > > > > > coresight tree picksup : b + d > > > > > > > > > > and if we could ensure the merge order of the trees are in > > > > > kvmarm > > > > > greg-kh (device-misc tree) (coresight goes via this tree) > > > > > > > > > > > > > Greg's char-misc tree is based on the rc releases rather than next. As such it > > > > is a while before other branches like kvmarm get merged, causing all sort of > > > > compilation breakage. > > > > > > My tree can not be based on -next, and neither can any other > > > maintainer's tree, as next is composed of maintainer trees :) > > > > > > > Exactly > > > > > > > we should be fine. > > > > > > > > > > Additionally, we could rip out the Kconfig changes from the TRBE patch > > > > > and add it only at the rc1, once we verify both the trees are in to make > > > > > sure the runtime operation dependency is not triggered. > > > > > > > > > > > > > We could also do that but Greg might frown at the tactic, and rightly so. The > > > > usual way to work with complex merge dependencies is to proceed in steps, which > > > > would mean that all KVM related patches go in the v5.13 merge window. When that > > > > is done we add the ETE/TRBE for the v5.14 merge window. I agree that we waste > > > > an entire cycle but it guarantees to avoid breaking builds and follows the > > > > conventional way to do things. > > > > > > Or someone creates a single branch with a signed tag and it gets pulled > > > into multiple maintainer's trees and never rebased. We've done that > > > lots of time, nothing new there. Or everything goes through one tree, > > > or you wait a release cycle. > > > > > > You have 3 choices, pick one :) > > > > I'm perfectly happy with getting this entire set merged via Marc's > > kvmarm tree, as long as you are fine with it. > > No objection from me at all for this to go that way. Swell - Marc, I'll send you a pull request. > > thanks, > > greg k-h From mboxrd@z Thu Jan 1 00:00:00 1970 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=-13.8 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER, INCLUDES_PATCH,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED autolearn=unavailable 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 DD662C433DB for ; Tue, 30 Mar 2021 16:53:39 +0000 (UTC) Received: from desiato.infradead.org (desiato.infradead.org [90.155.92.199]) (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 7224B619B9 for ; Tue, 30 Mar 2021 16:53:39 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 7224B619B9 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=linaro.org Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=desiato.20200630; h=Sender:Content-Transfer-Encoding :Content-Type:List-Subscribe:List-Help:List-Post:List-Archive: List-Unsubscribe:List-Id:Cc:To:Subject:Message-ID:Date:From:In-Reply-To: References:MIME-Version:Reply-To:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=iO387E9dXirHrzdFzs5GixufB3Dn7PwILVDkLyFS7W0=; b=MZj14OkS0s+rcu3JOhymaYvEK sbWF2hOs+9hwwuKjMDn8uZMg4hajkbcrX3iWp0Q+xUs6rSLHX5Eizqz2P6wwUkSU0q8d0ww3lPFK2 USyK0olOBxhWCexacdq/+rjdrVNnjyjW1lurxJMTYAIkNakQZHMP75BhwKJhXUBGAZm+s2tSpHM/z usYn4hzhR/0wLAsIv4+6qbm3KA8LZ88xyQUuWBTPkcz8PwTcwFm2BRzQktYqq1+YZnCIubMoC3FGm b5XCqn6gtEUSW3BKO+LledK6zizCKboidJX3W3jfaExns3jm9g+t68aSLa49kTfmgg3phLRL0UJER hqa6FFKxw==; Received: from localhost ([::1] helo=desiato.infradead.org) by desiato.infradead.org with esmtp (Exim 4.94 #2 (Red Hat Linux)) id 1lRHbE-004OUn-B7; Tue, 30 Mar 2021 16:52:16 +0000 Received: from mail-io1-xd29.google.com ([2607:f8b0:4864:20::d29]) by desiato.infradead.org with esmtps (Exim 4.94 #2 (Red Hat Linux)) id 1lRHb9-004OTj-P5 for linux-arm-kernel@lists.infradead.org; Tue, 30 Mar 2021 16:52:13 +0000 Received: by mail-io1-xd29.google.com with SMTP id k8so17108822iop.12 for ; Tue, 30 Mar 2021 09:52:10 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=KkAtFBgJyVrb9iuHnJExd0NJVK4yAFyTjJdaicBUnRw=; b=LAH4582+NwnCxqqe3+3sIP97xXc+BUkqqnvowuPgY9Iz4kONSGAQJUWEHtxLk+aI8l GEEB/arsdC3uv34zdRSwjrsexcA5bfXhqmfsxQGVJQeA6ALu++oTk4uU9lGgjGhKvqvX T6r31KQXcBbCdNMnnAMPdbQ0ORrLTkeCblpQ2yv0ZA4JA5eU8L6TFUmsLXYu6nKh9HAP j1xW7br0Z5pA7Itr1SNaiNps+APovmRNWrqSEH6++81C0sbbLqKIeS04aa65iduy3kBi O6HsENhq+/Bh3qW8PC2tbx7nUTCni0PPPdj2JryUft10R79qUTGiYRw94BGHCvn3JFvq GKQA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=KkAtFBgJyVrb9iuHnJExd0NJVK4yAFyTjJdaicBUnRw=; b=psnORs7ZJDrXp87iYhvQvxGnAkI5xwooX6YLWVdCno3nwlFi81xXu9FF5SZABiZhRH 3rkRjIkx2IWMWVx+Llo8mIIKHJrMmRBQPnncPvGDd93MgEphiZi41NEDQ/tP878Mh5e8 3jmyn7N8tuwCqmchXgap0RaFLQSZiAZ9olfQixcpSVcZdmKKlDswtxQthvdR8OVnFQex lCPYRM93/IWn7BAjnfNiIWAMFOdYPWu8x5QaZIXpM1BZKD7Vf+PI5qs4HUPS/LUlTm+p lQ2SVMNrX10ywdS3Wm8qt/QSWmMjwLbY+cnoS7Dzv2JcT0IrUA9zPbv3jXdEGnMMB8Vo HSPw== X-Gm-Message-State: AOAM533+Wa+Odih6fsL2MMiDjrnpYgbuFVpGsYwP4RVx8T2Iaw7iOJ+x EUvuKfVLuBCLACYj/eY45B6UJvSmEh55aXGbEqsL/Q== X-Google-Smtp-Source: ABdhPJyhBSaSMSZBcI2tiOVk3QJARoK9ZRlec1tWbobBP699R0NB9KE3gmV5jf5UDq8fQYvwbUwftVm14LrVLEykqL4= X-Received: by 2002:a05:6638:1390:: with SMTP id w16mr30240526jad.83.1617123128593; Tue, 30 Mar 2021 09:52:08 -0700 (PDT) MIME-Version: 1.0 References: <20210323120647.454211-1-suzuki.poulose@arm.com> <20210323120647.454211-8-suzuki.poulose@arm.com> <20210326165550.GC2009902@xps15> <20210330152314.GA2329603@xps15> In-Reply-To: From: Mathieu Poirier Date: Tue, 30 Mar 2021 10:51:57 -0600 Message-ID: Subject: Re: [PATCH v5 07/19] arm64: kvm: Enable access to TRBE support for host To: Greg KH Cc: Suzuki K Poulose , Marc Zyngier , Catalin Marinas , linux-arm-kernel , Linux Kernel Mailing List , Coresight ML , Mike Leach , Leo Yan , Anshuman Khandual , Will Deacon , Mark Rutland X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20210330_175211_904637_2154FE00 X-CRM114-Status: GOOD ( 47.19 ) 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: , Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org On Tue, 30 Mar 2021 at 10:47, Greg KH wrote: > > On Tue, Mar 30, 2021 at 10:33:51AM -0600, Mathieu Poirier wrote: > > On Tue, 30 Mar 2021 at 09:35, Greg KH wrote: > > > > > > On Tue, Mar 30, 2021 at 09:23:14AM -0600, Mathieu Poirier wrote: > > > > On Tue, Mar 30, 2021 at 11:38:18AM +0100, Suzuki K Poulose wrote: > > > > > On 26/03/2021 16:55, Mathieu Poirier wrote: > > > > > > On Tue, Mar 23, 2021 at 12:06:35PM +0000, Suzuki K Poulose wrote: > > > > > > > For a nvhe host, the EL2 must allow the EL1&0 translation > > > > > > > regime for TraceBuffer (MDCR_EL2.E2TB == 0b11). This must > > > > > > > be saved/restored over a trip to the guest. Also, before > > > > > > > entering the guest, we must flush any trace data if the > > > > > > > TRBE was enabled. And we must prohibit the generation > > > > > > > of trace while we are in EL1 by clearing the TRFCR_EL1. > > > > > > > > > > > > > > For vhe, the EL2 must prevent the EL1 access to the Trace > > > > > > > Buffer. > > > > > > > > > > > > > > Cc: Will Deacon > > > > > > > Cc: Catalin Marinas > > > > > > > Cc: Marc Zyngier > > > > > > > Cc: Mark Rutland > > > > > > > Cc: Anshuman Khandual > > > > > > > Acked-by: Mathieu Poirier > > > > > > > Signed-off-by: Suzuki K Poulose > > > > > > > --- > > > > > > > arch/arm64/include/asm/el2_setup.h | 13 +++++++++ > > > > > > > arch/arm64/include/asm/kvm_arm.h | 2 ++ > > > > > > > arch/arm64/include/asm/kvm_host.h | 2 ++ > > > > > > > arch/arm64/kernel/hyp-stub.S | 3 ++- > > > > > > > arch/arm64/kvm/debug.c | 6 ++--- > > > > > > > arch/arm64/kvm/hyp/nvhe/debug-sr.c | 42 ++++++++++++++++++++++++++++++ > > > > > > > arch/arm64/kvm/hyp/nvhe/switch.c | 1 + > > > > > > > 7 files changed, 65 insertions(+), 4 deletions(-) > > > > > > > > > > > > > > > > > > > Marc - do you want me to pick up this one? > > > > > > > > > > I think the kvmarm tree is the best route for this patch, given the amount > > > > > of changes the tree is going through, in the areas this patch > > > > > touches. Or else there would be conflicts with merging. And this patch > > > > > depends on the patches from this series that were queued. > > > > > > > > > > Here is the depency tree : > > > > > > > > > > a) kvm-arm fixes for debug (Patch 1, 2) & SPE save-restore fix (queued in > > > > > v5.12-rc3) > > > > > > > > > > b) TRBE defintions and Trace synchronization barrier (Patches 5 & 6) > > > > > > > > > > c) kvm-arm TRBE host support (Patch 7) > > > > > > > > > > d) TRBE driver support (and the ETE changes) > > > > > > > > > > > > > > > (c) code merge depends on -> (a) + (b) > > > > > (d) build (no conflicts) depends on -> (b) > > > > > > > > > > > > > > > Now (d) has an indirect dependency on (c) for operational correctness at > > > > > runtime. > > > > > So, if : > > > > > > > > > > kvmarm tree picks up : b + c > > > > > coresight tree picksup : b + d > > > > > > > > > > and if we could ensure the merge order of the trees are in > > > > > kvmarm > > > > > greg-kh (device-misc tree) (coresight goes via this tree) > > > > > > > > > > > > > Greg's char-misc tree is based on the rc releases rather than next. As such it > > > > is a while before other branches like kvmarm get merged, causing all sort of > > > > compilation breakage. > > > > > > My tree can not be based on -next, and neither can any other > > > maintainer's tree, as next is composed of maintainer trees :) > > > > > > > Exactly > > > > > > > we should be fine. > > > > > > > > > > Additionally, we could rip out the Kconfig changes from the TRBE patch > > > > > and add it only at the rc1, once we verify both the trees are in to make > > > > > sure the runtime operation dependency is not triggered. > > > > > > > > > > > > > We could also do that but Greg might frown at the tactic, and rightly so. The > > > > usual way to work with complex merge dependencies is to proceed in steps, which > > > > would mean that all KVM related patches go in the v5.13 merge window. When that > > > > is done we add the ETE/TRBE for the v5.14 merge window. I agree that we waste > > > > an entire cycle but it guarantees to avoid breaking builds and follows the > > > > conventional way to do things. > > > > > > Or someone creates a single branch with a signed tag and it gets pulled > > > into multiple maintainer's trees and never rebased. We've done that > > > lots of time, nothing new there. Or everything goes through one tree, > > > or you wait a release cycle. > > > > > > You have 3 choices, pick one :) > > > > I'm perfectly happy with getting this entire set merged via Marc's > > kvmarm tree, as long as you are fine with it. > > No objection from me at all for this to go that way. Swell - Marc, I'll send you a pull request. > > thanks, > > greg k-h _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel