From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from esa5.hc3370-68.iphmx.com (esa5.hc3370-68.iphmx.com [216.71.155.168]) by mx.groups.io with SMTP id smtpd.web11.1276.1616687246853566797 for ; Thu, 25 Mar 2021 08:47:27 -0700 Authentication-Results: mx.groups.io; dkim=pass header.i=@citrix.com header.s=securemail header.b=eOSoFdl1; spf=pass (domain: citrix.com, ip: 216.71.155.168, mailfrom: anthony.perard@citrix.com) DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=citrix.com; s=securemail; t=1616687246; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=kR85HuAEtSi2+1CX5gncd/zpXFCfU6BegJnoHsZGfX8=; b=eOSoFdl1aBmnE5Nky8HC7DBCduwtIYICvtqcU9c56VJ+zxkb4a4pdY+/ GJE1wsdATHGqgn6Jy+VL6kqa0qwA2JZxpGVxdb3s0Nhj2763wLjb15gFo df96mchgerVt1PnrIoGLpmC2tzMTj80P5Xb2GO04JIc8psW1TTSHfNMKa c=; Authentication-Results: esa5.hc3370-68.iphmx.com; dkim=none (message not signed) header.i=none IronPort-SDR: 28IfOMmo3K9HzOIx7zzQWMVhHTAoCEwTANEpGlFfWKhQ6rbPKk/G2BJVdKIaHmdx9hwPaMSRcN gymDz0SgkjjK66OC9UiZTTSf0wOZeRKlZzAC5NMQcq6PRH+zESX+PJaAlrHbc0tmDuFv9ytCgh Htx/w/K8JUjz/fNT2tknJP9uktCZzne6/6c0e5WAzBGM8GkepoGe0agXheb4pMXY3skFKF8Syx YuMRBeSmVbpu/y8SpC6XP5If4/4p5+f0kST46au63LPAw27amEwbGuw3tDTHXKXwoTNmJxV3Ca yh4= X-SBRS: 5.1 X-MesageID: 40017829 X-Ironport-Server: esa5.hc3370-68.iphmx.com X-Remote-IP: 162.221.158.21 X-Policy: $RELAYED IronPort-HdrOrdr: A9a23:IrV++qkQ1+HvqiziyZRnzoZoFHvpDfOijWdD5ilNYBxZY6Wkvu iUt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4oZ+M+0kAQ2w0XtC0QECSnC5evXUlnvicB0IKsSysCy8qNIOwl+1 vpsBqkoj3RMgvRLUynH7sK6Hgt/BzaQI3bs0OhEoCBeyx66bWpC+OhiSH+1wXGvN2PgznVqw N13QpnNFwI4hbQWM5UFmzfwE8bOQd9Dx9gkAKt3awG/3ts7HVUOQA5VY0E5yXmCRfVEi3iin DRPFJLhvc6b1M= X-IronPort-AV: E=Sophos;i="5.81,277,1610427600"; d="scan'208";a="40017829" From: "Anthony PERARD" To: CC: , Jordan Justen , Anthony PERARD , "Ard Biesheuvel" , Laszlo Ersek , Julien Grall , =?UTF-8?q?Roger=20Pau=20Monn=C3=A9?= Subject: [PATCH v2 6/7] OvmfPkg/XenPlatformPei: Calibrate APIC timer frequency Date: Thu, 25 Mar 2021 15:47:12 +0000 Message-ID: <20210325154713.670104-7-anthony.perard@citrix.com> X-Mailer: git-send-email 2.31.0 In-Reply-To: <20210325154713.670104-1-anthony.perard@citrix.com> References: <20210325154713.670104-1-anthony.perard@citrix.com> MIME-Version: 1.0 Return-Path: anthony.perard@citrix.com Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: base64 Q2FsY3VsYXRlIHRoZSBmcmVxdWVuY3kgb2YgdGhlIEFQSUMgdGltZXIgdGhhdCBYZW4gcHJvdmlk ZXMuCgpFdmVuIHRob3VnaCB0aGUgZnJlcXVlbmN5IGlzIGN1cnJlbnRseSBoYXJkLWNvZGVkLCBp dCBpc24ndCBwYXJ0IG9mCnRoZSBwdWJsaWMgQUJJIHRoYXQgWGVuIHByb3ZpZGVzIGFuZCB0aHVz IG1heSBjaGFuZ2UgYXQgYW55IHRpbWUuIE9WTUYKbmVlZHMgdG8gZGV0ZXJtaW5lIHRoZSBmcmVx dWVuY3kgYnkgYW4gb3RoZXIgbWVhbi4KCkZvcnR1bmF0ZWx5LCBYZW4gcHJvdmlkZXMgYSB3YXkg dG8gZGV0ZXJtaW5lcyB0aGUgZnJlcXVlbmN5IG9mIHRoZQpUU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