Received: by 2002:a25:683:0:0:0:0:0 with SMTP id 125csp1644229ybg; Thu, 4 Jun 2020 15:24:37 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxGrRoOGSv33Fyvksk0emBy9/KOD+qg83UKY7qDYB4R7gw+Es6wEM4+nCd+KKlJ9aLCiOeo X-Received: by 2002:a17:906:a88:: with SMTP id y8mr6226733ejf.68.1591309476991; Thu, 04 Jun 2020 15:24:36 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1591309476; cv=none; d=google.com; s=arc-20160816; b=aUTKa7n163966Sa0V+37TcCKoFIs/z+l3QfPT0KfL4O9ofndBxgvUOO3OrL+fciNUo EiVxfFXvSohblsEZXN7lO9iMq8i1EVXLCosN5bXw1ST5Xpj47keo3n3jXPng+oV5GCn2 iv3pMvjcxTHaxONNN5ggplbiqvFJihnrM4gifaGAVcLmnmXXVYc2jMD33ST1SiY2EFNo PxnEC5mj73XGAu41RwiP3xp/VOPQUSo9VC5KUPjm8Zj0auLYQ6WOLMIFA08FVx6zpQyU OoK8dnCABIZiKbQu2ZF8emmVXj5slcR2fNMJlGjxagTzLkEecbz1HzGah3zpHhV+KcJc 3v/Q== 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-disposition:mime-version:references:message-id:cc:to:from :date:subject:ironport-sdr:dkim-signature; bh=HTqcTU628wYZT8oBd+ArbsC8bAoTC8fUsqm9xVXgmro=; b=EhWkNCPCuNR+0+7PqTIk08Q/5ZyiKfT1gflzX4PB/DuEtumWhEs/4ATpMLriEX2bPJ 5OHSCs01LvpGT8dz2otV51w+/RytAL8sy6LGDgm3iGRwMRY0JEBPe52CbYWuDXeHprcw Q6p9EgjEW4RmLUdoPK8q8U5N69A20bGscAVjySkggfl3STy0sy8Rj6gh8VkrVmuZIzqc Wza5dGfgDLbAXc1XoCxcdCAqz6e6FZDICLZj/5KsuXi+oX56+C1gt1PV/4D0UB2wNXJf vOCM3BeXKW52cmKO+D+Syqlda0stNjVoH0MCd/DY+aWubYrgeZkCx6frYWrOGehA0lAK nwMQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@amazon.com header.s=amazon201209 header.b=Xp9f4OPO; 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 d4si2374804ejw.326.2020.06.04.15.24.14; Thu, 04 Jun 2020 15:24:36 -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=Xp9f4OPO; 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 S1730464AbgFDSeA (ORCPT + 99 others); Thu, 4 Jun 2020 14:34:00 -0400 Received: from smtp-fw-9101.amazon.com ([207.171.184.25]:56834 "EHLO smtp-fw-9101.amazon.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1730348AbgFDSeA (ORCPT ); Thu, 4 Jun 2020 14:34:00 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=amazon.com; i=@amazon.com; q=dns/txt; s=amazon201209; t=1591295640; x=1622831640; h=date:from:to:cc:message-id:references:mime-version: in-reply-to:subject; bh=HTqcTU628wYZT8oBd+ArbsC8bAoTC8fUsqm9xVXgmro=; b=Xp9f4OPOff8jKD9jEy1DjSHAIcs2lzAnVrlmF0AHlIJCv2t4VyR2I90N W2uPj+W/Lk5RB/+9ORMMpEcESt24L93jfYkl583RKiRRNFX49bmz4ONaR B2P/P6uydCs3Meo0yV8sS5exYbOWuUKhWhAxbnRfUk0jqI/ddyiyO3P8K 0=; IronPort-SDR: Bp9sXjz5OL6Qmgdn1t2NjI2Ij78oRPs1ANk1UfVNxYHuSJrPGMGuWQ5o01KOARrU4ThWIT/DpG g10L4tLv3oVA== X-IronPort-AV: E=Sophos;i="5.73,472,1583193600"; d="scan'208";a="41639696" Subject: Re: [PATCH 09/12] x86/xen: save and restore steal clock Received: from sea32-co-svc-lb4-vlan3.sea.corp.amazon.com (HELO email-inbound-relay-2a-90c42d1d.us-west-2.amazon.com) ([10.47.23.38]) by smtp-border-fw-out-9101.sea19.amazon.com with ESMTP; 04 Jun 2020 18:33:58 +0000 Received: from EX13MTAUEB002.ant.amazon.com (pdx4-ws-svc-p6-lb7-vlan3.pdx.amazon.com [10.170.41.166]) by email-inbound-relay-2a-90c42d1d.us-west-2.amazon.com (Postfix) with ESMTPS id 2AEAAA22B6; Thu, 4 Jun 2020 18:33:56 +0000 (UTC) Received: from EX13D08UEB004.ant.amazon.com (10.43.60.142) by EX13MTAUEB002.ant.amazon.com (10.43.60.12) with Microsoft SMTP Server (TLS) id 15.0.1497.2; Thu, 4 Jun 2020 18:33:36 +0000 Received: from EX13MTAUEB002.ant.amazon.com (10.43.60.12) by EX13D08UEB004.ant.amazon.com (10.43.60.142) with Microsoft SMTP Server (TLS) id 15.0.1497.2; Thu, 4 Jun 2020 18:33:36 +0000 Received: from dev-dsk-anchalag-2a-9c2d1d96.us-west-2.amazon.com (172.22.96.68) by mail-relay.amazon.com (10.43.60.234) with Microsoft SMTP Server id 15.0.1497.2 via Frontend Transport; Thu, 4 Jun 2020 18:33:36 +0000 Received: by dev-dsk-anchalag-2a-9c2d1d96.us-west-2.amazon.com (Postfix, from userid 4335130) id 5663D403BB; Thu, 4 Jun 2020 18:33:36 +0000 (UTC) Date: Thu, 4 Jun 2020 18:33:36 +0000 From: Anchal Agarwal To: Boris Ostrovsky CC: , , , , , , , , , , , , , , , , , , , , , , , , , , Message-ID: <20200604183336.GA25251@dev-dsk-anchalag-2a-9c2d1d96.us-west-2.amazon.com> References: <6f39a1594a25ab5325f34e1e297900d699cd92bf.1589926004.git.anchalag@amazon.com> <5edb4147-af12-3a0e-e8f7-5b72650209ac@oracle.com> MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Disposition: inline In-Reply-To: <5edb4147-af12-3a0e-e8f7-5b72650209ac@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 Sat, May 30, 2020 at 07:44:06PM -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 5/19/20 7:28 PM, Anchal Agarwal wrote: > > From: Munehisa Kamata > > > > Save steal clock values of all present CPUs in the system core ops > > suspend callbacks. Also, restore a boot CPU's steal clock in the system > > core resume callback. For non-boot CPUs, restore after they're brought > > up, because runstate info for non-boot CPUs are not active until then. > > > > Signed-off-by: Munehisa Kamata > > Signed-off-by: Anchal Agarwal > > --- > > arch/x86/xen/suspend.c | 13 ++++++++++++- > > arch/x86/xen/time.c | 3 +++ > > 2 files changed, 15 insertions(+), 1 deletion(-) > > > > diff --git a/arch/x86/xen/suspend.c b/arch/x86/xen/suspend.c > > index 784c4484100b..dae0f74f5390 100644 > > --- a/arch/x86/xen/suspend.c > > +++ b/arch/x86/xen/suspend.c > > @@ -91,12 +91,20 @@ void xen_arch_suspend(void) > > static int xen_syscore_suspend(void) > > { > > struct xen_remove_from_physmap xrfp; > > - int ret; > > + int cpu, ret; > > > > /* Xen suspend does similar stuffs in its own logic */ > > if (xen_suspend_mode_is_xen_suspend()) > > return 0; > > > > + for_each_present_cpu(cpu) { > > + /* > > + * Nonboot CPUs are already offline, but the last copy of > > + * runstate info is still accessible. > > + */ > > + xen_save_steal_clock(cpu); > > + } > > + > > xrfp.domid = DOMID_SELF; > > xrfp.gpfn = __pa(HYPERVISOR_shared_info) >> PAGE_SHIFT; > > > > @@ -118,6 +126,9 @@ static void xen_syscore_resume(void) > > > > pvclock_resume(); > > > Doesn't make any difference but I think since this patch is where you > are dealing with clock then pvclock_resume() should be added here and > not in the earlier patch. > > > -boris I think the reason it may be in previous patch because it was a part of syscore_resume and steal clock fix came in later. It could me moved to this patch that deals with all clock stuff. -Anchal > > > > > > + /* Nonboot CPUs will be resumed when they're brought up */ > > + xen_restore_steal_clock(smp_processor_id()); > > + > > gnttab_resume(); > > } > > > > diff --git a/arch/x86/xen/time.c b/arch/x86/xen/time.c > > index c8897aad13cd..33d754564b09 100644 > > --- a/arch/x86/xen/time.c > > +++ b/arch/x86/xen/time.c > > @@ -545,6 +545,9 @@ static void xen_hvm_setup_cpu_clockevents(void) > > { > > int cpu = smp_processor_id(); > > xen_setup_runstate_info(cpu); > > + if (cpu) > > + xen_restore_steal_clock(cpu); > > + > > /* > > * xen_setup_timer(cpu) - snprintf is bad in atomic context. Hence > > * doing it xen_hvm_cpu_notify (which gets called by smp_init during > > >