Received: by 2002:a6b:500f:0:0:0:0:0 with SMTP id e15csp202877iob; Mon, 2 May 2022 17:06:27 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxSUOACh0M5hWtpKN9+qovjYS7RAd7sljRJGI0+sL8KaboBVstN+4BKIc44PGbED+p6mkN+ X-Received: by 2002:a17:902:bc86:b0:151:ec83:4a8b with SMTP id bb6-20020a170902bc8600b00151ec834a8bmr13981488plb.69.1651536387001; Mon, 02 May 2022 17:06:27 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1651536386; cv=none; d=google.com; s=arc-20160816; b=wgSPCtRgty8lDzwG+bmkSiBMk1EF57yr4BX2LGD4N4kXnKnAEVBcRJyhfoH068ZX6P ROnf+Nmq+5PAoYHf3LwhLAu3X+igau3sEBr8n+z0Zdju5XXGuXR84foxQMrOgDInipji DGA+l37DHg8/8qX0H2WlWRb8mZ5WNTNP6kpSguGW9W0ze1BMP2045irWMY/va/9tFNnx BXdJpCy6ScsQklSqbWKLJKbAhtYQX85rMJGB73xAA6VcFu2/xn8Kyqv6gDyW3lr/+p8K jk6HW7kaCyw9GmQva97WKVOnBQOteO5Je9ui0i/whnlNGnm12V2OY2lDxp6o044GC32e hsGQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:subject:message-id:date:from:in-reply-to :references:mime-version:dkim-signature; bh=5k0JBj6NHH1RUsmHXdg39rK3mWkoUsv+nzSG9hIQPgw=; b=jqB+FM7byR8gpFqChoG+iaYbT6F6AhUX6qpiQxudx11NuezHpyP8FZqgCrNZX4Sytj OLFPf/T7YiZOGzHmzsh1cEugx8iArQzMfEHgzkVkswR6EfSQIkxrbQGkhEQFaB1op3ok trdIYG2GeZJo3pkQJFG97u5woPuzmp0y7itXZlXNdQq0o+T7x5QYDzRgC4C/askyQtBd wpkoZ9N2w40gzfRio1rPMnyCO9B5HkLbKME6lpa4d1Q4surJFAZkuIVDEME490SCo9bN ilCg8ToTKzdcofn4zlVEAerbItIGHdnLAM3RrGm2QO4/xyRWfTLeNrE26fQeGuZcnDNP URug== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=OhO1aPIJ; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from lindbergh.monkeyblade.net (lindbergh.monkeyblade.net. [2620:137:e000::1:18]) by mx.google.com with ESMTPS id p12-20020aa79e8c000000b0050e082dea07si1089008pfq.189.2022.05.02.17.06.26 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 02 May 2022 17:06:26 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:18 as permitted sender) client-ip=2620:137:e000::1:18; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=OhO1aPIJ; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id 050196257; Mon, 2 May 2022 17:05:50 -0700 (PDT) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1381032AbiD2Utm (ORCPT + 99 others); Fri, 29 Apr 2022 16:49:42 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:52160 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1380913AbiD2Uti (ORCPT ); Fri, 29 Apr 2022 16:49:38 -0400 Received: from ams.source.kernel.org (ams.source.kernel.org [IPv6:2604:1380:4601:e00::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 9E49084EFA; Fri, 29 Apr 2022 13:46:19 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ams.source.kernel.org (Postfix) with ESMTPS id 63AF2B837B8; Fri, 29 Apr 2022 20:46:18 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 27465C385A7; Fri, 29 Apr 2022 20:46:17 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1651265177; bh=jsYCu34zYnPSZjXO3cgZgGRLcHie+luSSGL0NBVj6U4=; h=References:In-Reply-To:From:Date:Subject:To:Cc:From; b=OhO1aPIJflzlkvH6l9NkZnvTQzJN3xMRD3Ywi9dCUkaV/kAI+dCXRhzRIPPq0LJpz wf28K1qPxxmcDjx2bxndbwp8pVwz2WgaZfoUVBtxuVALnXaF5PtVVE4pESISezRiba KSUiijuh+HPypTZnkMzFr1j7EST6O+tTlWMXT6dkmBruRivHrmjntUP1zDgKB4uWgb rcJ44LffqCdtYSfnnvPxMtdKyHY9Xmk+xiT3oggCgyWMBOlETdsPG05vg1mj4vhlOt 6DtBTaTiaFj4zVJajRF8qRi0lungzXyrw2JLatoVGPwi267UhYD8S7Wm3uHMHG5C59 WzsFopcJEwW3w== Received: by mail-pl1-f172.google.com with SMTP id n18so8126741plg.5; Fri, 29 Apr 2022 13:46:17 -0700 (PDT) X-Gm-Message-State: AOAM531ZWgSZaIP0K0mvz4klF1iLowWCJJp50kTCu8uIJWE99Ke6e5nQ WWHhsUM6OfIZLBimfNeLJ4oGHYi/ih8AdQ8YzA== X-Received: by 2002:a17:90b:4a85:b0:1dc:64:1980 with SMTP id lp5-20020a17090b4a8500b001dc00641980mr5758549pjb.211.1651265176710; Fri, 29 Apr 2022 13:46:16 -0700 (PDT) MIME-Version: 1.0 References: <20220425134204.149042-1-sebastianene@google.com> <20220425134204.149042-2-sebastianene@google.com> In-Reply-To: From: Rob Herring Date: Fri, 29 Apr 2022 15:46:05 -0500 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: [PATCH v3 1/2] dt-bindings: vm-wdt: Add qemu,vm-watchdog compatible To: Sebastian Ene Cc: "linux-kernel@vger.kernel.org" , Derek Kiernan , Dragan Cvetic , Arnd Bergmann , devicetree@vger.kernel.org, Quentin Perret , Will Deacon , Marc Zyngier , Greg Kroah-Hartman Content-Type: text/plain; charset="UTF-8" X-Spam-Status: No, score=-2.9 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,MAILING_LIST_MULTI, RDNS_NONE,SPF_HELO_NONE,T_SCC_BODY_TEXT_LINE autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, Apr 28, 2022 at 9:29 AM Sebastian Ene wrote: > > On Mon, Apr 25, 2022 at 01:29:51PM -0500, Rob Herring wrote: > > On Mon, Apr 25, 2022 at 01:42:05PM +0000, Sebastian Ene wrote: > > > The stall detection mechanism allows to configure the expiration > > > duration and the internal counter clock frequency measured in Hz. > > > Add these properties in the schema. > > > > > > Signed-off-by: Sebastian Ene > > > --- > > > .../devicetree/bindings/misc/vm-wdt.yaml | 44 +++++++++++++++++++ > > > 1 file changed, 44 insertions(+) > > > create mode 100644 Documentation/devicetree/bindings/misc/vm-wdt.yaml > > > > > > diff --git a/Documentation/devicetree/bindings/misc/vm-wdt.yaml b/Documentation/devicetree/bindings/misc/vm-wdt.yaml > > > new file mode 100644 > > > index 000000000000..cb7665a0c5af > > > --- /dev/null > > > +++ b/Documentation/devicetree/bindings/misc/vm-wdt.yaml > > > @@ -0,0 +1,44 @@ > > > +# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause) > > > +%YAML 1.2 > > > +--- > > > +$id: http://devicetree.org/schemas/misc/vm-wdt.yaml# > > > +$schema: http://devicetree.org/meta-schemas/core.yaml# > > > + > > > +title: VM watchdog > > > + > > > +description: | > > > + This binding describes a CPU stall detector mechanism for virtual cpus. > > > + > > > +maintainers: > > > + - Sebastian Ene > > > + > > > +properties: > > > + compatible: > > > + enum: > > > + - qemu,vm-watchdog > > > + clock: > > Hi, > > > > > 'clocks' is already a defined property and 'clock' is too close. It's > > also ambiguous what it is. 'clock-frequency' instead perhaps. > > > > Yes, I think 'clock-frequency' is a better name. I will update it. You are defining the register interface, so why not define a register containing the frequency? Again, make your interface discoverable. > > > + $ref: /schemas/types.yaml#/definitions/uint32 > > > + description: | > > > + The watchdog internal clock measure in Hz used to decrement the > > > + watchdog counter register on each tick. > > > + Defaults to 10 if unset. > > > + timeout-sec: > > > + $ref: /schemas/types.yaml#/definitions/uint32 > > > + description: | > > > + The watchdog expiration timeout measured in seconds. > > > + Defaults to 8 if unset. > > > + > > > +required: > > > + - compatible > > > + > > > +additionalProperties: false > > > + > > > +examples: > > > + - | > > > + watchdog { > > > + compatible = "qemu,vm-watchdog"; > > > + clock = <10>; > > > + timeout-sec = <8>; > > > > How does one access this 'hardware'? > > > > This is a MMIO device. Then how do you discover its address? You need 'reg'. > > Why does this need to be in DT? > > > > We have DT because h/w designers are incapable of making h/w > > discoverable. Why repeat that problem with s/w interfaces? > > > > We need to have this one in the DT because in a secure VM we only load > trusted DT components. How does using DT make something trusted vs. any other mechanism the hypervisor controls? I would like to know from the virtualization folks (Xen/KVM) how they would implement this feature? Certainly this could be reused, but then we need an ACPI binding too for non-DT systems. Why not use virtio? Rob