From: Andrew Cooper <andrew.cooper3@citrix.com>
To: Jan Beulich <JBeulich@suse.com>,
xen-devel <xen-devel@lists.xenproject.org>
Subject: Re: [PATCH 2/2] x86/E820: improve insn selection
Date: Tue, 12 Dec 2017 11:21:14 +0000 [thread overview]
Message-ID: <1bec2ae0-8d05-a223-e5d8-e22dbda893aa@citrix.com> (raw)
In-Reply-To: <5A2FC73B0200007800196C01@prv-mh.provo.novell.com>
On 12/12/17 11:10, Jan Beulich wrote:
> ..., largely to shrink code size a little:
> - use TEST instead of CMP with zero immediate
> - use MOVZWL instead of AND with 0xffff immediate
> - compute final highmem_bk value in registers, accessing memory just
> once
>
> Signed-off-by: Jan Beulich <jbeulich@suse.com>
Reviewed-by: Andrew Cooper <andrew.cooper3@citrix.com>, altbeit it
preferably with space in the first hunk.
Any chance we can drop redundant size suffixes as we go?
>
> --- a/xen/arch/x86/boot/mem.S
> +++ b/xen/arch/x86/boot/mem.S
> @@ -29,8 +29,8 @@ get_memory_map:
> movw %di,%ax
> addw $20,%ax
> movw %ax,%di
> - cmpl $0,%ebx # check to see if
> - jne 1b # %ebx is set to EOF
> + testl %ebx,%ebx # check to see if
> + jnz 1b # %ebx is set to EOF
>
> .Lmem88:
> movb $0x88, %ah
> @@ -48,17 +48,17 @@ get_memory_map:
> int $0x15
> jc .Lint12
>
> - cmpw $0x0, %cx # Kludge to handle BIOSes
> - jne 1f # which report their extended
> - cmpw $0x0, %dx # memory in AX/BX rather than
> - jne 1f # CX/DX. The spec I have read
> + testw %cx, %cx # Kludge to handle BIOSes
> + jnz 1f # which report their extended
> + testw %dx, %dx # memory in AX/BX rather than
> + jnz 1f # CX/DX. The spec I have read
> movw %ax, %cx # seems to indicate AX/BX
> movw %bx, %dx # are more reasonable anyway...
> -1: andl $0xffff,%edx # clear sign extend
> +1: movzwl %dx, %edx
> shll $6,%edx # and go from 64k to 1k chunks
> + movzwl %cx, %ecx
> + addl %ecx, %edx # add in lower memory
> movl %edx,bootsym(highmem_kb) # store extended memory size
> - andl $0xffff,%ecx # clear sign extend
> - addl %ecx,bootsym(highmem_kb) # and add lower memory into
>
> .Lint12:
> int $0x12
>
>
>
_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xenproject.org
https://lists.xenproject.org/mailman/listinfo/xen-devel
next prev parent reply other threads:[~2017-12-12 11:21 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-12-12 10:54 [PATCH 0/2] x86/E820: a fix and an improvement Jan Beulich
2017-12-12 11:10 ` [PATCH 1/2] x86/E820: don't overrun array Jan Beulich
2017-12-12 11:18 ` Andrew Cooper
2017-12-12 14:21 ` Jan Beulich
2017-12-20 19:28 ` Andrew Cooper
2017-12-12 11:10 ` [PATCH 2/2] x86/E820: improve insn selection Jan Beulich
2017-12-12 11:21 ` Andrew Cooper [this message]
2017-12-12 14:25 ` 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=1bec2ae0-8d05-a223-e5d8-e22dbda893aa@citrix.com \
--to=andrew.cooper3@citrix.com \
--cc=JBeulich@suse.com \
--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.