From: Andrew Cooper <andrew.cooper3@citrix.com>
To: Xen-devel <xen-devel@lists.xenproject.org>
Cc: "Andrew Cooper" <andrew.cooper3@citrix.com>,
"Wei Liu" <wl@xen.org>, "Jan Beulich" <JBeulich@suse.com>,
"Roger Pau Monné" <roger.pau@citrix.com>
Subject: [Xen-devel] [PATCH v2 3/5] x86/boot: Drop explicit %fs uses
Date: Fri, 17 Jan 2020 20:42:21 +0000 [thread overview]
Message-ID: <20200117204223.30076-4-andrew.cooper3@citrix.com> (raw)
In-Reply-To: <20200117204223.30076-1-andrew.cooper3@citrix.com>
The trampoline relocation code uses %fs for accessing Xen, and this comes with
an arbitrary 16M limitation. We could adjust the limit, but the boot code is
a confusing mix of %ds/%esi-based and %fs-based accesses, and the use of %fs
is longer to encode, and incurs an address generation overhead.
Rewrite the logic to use %ds, for better consistency with the surrounding
code, and a marginal performance improvement.
Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
---
CC: Jan Beulich <JBeulich@suse.com>
CC: Wei Liu <wl@xen.org>
CC: Roger Pau Monné <roger.pau@citrix.com>
---
xen/arch/x86/boot/head.S | 26 +++++++++++++++-----------
1 file changed, 15 insertions(+), 11 deletions(-)
diff --git a/xen/arch/x86/boot/head.S b/xen/arch/x86/boot/head.S
index 0137ee99a4..1deeae2f2a 100644
--- a/xen/arch/x86/boot/head.S
+++ b/xen/arch/x86/boot/head.S
@@ -718,23 +718,27 @@ trampoline_setup:
mov %edx, sym_esi(l2_bootmap)
/* Apply relocations to bootstrap trampoline. */
- mov sym_fs(trampoline_phys),%edx
- mov $sym_offs(__trampoline_rel_start),%edi
+ mov sym_esi(trampoline_phys), %edx
+ lea sym_esi(__trampoline_rel_start), %edi
+ lea sym_esi(__trampoline_rel_stop), %ecx
1:
- mov %fs:(%edi),%eax
- add %edx,%fs:(%edi,%eax)
+ mov (%edi), %eax
+ add %edx, (%edi, %eax)
add $4,%edi
- cmp $sym_offs(__trampoline_rel_stop),%edi
+
+ cmp %ecx, %edi
jb 1b
/* Patch in the trampoline segment. */
shr $4,%edx
- mov $sym_offs(__trampoline_seg_start),%edi
+ lea sym_esi(__trampoline_seg_start), %edi
+ lea sym_esi(__trampoline_seg_stop), %ecx
1:
- mov %fs:(%edi),%eax
- mov %dx,%fs:(%edi,%eax)
+ mov (%edi), %eax
+ mov %dx, (%edi, %eax)
add $4,%edi
- cmp $sym_offs(__trampoline_seg_stop),%edi
+
+ cmp %ecx, %edi
jb 1b
/* Do not parse command line on EFI platform here. */
@@ -760,9 +764,9 @@ trampoline_setup:
push %eax
/* Copy bootstrap trampoline to low memory, below 1MB. */
- mov $sym_offs(trampoline_start),%esi
+ lea sym_esi(trampoline_start), %esi
mov $((trampoline_end - trampoline_start) / 4),%ecx
- rep movsl %fs:(%esi),%es:(%edi)
+ rep movsl
/* Jump into the relocated trampoline. */
lret
--
2.11.0
_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xenproject.org
https://lists.xenproject.org/mailman/listinfo/xen-devel
next prev parent reply other threads:[~2020-01-17 20:42 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-01-17 20:42 [Xen-devel] [PATCH v2 0/5] x86: Remove more 16M total-size restrictions Andrew Cooper
2020-01-17 20:42 ` [Xen-devel] [PATCH v2 1/5] x86/boot: Create the l2_xenmap[] mappings dynamically Andrew Cooper
2020-01-20 10:29 ` Jan Beulich
2020-01-17 20:42 ` [Xen-devel] [PATCH v2 2/5] x86/boot: Size the boot/directmap " Andrew Cooper
2020-01-20 10:30 ` Jan Beulich
2020-01-17 20:42 ` Andrew Cooper [this message]
2020-01-20 10:35 ` [Xen-devel] [PATCH v2 3/5] x86/boot: Drop explicit %fs uses Jan Beulich
2020-01-17 20:42 ` [Xen-devel] [PATCH v2 4/5] x86/boot: Simplify pagetable manipulation loops Andrew Cooper
2020-01-20 10:46 ` Jan Beulich
2020-01-22 15:43 ` Andrew Cooper
2020-01-17 20:42 ` [Xen-devel] [PATCH v2 5/5] x86/boot: Drop sym_fs() Andrew Cooper
2020-01-20 11:39 ` 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=20200117204223.30076-4-andrew.cooper3@citrix.com \
--to=andrew.cooper3@citrix.com \
--cc=JBeulich@suse.com \
--cc=roger.pau@citrix.com \
--cc=wl@xen.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.