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

Re: [Minios-devel] [UNIKRAFT PATCH 1/2] plat: Add the eh_frame and eh_frame_hdr sections



Hi Vlad,

On 12/13/18 8:53 PM, Vlad-Andrei BĂDOIU (78692) wrote:
Hey Florian,

On 12/13/18 11:55 AM, Florian Schmidt wrote:
Hi Vlad,

thanks for the patch! I have one question:

On 12/12/18 6:08 PM, Vlad-Andrei BĂDOIU (78692) wrote:
This patch adds the eh_frame and eh_frame hdr sections to
the linker script for both XEN and KVM.

A new linker script has been created plat/common/x86/link64.lds in
order to avoid code duplication.

This patch adds the frames to the linker scripts.

Signed-off-by: Vlad-Andrei Badoiu <vlad_andrei.badoiu@xxxxxxxxxxxxxxx>
---
   plat/common/x86/link64.lds | 51 ++++++++++++++++++++++++++++++++++++++
   plat/kvm/x86/link64.lds    |  2 ++
   plat/xen/x86/link64.lds    |  2 ++
   3 files changed, 55 insertions(+)
   create mode 100644 plat/common/x86/link64.lds

diff --git a/plat/common/x86/link64.lds b/plat/common/x86/link64.lds
new file mode 100644
index 0000000..1b809c4
--- /dev/null
+++ b/plat/common/x86/link64.lds
@@ -0,0 +1,51 @@
+/* SPDX-License-Identifier: BSD-3-Clause */
+/*
+ * Authors: Vlad-Andrei Badoiu <vlad_andrei.badoiu@xxxxxxxxxxxxxxx>
+ *
+ * Copyright (c) 2018, NEC Europe Ltd., NEC Corporation. All rights
reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ *
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer
in the
+ *    documentation and/or other materials provided with the
distribution.
+ * 3. Neither the name of the copyright holder nor the names of its
+ *    contributors may be used to endorse or promote products
derived from
+ *    this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND
CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A
PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR
CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR
BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ *
+ * THIS HEADER MAY NOT BE EXTRACTED OR MODIFIED IN ANY WAY.
+ */
+
+. = ALIGN(0x1000);
+__eh_frame_start = .;
+.eh_frame :
+{
+    *(.eh_frame)
+    *(.eh_frame.*)
+}
+__eh_frame_end = .;
+
+. = ALIGN(0x1000);

I understand that the first alignment is probably necessary to make
sure you don't share a page with the read-write data coming before it
in the layout, but do you need such a large alignment before the hdr?
Can't the hdr and the frame share a page?
Yes, hdr and eh_frame could share a page. I'll send a v2 of this patch
with the in-between alignment removed, is that all right?

Yes, please. However, I would maybe wait for a review for the other file. It looks good to me, but I'd like Simon to give it just a 1-minute cursory look, because I'm not completely familiar with the logic of the memory regions code. So in case he has a remark, you can roll that into v2, too.

+__eh_frame_hdr_start = .;
+.eh_frame_hdr :
+{
+    *(.eh_frame_hdr)
+    *(.eh_frame_hdr.*)
+}
+__eh_frame_hdr_end = .;
diff --git a/plat/kvm/x86/link64.lds b/plat/kvm/x86/link64.lds
index 60b5d21..c96f750 100644
--- a/plat/kvm/x86/link64.lds
+++ b/plat/kvm/x86/link64.lds
@@ -41,6 +41,8 @@ SECTIONS
       }
       _etext = .;
   +    INCLUDE plat/common/x86/link64.lds
+
       /* Read-only data */
       . = ALIGN(0x1000);
       _rodata = .;
diff --git a/plat/xen/x86/link64.lds b/plat/xen/x86/link64.lds
index 5391dbd..2e83de4 100644
--- a/plat/xen/x86/link64.lds
+++ b/plat/xen/x86/link64.lds
@@ -39,6 +39,8 @@ SECTIONS
         _etext = .;            /* End of text section */
   +    INCLUDE plat/common/x86/link64.lds
+
       _rodata = .;
       .rodata : {
           *(.rodata)



--
Dr. Florian Schmidt
フローリアン・シュミット
Research Scientist,
Systems and Machine Learning Group
NEC Laboratories Europe
Kurfürsten-Anlage 36, D-69115 Heidelberg
Tel.     +49 (0)6221 4342-265
Fax:     +49 (0)6221 4342-155
e-mail:  florian.schmidt@xxxxxxxxx
============================================================
Registered at Amtsgericht Mannheim, Germany, HRB728558

_______________________________________________
Minios-devel mailing list
Minios-devel@xxxxxxxxxxxxxxxxxxxx
https://lists.xenproject.org/mailman/listinfo/minios-devel

 


Rackspace

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