From: Julien Grall <julien@xen.org>
To: Jan Beulich <jbeulich@suse.com>,
"xen-devel@lists.xenproject.org" <xen-devel@lists.xenproject.org>
Cc: "Andrew Cooper" <andrew.cooper3@citrix.com>,
"George Dunlap" <george.dunlap@citrix.com>,
"Ian Jackson" <iwj@xenproject.org>,
"Stefano Stabellini" <sstabellini@kernel.org>,
"Wei Liu" <wl@xen.org>, "Roger Pau Monné" <roger.pau@citrix.com>
Subject: Re: [PATCH 02/23] lib: move 64-bit div/mod compiler helpers
Date: Thu, 1 Apr 2021 15:56:53 +0100 [thread overview]
Message-ID: <008a8b14-8f58-2127-9e97-87c696e07b5e@xen.org> (raw)
In-Reply-To: <0fec827f-bb0b-4ea1-7757-9c27e9138be7@suse.com>
Hi Jan,
On 01/04/2021 11:19, Jan Beulich wrote:
> These were built for 32-bit architectures only (the same code could,
> with some tweaking, sensibly be used to provide TI-mode helpers on
> 64-bit arch-es) - retain this property, while still avoiding to have
> a CU without any contents at all. For this, Arm's CONFIG_64BIT gets
> generalized.
>
> Signed-off-by: Jan Beulich <jbeulich@suse.com>
> ---
> xen/arch/Kconfig | 2 ++
> xen/arch/arm/Kconfig | 12 +++---------
> xen/arch/x86/Kconfig | 1 +
> xen/common/Makefile | 1 -
> xen/lib/Makefile | 4 ++++
> xen/{common/lib.c => lib/divmod.c} | 2 --
> 6 files changed, 10 insertions(+), 12 deletions(-)
> rename xen/{common/lib.c => lib/divmod.c} (99%)
>
> diff --git a/xen/arch/Kconfig b/xen/arch/Kconfig
> index d144d4c8d3ee..f16eb0df43af 100644
> --- a/xen/arch/Kconfig
> +++ b/xen/arch/Kconfig
> @@ -1,3 +1,5 @@
> +config 64BIT
> + bool
>
> config NR_CPUS
> int "Maximum number of CPUs"
> diff --git a/xen/arch/arm/Kconfig b/xen/arch/arm/Kconfig
> index 330bbf6232d4..ecfa6822e4d3 100644
> --- a/xen/arch/arm/Kconfig
> +++ b/xen/arch/arm/Kconfig
> @@ -1,17 +1,11 @@
> -config 64BIT
> - bool
> - default "$(ARCH)" != "arm32"
> - help
> - Say yes to build a 64-bit Xen
> - Say no to build a 32-bit Xen
> -
> config ARM_32
> def_bool y
> - depends on !64BIT
> + depends on "$(ARCH)" = "arm32"
>
> config ARM_64
> def_bool y
> - depends on 64BIT
> + depends on !ARM_32
> + select 64BIT
> select HAS_FAST_MULTIPLY
>
> config ARM
> diff --git a/xen/arch/x86/Kconfig b/xen/arch/x86/Kconfig
> index f79e6634db3f..4d6911ffa467 100644
> --- a/xen/arch/x86/Kconfig
> +++ b/xen/arch/x86/Kconfig
> @@ -1,5 +1,6 @@
> config X86_64
> def_bool y
> + select 64BIT
>
> config X86
> def_bool y
> diff --git a/xen/common/Makefile b/xen/common/Makefile
> index 71c1d466bd8f..e2a7e62d14bf 100644
> --- a/xen/common/Makefile
> +++ b/xen/common/Makefile
> @@ -21,7 +21,6 @@ obj-y += kernel.o
> obj-y += keyhandler.o
> obj-$(CONFIG_KEXEC) += kexec.o
> obj-$(CONFIG_KEXEC) += kimage.o
> -obj-y += lib.o
> obj-$(CONFIG_LIVEPATCH) += livepatch.o livepatch_elf.o
> obj-$(CONFIG_MEM_ACCESS) += mem_access.o
> obj-y += memory.o
> diff --git a/xen/lib/Makefile b/xen/lib/Makefile
> index 0b274583ef0b..a5dc1442a422 100644
> --- a/xen/lib/Makefile
> +++ b/xen/lib/Makefile
> @@ -10,3 +10,7 @@ lib-y += rbtree.o
> lib-y += sort.o
> lib-$(CONFIG_X86) += xxhash32.o
> lib-$(CONFIG_X86) += xxhash64.o
> +
> +lib32-y := divmod.o
> +lib32-$(CONFIG_64BIT) :=
> +lib-y += $(lib32-y)
> diff --git a/xen/common/lib.c b/xen/lib/divmod.c
> similarity index 99%
> rename from xen/common/lib.c
> rename to xen/lib/divmod.c
> index 5b8f49153dad..0be6ccc70096 100644
> --- a/xen/common/lib.c
> +++ b/xen/lib/divmod.c
> @@ -40,7 +40,6 @@
> * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
> * SUCH DAMAGE.
> */
> -#if BITS_PER_LONG == 32
In theory BITS_PER_LONG == 32 is not quite the same as 32-bit arch. Can
you clarify whether this code is necessary on 64-bit arch where long is
only 32-bit.
Cheers?
--
Julien Grall
next prev parent reply other threads:[~2021-04-01 14:57 UTC|newest]
Thread overview: 39+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-04-01 10:14 [PATCH 00/23] further population of xen/lib/ Jan Beulich
2021-04-01 10:19 ` [PATCH 01/23] lib: move muldiv64() Jan Beulich
2021-04-15 10:00 ` Ping (x86): " Jan Beulich
2021-04-15 12:46 ` Roger Pau Monné
2021-04-01 10:19 ` [PATCH 02/23] lib: move 64-bit div/mod compiler helpers Jan Beulich
2021-04-01 14:56 ` Julien Grall [this message]
2021-04-01 15:23 ` Jan Beulich
2021-04-06 19:34 ` Julien Grall
2021-04-07 8:33 ` Jan Beulich
2021-04-07 14:06 ` Julien Grall
2021-04-01 10:20 ` [PATCH 03/23] string: drop redundant declarations Jan Beulich
2021-04-01 14:59 ` Julien Grall
2021-04-01 10:20 ` [PATCH 04/23] lib: move memset() Jan Beulich
2021-04-01 10:21 ` [PATCH 05/23] lib: move memcpy() Jan Beulich
2021-04-01 10:21 ` [PATCH 06/23] lib: move memmove() Jan Beulich
2021-04-01 10:22 ` [PATCH 07/23] lib: move memcmp() Jan Beulich
2021-04-01 10:22 ` [PATCH 08/23] lib: move memchr() Jan Beulich
2021-04-01 10:23 ` [PATCH 09/23] lib: move memchr_inv() Jan Beulich
2021-04-01 10:23 ` [PATCH 10/23] lib: move strlen() Jan Beulich
2021-04-01 10:23 ` [PATCH 11/23] lib: move strnlen() Jan Beulich
2021-04-01 10:24 ` [PATCH 12/23] lib: move strcmp() Jan Beulich
2021-04-01 10:25 ` [PATCH 13/23] lib: move strncmp() Jan Beulich
2021-04-01 10:25 ` [PATCH 14/23] lib: move strlcpy() Jan Beulich
2021-04-01 10:25 ` [PATCH 15/23] lib: move strlcat() Jan Beulich
2021-04-01 10:25 ` [PATCH 16/23] lib: move strchr() Jan Beulich
2021-04-01 10:26 ` [PATCH 17/23] lib: move strrchr() Jan Beulich
2021-04-01 10:26 ` [PATCH 18/23] lib: move strstr() Jan Beulich
2021-04-01 10:26 ` [PATCH 19/23] lib: move strcasecmp() Jan Beulich
2021-04-01 10:27 ` [PATCH 20/23] lib: move/rename strnicmp() to strncasecmp() Jan Beulich
2021-04-01 10:27 ` [PATCH 21/23] lib: move strspn() Jan Beulich
2021-04-01 10:28 ` [PATCH 22/23] lib: move strpbrk() Jan Beulich
2021-04-01 10:28 ` [PATCH 23/23] lib: move strsep() Jan Beulich
2021-04-01 11:54 ` [PATCH 00/23] further population of xen/lib/ Julien Grall
2021-04-01 13:43 ` Jan Beulich
2021-04-01 14:04 ` Julien Grall
2021-04-01 14:27 ` Jan Beulich
2021-04-01 14:55 ` Julien Grall
2021-04-01 15:25 ` Jan Beulich
2021-04-01 15:32 ` Julien Grall
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=008a8b14-8f58-2127-9e97-87c696e07b5e@xen.org \
--to=julien@xen.org \
--cc=andrew.cooper3@citrix.com \
--cc=george.dunlap@citrix.com \
--cc=iwj@xenproject.org \
--cc=jbeulich@suse.com \
--cc=roger.pau@citrix.com \
--cc=sstabellini@kernel.org \
--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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).