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

Re: [PATCH 7/8] x86/EFI: keep debug info in xen.efi


  • To: Jan Beulich <jbeulich@xxxxxxxx>
  • From: Roger Pau Monné <roger.pau@xxxxxxxxxx>
  • Date: Fri, 23 Apr 2021 12:58:05 +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=4GSV6DlcN8l0AYw9V35FatmggFYhG00rbwZMj7Psi0Q=; b=ELimJ6u/atezrEYl4q0cdpcQh+roxxy3LUyvwxxqvfQCizaeCxK2PZj8uY83yZ2LjpnwIjL3fBwcdHHF/BOGQYfp682kzGbcCbCSWzOscIs+kM9F/UQPWuDcC3Esut/vtaF56g01L3NgPSS+S4n5yG+UptZ6Y14uplOGiCwazflKsq0nt4CNGSPMWLoKmf8i6Voc9sPPAzf4Rm9Qw04SdWEOiOzaviqS6ounYVIxyt+u3rHmIG5IjCsDNqUNDJtVwgC70LUDmrMtG/VPJws62wEKzmtfuoZhivPfICUcvpKPWoNJsDn3cQrB/aRacCDTVxJhXk85vPlgPcwdZi4z9g==
  • Arc-seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=CwYJz+tkZsKXtg4PcTs0RLVQgvrWzf89StCQuq4IGYL1LjlI73CytrvLYnTEJkSKI8JunYP5iEb2F8YP2btM7YZBfRzFoP7v3xHGxrEtYa37es9udwRbfgg20kXYyf+Px1r+GOVBR+4jxsePVTTYO0K4mSEyNvAt5UH78eV9Oq3Co/lSKWe+VONc6Qe24dTPI8K1yaXZvjfmblavsxNgkKS8EfL/hW3+lnYVvdA2xSSgu6EgRP6KKU+dd6RfZcmuW6zUcIrGZCf1aZkUo1vhwPifavXv46GauaNm/lzq888kKu91UzO4MpHgikA+Bw1XpR048ZEdq3NHPsGYWZF0WA==
  • Authentication-results: esa2.hc3370-68.iphmx.com; dkim=pass (signature verified) header.i=@citrix.onmicrosoft.com
  • Cc: "xen-devel@xxxxxxxxxxxxxxxxxxxx" <xen-devel@xxxxxxxxxxxxxxxxxxxx>, "Andrew Cooper" <andrew.cooper3@xxxxxxxxxx>, Wei Liu <wl@xxxxxxx>
  • Delivery-date: Fri, 23 Apr 2021 10:58:21 +0000
  • Ironport-hdrordr: A9a23:l5zDt6hMxXXewNFX5MfNsdchBnBQXwh13DAbvn1ZSRFFG/Gwv9 yynfgdyB//gCsQXnZlotybJKycWxrnmKJdy4N5B9efdSPhv3alK5wn0Jv6z1TbaknD38N+9Y MlSahxD9XsEUN35PyR3CCUG8stqePpzImGnuHbpk0CcShPS4VNqzh0ERyaFEoefngiObMcGI CH7sRK4xqMEE5nDfiTPXUOU+jdq9CjrvuPDSIuPBI79BKIyQqh9b+SKXOl9y0DWDBCy6pKyx mmryXF4MyY0s2T+1vn+EL4q79Xn9bgzdUrPr3wtuElbg/CpyztSIBoW7iptC04rue1+D8R4a XxiiZlBetfwTf8eXy0vAvM1mDboUkTwk6n83C0qz/CptH0Xz0zAcYpv/MmTjLpr3AOkfs59Y Aj5RP/i7NnSSnusQ642v3zEzZtrUawqWpKq59ps1VvFbEwRZUUkZYS5ypuYfE9NRO/0q8LOs 90AvrR4f5HGGnqFUzxjy1UzNugUm9bJGb+fmEy/sic0z1hlHtk1UcvxMsGgnca9J4mIqM0n9 j5Dg==
  • Ironport-sdr: M5MvZnu53Af85koYzOC6of3UQVNC2KRsQeXW+1yB+OMpUwUHyeRRUfuB9B3vlINOJNJ0VCITVw sY7hCD+sAvbPJmtdaTotWHdalJP/1TVOCZlZnqpPY87Y7Hoi+oZqVJBsnLhi4LMFwn+CyJbLFo HkzxYruCxOUz5p3nwpFlG4qkUBk19UND98wKBHx5f1OfLYTqL2mMNRgQChil7dyJaTV0tbJhZl ObvwStjapcfpkPWf2ocVxuFh0jObLXUueclaKDZ4nOXNopWQelpfXCDf8JYI07jhoMmN/4Ocoz Kxw=
  • List-id: Xen developer discussion <xen-devel.lists.xenproject.org>

On Fri, Apr 23, 2021 at 12:45:14PM +0200, Jan Beulich wrote:
> On 23.04.2021 12:07, Roger Pau Monné wrote:
> > On Fri, Apr 23, 2021 at 10:51:40AM +0200, Jan Beulich wrote:
> >> On 23.04.2021 09:30, Roger Pau Monné wrote:
> >>> /*
> >>>  * Explicitly list debug section for the PE output so that they don't
> >>>  * end up at VA 0 which is below image base and thus invalid. Also use
> >>>  * the NOLOAD directive, even when currently ignored by PE output, in
> >>>  * order to note those sections shouldn't be loaded into memory.
> >>>  *
> >>>  * Note such sections are past _end, so if loaded will be discarded by
> >>>  * Xen anyway.
> >>>  */
> >>>
> >>> Feel free to reword or expand the comment.
> >>
> >> Yes, I've edited it some while inserting. Will see to get to
> >> submitting v2 then.
> >>
> >>> Not sure there's some
> >>> reference we could add here about how debug sections are placed in PE
> >>> files usually.
> >>
> >> As said before - I don't think there's any "usually" here, which is
> >> why different environments have invented different ways. The debug
> >> info native to COFF is more like ELF's symbol table (with a little
> >> bit of extra information) plus Dwarf's .debug_line, but not really
> >> fully covering what you'd expect from debug info.
> > 
> > One last thing, do you know if the newly added debug_* sections get
> > the IMAGE_SCN_MEM_DISCARDABLE section flag set?
> 
> At least with an up-to-date ld (i.e. one meeting the requirements so
> we wouldn't force debug info to be stripped) they do.
> 
> > Not sure there's a way we can force it from the linker script TBH, but
> > would be nice and seems to be a recommended flag for debug sections
> > according to Microsoft [0].
> 
> The linker does this for debugging sections irrespective of what the
> linker script says:
> 
>    if ((sec_flags & SEC_DEBUGGING) != 0)
>      styp_flags |= IMAGE_SCN_MEM_DISCARDABLE;

Great, that's good to know. Note sure it's worth adding to the commit
message, maybe I've just missed part of the documentation where LD
notes that IMAGE_SCN_MEM_DISCARDABLE will be unconditionally added to
debug sections.

Thanks, Roger.



 


Rackspace

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