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

Commit d35339a4 authored by Martin Schwidefsky's avatar Martin Schwidefsky
Browse files

s390: add support for transactional memory



Allow user-space processes to use transactional execution (TX).
If the TX facility is available user space programs can use
transactions for fine-grained serialization based on the data
objects that are referenced during a transaction. This is
useful for lockless data structures and speculative compiler
optimizations.

Signed-off-by: default avatarMartin Schwidefsky <schwidefsky@de.ibm.com>
parent e4b8b3f3
Loading
Loading
Loading
Loading
+1 −0
Original line number Original line Diff line number Diff line
@@ -101,6 +101,7 @@
#define HWCAP_S390_HPAGE	128
#define HWCAP_S390_HPAGE	128
#define HWCAP_S390_ETF3EH	256
#define HWCAP_S390_ETF3EH	256
#define HWCAP_S390_HIGH_GPRS	512
#define HWCAP_S390_HIGH_GPRS	512
#define HWCAP_S390_TE		1024


/*
/*
 * These are used to set parameters in the core dumps.
 * These are used to set parameters in the core dumps.
+5 −1
Original line number Original line Diff line number Diff line
@@ -329,9 +329,13 @@ struct _lowcore {
	__u8	pad_0x1338[0x1340-0x1338];	/* 0x1338 */
	__u8	pad_0x1338[0x1340-0x1338];	/* 0x1338 */
	__u32	access_regs_save_area[16];	/* 0x1340 */
	__u32	access_regs_save_area[16];	/* 0x1340 */
	__u64	cregs_save_area[16];		/* 0x1380 */
	__u64	cregs_save_area[16];		/* 0x1380 */
	__u8	pad_0x1400[0x1800-0x1400];	/* 0x1400 */

	/* Transaction abort diagnostic block */
	__u8	pgm_tdb[256];			/* 0x1800 */


	/* align to the top of the prefix area */
	/* align to the top of the prefix area */
	__u8	pad_0x1400[0x2000-0x1400];	/* 0x1400 */
	__u8	pad_0x1900[0x2000-0x1900];	/* 0x1900 */
} __packed;
} __packed;


#endif /* CONFIG_32BIT */
#endif /* CONFIG_32BIT */
+6 −0
Original line number Original line Diff line number Diff line
@@ -76,14 +76,20 @@ struct thread_struct {
	unsigned long gmap_addr;	/* address of last gmap fault. */
	unsigned long gmap_addr;	/* address of last gmap fault. */
	struct per_regs per_user;	/* User specified PER registers */
	struct per_regs per_user;	/* User specified PER registers */
	struct per_event per_event;	/* Cause of the last PER trap */
	struct per_event per_event;	/* Cause of the last PER trap */
	unsigned long per_flags;	/* Flags to control debug behavior */
        /* pfault_wait is used to block the process on a pfault event */
        /* pfault_wait is used to block the process on a pfault event */
	unsigned long pfault_wait;
	unsigned long pfault_wait;
	struct list_head list;
	struct list_head list;
	/* cpu runtime instrumentation */
	/* cpu runtime instrumentation */
	struct runtime_instr_cb *ri_cb;
	struct runtime_instr_cb *ri_cb;
	int ri_signum;
	int ri_signum;
#ifdef CONFIG_64BIT
	unsigned char trap_tdb[256];	/* Transaction abort diagnose block */
#endif
};
};


#define PER_FLAG_NO_TE		1UL	/* Flag to disable transactions. */

typedef struct thread_struct thread_struct;
typedef struct thread_struct thread_struct;


/*
/*
+6 −2
Original line number Original line Diff line number Diff line
@@ -361,17 +361,19 @@ struct per_struct_kernel {
	unsigned char access_id;	/* PER trap access identification */
	unsigned char access_id;	/* PER trap access identification */
};
};


#define PER_EVENT_MASK			0xE9000000UL
#define PER_EVENT_MASK			0xEB000000UL


#define PER_EVENT_BRANCH		0x80000000UL
#define PER_EVENT_BRANCH		0x80000000UL
#define PER_EVENT_IFETCH		0x40000000UL
#define PER_EVENT_IFETCH		0x40000000UL
#define PER_EVENT_STORE			0x20000000UL
#define PER_EVENT_STORE			0x20000000UL
#define PER_EVENT_STORE_REAL		0x08000000UL
#define PER_EVENT_STORE_REAL		0x08000000UL
#define PER_EVENT_TRANSACTION_END	0x02000000UL
#define PER_EVENT_NULLIFICATION		0x01000000UL
#define PER_EVENT_NULLIFICATION		0x01000000UL


#define PER_CONTROL_MASK		0x00a00000UL
#define PER_CONTROL_MASK		0x00e00000UL


#define PER_CONTROL_BRANCH_ADDRESS	0x00800000UL
#define PER_CONTROL_BRANCH_ADDRESS	0x00800000UL
#define PER_CONTROL_SUSPENSION		0x00400000UL
#define PER_CONTROL_ALTERATION		0x00200000UL
#define PER_CONTROL_ALTERATION		0x00200000UL


#endif
#endif
@@ -485,6 +487,8 @@ typedef struct
#define PTRACE_GET_LAST_BREAK	      0x5006
#define PTRACE_GET_LAST_BREAK	      0x5006
#define PTRACE_PEEK_SYSTEM_CALL       0x5007
#define PTRACE_PEEK_SYSTEM_CALL       0x5007
#define PTRACE_POKE_SYSTEM_CALL	      0x5008
#define PTRACE_POKE_SYSTEM_CALL	      0x5008
#define PTRACE_ENABLE_TE	      0x5009
#define PTRACE_DISABLE_TE	      0x5010


/*
/*
 * PT_PROT definition is loosely based on hppa bsd definition in
 * PT_PROT definition is loosely based on hppa bsd definition in
+3 −0
Original line number Original line Diff line number Diff line
@@ -80,6 +80,7 @@ extern unsigned int addressing_mode;
#define MACHINE_FLAG_LPAR	(1UL << 12)
#define MACHINE_FLAG_LPAR	(1UL << 12)
#define MACHINE_FLAG_SPP	(1UL << 13)
#define MACHINE_FLAG_SPP	(1UL << 13)
#define MACHINE_FLAG_TOPOLOGY	(1UL << 14)
#define MACHINE_FLAG_TOPOLOGY	(1UL << 14)
#define MACHINE_FLAG_TE		(1UL << 15)


#define MACHINE_IS_VM		(S390_lowcore.machine_flags & MACHINE_FLAG_VM)
#define MACHINE_IS_VM		(S390_lowcore.machine_flags & MACHINE_FLAG_VM)
#define MACHINE_IS_KVM		(S390_lowcore.machine_flags & MACHINE_FLAG_KVM)
#define MACHINE_IS_KVM		(S390_lowcore.machine_flags & MACHINE_FLAG_KVM)
@@ -98,6 +99,7 @@ extern unsigned int addressing_mode;
#define MACHINE_HAS_PFMF	(0)
#define MACHINE_HAS_PFMF	(0)
#define MACHINE_HAS_SPP		(0)
#define MACHINE_HAS_SPP		(0)
#define MACHINE_HAS_TOPOLOGY	(0)
#define MACHINE_HAS_TOPOLOGY	(0)
#define MACHINE_HAS_TE		      (0)
#else /* CONFIG_64BIT */
#else /* CONFIG_64BIT */
#define MACHINE_HAS_IEEE	(1)
#define MACHINE_HAS_IEEE	(1)
#define MACHINE_HAS_CSP		(1)
#define MACHINE_HAS_CSP		(1)
@@ -109,6 +111,7 @@ extern unsigned int addressing_mode;
#define MACHINE_HAS_PFMF	(S390_lowcore.machine_flags & MACHINE_FLAG_PFMF)
#define MACHINE_HAS_PFMF	(S390_lowcore.machine_flags & MACHINE_FLAG_PFMF)
#define MACHINE_HAS_SPP		(S390_lowcore.machine_flags & MACHINE_FLAG_SPP)
#define MACHINE_HAS_SPP		(S390_lowcore.machine_flags & MACHINE_FLAG_SPP)
#define MACHINE_HAS_TOPOLOGY	(S390_lowcore.machine_flags & MACHINE_FLAG_TOPOLOGY)
#define MACHINE_HAS_TOPOLOGY	(S390_lowcore.machine_flags & MACHINE_FLAG_TOPOLOGY)
#define MACHINE_HAS_TE		(S390_lowcore.machine_flags & MACHINE_FLAG_TE)
#endif /* CONFIG_64BIT */
#endif /* CONFIG_64BIT */


#define ZFCPDUMP_HSA_SIZE	(32UL<<20)
#define ZFCPDUMP_HSA_SIZE	(32UL<<20)
Loading