Received: by 2002:a25:e74b:0:0:0:0:0 with SMTP id e72csp2221224ybh; Fri, 17 Jul 2020 12:12:59 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzNEhd2LhQRQ6EUpWXLe9w4HyHrij7yEUL3rNZIUCfzsW6L6rA8w4BizHDvcee6enlqGEMZ X-Received: by 2002:a50:9f08:: with SMTP id b8mr8694620edf.388.1595013179210; Fri, 17 Jul 2020 12:12:59 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1595013179; cv=none; d=google.com; s=arc-20160816; b=rDCd+taaRMLopum+z5HWgJD3Dh/CXPXi2UZP49a8SyFbWIb7Ps+a7zQKLRYwpKFmTx MBKrX14EJsciH01AiWk11HeXIbubOwG6JUAcbsGL5ycdQTU9bQroeWOROGdQuKQbJ6Dz PfL/RiMvW1MG5CCN6TA5z5/e2s+PNpYxBgMJHnSZI3StRS10sccIEHT325y0UGATZm5E Vzb9T9DCrceTbU7maz9xFYwLKgTV2ZoiMPq0tdq4BuQN19lGkfj+XKWXlVtwSjisXpBE sENYzOq7j7lM3LH3+SIApct7sERCfgL5jItSnjvWgva6TXwH4mPNdhxXZHxbiOuT6SAG HJ3A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-transfer-encoding:content-disposition:mime-version :references:message-id:cc:to:from:date:subject:ironport-sdr :dkim-signature; bh=JXEp3fu4ueKSPTL/aTTxogwWbfIdE4zKSLg5x2ylncA=; b=XP4Jkr3/RqyiEgvpVmbdbLwWP3md2uoxsbbMgtXFUiDa8TbLivXPMsFjvKucJmyvV3 Nb/cKEO9YvU/la7HmvMEnWIafYOrpjbuHwFuVPzVSPtM42LXwrCX3RZfjsQnuzUywQfv Inok1glvfpUMB/s1M0rG6JX7uc3ZtqH4i3zN+p8vf3RpeejtD5wkmbZO76xwwXEeWABu /0yX7l9UUeMc0ZlpsTrDX3aRA11JFabssYWguA/JMTZ9Hy/3tiw2RUozMfpqcJ/D1VAT wM6z4K2+CEeH1fOGvOEOyKoXOeMNbLVMhiRZogjOzV2PtG0CVfjWpJtngkmrMmHtVs7U tnGQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@amazon.com header.s=amazon201209 header.b=qFWB9M0p; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=amazon.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id x94si6681497ede.416.2020.07.17.12.12.36; Fri, 17 Jul 2020 12:12:59 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@amazon.com header.s=amazon201209 header.b=qFWB9M0p; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=amazon.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728565AbgGQTKf (ORCPT + 99 others); Fri, 17 Jul 2020 15:10:35 -0400 Received: from smtp-fw-4101.amazon.com ([72.21.198.25]:58472 "EHLO smtp-fw-4101.amazon.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728182AbgGQTKd (ORCPT ); Fri, 17 Jul 2020 15:10:33 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=amazon.com; i=@amazon.com; q=dns/txt; s=amazon201209; t=1595013033; x=1626549033; h=date:from:to:cc:message-id:references:mime-version: content-transfer-encoding:in-reply-to:subject; bh=JXEp3fu4ueKSPTL/aTTxogwWbfIdE4zKSLg5x2ylncA=; b=qFWB9M0p4V9EPFUX9w3CtmL975Re8xUfeScpOkbW6oj2DTGFjPIHiIMR GADrCHxJI1cPfotygfYbnRJ/COloPrZfb1ZMYfW/sFDnXT5cFzuud0rta 2eyL3KD/Cvwb7/O/h0iya5YppUjJHaaNB/F4sTcRYTLJgxf514RxfGnFB 8=; IronPort-SDR: B7g8C+O+44k2rWyS1+qLZ7Ril88L7euUS5PHylv/wSxXaBC1vnDAauj2J020dgzo+5pOznIGT3 9bsyqNana+Aw== X-IronPort-AV: E=Sophos;i="5.75,364,1589241600"; d="scan'208";a="42640067" Subject: Re: [PATCH v2 01/11] xen/manage: keep track of the on-going suspend mode Received: from iad12-co-svc-p1-lb1-vlan3.amazon.com (HELO email-inbound-relay-1e-303d0b0e.us-east-1.amazon.com) ([10.43.8.6]) by smtp-border-fw-out-4101.iad4.amazon.com with ESMTP; 17 Jul 2020 19:10:32 +0000 Received: from EX13MTAUEE002.ant.amazon.com (iad55-ws-svc-p15-lb9-vlan2.iad.amazon.com [10.40.159.162]) by email-inbound-relay-1e-303d0b0e.us-east-1.amazon.com (Postfix) with ESMTPS id D73BFA20E1; Fri, 17 Jul 2020 19:10:24 +0000 (UTC) Received: from EX13D08UEE003.ant.amazon.com (10.43.62.118) by EX13MTAUEE002.ant.amazon.com (10.43.62.24) with Microsoft SMTP Server (TLS) id 15.0.1497.2; Fri, 17 Jul 2020 19:10:09 +0000 Received: from EX13MTAUEA002.ant.amazon.com (10.43.61.77) by EX13D08UEE003.ant.amazon.com (10.43.62.118) with Microsoft SMTP Server (TLS) id 15.0.1497.2; Fri, 17 Jul 2020 19:10:09 +0000 Received: from dev-dsk-anchalag-2a-9c2d1d96.us-west-2.amazon.com (172.22.96.68) by mail-relay.amazon.com (10.43.61.169) with Microsoft SMTP Server id 15.0.1497.2 via Frontend Transport; Fri, 17 Jul 2020 19:10:09 +0000 Received: by dev-dsk-anchalag-2a-9c2d1d96.us-west-2.amazon.com (Postfix, from userid 4335130) id 3826A56980; Fri, 17 Jul 2020 19:10:09 +0000 (UTC) Date: Fri, 17 Jul 2020 19:10:09 +0000 From: Anchal Agarwal To: Boris Ostrovsky CC: , , , , , , , , , , , , , , , , , , , , , , , , , Message-ID: <20200717191009.GA3387@dev-dsk-anchalag-2a-9c2d1d96.us-west-2.amazon.com> References: <20200702182136.GA3511@dev-dsk-anchalag-2a-9c2d1d96.us-west-2.amazon.com> <50298859-0d0e-6eb0-029b-30df2a4ecd63@oracle.com> <20200715204943.GB17938@dev-dsk-anchalag-2a-9c2d1d96.us-west-2.amazon.com> <0ca3c501-e69a-d2c9-a24c-f83afd4bdb8c@oracle.com> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <0ca3c501-e69a-d2c9-a24c-f83afd4bdb8c@oracle.com> User-Agent: Mutt/1.5.21 (2010-09-15) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, Jul 15, 2020 at 05:18:08PM -0400, Boris Ostrovsky wrote: > CAUTION: This email originated from outside of the organization. Do not click links or open attachments unless you can confirm the sender and know the content is safe. > > > > On 7/15/20 4:49 PM, Anchal Agarwal wrote: > > On Mon, Jul 13, 2020 at 11:52:01AM -0400, Boris Ostrovsky wrote: > >> CAUTION: This email originated from outside of the organization. Do not click links or open attachments unless you can confirm the sender and know the content is safe. > >> > >> > >> > >> On 7/2/20 2:21 PM, Anchal Agarwal wrote: > >>> + > >>> +bool xen_is_xen_suspend(void) > >> > >> Weren't you going to call this pv suspend? (And also --- is this suspend > >> or hibernation? Your commit messages and cover letter talk about fixing > >> hibernation). > >> > >> > > This is for hibernation is for pvhvm/hvm/pv-on-hvm guests as you may call it. > > The method is just there to check if "xen suspend" is in progress. > > I do not see "xen_suspend" differentiating between pv or hvm > > domain until later in the code hence, I abstracted it to xen_is_xen_suspend. > > > I meant "pv suspend" in the sense that this is paravirtual suspend, not > suspend for paravirtual guests. Just like pv drivers are for both pv and > hvm guests. > > > And then --- should it be pv suspend or pv hibernation? > > Ok so I think I am lot confused by this question. Here is what this function for, function xen_is_xen_suspend() just tells us whether the guest is in "SHUTDOWN_SUSPEND" state or not. This check is needed for correct invocation of syscore_ops callbacks registered for guest's hibernation and for xenbus to invoke respective callbacks[suspend/resume vs freeze/thaw/restore]. Since "shutting_down" state is defined static and is not directly available to other parts of the code, the function solves the purpose. I am having hard time understanding why this should be called pv suspend/hibernation unless you are suggesting something else? Am I missing your point here? > > >>> +{ > >>> + return suspend_mode == XEN_SUSPEND; > >>> +} > >>> + > >> > >> +static int xen_setup_pm_notifier(void) > >> +{ > >> + if (!xen_hvm_domain()) > >> + return -ENODEV; > >> > >> I forgot --- what did we decide about non-x86 (i.e. ARM)? > > It would be great to support that however, its out of > > scope for this patch set. > > I’ll be happy to discuss it separately. > > > I wasn't implying that this *should* work on ARM but rather whether this > will break ARM somehow (because xen_hvm_domain() is true there). > > Ok makes sense. TBH, I haven't tested this part of code on ARM and the series was only support x86 guests hibernation. Moreover, this notifier is there to distinguish between 2 PM events PM SUSPEND and PM hibernation. Now since we only care about PM HIBERNATION I may just remove this code and rely on "SHUTDOWN_SUSPEND" state. However, I may have to fix other patches in the series where this check may appear and cater it only for x86 right? > > >> > >> And PVH dom0. > > That's another good use case to make it work with however, I still > > think that should be tested/worked upon separately as the feature itself > > (PVH Dom0) is very new. > > > Same question here --- will this break PVH dom0? > I haven't tested it as a part of this series. Is that a blocker here? > Thanks, Anchal > -boris > >