* [PATCH v2] x86/boot: fix reloc.S build dependencies
@ 2014-10-21 21:09 Daniel Kiper
2014-10-21 21:09 ` [PATCH v2] x86/boot: use constant in head.S instead of hardcoded value Daniel Kiper
` (2 more replies)
0 siblings, 3 replies; 6+ messages in thread
From: Daniel Kiper @ 2014-10-21 21:09 UTC (permalink / raw)
To: xen-devel; +Cc: andrew.cooper3, Daniel Kiper, keir, jbeulich
reloc.S is not rebuild if header included
in reloc.c is updated. Fix this issue.
Additionally, remove reloc.S build dependency
on head.S because anything from reloc.S does
not depend on head.S.
Add reloc.c dependency to reloc.o build rule for consistency.
Signed-off-by: Daniel Kiper <daniel.kiper@oracle.com>
---
v2 - suggestions/fixes:
- do not use export and pass variable to make command line directly
(suggested by Jan Beulich),
- improve commit message
(suggested by Jan Beulich).
---
xen/arch/x86/boot/Makefile | 8 ++++----
xen/arch/x86/boot/build32.mk | 3 ++-
2 files changed, 6 insertions(+), 5 deletions(-)
diff --git a/xen/arch/x86/boot/Makefile b/xen/arch/x86/boot/Makefile
index 13f4a66..5fdb5ae 100644
--- a/xen/arch/x86/boot/Makefile
+++ b/xen/arch/x86/boot/Makefile
@@ -1,8 +1,8 @@
obj-bin-y += head.o
-head.o: reloc.S
+RELOC_DEPS = $(BASEDIR)/include/asm-x86/config.h $(BASEDIR)/include/xen/multiboot.h
-%.S: %.c
- $(MAKE) -f build32.mk $@
+head.o: reloc.S
-reloc.S: head.S
+reloc.S: reloc.c $(RELOC_DEPS)
+ $(MAKE) -f build32.mk $@ RELOC_DEPS="$(RELOC_DEPS)"
diff --git a/xen/arch/x86/boot/build32.mk b/xen/arch/x86/boot/build32.mk
index a36f620..c208249 100644
--- a/xen/arch/x86/boot/build32.mk
+++ b/xen/arch/x86/boot/build32.mk
@@ -30,5 +30,6 @@ CFLAGS := $(filter-out -flto,$(CFLAGS))
esac; \
done
-reloc.o: $(BASEDIR)/include/asm-x86/config.h
+reloc.o: reloc.c $(RELOC_DEPS)
+
.PRECIOUS: %.bin %.lnk
--
1.7.10.4
^ permalink raw reply related [flat|nested] 6+ messages in thread
* [PATCH v2] x86/boot: use constant in head.S instead of hardcoded value
2014-10-21 21:09 [PATCH v2] x86/boot: fix reloc.S build dependencies Daniel Kiper
@ 2014-10-21 21:09 ` Daniel Kiper
2014-10-22 9:56 ` Andrew Cooper
2014-10-21 21:09 ` [PATCH] x86/boot/reloc: add memory to clobber list Daniel Kiper
2014-10-22 9:56 ` [PATCH v2] x86/boot: fix reloc.S build dependencies Andrew Cooper
2 siblings, 1 reply; 6+ messages in thread
From: Daniel Kiper @ 2014-10-21 21:09 UTC (permalink / raw)
To: xen-devel; +Cc: andrew.cooper3, Daniel Kiper, keir, jbeulich
..to access multiboot.mem_lower data.
Signed-off-by: Daniel Kiper <daniel.kiper@oracle.com>
---
v2 - suggestions/fixes:
- align constant name to currently used convention
(suggested by Andrew Cooper and Jan Beulich).
---
xen/arch/x86/boot/head.S | 2 +-
xen/arch/x86/x86_64/asm-offsets.c | 1 +
2 files changed, 2 insertions(+), 1 deletion(-)
diff --git a/xen/arch/x86/boot/head.S b/xen/arch/x86/boot/head.S
index cd43952..c99f739 100644
--- a/xen/arch/x86/boot/head.S
+++ b/xen/arch/x86/boot/head.S
@@ -101,7 +101,7 @@ __start:
*/
testb $MBI_MEMLIMITS,(%ebx)
jz 2f /* not available? BDA value will be fine */
- mov 4(%ebx),%edx
+ mov MB_mem_lower(%ebx),%edx
cmp $0x100,%edx /* is the multiboot value too small? */
jb 2f /* if so, do not use it */
shl $10-4,%edx
diff --git a/xen/arch/x86/x86_64/asm-offsets.c b/xen/arch/x86/x86_64/asm-offsets.c
index 3994f4d..447c650 100644
--- a/xen/arch/x86/x86_64/asm-offsets.c
+++ b/xen/arch/x86/x86_64/asm-offsets.c
@@ -165,4 +165,5 @@ void __dummy__(void)
OFFSET(MB_flags, multiboot_info_t, flags);
OFFSET(MB_cmdline, multiboot_info_t, cmdline);
+ OFFSET(MB_mem_lower, multiboot_info_t, mem_lower);
}
--
1.7.10.4
^ permalink raw reply related [flat|nested] 6+ messages in thread
* [PATCH] x86/boot/reloc: add memory to clobber list
2014-10-21 21:09 [PATCH v2] x86/boot: fix reloc.S build dependencies Daniel Kiper
2014-10-21 21:09 ` [PATCH v2] x86/boot: use constant in head.S instead of hardcoded value Daniel Kiper
@ 2014-10-21 21:09 ` Daniel Kiper
2014-10-22 9:58 ` Andrew Cooper
2014-10-22 9:56 ` [PATCH v2] x86/boot: fix reloc.S build dependencies Andrew Cooper
2 siblings, 1 reply; 6+ messages in thread
From: Daniel Kiper @ 2014-10-21 21:09 UTC (permalink / raw)
To: xen-devel; +Cc: andrew.cooper3, Daniel Kiper, keir, jbeulich
Assembly inline in reloc_mbi_struct() clobbers
memory so tell compiler about that.
Signed-off-by: Daniel Kiper <daniel.kiper@oracle.com>
---
xen/arch/x86/boot/reloc.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/xen/arch/x86/boot/reloc.c b/xen/arch/x86/boot/reloc.c
index 4609e55..f971920 100644
--- a/xen/arch/x86/boot/reloc.c
+++ b/xen/arch/x86/boot/reloc.c
@@ -46,7 +46,7 @@ static void *reloc_mbi_struct(void *old, unsigned int bytes)
" mov %0,%%edi \n"
" rep movsb \n"
: "=&r" (new), "+c" (bytes), "+S" (old)
- : : "edx", "edi");
+ : : "edx", "edi", "memory");
return new;
}
--
1.7.10.4
^ permalink raw reply related [flat|nested] 6+ messages in thread
* Re: [PATCH v2] x86/boot: fix reloc.S build dependencies
2014-10-21 21:09 [PATCH v2] x86/boot: fix reloc.S build dependencies Daniel Kiper
2014-10-21 21:09 ` [PATCH v2] x86/boot: use constant in head.S instead of hardcoded value Daniel Kiper
2014-10-21 21:09 ` [PATCH] x86/boot/reloc: add memory to clobber list Daniel Kiper
@ 2014-10-22 9:56 ` Andrew Cooper
2 siblings, 0 replies; 6+ messages in thread
From: Andrew Cooper @ 2014-10-22 9:56 UTC (permalink / raw)
To: Daniel Kiper, xen-devel; +Cc: keir, jbeulich
On 21/10/14 22:09, Daniel Kiper wrote:
> reloc.S is not rebuild if header included
> in reloc.c is updated. Fix this issue.
>
> Additionally, remove reloc.S build dependency
> on head.S because anything from reloc.S does
> not depend on head.S.
>
> Add reloc.c dependency to reloc.o build rule for consistency.
>
> Signed-off-by: Daniel Kiper <daniel.kiper@oracle.com>
Reviewed-by: Andrew Cooper <andrew.cooper3@citrix.com>
> ---
> v2 - suggestions/fixes:
> - do not use export and pass variable to make command line directly
> (suggested by Jan Beulich),
> - improve commit message
> (suggested by Jan Beulich).
> ---
> xen/arch/x86/boot/Makefile | 8 ++++----
> xen/arch/x86/boot/build32.mk | 3 ++-
> 2 files changed, 6 insertions(+), 5 deletions(-)
>
> diff --git a/xen/arch/x86/boot/Makefile b/xen/arch/x86/boot/Makefile
> index 13f4a66..5fdb5ae 100644
> --- a/xen/arch/x86/boot/Makefile
> +++ b/xen/arch/x86/boot/Makefile
> @@ -1,8 +1,8 @@
> obj-bin-y += head.o
>
> -head.o: reloc.S
> +RELOC_DEPS = $(BASEDIR)/include/asm-x86/config.h $(BASEDIR)/include/xen/multiboot.h
>
> -%.S: %.c
> - $(MAKE) -f build32.mk $@
> +head.o: reloc.S
>
> -reloc.S: head.S
> +reloc.S: reloc.c $(RELOC_DEPS)
> + $(MAKE) -f build32.mk $@ RELOC_DEPS="$(RELOC_DEPS)"
> diff --git a/xen/arch/x86/boot/build32.mk b/xen/arch/x86/boot/build32.mk
> index a36f620..c208249 100644
> --- a/xen/arch/x86/boot/build32.mk
> +++ b/xen/arch/x86/boot/build32.mk
> @@ -30,5 +30,6 @@ CFLAGS := $(filter-out -flto,$(CFLAGS))
> esac; \
> done
>
> -reloc.o: $(BASEDIR)/include/asm-x86/config.h
> +reloc.o: reloc.c $(RELOC_DEPS)
> +
> .PRECIOUS: %.bin %.lnk
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [PATCH v2] x86/boot: use constant in head.S instead of hardcoded value
2014-10-21 21:09 ` [PATCH v2] x86/boot: use constant in head.S instead of hardcoded value Daniel Kiper
@ 2014-10-22 9:56 ` Andrew Cooper
0 siblings, 0 replies; 6+ messages in thread
From: Andrew Cooper @ 2014-10-22 9:56 UTC (permalink / raw)
To: Daniel Kiper, xen-devel; +Cc: keir, jbeulich
On 21/10/14 22:09, Daniel Kiper wrote:
> ..to access multiboot.mem_lower data.
>
> Signed-off-by: Daniel Kiper <daniel.kiper@oracle.com>
Reviewed-by: Andrew Cooper <andrew.cooper3@citrix.com>
> ---
> v2 - suggestions/fixes:
> - align constant name to currently used convention
> (suggested by Andrew Cooper and Jan Beulich).
> ---
> xen/arch/x86/boot/head.S | 2 +-
> xen/arch/x86/x86_64/asm-offsets.c | 1 +
> 2 files changed, 2 insertions(+), 1 deletion(-)
>
> diff --git a/xen/arch/x86/boot/head.S b/xen/arch/x86/boot/head.S
> index cd43952..c99f739 100644
> --- a/xen/arch/x86/boot/head.S
> +++ b/xen/arch/x86/boot/head.S
> @@ -101,7 +101,7 @@ __start:
> */
> testb $MBI_MEMLIMITS,(%ebx)
> jz 2f /* not available? BDA value will be fine */
> - mov 4(%ebx),%edx
> + mov MB_mem_lower(%ebx),%edx
> cmp $0x100,%edx /* is the multiboot value too small? */
> jb 2f /* if so, do not use it */
> shl $10-4,%edx
> diff --git a/xen/arch/x86/x86_64/asm-offsets.c b/xen/arch/x86/x86_64/asm-offsets.c
> index 3994f4d..447c650 100644
> --- a/xen/arch/x86/x86_64/asm-offsets.c
> +++ b/xen/arch/x86/x86_64/asm-offsets.c
> @@ -165,4 +165,5 @@ void __dummy__(void)
>
> OFFSET(MB_flags, multiboot_info_t, flags);
> OFFSET(MB_cmdline, multiboot_info_t, cmdline);
> + OFFSET(MB_mem_lower, multiboot_info_t, mem_lower);
> }
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [PATCH] x86/boot/reloc: add memory to clobber list
2014-10-21 21:09 ` [PATCH] x86/boot/reloc: add memory to clobber list Daniel Kiper
@ 2014-10-22 9:58 ` Andrew Cooper
0 siblings, 0 replies; 6+ messages in thread
From: Andrew Cooper @ 2014-10-22 9:58 UTC (permalink / raw)
To: Daniel Kiper, xen-devel; +Cc: keir, jbeulich
On 21/10/14 22:09, Daniel Kiper wrote:
> Assembly inline in reloc_mbi_struct() clobbers
> memory so tell compiler about that.
>
> Signed-off-by: Daniel Kiper <daniel.kiper@oracle.com>
Reviewed-by: Andrew Cooper <andrew.cooper3@citrix.com>
> ---
> xen/arch/x86/boot/reloc.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/xen/arch/x86/boot/reloc.c b/xen/arch/x86/boot/reloc.c
> index 4609e55..f971920 100644
> --- a/xen/arch/x86/boot/reloc.c
> +++ b/xen/arch/x86/boot/reloc.c
> @@ -46,7 +46,7 @@ static void *reloc_mbi_struct(void *old, unsigned int bytes)
> " mov %0,%%edi \n"
> " rep movsb \n"
> : "=&r" (new), "+c" (bytes), "+S" (old)
> - : : "edx", "edi");
> + : : "edx", "edi", "memory");
> return new;
> }
>
^ permalink raw reply [flat|nested] 6+ messages in thread
end of thread, other threads:[~2014-10-22 9:58 UTC | newest]
Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-10-21 21:09 [PATCH v2] x86/boot: fix reloc.S build dependencies Daniel Kiper
2014-10-21 21:09 ` [PATCH v2] x86/boot: use constant in head.S instead of hardcoded value Daniel Kiper
2014-10-22 9:56 ` Andrew Cooper
2014-10-21 21:09 ` [PATCH] x86/boot/reloc: add memory to clobber list Daniel Kiper
2014-10-22 9:58 ` Andrew Cooper
2014-10-22 9:56 ` [PATCH v2] x86/boot: fix reloc.S build dependencies Andrew Cooper
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.