Received: by 2002:a05:7412:8521:b0:e2:908c:2ebd with SMTP id t33csp1092463rdf; Sat, 4 Nov 2023 06:19:40 -0700 (PDT) X-Google-Smtp-Source: AGHT+IF/VyJ3N/UeVAyiiR0csF2SdYO8EU5azdHttfYHdxibw8dX2i1WDYrWE0x9yHVjJAtDMVB5 X-Received: by 2002:a17:902:efc9:b0:1ca:20a0:7b08 with SMTP id ja9-20020a170902efc900b001ca20a07b08mr22852190plb.50.1699103979847; Sat, 04 Nov 2023 06:19:39 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1699103979; cv=none; d=google.com; s=arc-20160816; b=iaS8krB3rvXtxn7CPvxkVVF4SwW7mKikn5tdxfVGqTsh8zn1brZOwF5tuFK1001LI8 B8FgbY2k/p2+PMa2Bif41GdAjJ7K+3fUvvZO15zkbDGUyaSDoBu7GLb7ydFZHKPkL/Cc xYqYtOj20fmTI+PsXxhA3R6VxF4vByl1SPQ6y9vF7f+x/mYeifQS8KMwcOm5YrQJ9neK xHldIYKO0pCAw66Yqu3efrEfy05W/n9Wi+1YrhjrDSpnj5pEc6SrF37PpNTacDQQLrUb R+WtXSCmGHxzQQCmw0E80/vShsD2/N9WjxfhxL3s/3ExnasMS+jZuzePepQEm4omqYi3 t3Xg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-transfer-encoding :content-disposition:mime-version:references:message-id:subject:cc :to:from:date:dkim-signature; bh=qOxbvFjtmafot1stLDekiq67UQ9eB5y/Ehg94/Sjt3M=; fh=4ATEPdFj4ZvqLkaF1r7tTd6pypil3tLTU9YpGxY1IDc=; b=B7hTcyoyaA9VHQ+w0RpTM2HGuc7C+Q3a+b8yjcWK+HgVX+epypoFT81XznYmpO1mW6 GjxovV5drs+wZfdcsCP7f62Va2Wgw8xOzNtyGn9H9UKSaYWHzGpdCEja03oGHowLfloW ZmfuyDpvxlvwCm1AKQpXZMJdKnLW6HwapHXyof1jkmnfpzO6bkmKXRB+W5ADdrDXsf/U LGPlphwCRjNGRkDUOdOeJ3tPIcJx2mZ3iUzkURFj0mzIjKW1ScF4B8NwLfpcXDeobzWj NsHLK2vjesHhXdR0TPxewqdDOm914kSthqym9WW6JMXeUcXKxBbWWWIh7E9Rf1NbgU2g kNtw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@weissschuh.net header.s=mail header.b=k4QTOors; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:7 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from snail.vger.email (snail.vger.email. [2620:137:e000::3:7]) by mx.google.com with ESMTPS id ja2-20020a170902efc200b001cc30cb3fbesi3776908plb.147.2023.11.04.06.19.39 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 04 Nov 2023 06:19:39 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:7 as permitted sender) client-ip=2620:137:e000::3:7; Authentication-Results: mx.google.com; dkim=pass header.i=@weissschuh.net header.s=mail header.b=k4QTOors; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:7 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by snail.vger.email (Postfix) with ESMTP id CF32E80425BC; Sat, 4 Nov 2023 06:19:38 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at snail.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231348AbjKDNQ7 (ORCPT + 99 others); Sat, 4 Nov 2023 09:16:59 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:41016 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229456AbjKDNQ6 (ORCPT ); Sat, 4 Nov 2023 09:16:58 -0400 Received: from todd.t-8ch.de (todd.t-8ch.de [159.69.126.157]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 0EECE194 for ; Sat, 4 Nov 2023 06:16:56 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=weissschuh.net; s=mail; t=1699103813; bh=u0qeXEEOdwc8vPkT1WlKQFA0UcoAyRJbJYXcMqHSGT8=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=k4QTOorshB3i8vekuVrzyZr81UV534ymfN6qwAo83A181YnK2onhXDNue2X9TOuae V9VSiuld6IT73X19WzF5JXItOmrOMGCUgo7WLw/Z8AfRcjaWTPCLgaeZypZpSRd/6K s1eWwYneUJvxFU7L/yw0w0iyppHfVbSVXMBw3gLY= Date: Sat, 4 Nov 2023 14:16:53 +0100 From: Thomas =?utf-8?Q?Wei=C3=9Fschuh?= To: Greg Kroah-Hartman Cc: Arnd Bergmann , linux-kernel@vger.kernel.org, Zhangjin Wu , Willy Tarreau , Yuan Tan Subject: Re: [PATCH RFC] misc/pvpanic: add support for normal shutdowns Message-ID: <365bbe1f-5ee8-40fe-bec0-53d9e7395c18@t-8ch.de> References: <20231104-pvpanic-shutdown-v1-1-5ee7c9b3e301@weissschuh.net> <2023110407-unselect-uptight-b96d@gregkh> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <2023110407-unselect-uptight-b96d@gregkh> X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_BLOCKED, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE,URIBL_BLOCKED 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 X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (snail.vger.email [0.0.0.0]); Sat, 04 Nov 2023 06:19:39 -0700 (PDT) On 2023-11-04 14:05:02+0100, Greg Kroah-Hartman wrote: > On Sat, Nov 04, 2023 at 12:29:30PM +0100, Thomas Weißschuh wrote: > > Shutdown requests are normally hardware dependent. > > By extending pvpanic to also handle shutdown requests, guests can > > submit such requests with an easily implementable and cross-platform > > mechanism. > > > > Signed-off-by: Thomas Weißschuh > > --- > > The corresponding patch to qemu has also been submitted[0]. > > General discussions about the feature should happen on the other thread. > > > > [0] https://lore.kernel.org/qemu-devel/20231104-pvpanic-shutdown-v1-0-02353157891b@t-8ch.de/ > > --- > > drivers/misc/pvpanic/pvpanic.c | 19 +++++++++++++++++-- > > include/uapi/misc/pvpanic.h | 1 + > > 2 files changed, 18 insertions(+), 2 deletions(-) [..] > > diff --git a/include/uapi/misc/pvpanic.h b/include/uapi/misc/pvpanic.h > > index 54b7485390d3..82fc618bfbcf 100644 > > --- a/include/uapi/misc/pvpanic.h > > +++ b/include/uapi/misc/pvpanic.h > > @@ -5,5 +5,6 @@ > > > > #define PVPANIC_PANICKED (1 << 0) > > #define PVPANIC_CRASH_LOADED (1 << 1) > > +#define PVPANIC_SHUTDOWN (1 << 2) > > Why are these in a uapi file? They are ABI between qemu and its guest. The specification for these values is part of qemu but for some reason the header is part of Linux which is then imported back into qemu. I guess this has historical reasons, maybe because qemu doesn't really ship ABI headers and for Linux it's natural. The real reason probably doesn't matter today as the header propably can't be dropped from Linux anyways for compatibility reasons. > And if they need to be here, why not use the proper BIT() macro for it? This was for uniformity with the existing code. I can send a (standalone?) patch to fix it up. Thomas