From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from esa1.hc3370-68.iphmx.com (esa1.hc3370-68.iphmx.com [216.71.145.142]) by mx.groups.io with SMTP id smtpd.web09.1416.1580750767139148400 for ; Mon, 03 Feb 2020 09:26:07 -0800 Authentication-Results: mx.groups.io; dkim=pass header.i=@citrix.com header.s=securemail header.b=h2/5D+tr; spf=pass (domain: citrix.com, ip: 216.71.145.142, mailfrom: anthony.perard@citrix.com) DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=citrix.com; s=securemail; t=1580750767; h=date:from:to:cc:subject:message-id:references: mime-version:in-reply-to; bh=VpCpn1+K1R69EFAC3075kl/kja4Pp2a34IzrC3K+V+s=; b=h2/5D+trV6s17jMkusphEf4wFjqG9mew1A8vR4kvKhpAqB9Vpti062Fo vo061NRLAVM6dwFrVtv1SxjNd0X+qmzrxQ9XfBBrE44Ipl5Ini25QfXS6 nteJTBbAFc8CC3Nl6f+yhdhVWE6LqL35HapBj5iPW/qwZG3/ZadVylfcI 4=; Authentication-Results: esa1.hc3370-68.iphmx.com; dkim=none (message not signed) header.i=none; spf=None smtp.pra=anthony.perard@citrix.com; spf=Pass smtp.mailfrom=anthony.perard@citrix.com; spf=None smtp.helo=postmaster@mail.citrix.com Received-SPF: None (esa1.hc3370-68.iphmx.com: no sender authenticity information available from domain of anthony.perard@citrix.com) identity=pra; client-ip=162.221.158.21; receiver=esa1.hc3370-68.iphmx.com; envelope-from="anthony.perard@citrix.com"; x-sender="anthony.perard@citrix.com"; x-conformance=sidf_compatible Received-SPF: Pass (esa1.hc3370-68.iphmx.com: domain of anthony.perard@citrix.com designates 162.221.158.21 as permitted sender) identity=mailfrom; client-ip=162.221.158.21; receiver=esa1.hc3370-68.iphmx.com; envelope-from="anthony.perard@citrix.com"; x-sender="anthony.perard@citrix.com"; x-conformance=sidf_compatible; x-record-type="v=spf1"; x-record-text="v=spf1 ip4:209.167.231.154 ip4:178.63.86.133 ip4:195.66.111.40/30 ip4:85.115.9.32/28 ip4:199.102.83.4 ip4:192.28.146.160 ip4:192.28.146.107 ip4:216.52.6.88 ip4:216.52.6.188 ip4:162.221.158.21 ip4:162.221.156.83 ip4:168.245.78.127 ~all" Received-SPF: None (esa1.hc3370-68.iphmx.com: no sender authenticity information available from domain of postmaster@mail.citrix.com) identity=helo; client-ip=162.221.158.21; receiver=esa1.hc3370-68.iphmx.com; envelope-from="anthony.perard@citrix.com"; x-sender="postmaster@mail.citrix.com"; x-conformance=sidf_compatible IronPort-SDR: upkHFSA0m9XpRVinFqwXjuwXKzXgIIMpGjRdjYAtMn+UgLTPrCL8zBQcJx9yWCGhiMaG8/oVkK YkI8EJJwLkTGc8Yrl50nLsBwpunEKsaQeRZx2EGKCrys+3KhO/Gv1DBJBdyooJVLU9trz73cFZ N7XS/Dcr4F1fOMqHZr63KLLmnZgWRgc86KfvV1Dl2YxRzCjQ+Bj9L4E2Z9v5tkJXIIMo9poi1c ZhlRk+YaUwUgbIX5MgstYBQFt7LXnl49y+MKCyZ0lxMdEnGdkiCl10sdLKkoPEjN//Y0z3gIba Fp0= X-SBRS: 2.7 X-MesageID: 12035997 X-Ironport-Server: esa1.hc3370-68.iphmx.com X-Remote-IP: 162.221.158.21 X-Policy: $RELAYED X-IronPort-AV: E=Sophos;i="5.70,398,1574139600"; d="scan'208";a="12035997" Date: Mon, 3 Feb 2020 17:26:04 +0000 From: "Anthony PERARD" To: "Gao, Liming" CC: Laszlo Ersek , "devel@edk2.groups.io" , "Kinney, Michael D" , Ard Biesheuvel , "xen-devel@lists.xenproject.org" , "Justen, Jordan L" , Julien Grall , "Feng, Bob C" Subject: Re: [PATCH 2/5] MdePkg: Allow PcdFSBClock to by Dynamic Message-ID: <20200203172604.GI2306@perard.uk.xensource.com> References: <20200129121235.1814563-1-anthony.perard@citrix.com> <20200129121235.1814563-3-anthony.perard@citrix.com> <20200203153407.GH2306@perard.uk.xensource.com> MIME-Version: 1.0 In-Reply-To: <20200203153407.GH2306@perard.uk.xensource.com> Return-Path: anthony.perard@citrix.com Content-Type: text/plain; charset="us-ascii" Content-Disposition: inline On Mon, Feb 03, 2020 at 03:34:07PM +0000, Anthony PERARD wrote: > On Mon, Feb 03, 2020 at 01:34:55AM +0000, Gao, Liming wrote: > > Anthony: > > This change is OK to me. But if this PCD is configured as Dynamic, its value will be got from PCD service. This operation will take some time and cause the inaccurate time delay. Have you measured its impact? > > No, I haven't. But I don't think it matter in a Xen guest, the APIC timer is > emulated anyway, so reading from a register of the APIC is going to be > slower than getting the value from the PCD services, I think. > (Hopefully, I'm not too wrong.) > > But I'll give it at measuring the difference, it would be interesting to > know. Now that I've given a try, having the value as Dynamic doesn't change anything in a Xen guest. On my test machine, simply running GetPerformanceCounter (); takes between 10000 ns and 20000 ns. Reading the dynamic value from PCD on the other hand takes about 350ns. (10ns if it's static.) When I run NanoSecondDelay() with different values, I have: - with static pcd: 63894 ns to delay by 1 ns 66611 ns to delay by 10 ns 43927 ns to delay by 100 ns 71367 ns to delay by 1000 ns 55881 ns to delay by 10000 ns 147716 ns to delay by 100000 ns 1048335 ns to delay by 1000000 ns 10041179 ns to delay by 10000000 ns - with a dynamic pcd: 40949 ns to delay by 1 ns 84832 ns to delay by 10 ns 82745 ns to delay by 100 ns 59848 ns to delay by 1000 ns 52647 ns to delay by 10000 ns 137051 ns to delay by 100000 ns 1042492 ns to delay by 1000000 ns 10036306 ns to delay by 10000000 ns So, the kind of PCD used for PcdFSBClock on Xen (with OvmfXen) doesn't really matter. Anyway, thanks for the feedback. -- Anthony PERARD