From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail02.groups.io (mail02.groups.io [66.175.222.108]) by spool.mail.gandi.net (Postfix) with ESMTPS id A4A77AC0FCD for ; Thu, 2 Nov 2023 11:28:17 +0000 (UTC) DKIM-Signature: a=rsa-sha256; bh=n3p30MSX+3NCQ1rQ6dhUJ/Zc4LDLNYTxZTao62usMyo=; c=relaxed/simple; d=groups.io; h=Message-ID:Date:MIME-Version:Subject:To:Cc:References:From:In-Reply-To:Precedence:List-Subscribe:List-Help:Sender:List-Id:Mailing-List:Delivered-To:Reply-To:List-Unsubscribe-Post:List-Unsubscribe:Content-Language:Content-Type:Content-Transfer-Encoding; s=20140610; t=1698924496; v=1; b=s29N5ZGrI8XMmrNfYbImQYo7FtwpJPg9PaW3JEfr6lC1qXmm9f29ocGOCBdn/xIwAVJZMkAv GSvY8c4o4QARvsPD28wnzdRNjcY0CoQH/qELYWFemIBWF7UM4AbfSyTmvAj+Xbw3Cj51cTYJ9u0 Zmb2t5zYWLTIMzgGkNGQb3DM= X-Received: by 127.0.0.2 with SMTP id j1VDYY7687511xrm8uvF7kab; Thu, 02 Nov 2023 04:28:16 -0700 X-Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) by mx.groups.io with SMTP id smtpd.web10.28734.1698924495596519296 for ; Thu, 02 Nov 2023 04:28:15 -0700 X-Received: from mimecast-mx02.redhat.com (mx-ext.redhat.com [66.187.233.73]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-65-AwEJk82_P_e_uUhgGFvMIQ-1; Thu, 02 Nov 2023 07:28:11 -0400 X-MC-Unique: AwEJk82_P_e_uUhgGFvMIQ-1 X-Received: from smtp.corp.redhat.com (int-mx01.intmail.prod.int.rdu2.redhat.com [10.11.54.1]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id DDEC01C02146; Thu, 2 Nov 2023 11:28:10 +0000 (UTC) X-Received: from [10.39.195.76] (unknown [10.39.195.76]) by smtp.corp.redhat.com (Postfix) with ESMTPS id B4CC325C0; Thu, 2 Nov 2023 11:28:09 +0000 (UTC) Message-ID: <04b7b3de-8038-c9ac-36b7-2cbcbbd6d104@redhat.com> Date: Thu, 2 Nov 2023 12:28:08 +0100 MIME-Version: 1.0 Subject: Re: [edk2-devel] [PATCH] MdeModulePkg/XhciDxe: Non-zero start/stop values in XhcGetElapsedTicks To: devel@edk2.groups.io, mike.maslenkin@gmail.com, patrick.henz@hpe.com Cc: hao.a.wu@intel.com, ray.ni@intel.com References: From: "Laszlo Ersek" In-Reply-To: X-Scanned-By: MIMEDefang 3.4.1 on 10.11.54.1 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Precedence: Bulk List-Subscribe: List-Help: Sender: devel@edk2.groups.io List-Id: Mailing-List: list devel@edk2.groups.io; contact devel+owner@edk2.groups.io Reply-To: devel@edk2.groups.io,lersek@redhat.com List-Unsubscribe-Post: List-Unsubscribe=One-Click List-Unsubscribe: X-Gm-Message-State: PakEElRAxt3QkgTEtdvt4hQlx7686176AA= Content-Language: en-US Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-GND-Status: LEGIT Authentication-Results: spool.mail.gandi.net; dkim=pass header.d=groups.io header.s=20140610 header.b=s29N5ZGr; dmarc=fail reason="SPF not aligned (relaxed), DKIM not aligned (relaxed)" header.from=redhat.com (policy=none); spf=pass (spool.mail.gandi.net: domain of bounce@groups.io designates 66.175.222.108 as permitted sender) smtp.mailfrom=bounce@groups.io On 11/1/23 02:12, Mike Maslenkin wrote: > On Tue, Oct 31, 2023 at 7:52 PM Henz, Patrick wrote: >> >> REF:https://bugzilla.tianocore.org/show_bug.cgi?id=4578 >> >> The implementation of XhcGetElapsedTicks did not account for >> non-zero start and stop values for the performance counter >> timer, potentially resulting in an incorrect elapsed tick >> count getting returned to the caller. Account for non-zero >> start and stop values when calculating the elapsed tick >> count. >> >> Cc: Hao A Wu >> Cc: Ray Ni >> Signed-off-by: Patrick Henz >> Reviewed-by: >> --- >> MdeModulePkg/Bus/Pci/XhciDxe/Xhci.c | 4 ++-- >> 1 file changed, 2 insertions(+), 2 deletions(-) >> >> diff --git a/MdeModulePkg/Bus/Pci/XhciDxe/Xhci.c b/MdeModulePkg/Bus/Pci/XhciDxe/Xhci.c >> index 7a2e32a9dd..6cb97b7452 100644 >> --- a/MdeModulePkg/Bus/Pci/XhciDxe/Xhci.c >> +++ b/MdeModulePkg/Bus/Pci/XhciDxe/Xhci.c >> @@ -2389,7 +2389,7 @@ XhcGetElapsedTicks ( >> // Counter counts upwards, check for an overflow condition >> // >> if (*PreviousTick > CurrentTick) { >> - Delta = (mPerformanceCounterEndValue - *PreviousTick) + CurrentTick; >> + Delta = (CurrentTick - mPerformanceCounterStartValue) + (mPerformanceCounterEndValue - *PreviousTick); >> } else { >> Delta = CurrentTick - *PreviousTick; >> } >> @@ -2398,7 +2398,7 @@ XhcGetElapsedTicks ( >> // Counter counts downwards, check for an underflow condition >> // >> if (*PreviousTick < CurrentTick) { >> - Delta = (mPerformanceCounterStartValue - CurrentTick) + *PreviousTick; >> + Delta = (mPerformanceCounterStartValue - CurrentTick) + (*PreviousTick - mPerformanceCounterEndValue); >> } else { >> Delta = *PreviousTick - CurrentTick; >> } >> -- >> 2.34.1 >> >> >> >> ------------ >> Groups.io Links: You receive all messages sent to this group. >> View/Reply Online (#110434): https://edk2.groups.io/g/devel/message/110434 >> Mute This Topic: https://groups.io/mt/102301510/1770412 >> Group Owner: devel+owner@edk2.groups.io >> Unsubscribe: https://edk2.groups.io/g/devel/unsub [mike.maslenkin@gmail.com] >> ------------ >> >> > Hello, All > > Just curious why this patch was broken by google groups. > > Some patches to edk2 and edk2-redfish-client have unintended line > breaks marked with "=", additional "0D" and additional "3D" to "=" > Web shows https://edk2.groups.io/g/devel/message/110434 exactly as it > saved by mailer. > What do sender should setup to avoid this? I recommend selecting base64 content-transfer-encoding, rather than quode-printable. Base64 will ensure that the embedded CRLFs (which are used in the edk2 source tree) survive intact, and also that "git-am" can cleanly apply the patch (as saved from the mailing list). Base64 is more robust than 8bit too. (If 8bit survived all mail servers along the way, it would work fine as well.) ... According to my notes, git has always *ignored* the [sendemail] transferEncoding = base64 stanza in my git config file. Which is why I have an alias around git-send-email that open-codes git send-email --transfer-encoding=base64 ... So that's what I recommend. (BTW, our "BaseTools/Scripts/SetupGit.py" script sets "sendemail.transferEncoding=8bit", but that is problematic for two reasons: (1) git ignores it anyway, per my records mentioned above, (2) 8bit is inferior to base64 in practice, when it comes to CRLF integrity across all email servers.) ... Side comment: I can apply quoted-printable-encoded patches as well, from the list, but that's only because I manually transcode them to 8bit, before passing them to git-am. I use the following hairy script: ---------------------------- #!/bin/bash set -e -u -C TMPD=$(mktemp -d) trap 'rm -f -r -- "$TMPD"' EXIT cd "$TMPD" tee input | dos2unix | csplit -s - '/^$/' HEAD_LINES=$(wc -l < xx00) head -n "$HEAD_LINES" input \ | sed -r 's/^(Content-Transfer-Encoding: )quoted-printable/\18bit/' tail -n +$((HEAD_LINES + 1)) input \ | perl -p -e 'use MIME::QuotedPrint; $_=MIME::QuotedPrint::decode($_);' \ | unix2dos ---------------------------- (The perl command is from Paolo Bonzini.) Summary: send your patches with git send-email --transfer-encoding=base64 ... Laszlo -=-=-=-=-=-=-=-=-=-=-=- Groups.io Links: You receive all messages sent to this group. View/Reply Online (#110522): https://edk2.groups.io/g/devel/message/110522 Mute This Topic: https://groups.io/mt/102301510/7686176 Group Owner: devel+owner@edk2.groups.io Unsubscribe: https://edk2.groups.io/g/devel/leave/12367111/7686176/1913456212/xyzzy [rebecca@openfw.io] -=-=-=-=-=-=-=-=-=-=-=-