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

Commit 25097bf1 authored by Christian Ehrhardt's avatar Christian Ehrhardt Committed by Martin Schwidefsky
Browse files

[S390] s390: move machine flags to lowcore



Currently the storage of the machine flags is a globally exported unsigned
long long variable. By moving the storage location into the lowcore struct we
allow assembler code to check machine_flags directly even without needing a
register. Addtionally the lowcore and therefore the machine flags too will be
in cache most of the time.

Signed-off-by: default avatarChristian Ehrhardt <ehrhardt@linux.vnet.ibm.com>
Signed-off-by: default avatarMartin Schwidefsky <schwidefsky@de.ibm.com>
parent b21597d0
Loading
Loading
Loading
Loading
+25 −0
Original line number Diff line number Diff line
/*
 *    Copyright IBM Corp. 2000,2009
 *    Author(s): Hartmut Penner <hp@de.ibm.com>,
 *		 Martin Schwidefsky <schwidefsky@de.ibm.com>
 *		 Christian Ehrhardt <ehrhardt@de.ibm.com>
 */

#ifndef _ASM_S390_CPUID_H_
#define _ASM_S390_CPUID_H_

/*
 *  CPU type and hardware bug flags. Kept separately for each CPU.
 *  Members of this structure are referenced in head.S, so think twice
 *  before touching them. [mj]
 */

typedef struct
{
	unsigned int version :	8;
	unsigned int ident   : 24;
	unsigned int machine : 16;
	unsigned int unused  : 16;
} __attribute__ ((packed)) cpuid_t;

#endif /* _ASM_S390_CPUID_H_ */
+1 −0
Original line number Diff line number Diff line
@@ -15,6 +15,7 @@
#define ASM_KVM_HOST_H
#include <linux/kvm_host.h>
#include <asm/debug.h>
#include <asm/cpuid.h>

#define KVM_MAX_VCPUS 64
#define KVM_MEMORY_SLOTS 32
+8 −4
Original line number Diff line number Diff line
@@ -66,6 +66,7 @@
#define __LC_USER_EXEC_ASCE		0x02ac
#define __LC_CPUID			0x02b0
#define __LC_INT_CLOCK			0x02c8
#define __LC_MACHINE_FLAGS		0x02d8
#define __LC_IRB			0x0300
#define __LC_PFAULT_INTPARM		0x0080
#define __LC_CPU_TIMER_SAVE_AREA	0x00d8
@@ -110,6 +111,7 @@
#define __LC_CPUID			0x0320
#define __LC_INT_CLOCK			0x0340
#define __LC_VDSO_PER_CPU		0x0350
#define __LC_MACHINE_FLAGS		0x0358
#define __LC_IRB			0x0380
#define __LC_PASTE			0x03c0
#define __LC_PFAULT_INTPARM		0x11b8
@@ -127,9 +129,9 @@

#ifndef __ASSEMBLY__

#include <asm/processor.h>
#include <asm/cpuid.h>
#include <asm/ptrace.h>
#include <linux/types.h>
#include <asm/sigp.h>

void restart_int_handler(void);
void ext_int_handler(void);
@@ -277,7 +279,8 @@ struct _lowcore
	__u32	ext_call_fast;			/* 0x02c4 */
	__u64	int_clock;			/* 0x02c8 */
	__u64	clock_comparator;		/* 0x02d0 */
	__u8	pad_0x02d8[0x0300-0x02d8];	/* 0x02d8 */
	__u32	machine_flags;			/* 0x02d8 */
	__u8	pad_0x02dc[0x0300-0x02dc];	/* 0x02dc */

	/* Interrupt response block */
	__u8	irb[64];			/* 0x0300 */
@@ -381,7 +384,8 @@ struct _lowcore
	__u64	int_clock;			/* 0x0340 */
	__u64	clock_comparator;		/* 0x0348 */
	__u64	vdso_per_cpu_data;		/* 0x0350 */
	__u8	pad_0x0358[0x0380-0x0358];	/* 0x0358 */
	__u64	machine_flags;			/* 0x0358 */
	__u8	pad_0x0360[0x0380-0x0360];	/* 0x0360 */

	/* Interrupt response block. */
	__u8	irb[64];			/* 0x0380 */
+3 −14
Original line number Diff line number Diff line
@@ -14,7 +14,10 @@
#define __ASM_S390_PROCESSOR_H

#include <linux/linkage.h>
#include <asm/cpuid.h>
#include <asm/page.h>
#include <asm/ptrace.h>
#include <asm/setup.h>

#ifdef __KERNEL__
/*
@@ -23,20 +26,6 @@
 */
#define current_text_addr() ({ void *pc; asm("basr %0,0" : "=a" (pc)); pc; })

/*
 *  CPU type and hardware bug flags. Kept separately for each CPU.
 *  Members of this structure are referenced in head.S, so think twice
 *  before touching them. [mj]
 */

typedef struct
{
        unsigned int version :  8;
        unsigned int ident   : 24;
        unsigned int machine : 16;
        unsigned int unused  : 16;
} __attribute__ ((packed)) cpuid_t;

static inline void get_cpu_id(cpuid_t *ptr)
{
	asm volatile("stidp 0(%1)" : "=m" (*ptr) : "a" (ptr));
+0 −2
Original line number Diff line number Diff line
@@ -313,8 +313,6 @@ typedef struct


#ifdef __KERNEL__
#include <asm/setup.h>
#include <asm/page.h>

/*
 * The pt_regs struct defines the way the registers are stored on
Loading