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

Commit e4ff5b8f authored by Isaku Yamahata's avatar Isaku Yamahata Committed by Tony Luck
Browse files

ia64/pv_ops: gate page paravirtualization.



paravirtualize gate page by allowing each pv_ops instances
to define its own gate page.

Signed-off-by: default avatarIsaku Yamahata <yamahata@valinux.co.jp>
Signed-off-by: default avatarTony Luck <tony.luck@intel.com>
parent 1aec1c55
Loading
Loading
Loading
Loading
+38 −0
Original line number Diff line number Diff line
/******************************************************************************
 * arch/ia64/include/asm/native/inst.h
 *
 * Copyright (c) 2008 Isaku Yamahata <yamahata at valinux co jp>
 *                    VA Linux Systems Japan K.K.
 *
 * This program is free software; you can redistribute it and/or modify
 * it under the terms of the GNU General Public License as published by
 * the Free Software Foundation; either version 2 of the License, or
 * (at your option) any later version.
 *
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 *
 * You should have received a copy of the GNU General Public License
 * along with this program; if not, write to the Free Software
 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
 *
 */

#define __paravirt_start_gate_fsyscall_patchlist		\
	__ia64_native_start_gate_fsyscall_patchlist
#define __paravirt_end_gate_fsyscall_patchlist			\
	__ia64_native_end_gate_fsyscall_patchlist
#define __paravirt_start_gate_brl_fsys_bubble_down_patchlist	\
	__ia64_native_start_gate_brl_fsys_bubble_down_patchlist
#define __paravirt_end_gate_brl_fsys_bubble_down_patchlist	\
	__ia64_native_end_gate_brl_fsys_bubble_down_patchlist
#define __paravirt_start_gate_vtop_patchlist			\
	__ia64_native_start_gate_vtop_patchlist
#define __paravirt_end_gate_vtop_patchlist			\
	__ia64_native_end_gate_vtop_patchlist
#define __paravirt_start_gate_mckinley_e9_patchlist		\
	__ia64_native_start_gate_mckinley_e9_patchlist
#define __paravirt_end_gate_mckinley_e9_patchlist		\
	__ia64_native_end_gate_mckinley_e9_patchlist
+35 −0
Original line number Diff line number Diff line
@@ -35,6 +35,41 @@ extern struct pv_fsys_data pv_fsys_data;

unsigned long *paravirt_get_fsyscall_table(void);
char *paravirt_get_fsys_bubble_down(void);

/******************************************************************************
 * patchlist addresses for gate page
 */
enum pv_gate_patchlist {
	PV_GATE_START_FSYSCALL,
	PV_GATE_END_FSYSCALL,

	PV_GATE_START_BRL_FSYS_BUBBLE_DOWN,
	PV_GATE_END_BRL_FSYS_BUBBLE_DOWN,

	PV_GATE_START_VTOP,
	PV_GATE_END_VTOP,

	PV_GATE_START_MCKINLEY_E9,
	PV_GATE_END_MCKINLEY_E9,
};

struct pv_patchdata {
	unsigned long start_fsyscall_patchlist;
	unsigned long end_fsyscall_patchlist;
	unsigned long start_brl_fsys_bubble_down_patchlist;
	unsigned long end_brl_fsys_bubble_down_patchlist;
	unsigned long start_vtop_patchlist;
	unsigned long end_vtop_patchlist;
	unsigned long start_mckinley_e9_patchlist;
	unsigned long end_mckinley_e9_patchlist;

	void *gate_section;
};

extern struct pv_patchdata pv_patchdata;

unsigned long paravirt_get_gate_patchlist(enum pv_gate_patchlist type);
void *paravirt_get_gate_section(void);
#endif

#ifdef CONFIG_PARAVIRT_GUEST
+5 −27
Original line number Diff line number Diff line
@@ -5,7 +5,7 @@
extra-y	:= head.o init_task.o vmlinux.lds

obj-y := acpi.o entry.o efi.o efi_stub.o gate-data.o fsys.o ia64_ksyms.o irq.o irq_ia64.o	\
	 irq_lsapic.o ivt.o machvec.o pal.o patch.o process.o perfmon.o ptrace.o sal.o		\
	 irq_lsapic.o ivt.o machvec.o pal.o paravirt_patchlist.o patch.o process.o perfmon.o ptrace.o sal.o		\
	 salinfo.o setup.o signal.o sys_ia64.o time.o traps.o unaligned.o \
	 unwind.o mca.o mca_asm.o topology.o

@@ -47,35 +47,13 @@ ifeq ($(CONFIG_DMAR), y)
obj-$(CONFIG_SWIOTLB)		+= pci-swiotlb.o
endif

# The gate DSO image is built using a special linker script.
targets += gate.so gate-syms.o

extra-y += gate.so gate-syms.o gate.lds gate.o

# fp_emulate() expects f2-f5,f16-f31 to contain the user-level state.
CFLAGS_traps.o  += -mfixed-range=f2-f5,f16-f31

CPPFLAGS_gate.lds := -P -C -U$(ARCH)

quiet_cmd_gate = GATE $@
      cmd_gate = $(CC) -nostdlib $(GATECFLAGS_$(@F)) -Wl,-T,$(filter-out FORCE,$^) -o $@

GATECFLAGS_gate.so = -shared -s -Wl,-soname=linux-gate.so.1 \
		     $(call ld-option, -Wl$(comma)--hash-style=sysv)
$(obj)/gate.so: $(obj)/gate.lds $(obj)/gate.o FORCE
	$(call if_changed,gate)

$(obj)/built-in.o: $(obj)/gate-syms.o
$(obj)/built-in.o: ld_flags += -R $(obj)/gate-syms.o

GATECFLAGS_gate-syms.o = -r
$(obj)/gate-syms.o: $(obj)/gate.lds $(obj)/gate.o FORCE
	$(call if_changed,gate)

# gate-data.o contains the gate DSO image as data in section .data.gate.
# We must build gate.so before we can assemble it.
# Note: kbuild does not track this dependency due to usage of .incbin
$(obj)/gate-data.o: $(obj)/gate.so
# The gate DSO image is built using a special linker script.
include $(srctree)/arch/ia64/kernel/Makefile.gate
# tell compiled for native
CPPFLAGS_gate.lds += -D__IA64_GATE_PARAVIRTUALIZED_NATIVE

# Calculate NR_IRQ = max(IA64_NATIVE_NR_IRQS, XEN_NR_IRQS, ...) based on config
define sed-y
+27 −0
Original line number Diff line number Diff line
# The gate DSO image is built using a special linker script.

targets += gate.so gate-syms.o

extra-y += gate.so gate-syms.o gate.lds gate.o

CPPFLAGS_gate.lds := -P -C -U$(ARCH)

quiet_cmd_gate = GATE $@
      cmd_gate = $(CC) -nostdlib $(GATECFLAGS_$(@F)) -Wl,-T,$(filter-out FORCE,$^) -o $@

GATECFLAGS_gate.so = -shared -s -Wl,-soname=linux-gate.so.1 \
		     $(call ld-option, -Wl$(comma)--hash-style=sysv)
$(obj)/gate.so: $(obj)/gate.lds $(obj)/gate.o FORCE
	$(call if_changed,gate)

$(obj)/built-in.o: $(obj)/gate-syms.o
$(obj)/built-in.o: ld_flags += -R $(obj)/gate-syms.o

GATECFLAGS_gate-syms.o = -r
$(obj)/gate-syms.o: $(obj)/gate.lds $(obj)/gate.o FORCE
	$(call if_changed,gate)

# gate-data.o contains the gate DSO image as data in section .data.gate.
# We must build gate.so before we can assemble it.
# Note: kbuild does not track this dependency due to usage of .incbin
$(obj)/gate-data.o: $(obj)/gate.so
+9 −8
Original line number Diff line number Diff line
@@ -7,6 +7,7 @@


#include <asm/system.h>
#include "paravirt_patchlist.h"

SECTIONS
{
@@ -33,21 +34,21 @@ SECTIONS
	. = GATE_ADDR + 0x600;

	.data.patch		: {
		__start_gate_mckinley_e9_patchlist = .;
		__paravirt_start_gate_mckinley_e9_patchlist = .;
		*(.data.patch.mckinley_e9)
		__end_gate_mckinley_e9_patchlist = .;
		__paravirt_end_gate_mckinley_e9_patchlist = .;

		__start_gate_vtop_patchlist = .;
		__paravirt_start_gate_vtop_patchlist = .;
		*(.data.patch.vtop)
		__end_gate_vtop_patchlist = .;
		__paravirt_end_gate_vtop_patchlist = .;

		__start_gate_fsyscall_patchlist = .;
		__paravirt_start_gate_fsyscall_patchlist = .;
		*(.data.patch.fsyscall_table)
		__end_gate_fsyscall_patchlist = .;
		__paravirt_end_gate_fsyscall_patchlist = .;

		__start_gate_brl_fsys_bubble_down_patchlist = .;
		__paravirt_start_gate_brl_fsys_bubble_down_patchlist = .;
		*(.data.patch.brl_fsys_bubble_down)
		__end_gate_brl_fsys_bubble_down_patchlist = .;
		__paravirt_end_gate_brl_fsys_bubble_down_patchlist = .;
	}						:readable

	.IA_64.unwind_info	: { *(.IA_64.unwind_info*) }
Loading