Received: by 2002:a05:7412:b995:b0:f9:9502:5bb8 with SMTP id it21csp1774233rdb; Sun, 24 Dec 2023 00:59:21 -0800 (PST) X-Google-Smtp-Source: AGHT+IFyafNFv+OpPcR5IAHM9FTSRbEP4BHonqV7lmDE5mLZ86Tj17lzEfdDbyf21wavMeNCfK4M X-Received: by 2002:a05:6808:3c97:b0:3bb:a468:1c1 with SMTP id gs23-20020a0568083c9700b003bba46801c1mr917017oib.99.1703408361569; Sun, 24 Dec 2023 00:59:21 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1703408361; cv=none; d=google.com; s=arc-20160816; b=ZjXdv63TVa9eCZHuMryj/9Jv4TKfG/wkyPgMeh/etaIWFIbd6eX7GJ4JtwJVq4MzMv dOIqYqHsUwnLvkLH5sxPs70K4QXHwBGK6it0fq+nuUhOGgej37VB7TABxcVP9nzPZCFH cSepTXwJEOXvnqgxLCOq+AYJSny44FdOw5qcY+bUMlCyFwxcPdyoTa0H0lnm8J7j2fj6 oN4uQEROFC43GSzXrx0xanRTrLfwsA5XaqrzN41+1QPZ1OVGvJJCgh5lNM7o6RFzU2hk aWRCw4r7CtoMtn5UNoR9hsCzTykA2Wpl6pOONk+E3nf8HRT1dKYJWH9nXeD9LUI+B3c+ VfWQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:in-reply-to:autocrypt:from :content-language:references:cc:to:subject:user-agent:mime-version :list-unsubscribe:list-subscribe:list-id:precedence:date:message-id :dkim-signature; bh=NNNZwmmHpFEp9KluoTDo1kPLn1YyhBCI6z185EMKpYY=; fh=Ct7jLPYMc41foKPf8c8jI5FvJrWExMGAtQq+3grgLyE=; b=E18kUiKZBDNAWx65bawzLEn+kxwsdRcOso1+P4srDsaQhlZt4WgQwZTSqxtt9czdeH ZCJvIyjiPzXNXcn69OreuIVLBShJMmlPLtqXlk4vtqK0HuVXr4wUNfHD/GaNlRNa2gt+ EaRoLjKWu6tYQKgv9oB0d9v0n1lR3bYRZoFyURv6LealHG67rOwn+EhOX6xDW5ercN8X O2FJSlPbyyp3ITXdR8RIWlmYIoA5djtKNlE0jjqFp1WEYOsX/KM1K0R3eae91RF/LnmY 3MvG3cU+xfvNFfNUzW+KZxXTQ+B/9k41R8LwHxAGV5CJez4WJjSLOziCYdb2kQidsj78 Ov5w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=SEWCQDDl; spf=pass (google.com: domain of linux-kernel+bounces-10666-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.48.161 as permitted sender) smtp.mailfrom="linux-kernel+bounces-10666-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from sy.mirrors.kernel.org (sy.mirrors.kernel.org. [147.75.48.161]) by mx.google.com with ESMTPS id 1-20020a631741000000b005cdf792310fsi3803707pgx.676.2023.12.24.00.59.21 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 24 Dec 2023 00:59:21 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-10666-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.48.161 as permitted sender) client-ip=147.75.48.161; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=SEWCQDDl; spf=pass (google.com: domain of linux-kernel+bounces-10666-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.48.161 as permitted sender) smtp.mailfrom="linux-kernel+bounces-10666-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by sy.mirrors.kernel.org (Postfix) with ESMTPS id 2EFC0B21949 for ; Sun, 24 Dec 2023 08:59:17 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id EF7971FBC; Sun, 24 Dec 2023 08:59:07 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="SEWCQDDl" X-Original-To: linux-kernel@vger.kernel.org Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 1AF4215C5; Sun, 24 Dec 2023 08:59:06 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 6A61DC433C8; Sun, 24 Dec 2023 08:59:00 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1703408346; bh=ua9qUiBueopgoOkX0jAStkd+tSclawKgL6vPqUrmrrU=; h=Date:Subject:To:Cc:References:From:In-Reply-To:From; b=SEWCQDDl7bTDerFb5LpY6qpCroNeT0OYDCAGdWuSJ16i3ybasPoJaW8HfVOZCkxJt IfZuo8cxkplAqzQfYZQMUcbSg2u8fICv2u8GtKVNmY0wowrBYwVbX+j73G2XAbzb2T o7HHCtRtYaQCsp4IhvQglp1AzWHNnc9CAgxwfTNcueB6Dw53qbVx/AK5us7a/ky+sq LdYE45aB6wtMrz0SlBDDJahVHC8lOBNydSEQyhiCfwDowqXcvsV1on01JV889z3/be NhJXluSVLW4OsVPdH+4aE1uW2ZESexG5LRqBqqUTLhPdkgW0I9znrYNMdpQojOr7NC ZRkoYOGC8Bnsw== Message-ID: Date: Sun, 24 Dec 2023 09:58:57 +0100 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH v2 17/17] devicetree: Add bindings for ftrace KHO To: Alexander Graf , linux-kernel@vger.kernel.org Cc: linux-trace-kernel@vger.kernel.org, linux-mm@kvack.org, devicetree@vger.kernel.org, linux-arm-kernel@lists.infradead.org, kexec@lists.infradead.org, linux-doc@vger.kernel.org, x86@kernel.org, Eric Biederman , "H. Peter Anvin" , Andy Lutomirski , Peter Zijlstra , Rob Herring , Steven Rostedt , Andrew Morton , Mark Rutland , Tom Lendacky , Ashish Kalra , James Gowans , Stanislav Kinsburskii , arnd@arndb.de, pbonzini@redhat.com, madvenka@linux.microsoft.com, Anthony Yznaga , Usama Arif , David Woodhouse , Benjamin Herrenschmidt References: <20231222193607.15474-1-graf@amazon.com> <20231222195144.24532-1-graf@amazon.com> <20231222195144.24532-12-graf@amazon.com> <39a33f9b-0290-428d-ab1f-f90856cdb31d@kernel.org> <34e78a84-a29d-4b01-a860-cac3959f6cb6@amazon.com> Content-Language: en-US From: Krzysztof Kozlowski Autocrypt: addr=krzk@kernel.org; keydata= xsFNBFVDQq4BEAC6KeLOfFsAvFMBsrCrJ2bCalhPv5+KQF2PS2+iwZI8BpRZoV+Bd5kWvN79 cFgcqTTuNHjAvxtUG8pQgGTHAObYs6xeYJtjUH0ZX6ndJ33FJYf5V3yXqqjcZ30FgHzJCFUu JMp7PSyMPzpUXfU12yfcRYVEMQrmplNZssmYhiTeVicuOOypWugZKVLGNm0IweVCaZ/DJDIH gNbpvVwjcKYrx85m9cBVEBUGaQP6AT7qlVCkrf50v8bofSIyVa2xmubbAwwFA1oxoOusjPIE J3iadrwpFvsZjF5uHAKS+7wHLoW9hVzOnLbX6ajk5Hf8Pb1m+VH/E8bPBNNYKkfTtypTDUCj NYcd27tjnXfG+SDs/EXNUAIRefCyvaRG7oRYF3Ec+2RgQDRnmmjCjoQNbFrJvJkFHlPeHaeS BosGY+XWKydnmsfY7SSnjAzLUGAFhLd/XDVpb1Een2XucPpKvt9ORF+48gy12FA5GduRLhQU vK4tU7ojoem/G23PcowM1CwPurC8sAVsQb9KmwTG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poh8WWfRS+xegBxc6hBXahpyUKphAKYkah+m+I0QToCfnGKnPqyYIMDEHCS/RfqA5 t8F+O56+oyLBAeWX7XcmyM6TGeVfb+OZVMJnZzK0s2VYAuI0Rl87FBFYgULdgqKV7R7WHzwD uZwJCLykjad45hsWcOGk3OcaAGQS6NDlfhM6O9aYNwGL6tGt/6BkRikNOs7VDEa4/HlbaSJo 7FgndGw1kWmkeL6oQh7wBvYll2buKod4qYntmNKEicoHGU+x91Gcan8mCoqhJkbqrL7+nXG2 5Q/GS5M9RFWS+nYyJh+c3OcfKqVcZQNANItt7+ULzdNJuhvTRRdC3g9hmCEuNSr+CLMdnRBY fv0= In-Reply-To: <34e78a84-a29d-4b01-a860-cac3959f6cb6@amazon.com> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit On 24/12/2023 00:20, Alexander Graf wrote: >>> new file mode 100644 >>> index 000000000000..9960fefc292d >>> --- /dev/null >>> +++ b/Documentation/devicetree/bindings/kho/ftrace/ftrace-array.yaml >>> @@ -0,0 +1,46 @@ >>> +# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause) >>> +%YAML 1.2 >>> +--- >>> +$id: http://devicetree.org/schemas/kho/ftrace/ftrace-array.yaml# >>> +$schema: http://devicetree.org/meta-schemas/core.yaml# >>> + >>> +title: Ftrace trace array >>> + >> Missing description. Commit msg also does not tell me much. This must >> stand on its own and must describe the hardware. Whatever you have in >> cover letter, does not matter, especially that you did not Cc us on it. > > > Alrighty, I'll add descriptions and make the commit message stand on its > own. > > For quick reference: KHO is a new mechanism this patch set introduces > which allows Linux to pass arbitrary memory and metadata between kernels > on kexec. I'm reusing FDTs to implement the hand over protocol, as > Linux-to-Linux boot communication holds very similar properties to > firmware-to-Linux boot communication. So this binding is not about > hardware; it's about preserving Linux subsystem state across kexec. Devicetree is for non-discoverable systems and their hardware, not for passing arbitrary data between kernels. For me this does not suit DT at all, please use other ways. > > For more details, please refer to the KHO documentation which is part of > patch 7 of this patch set: > https://lore.kernel.org/lkml/20231222195144.24532-2-graf@amazon.com/ > > >> >>> +maintainers: >>> + - Alexander Graf >>> + >>> +properties: >>> + compatible: >>> + enum: >>> + - ftrace,array-v1 >>> + >>> + trace_flags: >> Underscores are not allowed. Does not look like generic property. > > > Let me make it "trace-flags" to not have underscores. Could you please > elaborate on what you mean by generic property? Generic property, so one without vendor prefix, is shared and common to a group of devices. > > >> >> >>> + $ref: /schemas/types.yaml#/definitions/uint32 >>> + description: >>> + Bitmap of all the trace flags that were enabled in the trace array at the >>> + point of serialization. >>> + >>> +# Subnodes will be of type "ftrace,cpu-v1", one each per CPU >>> +additionalProperties: true >> No, this must be false. And it goes after required: > > > Ok, making it false and adding pattern matches instead for subnodes. > > >> >> >>> + >>> +required: >>> + - compatible >>> + - trace_flags >>> + >>> +examples: >>> + - | >>> + ftrace { >>> + compatible = "ftrace-v1"; >>> + events = <1 1 2 2 3 3>; >>> + >>> + global_trace { >> Again, no underscores. > > > Ok :) > > >> >>> + compatible = "ftrace,array-v1"; >>> + trace_flags = < 0x3354601 >; >>> + >>> + cpu0 { >>> + compatible = "ftrace,cpu-v1"; >>> + cpu = < 0x00 >; >> Drop redundant spaces. > > > I don't understand what you're referring to as redundant spaces? Double > checking, I believe indentation is off for every line below "ftrace {". > Is that what you're referring to? Fixing :) Open DTS, some recent, arm64 like Qualcomm. Do you see spaces around <>? Or open the coding style document... Please do not introduce different coding style. > > >> >>> + mem = < 0x101000000ULL 0x38ULL 0x101000100ULL 0x1000ULL 0x101000038ULL 0x38ULL 0x101002000ULL 0x1000ULL>; >> ? Do you see any of such syntax in DTS? > > > I was trying to make it easy to reason to readers about 64bit numbers - 64bit numbers are not a problem for DTS reading. Above syntax is. > and then potentially extend dtc to consume that new syntax. KHO DTs are > native/little endian, so dtc already has some difficulties interpreting > it which I'll need to fix up with patches to it eventually :). I'll > change it to something that looks more 32bit'y for now. > Best regards, Krzysztof