Received: by 2002:ac0:a5a7:0:0:0:0:0 with SMTP id m36-v6csp265525imm; Tue, 17 Jul 2018 18:40:12 -0700 (PDT) X-Google-Smtp-Source: AAOMgpeNN0vkqfVgqYmHfuBWmeroFHn7FqcqxKUuf/6SfLFpdGP7mh9KIVWxXS9ZDAF4vqgIshQM X-Received: by 2002:a17:902:8210:: with SMTP id x16-v6mr3859841pln.307.1531878012935; Tue, 17 Jul 2018 18:40:12 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1531878012; cv=none; d=google.com; s=arc-20160816; b=By/+K4xhj4S8NMHrvdYdH5uJ83gqooFsScCBHUYuOTvKvnGRUMz54i354SzpdH500S WmyeG21rGF5aeWU6nm73QBV/AMyfEeScFqGzbKiumj+I09X8+JJ6Ma0RZlf9J4BMEvFs YYI3K7vtz0nnVmm5EvxK0/ZP0scO3LEcCJMxOVN/JnPv7NzRY1RITebbCwdAv0jIqL6b rPFle2xjI1uahPn8+jUQGVTl4HZrXlBeZX6JVDkRxoQnY2qlbCmSFU3YqlH3GPBFqtMo fVH6Bke78pRz3iUoXbsv05t+1Ap1H0TQx+OZhCs5lUIv9v8rimnHK6CN/CVrFcKd9JT3 5mLg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:dkim-signature :arc-authentication-results; bh=DOv1mAkL1aMLDz8MX2V5SYhP+2MHPCPDfqA1pl9otyg=; b=l/+In2UTh44JZwxBeosCG5wen0rnSYI4x02RUK4/8Ulpp9H7bIQ6EK21bi/Zzf6GcC +sLwNcQh9jrJEAMTkzRDoPYgIapxQmyhaXxcZdGxQA7Cy8UnWdKaBWrRoAtdS9MIJfnA 9YPHkBR3SzqOIy8TI/apWAxEXgDv6NU6tU0DPmk3gz3msfP2QAZlK543uN29R8+6lIuO XyBkZug95iPPScvc4I71ATPOjGnDp4AoslmoyCTiHkQjqU4EUBBhdlghGOjoxPRv5/me +jMn/brtV+rr3+3id3JYQMdB8JfW1V89cbSaJT97XN2LiuNc+RB70nfSdHabmDpaDayF BtGA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@oracle.com header.s=corp-2018-07-02 header.b=CIXpKmxk; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=oracle.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id g27-v6si2113507pgm.208.2018.07.17.18.39.57; Tue, 17 Jul 2018 18:40:12 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@oracle.com header.s=corp-2018-07-02 header.b=CIXpKmxk; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=oracle.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1731637AbeGRCOE (ORCPT + 99 others); Tue, 17 Jul 2018 22:14:04 -0400 Received: from aserp2130.oracle.com ([141.146.126.79]:51510 "EHLO aserp2130.oracle.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1730652AbeGRCOE (ORCPT ); Tue, 17 Jul 2018 22:14:04 -0400 Received: from pps.filterd (aserp2130.oracle.com [127.0.0.1]) by aserp2130.oracle.com (8.16.0.22/8.16.0.22) with SMTP id w6I1YKif168897; Wed, 18 Jul 2018 01:38:42 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oracle.com; h=mime-version : references : in-reply-to : from : date : message-id : subject : to : cc : content-type; s=corp-2018-07-02; bh=DOv1mAkL1aMLDz8MX2V5SYhP+2MHPCPDfqA1pl9otyg=; b=CIXpKmxkmgCbXHVff+EAD/aHozWj1/3QBgHm/L3zXKK8gtFR2QLTcQq1Iy2TOGzr8/yL 9zd4+qVsomAgan6+v3juyPD8ryTPXBsug8cMvGFssZqxCg0scHCllO9lFJ0h2MQzhBWn QTQKUdEf55iesPTrcSeKEk1AXCHe8Q71FH3YHP7TbLwuqp4CY0GjiPGaPmawvT2uYlVU nzlLHlzEobcTkO+lzdPn3maX1yU+EyfukL+TWjsrBDxDEpMs57iAGQpOearPV09lOlwN 1wS29M9kKwYZvSANShRPqgfaRgVtSDEVjUuYu4UmxoCRK6p2h1i3NTi8QqOmHSueDykK qA== Received: from userv0021.oracle.com (userv0021.oracle.com [156.151.31.71]) by aserp2130.oracle.com with ESMTP id 2k7a3t329j-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Wed, 18 Jul 2018 01:38:42 +0000 Received: from aserv0122.oracle.com (aserv0122.oracle.com [141.146.126.236]) by userv0021.oracle.com (8.14.4/8.14.4) with ESMTP id w6I1cdNo001864 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Wed, 18 Jul 2018 01:38:40 GMT Received: from abhmp0004.oracle.com (abhmp0004.oracle.com [141.146.116.10]) by aserv0122.oracle.com (8.14.4/8.14.4) with ESMTP id w6I1cdqL026575; Wed, 18 Jul 2018 01:38:39 GMT Received: from mail-oi0-f44.google.com (/209.85.218.44) by default (Oracle Beehive Gateway v4.0) with ESMTP ; Tue, 17 Jul 2018 18:38:39 -0700 Received: by mail-oi0-f44.google.com with SMTP id q11-v6so5690945oic.12; Tue, 17 Jul 2018 18:38:39 -0700 (PDT) X-Gm-Message-State: AOUpUlGJk+J6cVqx/gFlc14AO9pKaMFh28al3R97V/piFNcKITKqlenB cxBy3cHbkvZUpuTxBfXejWTTaKoqVkdzQIHRvzw= X-Received: by 2002:aca:b541:: with SMTP id e62-v6mr3757618oif.136.1531877918775; Tue, 17 Jul 2018 18:38:38 -0700 (PDT) MIME-Version: 1.0 References: <20180712000419.5165-1-pasha.tatashin@oracle.com> <20180712000419.5165-7-pasha.tatashin@oracle.com> In-Reply-To: From: Pavel Tatashin Date: Tue, 17 Jul 2018 21:38:02 -0400 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: [PATCH v13 06/18] x86/xen/time: initialize pv xen time in init_hypervisor_platform To: boris.ostrovsky@oracle.com Cc: Steven Sistare , Daniel Jordan , linux@armlinux.org.uk, schwidefsky@de.ibm.com, Heiko Carstens , John Stultz , sboyd@codeaurora.org, x86@kernel.org, LKML , mingo@redhat.com, tglx@linutronix.de, hpa@zytor.com, douly.fnst@cn.fujitsu.com, peterz@infradead.org, prarit@redhat.com, feng.tang@intel.com, Petr Mladek , gnomes@lxorguk.ukuu.org.uk, linux-s390@vger.kernel.org, jgross@suse.com Content-Type: text/plain; charset="UTF-8" X-Proofpoint-Virus-Version: vendor=nai engine=5900 definitions=8957 signatures=668706 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 suspectscore=3 malwarescore=0 phishscore=0 bulkscore=0 spamscore=0 mlxscore=0 mlxlogscore=899 adultscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.0.1-1806210000 definitions=main-1807180016 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org > > + set_fixmap(FIX_PARAVIRT_BOOTMAP, xen_start_info->shared_info); > > + HYPERVISOR_shared_info = (void *)fix_to_virt(FIX_PARAVIRT_BOOTMAP); > > + > > + /* xen clock uses per-cpu vcpu_info, need to init it for boot cpu */ > > + xen_vcpu_info_reset(0); > > > I don't believe this is necessary, it has been done in > xen_start_kernel() for PV guests. We need it, because HYPERVISOR_shared_info has changed from dummy. And, to output timestamps we must have access to the actual shared page. > > + > > + /* pvclock is in shared info area */ > > + xen_init_time_ops(); > > +} > > + > > > > > } > > > > -void __ref xen_init_time_ops(void) > > +void __init xen_init_time_ops(void) > > { > > pv_time_ops = xen_time_ops; > > > > @@ -542,17 +542,11 @@ void __init xen_hvm_init_time_ops(void) > > return; > > > > if (!xen_feature(XENFEAT_hvm_safe_pvclock)) { > > - printk(KERN_INFO "Xen doesn't support pvclock on HVM," > > - "disable pv timer\n"); > > + pr_info("Xen doesn't support pvclock on HVM, disable pv timer"); > > return; > > } > > - > > - pv_time_ops = xen_time_ops; > > + xen_init_time_ops(); > > > As we discussed elsewhere, now that HVM guests call this routine as well > we need to make sure that x86_init.timers.timer_init is not updated > there for HVM since those guests expect a "real" timer to be connected > to IO-APIC. Yes, I decided to keep xen_init_time_ops() and xen_hvm_init_time_ops() separate. The unification does not save that many LOC, but increase the complexity. Thank you, Pavel