diff mbox series

[PULL,37/76] i386: import & use bootparam.h

Message ID 1549390526-24246-38-git-send-email-pbonzini@redhat.com
State New
Headers show
Series [PULL,01/76] vhost-user-test: use g_cond_broadcast | expand

Commit Message

Paolo Bonzini Feb. 5, 2019, 6:14 p.m. UTC
From: Li Zhijian <lizhijian@cn.fujitsu.com>

it's from v4.20-rc5.

CC: Stefano Garzarella <sgarzare@redhat.com>
CC: Michael S. Tsirkin <mst@redhat.com>
Signed-off-by: Li Zhijian <lizhijian@cn.fujitsu.com>
Reviewed-by: Michael S. Tsirkin <mst@redhat.com>
Reviewed-by: Stefano Garzarella <sgarzare@redhat.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
---
 hw/i386/pc.c                                 |  8 +------
 include/standard-headers/asm-x86/bootparam.h | 34 ++++++++++++++++++++++++++++
 scripts/update-linux-headers.sh              |  6 +++++
 3 files changed, 41 insertions(+), 7 deletions(-)
 create mode 100644 include/standard-headers/asm-x86/bootparam.h

Comments

Peter Maydell Feb. 14, 2019, 4:40 p.m. UTC | #1
On Tue, 5 Feb 2019 at 19:14, Paolo Bonzini <pbonzini@redhat.com> wrote:
>
> From: Li Zhijian <lizhijian@cn.fujitsu.com>
>
> it's from v4.20-rc5.
>
> CC: Stefano Garzarella <sgarzare@redhat.com>
> CC: Michael S. Tsirkin <mst@redhat.com>
> Signed-off-by: Li Zhijian <lizhijian@cn.fujitsu.com>
> Reviewed-by: Michael S. Tsirkin <mst@redhat.com>
> Reviewed-by: Stefano Garzarella <sgarzare@redhat.com>
> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
> ---
>  hw/i386/pc.c                                 |  8 +------
>  include/standard-headers/asm-x86/bootparam.h | 34 ++++++++++++++++++++++++++++
>  scripts/update-linux-headers.sh              |  6 +++++
>  3 files changed, 41 insertions(+), 7 deletions(-)
>  create mode 100644 include/standard-headers/asm-x86/bootparam.h

Hi -- I just noticed this commit while I was looking through
git logs for a different reason. For future changes to
the standard-headers/, can we keep the "change the update
script" patches separate from the "and now update the headers
from upstream kernel commit X with the new script" parts,
please? Otherwise it's very hard to be sure that the header
changes are correct and that we still have an in-sync
set of header files that aren't a patchwork of files from
different versions. (For instance, this commit claims it is
"from v4.20-rc5", but the rest of the header files are already
at 4.21-rc1/5.0-rc1.)

thanks
-- PMM
Paolo Bonzini Feb. 14, 2019, 4:50 p.m. UTC | #2
On 14/02/19 17:40, Peter Maydell wrote:
>> ---
>>  hw/i386/pc.c                                 |  8 +------
>>  include/standard-headers/asm-x86/bootparam.h | 34 ++++++++++++++++++++++++++++
>>  scripts/update-linux-headers.sh              |  6 +++++
>>  3 files changed, 41 insertions(+), 7 deletions(-)
>>  create mode 100644 include/standard-headers/asm-x86/bootparam.h
> Hi -- I just noticed this commit while I was looking through
> git logs for a different reason. For future changes to
> the standard-headers/, can we keep the "change the update
> script" patches separate from the "and now update the headers
> from upstream kernel commit X with the new script" parts,
> please? Otherwise it's very hard to be sure that the header
> changes are correct and that we still have an in-sync
> set of header files that aren't a patchwork of files from
> different versions. (For instance, this commit claims it is
> "from v4.20-rc5", but the rest of the header files are already
> at 4.21-rc1/5.0-rc1.)

Yes, will do.  (FWIW, the file hasn't changed between v4.20-rc5 and
v5.0-rc1).

Paolo
diff mbox series

Patch

diff --git a/hw/i386/pc.c b/hw/i386/pc.c
index 00166d1..9664822 100644
--- a/hw/i386/pc.c
+++ b/hw/i386/pc.c
@@ -76,6 +76,7 @@ 
 #include "hw/usb.h"
 #include "hw/i386/intel_iommu.h"
 #include "hw/net/ne2000-isa.h"
+#include "standard-headers/asm-x86/bootparam.h"
 
 /* debug PC/ISA interrupts */
 //#define DEBUG_IRQ
@@ -1059,13 +1060,6 @@  static long get_file_size(FILE *f)
     return size;
 }
 
-/* setup_data types */
-#define SETUP_NONE     0
-#define SETUP_E820_EXT 1
-#define SETUP_DTB      2
-#define SETUP_PCI      3
-#define SETUP_EFI      4
-
 struct setup_data {
     uint64_t next;
     uint32_t type;
diff --git a/include/standard-headers/asm-x86/bootparam.h b/include/standard-headers/asm-x86/bootparam.h
new file mode 100644
index 0000000..67d4f01
--- /dev/null
+++ b/include/standard-headers/asm-x86/bootparam.h
@@ -0,0 +1,34 @@ 
+/* SPDX-License-Identifier: GPL-2.0 WITH Linux-syscall-note */
+#ifndef _ASM_X86_BOOTPARAM_H
+#define _ASM_X86_BOOTPARAM_H
+
+/* setup_data types */
+#define SETUP_NONE			0
+#define SETUP_E820_EXT			1
+#define SETUP_DTB			2
+#define SETUP_PCI			3
+#define SETUP_EFI			4
+#define SETUP_APPLE_PROPERTIES		5
+#define SETUP_JAILHOUSE			6
+
+/* ram_size flags */
+#define RAMDISK_IMAGE_START_MASK	0x07FF
+#define RAMDISK_PROMPT_FLAG		0x8000
+#define RAMDISK_LOAD_FLAG		0x4000
+
+/* loadflags */
+#define LOADED_HIGH	(1<<0)
+#define KASLR_FLAG	(1<<1)
+#define QUIET_FLAG	(1<<5)
+#define KEEP_SEGMENTS	(1<<6)
+#define CAN_USE_HEAP	(1<<7)
+
+/* xloadflags */
+#define XLF_KERNEL_64			(1<<0)
+#define XLF_CAN_BE_LOADED_ABOVE_4G	(1<<1)
+#define XLF_EFI_HANDOVER_32		(1<<2)
+#define XLF_EFI_HANDOVER_64		(1<<3)
+#define XLF_EFI_KEXEC			(1<<4)
+
+
+#endif /* _ASM_X86_BOOTPARAM_H */
diff --git a/scripts/update-linux-headers.sh b/scripts/update-linux-headers.sh
index 0a964fe..3578cfe 100755
--- a/scripts/update-linux-headers.sh
+++ b/scripts/update-linux-headers.sh
@@ -120,6 +120,12 @@  for arch in $ARCHLIST; do
         cp "$tmpdir/include/asm/unistd_x32.h" "$output/linux-headers/asm-x86/"
         cp "$tmpdir/include/asm/unistd_64.h" "$output/linux-headers/asm-x86/"
         cp_portable "$tmpdir/include/asm/kvm_para.h" "$output/include/standard-headers/asm-$arch"
+        # Remove everything except the macros from bootparam.h avoiding the
+        # unnecessary import of several video/ist/etc headers
+        sed -e '/__ASSEMBLY__/,/__ASSEMBLY__/d' \
+               "$tmpdir/include/asm/bootparam.h" > "$tmpdir/bootparam.h"
+        cp_portable "$tmpdir/bootparam.h" \
+                    "$output/include/standard-headers/asm-$arch"
     fi
 done