[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [PATCH v2] x86/oprofile: remove compat accessors usage from backtrace


  • To: Jan Beulich <jbeulich@xxxxxxxx>
  • From: Roger Pau Monné <roger.pau@xxxxxxxxxx>
  • Date: Tue, 27 Apr 2021 13:50:18 +0200
  • Arc-authentication-results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=citrix.com; dmarc=pass action=none header.from=citrix.com; dkim=pass header.d=citrix.com; arc=none
  • Arc-message-signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=NBhYHFcqwLgMG01x8oXgMRgHYh1klyA5h9cl6AsWXSM=; b=KkgBguGphhEz0IQPTNaFAdZNupBq4ep75rXApZ4Tz3qn+4HK7eyv329SaU99R2eCPY5PgUuTL4N9pQh+9nwbBGEXVxJTS4CQIFFrt+a04LU5mXWiQ0ZDNzCXurWMyB0+MPpKYEnlzsCoHw/j17w/QzsHUyo1kzeFUQgLbqYBNbBpICE8V01tD2GWykFnvZVUkm6uCuIEn60CvTjQPH+kl4+a2/nU2g1zbARV2gt1y4HAES58PLqTMynDQDyX9SPhcARxI+9nbH2GSe0cF33fpeKl98qL95Suhd6DkR5iTux+6pRpPDHFpRXz6wyC878h1vGLeB2GbzltX5+URDd8bQ==
  • Arc-seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=ioM2tmTAfzIBeCNFz6HL/iAlHOmwrpdJHrYMhSe+35Q3ih1/MvQS8MLTSfEyX1J6c8d0ArAZhyJr797Puu4umHqJMXxUxiQmEXg3BErqs8eumZy2D2WKIzAcVnKylwYQRqgR32L5Otclc4txhziiw/fbYtzvlKPIAgoaBrCAEdi4GkNC7z46PEK3ArBcVHvaQUfaSmTP44CQo9mxkypv+pdKMIKkEut/Azh0R/kQyamc0N8MHE2Zmh7f5+ja+QOJeYcI+xwJcDmxx1rHl4dmhW0QLtHYBljo3JFmeNEyhv2nGDFVjA7ZxfbYFS8Gb0Ajq7vaivljgxlWjAI17GfKdQ==
  • Authentication-results: esa4.hc3370-68.iphmx.com; dkim=pass (signature verified) header.i=@citrix.onmicrosoft.com
  • Cc: Andrew Cooper <andrew.cooper3@xxxxxxxxxx>, Wei Liu <wl@xxxxxxx>, <xen-devel@xxxxxxxxxxxxxxxxxxxx>
  • Delivery-date: Tue, 27 Apr 2021 11:50:31 +0000
  • Ironport-hdrordr: A9a23:syzhuKrRNLqb92B+ab/DVjkaV5uRKtV00zAX/kB9WHVpW+SivY SHgOkb2RjoiDwYRXEnnpS6NLOdRG7HnKQZ3aA4Bp3neAX9omOnIMVZ7YXkyyD9ACGWzIRg/I 9aWexFBNX0ZGIQse/T6gO1Cstl5dGB/ryhi+u29QYXcShBQchbnmREIyycFVB7QxQDIJI/Go aV6MYvnUvbRV08aMOnCn4ZG9XSvtGjruOqXTcqJT4CrDOPgzSh9aLgH3Gjsis2fjtTzd4ZgA /4uiPj4KHLiZCG4z/ak1Te9pFH3Obmo+EzfPCkrugwBnHShh2zZIJnMofy8AwdhO208l4lnJ 3tjn4bTqJOwkjcdG20vhfhsjOIuFlB11bYxVCVmnflq8DiLQhKcvZpv55TcRfS9iMbzbNB+Z 9LxG6Qut52Ch7NjU3Glrz1fixqjUa9rD4el/cShRVkIO4jQYJWxLZ+wGplVLM7WA7q4oEuF+ djSOvG4uxNTF+cZ3fF+kFy3d2FRB0Ib1m7a3lHnvbQ/yldnXh/wUdd7tcYhG08+JU0TIQBz/ jYM55viKpFQqYtHONALdZEZfHyJn3GQBrKPm7XC0/gDrs7N3XErIOyx7kp+uewetgtwIEpkJ rMFHNU3FRCO37GOImr5tlm4xrNSGKyUXDG0cdF/aV0vbX6Wf7lKiuGRFcyk9axovkWD8HBMs zDeq5+MrvGFy/DCIxJ1wrxV915Mn8FSvAYvd49RhaPr6vwW8jXn92eVMyWCKvmED4iVG+6KG AERiLPKMJJ6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Diht e40Xb6B4odJiIzhL1L+AVRakxWfQ/IW+RlIC+BLBOUIkxTzm96OaG/4bXuTTmLUxVITcT7we82 +12Ojfmnu3kSSjqT+OQ9Ab8C3mUSA8YdzNROrjW73m6YJasqzaxgVCuhAGyYlGaXwYWAtJ6jcu G60=
  • List-id: Xen developer discussion <xen-devel.lists.xenproject.org>

On Mon, Apr 26, 2021 at 09:49:13AM +0200, Jan Beulich wrote:
> On 23.04.2021 16:37, Roger Pau Monne wrote:
> > Remove the unneeded usage of the compat layer to copy frame pointers
> > from guest address space. Instead just use raw_copy_from_guest.
> > 
> > While there drop the checks for the accessibility of one struct
> > frame_head beyond the current one: it's not clear why it's needed and
> > all the hypnoses point to dropping such check being harmless. The
> 
> DYM "hypotheses"?

Yes, sorry, selected the wrong spell checker suggestion I guess.

> 
> > worse that could happen is that a failure happens later if data past
> > frame_head is attempted to be fetched, albeit I'm not able to spot any
> > such access.
> > 
> > Also drop the explicit truncation of the head pointer in the 32bit
> > case as all callers already pass a zero extended value. The first
> > value being rsp from the guest registers,
> 
> While I know I'm guilty of splitting hair saying so, I'd like to point
> out that I'm unaware of guarantees that the upper halves of GPRs are
> zero after a switch from compat to 64-bit mode. With this I'm also
> unconvinced there are guarantees that the %rsp stored into a stack
> frame is actually guaranteed to be zero-extended. Nevertheless I'm not
> meaning this remark to keep the change from going in as is - for all
> practical purposes what you say is presumably true.

Also, given the context of this code (oprofile backtrace generation),
I'm unsure what issues could arise from not using a zero extended
value for a guest in 32bit mode apart from a failure to obtain the
backtrace itself.

> What I would consider nice though is if the two remaining if() could
> be corrected for coding style: Adjacent code is already inconsistent,
> so taking the opportunity to move it a little in the right direction
> would seem desirable to me. (I would suggest doing so myself while
> committing, but because I don't fully agree with dropping the 2-frame
> checks described further up without properly understanding why they're
> there, I'd like to not put my name on this change in any way, not even
> just as committer. But I guess Andrew or Wei or whoever ends up
> committing this could do so, as long as they agree of course.)

OK, I can add the 2-frame checks back in, I certainly don't have that
strong opinion and the resulting code will be better just by dropping
the usage of the compat layer even if we decide to keep those
checks.

Let me prepare a new version.

Thanks, Roger.



 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.