Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 62395efd authored by Ingo Molnar's avatar Ingo Molnar
Browse files

Merge branch 'x86/asm' into tracing/syscalls



We need the wider TIF work-mask checks in entry_32.S.

Signed-off-by: default avatarIngo Molnar <mingo@elte.hu>
parents ccd50dfd 88200bc2
Loading
Loading
Loading
Loading
+7 −1
Original line number Original line Diff line number Diff line
@@ -933,6 +933,12 @@ config X86_CPUID
	  with major 203 and minors 0 to 31 for /dev/cpu/0/cpuid to
	  with major 203 and minors 0 to 31 for /dev/cpu/0/cpuid to
	  /dev/cpu/31/cpuid.
	  /dev/cpu/31/cpuid.


config X86_CPU_DEBUG
	tristate "/sys/kernel/debug/x86/cpu/* - CPU Debug support"
	---help---
	  If you select this option, this will provide various x86 CPUs
	  information through debugfs.

choice
choice
	prompt "High Memory Support"
	prompt "High Memory Support"
	default HIGHMEM4G if !X86_NUMAQ
	default HIGHMEM4G if !X86_NUMAQ
@@ -1433,7 +1439,7 @@ config CRASH_DUMP
config KEXEC_JUMP
config KEXEC_JUMP
	bool "kexec jump (EXPERIMENTAL)"
	bool "kexec jump (EXPERIMENTAL)"
	depends on EXPERIMENTAL
	depends on EXPERIMENTAL
	depends on KEXEC && HIBERNATION && X86_32
	depends on KEXEC && HIBERNATION
	---help---
	---help---
	  Jump between original kernel and kexeced kernel and invoke
	  Jump between original kernel and kexeced kernel and invoke
	  code in physical address mode via KEXEC
	  code in physical address mode via KEXEC
+8 −15
Original line number Original line Diff line number Diff line
@@ -6,6 +6,7 @@
# for more details.
# for more details.
#
#
# Copyright (C) 1994 by Linus Torvalds
# Copyright (C) 1994 by Linus Torvalds
# Changed by many, many contributors over the years.
#
#


# ROOT_DEV specifies the default root-device when making the image.
# ROOT_DEV specifies the default root-device when making the image.
@@ -21,11 +22,7 @@ ROOT_DEV := CURRENT


SVGA_MODE	:= -DSVGA_MODE=NORMAL_VGA
SVGA_MODE	:= -DSVGA_MODE=NORMAL_VGA


# If you want the RAM disk device, define this to be the size in blocks.
targets		:= vmlinux.bin setup.bin setup.elf bzImage

#RAMDISK := -DRAMDISK=512

targets		:= vmlinux.bin setup.bin setup.elf zImage bzImage
subdir-		:= compressed
subdir-		:= compressed


setup-y		+= a20.o cmdline.o copy.o cpu.o cpucheck.o edd.o
setup-y		+= a20.o cmdline.o copy.o cpu.o cpucheck.o edd.o
@@ -71,17 +68,13 @@ KBUILD_CFLAGS := $(LINUXINCLUDE) -g -Os -D_SETUP -D__KERNEL__ \
KBUILD_CFLAGS +=   $(call cc-option,-m32)
KBUILD_CFLAGS +=   $(call cc-option,-m32)
KBUILD_AFLAGS	:= $(KBUILD_CFLAGS) -D__ASSEMBLY__
KBUILD_AFLAGS	:= $(KBUILD_CFLAGS) -D__ASSEMBLY__


$(obj)/zImage:  asflags-y := $(SVGA_MODE) $(RAMDISK)
$(obj)/bzImage: asflags-y  := $(SVGA_MODE)
$(obj)/bzImage: ccflags-y := -D__BIG_KERNEL__
$(obj)/bzImage: asflags-y := $(SVGA_MODE) $(RAMDISK) -D__BIG_KERNEL__
$(obj)/bzImage: BUILDFLAGS   := -b


quiet_cmd_image = BUILD   $@
quiet_cmd_image = BUILD   $@
cmd_image = $(obj)/tools/build $(BUILDFLAGS) $(obj)/setup.bin \
cmd_image = $(obj)/tools/build $(obj)/setup.bin $(obj)/vmlinux.bin \
	    $(obj)/vmlinux.bin $(ROOT_DEV) > $@
	$(ROOT_DEV) > $@


$(obj)/zImage $(obj)/bzImage: $(obj)/setup.bin \
$(obj)/bzImage: $(obj)/setup.bin $(obj)/vmlinux.bin $(obj)/tools/build FORCE
			      $(obj)/vmlinux.bin $(obj)/tools/build FORCE
	$(call if_changed,image)
	$(call if_changed,image)
	@echo 'Kernel: $@ is ready' ' (#'`cat .version`')'
	@echo 'Kernel: $@ is ready' ' (#'`cat .version`')'


+9 −20
Original line number Original line Diff line number Diff line
@@ -24,12 +24,8 @@
#include "boot.h"
#include "boot.h"
#include "offsets.h"
#include "offsets.h"


SETUPSECTS	= 4			/* default nr of setup-sectors */
BOOTSEG		= 0x07C0		/* original address of boot-sector */
BOOTSEG		= 0x07C0		/* original address of boot-sector */
SYSSEG		= DEF_SYSSEG		/* system loaded at 0x10000 (65536) */
SYSSEG		= 0x1000		/* historical load address >> 4 */
SYSSIZE		= DEF_SYSSIZE		/* system size: # of 16-byte clicks */
					/* to be loaded */
ROOT_DEV	= 0			/* ROOT_DEV is now written by "build" */


#ifndef SVGA_MODE
#ifndef SVGA_MODE
#define SVGA_MODE ASK_VGA
#define SVGA_MODE ASK_VGA
@@ -97,12 +93,12 @@ bugger_off_msg:
	.section ".header", "a"
	.section ".header", "a"
	.globl	hdr
	.globl	hdr
hdr:
hdr:
setup_sects:	.byte SETUPSECTS
setup_sects:	.byte 0			/* Filled in by build.c */
root_flags:	.word ROOT_RDONLY
root_flags:	.word ROOT_RDONLY
syssize:	.long SYSSIZE
syssize:	.long 0			/* Filled in by build.c */
ram_size:	.word RAMDISK
ram_size:	.word 0			/* Obsolete */
vid_mode:	.word SVGA_MODE
vid_mode:	.word SVGA_MODE
root_dev:	.word ROOT_DEV
root_dev:	.word 0			/* Filled in by build.c */
boot_flag:	.word 0xAA55
boot_flag:	.word 0xAA55


	# offset 512, entry point
	# offset 512, entry point
@@ -123,14 +119,15 @@ _start:
					# or else old loadlin-1.5 will fail)
					# or else old loadlin-1.5 will fail)
		.globl realmode_swtch
		.globl realmode_swtch
realmode_swtch:	.word	0, 0		# default_switch, SETUPSEG
realmode_swtch:	.word	0, 0		# default_switch, SETUPSEG
start_sys_seg:	.word	SYSSEG
start_sys_seg:	.word	SYSSEG		# obsolete and meaningless, but just
					# in case something decided to "use" it
		.word	kernel_version-512 # pointing to kernel version string
		.word	kernel_version-512 # pointing to kernel version string
					# above section of header is compatible
					# above section of header is compatible
					# with loadlin-1.5 (header v1.5). Don't
					# with loadlin-1.5 (header v1.5). Don't
					# change it.
					# change it.


type_of_loader:	.byte	0		# = 0, old one (LILO, Loadlin,
type_of_loader:	.byte	0		# 0 means ancient bootloader, newer
					#      Bootlin, SYSLX, bootsect...)
					# bootloaders know to change this.
					# See Documentation/i386/boot.txt for
					# See Documentation/i386/boot.txt for
					# assigned ids
					# assigned ids


@@ -142,11 +139,7 @@ CAN_USE_HEAP = 0x80 # If set, the loader also has set
					# space behind setup.S can be used for
					# space behind setup.S can be used for
					# heap purposes.
					# heap purposes.
					# Only the loader knows what is free
					# Only the loader knows what is free
#ifndef __BIG_KERNEL__
		.byte	0
#else
		.byte	LOADED_HIGH
		.byte	LOADED_HIGH
#endif


setup_move_size: .word  0x8000		# size to move, when setup is not
setup_move_size: .word  0x8000		# size to move, when setup is not
					# loaded at 0x90000. We will move setup
					# loaded at 0x90000. We will move setup
@@ -157,11 +150,7 @@ setup_move_size: .word 0x8000 # size to move, when setup is not


code32_start:				# here loaders can put a different
code32_start:				# here loaders can put a different
					# start address for 32-bit code.
					# start address for 32-bit code.
#ifndef __BIG_KERNEL__
		.long	0x1000		#   0x1000 = default for zImage
#else
		.long	0x100000	# 0x100000 = default for big kernel
		.long	0x100000	# 0x100000 = default for big kernel
#endif


ramdisk_image:	.long	0		# address of loaded ramdisk image
ramdisk_image:	.long	0		# address of loaded ramdisk image
					# Here the loader puts the 32-bit
					# Here the loader puts the 32-bit
+0 −44
Original line number Original line Diff line number Diff line
@@ -32,47 +32,6 @@ static void realmode_switch_hook(void)
	}
	}
}
}


/*
 * A zImage kernel is loaded at 0x10000 but wants to run at 0x1000.
 * A bzImage kernel is loaded and runs at 0x100000.
 */
static void move_kernel_around(void)
{
	/* Note: rely on the compile-time option here rather than
	   the LOADED_HIGH flag.  The Qemu kernel loader unconditionally
	   sets the loadflags to zero. */
#ifndef __BIG_KERNEL__
	u16 dst_seg, src_seg;
	u32 syssize;

	dst_seg =  0x1000 >> 4;
	src_seg = 0x10000 >> 4;
	syssize = boot_params.hdr.syssize; /* Size in 16-byte paragraphs */

	while (syssize) {
		int paras  = (syssize >= 0x1000) ? 0x1000 : syssize;
		int dwords = paras << 2;

		asm volatile("pushw %%es ; "
			     "pushw %%ds ; "
			     "movw %1,%%es ; "
			     "movw %2,%%ds ; "
			     "xorw %%di,%%di ; "
			     "xorw %%si,%%si ; "
			     "rep;movsl ; "
			     "popw %%ds ; "
			     "popw %%es"
			     : "+c" (dwords)
			     : "r" (dst_seg), "r" (src_seg)
			     : "esi", "edi");

		syssize -= paras;
		dst_seg += paras;
		src_seg += paras;
	}
#endif
}

/*
/*
 * Disable all interrupts at the legacy PIC.
 * Disable all interrupts at the legacy PIC.
 */
 */
@@ -147,9 +106,6 @@ void go_to_protected_mode(void)
	/* Hook before leaving real mode, also disables interrupts */
	/* Hook before leaving real mode, also disables interrupts */
	realmode_switch_hook();
	realmode_switch_hook();


	/* Move the kernel/setup to their final resting places */
	move_kernel_around();

	/* Enable the A20 gate */
	/* Enable the A20 gate */
	if (enable_a20()) {
	if (enable_a20()) {
		puts("A20 gate not responding, unable to boot...\n");
		puts("A20 gate not responding, unable to boot...\n");
+1 −8
Original line number Original line Diff line number Diff line
@@ -130,7 +130,7 @@ static void die(const char * str, ...)


static void usage(void)
static void usage(void)
{
{
	die("Usage: build [-b] setup system [rootdev] [> image]");
	die("Usage: build setup system [rootdev] [> image]");
}
}


int main(int argc, char ** argv)
int main(int argc, char ** argv)
@@ -145,11 +145,6 @@ int main(int argc, char ** argv)
	void *kernel;
	void *kernel;
	u32 crc = 0xffffffffUL;
	u32 crc = 0xffffffffUL;


	if (argc > 2 && !strcmp(argv[1], "-b"))
	  {
	    is_big_kernel = 1;
	    argc--, argv++;
	  }
	if ((argc < 3) || (argc > 4))
	if ((argc < 3) || (argc > 4))
		usage();
		usage();
	if (argc > 3) {
	if (argc > 3) {
@@ -216,8 +211,6 @@ int main(int argc, char ** argv)
		die("Unable to mmap '%s': %m", argv[2]);
		die("Unable to mmap '%s': %m", argv[2]);
	/* Number of 16-byte paragraphs, including space for a 4-byte CRC */
	/* Number of 16-byte paragraphs, including space for a 4-byte CRC */
	sys_size = (sz + 15 + 4) / 16;
	sys_size = (sz + 15 + 4) / 16;
	if (!is_big_kernel && sys_size > DEF_SYSSIZE)
		die("System is too big. Try using bzImage or modules.");


	/* Patch the setup code with the appropriate size parameters */
	/* Patch the setup code with the appropriate size parameters */
	buf[0x1f1] = setup_sectors-1;
	buf[0x1f1] = setup_sectors-1;
Loading