Received: by 2002:a05:6a10:5594:0:0:0:0 with SMTP id ee20csp600962pxb; Mon, 25 Apr 2022 17:51:22 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyTIVd/LQNC0Hk3DV5mR4axaYduXgUsMxyucceyU+qHnwRJfFslFqnggsn7gZgyx5oJdbRk X-Received: by 2002:a65:4203:0:b0:39d:6f6c:6b62 with SMTP id c3-20020a654203000000b0039d6f6c6b62mr17177254pgq.78.1650934281793; Mon, 25 Apr 2022 17:51:21 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1650934281; cv=none; d=google.com; s=arc-20160816; b=qtttCcYNJD+XIVDDo8w1gUsw7+32/FfMpipxDCvp/zcUL22r95E/iyFp96ORmsGPpn rReHVML97cBnCVKeFA7OjW9ZKZoQTj/Ws9g3k2J6NBr4xrUEkOVS/Vzmaqz6IaAgjam+ 8MgtMt6HPGY0Ij6ev1Mcudc/r4m25DShC+/5cJAsx3fR7j8QmYK/VKJ6PCj9sBBH2pCM 5ZlJEEpK8wPcYCb+Avi2dsCdiApSqkfSw6tjxQCJKfbRq+Yi5vv7lge2v437C8/JbwLK GyarSTGZED1a6El+ep+JkNeHjj7I6lThMVkNSTRtk8OA3KLtgdoYphbFjuP0OXDFML8c RkPA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:in-reply-to:from :references:cc:to:content-language:subject:user-agent:mime-version :date:message-id:dkim-signature; bh=r0QZyBeWqKyz0fDvDlrnLceVxOw9MHH62RSkL/PsS1I=; b=uQD+BtEJNJJdCOFoAznbAMxp5ko0eV2skD6qo79+H9l++m/Gz+hH/38enbxq/RyGjR d7uu+5MrzctCvhgJhuiArxb+k3y/iupDFFUmRg2xyGdifmDCrBC221ORdn5IaW+uycIK ycuRwtnxRBPqY2FcYe5Dgd2q0gBF8PkFwkehWSlVdUIaDNDh5HPx25lz1CiMPPfYJzCq /SwiolvIBW0YTfxe3L1SLBdi5olYl4k6RRNme8lRQj49Me4dsZN+6gU3bXMfDt4BHe3P 7IhLagXzTJk1MCTofdr0OYta6p8NoO+XZiAor3fnaNeGA4QEegQqXUfinFWry2ndje/d zVrg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@infradead.org header.s=desiato.20200630 header.b=OoLr8vxM; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id b13-20020a63cf4d000000b00398d40dfc06si18634523pgj.482.2022.04.25.17.51.05; Mon, 25 Apr 2022 17:51:21 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@infradead.org header.s=desiato.20200630 header.b=OoLr8vxM; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S240309AbiDYQFi (ORCPT + 99 others); Mon, 25 Apr 2022 12:05:38 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:37294 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S238782AbiDYQFc (ORCPT ); Mon, 25 Apr 2022 12:05:32 -0400 Received: from desiato.infradead.org (desiato.infradead.org [IPv6:2001:8b0:10b:1:d65d:64ff:fe57:4e05]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id D03BFE012; Mon, 25 Apr 2022 09:02:26 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=desiato.20200630; h=Content-Transfer-Encoding:Content-Type :In-Reply-To:From:References:Cc:To:Subject:MIME-Version:Date:Message-ID: Sender:Reply-To:Content-ID:Content-Description; bh=r0QZyBeWqKyz0fDvDlrnLceVxOw9MHH62RSkL/PsS1I=; b=OoLr8vxMmA/7L3nlKhi2UFrGQT +TlCzIlEj8nr9vMT2ahglxiYSGwINiNYkoDMQRsvGWwEc/ioFHp5abPKviS2kpu7Uvaf1IFszWPCP EEof+REfNx6wD3RBekhJ6PkT+/cefF1vByc9ZEa5T7FkPjarfWeuzTuCLnkQQutJ2O4GdPiM87kfh AFnZArBWoY2fU5yjcIOLl6LssIE5CE5y8ohjSQCb24N0N755IN8O46EiyrC6xv5dwz/AV6IN2Y0gl IeimM7a0lI4t11FzT9bhzwo48ckDCWq5SPIUucuIs7zmIykYhIb54Mpjb0RoWJjKmI0f1fvbRJiVd srFJP1Cw==; Received: from [2601:1c0:6280:3f0:e65e:37ff:febd:ee53] by desiato.infradead.org with esmtpsa (Exim 4.94.2 #2 (Red Hat Linux)) id 1nj1AG-008ZeN-7w; Mon, 25 Apr 2022 16:02:17 +0000 Message-ID: <1d938867-05b9-fab5-1f48-a635d92420d3@infradead.org> Date: Mon, 25 Apr 2022 09:02:03 -0700 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:91.0) Gecko/20100101 Thunderbird/91.8.0 Subject: Re: [PATCH v3 2/2] misc: Add a mechanism to detect stalls on guest vCPUs Content-Language: en-US To: Sebastian Ene , Rob Herring , Greg Kroah-Hartman , Arnd Bergmann , Dragan Cvetic Cc: linux-kernel@vger.kernel.org, devicetree@vger.kernel.org, maz@kernel.org, will@kernel.org, qperret@google.com References: <20220425134204.149042-1-sebastianene@google.com> <20220425134204.149042-3-sebastianene@google.com> From: Randy Dunlap In-Reply-To: <20220425134204.149042-3-sebastianene@google.com> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=-6.3 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,NICE_REPLY_A,RCVD_IN_DNSWL_MED, SPF_HELO_NONE,SPF_NONE autolearn=ham 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 4/25/22 06:42, Sebastian Ene wrote: > This driver creates per-cpu hrtimers which are required to do the > periodic 'pet' operation. On a conventional watchdog-core driver, the > userspace is responsible for delivering the 'pet' events by writing to > the particular /dev/watchdogN node. In this case we require a strong > thread affinity to be able to account for lost time on a per vCPU. > > This part of the driver is the 'frontend' which is reponsible for > delivering the periodic 'pet' events, configuring the virtual peripheral > and listening for cpu hotplug events. The other part of the driver > handles the peripheral emulation and this part accounts for lost time by > looking at the /proc/{}/task/{}/stat entries and is located here: > https://chromium-review.googlesource.com/c/chromiumos/platform/crosvm/+/3548817 > > Signed-off-by: Sebastian Ene > --- > drivers/misc/Kconfig | 12 +++ > drivers/misc/Makefile | 1 + > drivers/misc/vm-wdt.c | 207 ++++++++++++++++++++++++++++++++++++++++++ > 3 files changed, 220 insertions(+) > create mode 100644 drivers/misc/vm-wdt.c > > diff --git a/drivers/misc/Kconfig b/drivers/misc/Kconfig > index 2b9572a6d114..71c173e3f064 100644 > --- a/drivers/misc/Kconfig > +++ b/drivers/misc/Kconfig > @@ -493,6 +493,18 @@ config OPEN_DICE > > If unsure, say N. > > +config VM_WATCHDOG > + tristate "Virtual Machine Watchdog" > + select LOCKUP_DETECTOR > + help > + Detect CPU locks on the virtual machine. This driver relies on the > + hrtimers which are CPU-binded to do the 'pet' operation. When a vCPU > + has to do a 'pet', it exists the guest through MMIO write and the exits ? I dunno, but it's confusing. > + backend driver takes into account the lost ticks for this particular > + CPU. > + To compile this driver as a module, choose M here: the > + module will be called vm-wdt. -- ~Randy