Module Name:    src
Committed By:   bouyer
Date:           Mon Oct 16 17:29:31 UTC 2023

Modified Files:
        src/sys/arch/amd64/amd64: locore.S
        src/sys/arch/i386/i386: locore.S
        src/sys/arch/xen/include: hypervisor.h

Log Message:
Xen's start_info_t is larger than 512 bytes these days, so bump the copy
size to a whole PAGE_SIZE, and CTASSERT() that start_info_t is smaller.
Luckily we didn't use yet the parts skipped


To generate a diff of this commit:
cvs rdiff -u -r1.223 -r1.224 src/sys/arch/amd64/amd64/locore.S
cvs rdiff -u -r1.196 -r1.197 src/sys/arch/i386/i386/locore.S
cvs rdiff -u -r1.57 -r1.58 src/sys/arch/xen/include/hypervisor.h

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/sys/arch/amd64/amd64/locore.S
diff -u src/sys/arch/amd64/amd64/locore.S:1.223 src/sys/arch/amd64/amd64/locore.S:1.224
--- src/sys/arch/amd64/amd64/locore.S:1.223	Sun Jul 16 19:55:43 2023
+++ src/sys/arch/amd64/amd64/locore.S	Mon Oct 16 17:29:30 2023
@@ -1,4 +1,4 @@
-/*	$NetBSD: locore.S,v 1.223 2023/07/16 19:55:43 riastradh Exp $	*/
+/*	$NetBSD: locore.S,v 1.224 2023/10/16 17:29:30 bouyer Exp $	*/
 
 /*
  * Copyright-o-rama!
@@ -939,7 +939,7 @@ longmode_hi:
 	/* Copy start_info to a safe place. */
 	movq	%rbx,%rsi
 	movq	$_C_LABEL(start_info_union),%rdi
-	movq	$64,%rcx
+	movq	$(PAGE_SIZE / 8),%rcx
 	rep
 	movsq
 

Index: src/sys/arch/i386/i386/locore.S
diff -u src/sys/arch/i386/i386/locore.S:1.196 src/sys/arch/i386/i386/locore.S:1.197
--- src/sys/arch/i386/i386/locore.S:1.196	Sun Jul 16 19:55:43 2023
+++ src/sys/arch/i386/i386/locore.S	Mon Oct 16 17:29:31 2023
@@ -1,4 +1,4 @@
-/*	$NetBSD: locore.S,v 1.196 2023/07/16 19:55:43 riastradh Exp $	*/
+/*	$NetBSD: locore.S,v 1.197 2023/10/16 17:29:31 bouyer Exp $	*/
 
 /*
  * Copyright-o-rama!
@@ -128,7 +128,7 @@
  */
 
 #include <machine/asm.h>
-__KERNEL_RCSID(0, "$NetBSD: locore.S,v 1.196 2023/07/16 19:55:43 riastradh Exp $");
+__KERNEL_RCSID(0, "$NetBSD: locore.S,v 1.197 2023/10/16 17:29:31 bouyer Exp $");
 
 #include "opt_copy_symtab.h"
 #include "opt_ddb.h"
@@ -1142,7 +1142,7 @@ begin:
 	/* Copy the necessary stuff from start_info structure. */
 	/* We need to copy shared_info early, so that sti/cli work */
 	movl	$RELOC(start_info_union),%edi
-	movl	$128,%ecx
+	movl	$(PAGE_SIZE / 4),%ecx
 	rep
 	movsl
 

Index: src/sys/arch/xen/include/hypervisor.h
diff -u src/sys/arch/xen/include/hypervisor.h:1.57 src/sys/arch/xen/include/hypervisor.h:1.58
--- src/sys/arch/xen/include/hypervisor.h:1.57	Sat Feb 25 00:34:48 2023
+++ src/sys/arch/xen/include/hypervisor.h	Mon Oct 16 17:29:31 2023
@@ -1,4 +1,4 @@
-/*	$NetBSD: hypervisor.h,v 1.57 2023/02/25 00:34:48 riastradh Exp $	*/
+/*	$NetBSD: hypervisor.h,v 1.58 2023/10/16 17:29:31 bouyer Exp $	*/
 
 /*
  * Copyright (c) 2006 Manuel Bouyer.
@@ -58,6 +58,8 @@
 #include "isa.h"
 #include "pci.h"
 
+#include <machine/vmparam.h>
+
 struct cpu_info;
 
 int xen_hvm_init(void);
@@ -134,11 +136,13 @@ struct xen_npx_attach_args {
 union start_info_union
 {
     start_info_t start_info;
-    char padding[512];
+    char padding[PAGE_SIZE];
 };
 extern union start_info_union start_info_union;
 #define xen_start_info (start_info_union.start_info)
 
+CTASSERT(sizeof(start_info_t) <= PAGE_SIZE);
+
 extern struct hvm_start_info *hvm_start_info;
 
 /* For use in guest OSes. */

Reply via email to