From: Daniel Kiper <daniel.kiper@oracle.com>
To: xen-devel@lists.xenproject.org
Cc: jgross@suse.com, sstabellini@kernel.org,
andrew.cooper3@citrix.com, cardoe@cardoe.com,
pgnet.dev@gmail.com, ning.sun@intel.com, julien.grall@arm.com,
david.vrabel@citrix.com, jbeulich@suse.com,
qiaowei.ren@intel.com, gang.wei@intel.com, fu.wei@linaro.org
Subject: [PATCH v9 12/13] x86/boot: rename sym_phys() to sym_offs()
Date: Thu, 29 Sep 2016 23:42:41 +0200 [thread overview]
Message-ID: <1475185362-14198-13-git-send-email-daniel.kiper@oracle.com> (raw)
In-Reply-To: <1475185362-14198-1-git-send-email-daniel.kiper@oracle.com>
This way macro name better describes its function.
Currently it is used to calculate symbol offset in
relation to the beginning of Xen image mapping.
However, value returned by sym_offs() for a given
symbol is not always equal its physical address.
There is no functional change.
Suggested-by: Jan Beulich <jbeulich@suse.com>
Signed-off-by: Daniel Kiper <daniel.kiper@oracle.com>
Acked-by: Jan Beulich <jbeulich@suse.com>
---
v8 - suggestions/fixes:
- improve commit message
(suggested by Jan Beulich).
---
xen/arch/x86/boot/head.S | 40 ++++++++++++++++++++--------------------
xen/arch/x86/boot/trampoline.S | 2 +-
xen/arch/x86/boot/wakeup.S | 4 ++--
xen/arch/x86/boot/x86_64.S | 18 +++++++++---------
4 files changed, 32 insertions(+), 32 deletions(-)
diff --git a/xen/arch/x86/boot/head.S b/xen/arch/x86/boot/head.S
index 4425436..26f48da 100644
--- a/xen/arch/x86/boot/head.S
+++ b/xen/arch/x86/boot/head.S
@@ -12,9 +12,9 @@
.text
.code32
-#define sym_phys(sym) ((sym) - __XEN_VIRT_START)
-#define sym_esi(sym) sym_phys(sym)(%esi)
-#define sym_fs(sym) %fs:sym_phys(sym)
+#define sym_offs(sym) ((sym) - __XEN_VIRT_START)
+#define sym_esi(sym) sym_offs(sym)(%esi)
+#define sym_fs(sym) %fs:sym_offs(sym)
#define BOOT_CS32 0x0008
#define BOOT_CS64 0x0010
@@ -97,7 +97,7 @@ multiboot2_header_start:
/* EFI64 entry point. */
mb2ht_init MB2_HT(ENTRY_ADDRESS_EFI64), MB2_HT(OPTIONAL), \
- sym_phys(__efi64_start)
+ sym_offs(__efi64_start)
/* Multiboot2 header end tag. */
mb2ht_init MB2_HT(END), MB2_HT(REQUIRED)
@@ -110,11 +110,11 @@ multiboot2_header_start:
gdt_boot_descr:
.word 7*8-1
gdt_boot_base:
- .long sym_phys(trampoline_gdt)
+ .long sym_offs(trampoline_gdt)
.long 0 /* Needed for 64-bit lgdt */
cs32_switch_addr:
- .long sym_phys(cs32_switch)
+ .long sym_offs(cs32_switch)
.word BOOT_CS32
.align 4
@@ -131,23 +131,23 @@ vga_text_buffer:
.section .init.text, "ax", @progbits
bad_cpu:
- add $sym_phys(.Lbad_cpu_msg),%esi # Error message
+ add $sym_offs(.Lbad_cpu_msg),%esi # Error message
jmp .Lget_vtb
not_multiboot:
- add $sym_phys(.Lbad_ldr_msg),%esi # Error message
+ add $sym_offs(.Lbad_ldr_msg),%esi # Error message
jmp .Lget_vtb
.Lmb2_no_st:
- add $sym_phys(.Lbad_ldr_nst),%esi # Error message
+ add $sym_offs(.Lbad_ldr_nst),%esi # Error message
jmp .Lget_vtb
.Lmb2_no_ih:
- add $sym_phys(.Lbad_ldr_nih),%esi # Error message
+ add $sym_offs(.Lbad_ldr_nih),%esi # Error message
jmp .Lget_vtb
.Lmb2_no_bs:
- add $sym_phys(.Lbad_ldr_nbs),%esi # Error message
+ add $sym_offs(.Lbad_ldr_nbs),%esi # Error message
xor %edi,%edi # No VGA text buffer
jmp .Lsend_chr
.Lmb2_efi_ia_32:
- add $sym_phys(.Lbad_efi_msg),%esi # Error message
+ add $sym_offs(.Lbad_efi_msg),%esi # Error message
xor %edi,%edi # No VGA text buffer
jmp .Lsend_chr
.Lget_vtb:
@@ -352,7 +352,7 @@ __start:
cli
/* Load default Xen image load base address. */
- mov $sym_phys(__image_base__),%esi
+ mov $sym_offs(__image_base__),%esi
/* Bootloaders may set multiboot{1,2}.mem_lower to a nonzero value. */
xor %edx,%edx
@@ -503,8 +503,8 @@ trampoline_setup:
jnz 1f
/* Initialize BSS (no nasty surprises!). */
- mov $sym_phys(__bss_start),%edi
- mov $sym_phys(__bss_end),%ecx
+ mov $sym_offs(__bss_start),%edi
+ mov $sym_offs(__bss_end),%ecx
push %fs
pop %es
sub %edi,%ecx
@@ -577,22 +577,22 @@ trampoline_setup:
/* Apply relocations to bootstrap trampoline. */
mov sym_fs(trampoline_phys),%edx
- mov $sym_phys(__trampoline_rel_start),%edi
+ mov $sym_offs(__trampoline_rel_start),%edi
1:
mov %fs:(%edi),%eax
add %edx,%fs:(%edi,%eax)
add $4,%edi
- cmp $sym_phys(__trampoline_rel_stop),%edi
+ cmp $sym_offs(__trampoline_rel_stop),%edi
jb 1b
/* Patch in the trampoline segment. */
shr $4,%edx
- mov $sym_phys(__trampoline_seg_start),%edi
+ mov $sym_offs(__trampoline_seg_start),%edi
1:
mov %fs:(%edi),%eax
mov %dx,%fs:(%edi,%eax)
add $4,%edi
- cmp $sym_phys(__trampoline_seg_stop),%edi
+ cmp $sym_offs(__trampoline_seg_stop),%edi
jb 1b
/* Do not parse command line on EFI platform here. */
@@ -618,7 +618,7 @@ trampoline_setup:
push %eax
/* Copy bootstrap trampoline to low memory, below 1MB. */
- mov $sym_phys(trampoline_start),%esi
+ mov $sym_offs(trampoline_start),%esi
mov $((trampoline_end - trampoline_start) / 4),%ecx
rep movsl %fs:(%esi),%es:(%edi)
diff --git a/xen/arch/x86/boot/trampoline.S b/xen/arch/x86/boot/trampoline.S
index 64f8efd..b96607a 100644
--- a/xen/arch/x86/boot/trampoline.S
+++ b/xen/arch/x86/boot/trampoline.S
@@ -92,7 +92,7 @@ trampoline_protmode_entry:
mov %ecx,%cr4
/* Load pagetable base register. */
- mov $sym_phys(idle_pg_table),%eax
+ mov $sym_offs(idle_pg_table),%eax
add bootsym_rel(trampoline_xen_phys_start,4,%eax)
mov %eax,%cr3
diff --git a/xen/arch/x86/boot/wakeup.S b/xen/arch/x86/boot/wakeup.S
index 08ea9b2..42d57ab 100644
--- a/xen/arch/x86/boot/wakeup.S
+++ b/xen/arch/x86/boot/wakeup.S
@@ -120,7 +120,7 @@ wakeup_32:
mov $bootsym_rel(wakeup_stack, 4, %esp)
# check saved magic again
- mov $sym_phys(saved_magic), %eax
+ mov $sym_offs(saved_magic),%eax
add bootsym_rel(trampoline_xen_phys_start, 4, %eax)
mov (%eax), %eax
cmp $0x9abcdef0, %eax
@@ -133,7 +133,7 @@ wakeup_32:
mov %ecx, %cr4
/* Load pagetable base register */
- mov $sym_phys(idle_pg_table),%eax
+ mov $sym_offs(idle_pg_table),%eax
add bootsym_rel(trampoline_xen_phys_start,4,%eax)
mov %eax,%cr3
diff --git a/xen/arch/x86/boot/x86_64.S b/xen/arch/x86/boot/x86_64.S
index 7392004..86d3775 100644
--- a/xen/arch/x86/boot/x86_64.S
+++ b/xen/arch/x86/boot/x86_64.S
@@ -112,7 +112,7 @@ GLOBAL(__page_tables_start)
* actualy mapped (mostly using superpages). Uses 4x 4k pages.
*/
GLOBAL(l2_identmap)
- .quad sym_phys(l1_identmap) + __PAGE_HYPERVISOR
+ .quad sym_offs(l1_identmap) + __PAGE_HYPERVISOR
idx = 1
.rept 7
.quad (idx << L2_PAGETABLE_SHIFT) | PAGE_HYPERVISOR | _PAGE_PSE
@@ -130,7 +130,7 @@ GLOBAL(l2_xenmap)
.quad 0
idx = 1
.rept 7
- .quad sym_phys(__image_base__) + (idx << L2_PAGETABLE_SHIFT) + (PAGE_HYPERVISOR | _PAGE_PSE)
+ .quad sym_offs(__image_base__) + (idx << L2_PAGETABLE_SHIFT) + (PAGE_HYPERVISOR | _PAGE_PSE)
idx = idx + 1
.endr
.fill L2_PAGETABLE_ENTRIES - 8, 8, 0
@@ -141,7 +141,7 @@ l2_fixmap:
idx = 0
.rept L2_PAGETABLE_ENTRIES
.if idx == l2_table_offset(FIXADDR_TOP - 1)
- .quad sym_phys(l1_fixmap) + __PAGE_HYPERVISOR
+ .quad sym_offs(l1_fixmap) + __PAGE_HYPERVISOR
.else
.quad 0
.endif
@@ -153,7 +153,7 @@ l2_fixmap:
l3_identmap:
idx = 0
.rept 4
- .quad sym_phys(l2_identmap) + (idx << PAGE_SHIFT) + __PAGE_HYPERVISOR
+ .quad sym_offs(l2_identmap) + (idx << PAGE_SHIFT) + __PAGE_HYPERVISOR
idx = idx + 1
.endr
.fill L3_PAGETABLE_ENTRIES - 4, 8, 0
@@ -164,9 +164,9 @@ l3_xenmap:
idx = 0
.rept L3_PAGETABLE_ENTRIES
.if idx == l3_table_offset(XEN_VIRT_START)
- .quad sym_phys(l2_xenmap) + __PAGE_HYPERVISOR
+ .quad sym_offs(l2_xenmap) + __PAGE_HYPERVISOR
.elseif idx == l3_table_offset(FIXADDR_TOP - 1)
- .quad sym_phys(l2_fixmap) + __PAGE_HYPERVISOR
+ .quad sym_offs(l2_fixmap) + __PAGE_HYPERVISOR
.else
.quad 0
.endif
@@ -176,13 +176,13 @@ l3_xenmap:
/* Top-level master (and idle-domain) page directory. */
GLOBAL(idle_pg_table)
- .quad sym_phys(l3_bootmap) + __PAGE_HYPERVISOR
+ .quad sym_offs(l3_bootmap) + __PAGE_HYPERVISOR
idx = 1
.rept L4_PAGETABLE_ENTRIES - 1
.if idx == l4_table_offset(DIRECTMAP_VIRT_START)
- .quad sym_phys(l3_identmap) + __PAGE_HYPERVISOR
+ .quad sym_offs(l3_identmap) + __PAGE_HYPERVISOR
.elseif idx == l4_table_offset(XEN_VIRT_START)
- .quad sym_phys(l3_xenmap) + __PAGE_HYPERVISOR
+ .quad sym_offs(l3_xenmap) + __PAGE_HYPERVISOR
.else
.quad 0
.endif
--
1.7.10.4
_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
https://lists.xen.org/xen-devel
next prev parent reply other threads:[~2016-09-29 21:43 UTC|newest]
Thread overview: 40+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-09-29 21:42 [PATCH v9 00/13] x86: multiboot2 protocol support Daniel Kiper
2016-09-29 21:42 ` [PATCH v9 01/13] x86: add " Daniel Kiper
2016-09-29 21:42 ` [PATCH v9 02/13] efi: create efi_enabled() Daniel Kiper
2016-09-29 21:42 ` [PATCH v9 03/13] x86: allow EFI reboot method neither on EFI platforms Daniel Kiper
2016-09-29 21:42 ` [PATCH v9 04/13] x86: properly calculate xen ELF end of image address Daniel Kiper
2016-09-30 9:43 ` Jan Beulich
2016-09-29 21:42 ` [PATCH v9 05/13] efi: build xen.gz with EFI code Daniel Kiper
2016-09-29 21:42 ` [PATCH v9 06/13] efi: create new early memory allocator Daniel Kiper
2016-09-30 9:46 ` Jan Beulich
2016-09-30 10:49 ` Daniel Kiper
2016-10-05 7:02 ` Daniel Kiper
2016-10-05 15:45 ` Julien Grall
2016-10-05 18:30 ` Julien Grall
2016-10-06 12:21 ` Jan Beulich
2016-10-11 13:39 ` Julien Grall
2016-10-12 11:45 ` Jan Beulich
2016-10-12 12:51 ` Julien Grall
2016-10-12 12:59 ` Jan Beulich
2016-10-24 9:03 ` Daniel Kiper
2016-10-24 9:57 ` Jan Beulich
2016-11-03 13:48 ` Daniel Kiper
2016-11-10 10:34 ` Daniel Kiper
2016-10-31 13:32 ` Julien Grall
2016-09-29 21:42 ` [PATCH v9 07/13] x86: add multiboot2 protocol support for EFI platforms Daniel Kiper
2016-11-23 18:52 ` Andrew Cooper
2016-11-24 11:08 ` Jan Beulich
2016-11-24 21:44 ` Daniel Kiper
2016-11-25 7:50 ` Jan Beulich
2016-11-30 13:45 ` Daniel Kiper
2016-11-30 13:59 ` Jan Beulich
2016-11-30 17:21 ` Daniel Kiper
2016-11-24 21:31 ` Daniel Kiper
2016-09-29 21:42 ` [PATCH v9 08/13] x86/boot: implement early command line parser in C Daniel Kiper
2016-09-29 21:42 ` [PATCH v9 09/13] x86: change default load address from 1 MiB to 2 MiB Daniel Kiper
2016-09-30 10:02 ` Jan Beulich
2016-09-29 21:42 ` [PATCH v9 10/13] x86/setup: use XEN_IMG_OFFSET instead of Daniel Kiper
2016-09-29 21:42 ` [PATCH v9 11/13] x86: make Xen early boot code relocatable Daniel Kiper
2016-09-29 21:42 ` Daniel Kiper [this message]
2016-09-29 21:42 ` [PATCH v9 13/13] x86: add multiboot2 protocol support for relocatable images Daniel Kiper
2016-09-30 10:03 ` Jan Beulich
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1475185362-14198-13-git-send-email-daniel.kiper@oracle.com \
--to=daniel.kiper@oracle.com \
--cc=andrew.cooper3@citrix.com \
--cc=cardoe@cardoe.com \
--cc=david.vrabel@citrix.com \
--cc=fu.wei@linaro.org \
--cc=gang.wei@intel.com \
--cc=jbeulich@suse.com \
--cc=jgross@suse.com \
--cc=julien.grall@arm.com \
--cc=ning.sun@intel.com \
--cc=pgnet.dev@gmail.com \
--cc=qiaowei.ren@intel.com \
--cc=sstabellini@kernel.org \
--cc=xen-devel@lists.xenproject.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.