Commit 7ff71e6d authored by Linus Torvalds's avatar Linus Torvalds
Browse files
Pull alpha fixes from Matt Turner:
 "A few changes for alpha, including some important fixes for kernel
  stack alignment"

* tag 'alpha-fixes-v6.14-rc2' of git://git.kernel.org/pub/scm/linux/kernel/git/mattst88/alpha:
  alpha: Use str_yes_no() helper in pci_dac_dma_supported()
  alpha: Replace one-element array with flexible array member
  alpha: align stack for page fault and user unaligned trap handlers
  alpha: make stack 16-byte aligned (most cases)
  alpha: replace hardcoded stack offsets with autogenerated ones
parents 78a632a2 1523226e
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -135,7 +135,7 @@ struct crb_struct {
	/* virtual->physical map */
	unsigned long map_entries;
	unsigned long map_pages;
	struct vf_map_struct map[1];
	struct vf_map_struct map[];
};

struct memclust_struct {
+2 −0
Original line number Diff line number Diff line
@@ -42,6 +42,8 @@ struct pt_regs {
	unsigned long trap_a0;
	unsigned long trap_a1;
	unsigned long trap_a2;
/* This makes the stack 16-byte aligned as GCC expects */
	unsigned long __pad0;
/* These are saved by PAL-code: */
	unsigned long ps;
	unsigned long pc;
+4 −0
Original line number Diff line number Diff line
@@ -19,9 +19,13 @@ static void __used foo(void)
	DEFINE(TI_STATUS, offsetof(struct thread_info, status));
	BLANK();

	DEFINE(SP_OFF, offsetof(struct pt_regs, ps));
	DEFINE(SIZEOF_PT_REGS, sizeof(struct pt_regs));
	BLANK();

	DEFINE(SWITCH_STACK_SIZE, sizeof(struct switch_stack));
	BLANK();

	DEFINE(HAE_CACHE, offsetof(struct alpha_machine_vector, hae_cache));
	DEFINE(HAE_REG, offsetof(struct alpha_machine_vector, hae_register));
}
+10 −14
Original line number Diff line number Diff line
@@ -15,10 +15,6 @@
	.set noat
	.cfi_sections	.debug_frame

/* Stack offsets.  */
#define SP_OFF			184
#define SWITCH_STACK_SIZE	64

.macro	CFI_START_OSF_FRAME	func
	.align	4
	.globl	\func
@@ -198,8 +194,8 @@ CFI_END_OSF_FRAME entArith
CFI_START_OSF_FRAME entMM
	SAVE_ALL
/* save $9 - $15 so the inline exception code can manipulate them.  */
	subq	$sp, 56, $sp
	.cfi_adjust_cfa_offset	56
	subq	$sp, 64, $sp
	.cfi_adjust_cfa_offset	64
	stq	$9, 0($sp)
	stq	$10, 8($sp)
	stq	$11, 16($sp)
@@ -214,7 +210,7 @@ CFI_START_OSF_FRAME entMM
	.cfi_rel_offset	$13, 32
	.cfi_rel_offset	$14, 40
	.cfi_rel_offset	$15, 48
	addq	$sp, 56, $19
	addq	$sp, 64, $19
/* handle the fault */
	lda	$8, 0x3fff
	bic	$sp, $8, $8
@@ -227,7 +223,7 @@ CFI_START_OSF_FRAME entMM
	ldq	$13, 32($sp)
	ldq	$14, 40($sp)
	ldq	$15, 48($sp)
	addq	$sp, 56, $sp
	addq	$sp, 64, $sp
	.cfi_restore	$9
	.cfi_restore	$10
	.cfi_restore	$11
@@ -235,7 +231,7 @@ CFI_START_OSF_FRAME entMM
	.cfi_restore	$13
	.cfi_restore	$14
	.cfi_restore	$15
	.cfi_adjust_cfa_offset	-56
	.cfi_adjust_cfa_offset	-64
/* finish up the syscall as normal.  */
	br	ret_from_sys_call
CFI_END_OSF_FRAME entMM
@@ -382,8 +378,8 @@ entUnaUser:
	.cfi_restore	$0
	.cfi_adjust_cfa_offset	-256
	SAVE_ALL		/* setup normal kernel stack */
	lda	$sp, -56($sp)
	.cfi_adjust_cfa_offset	56
	lda	$sp, -64($sp)
	.cfi_adjust_cfa_offset	64
	stq	$9, 0($sp)
	stq	$10, 8($sp)
	stq	$11, 16($sp)
@@ -399,7 +395,7 @@ entUnaUser:
	.cfi_rel_offset	$14, 40
	.cfi_rel_offset	$15, 48
	lda	$8, 0x3fff
	addq	$sp, 56, $19
	addq	$sp, 64, $19
	bic	$sp, $8, $8
	jsr	$26, do_entUnaUser
	ldq	$9, 0($sp)
@@ -409,7 +405,7 @@ entUnaUser:
	ldq	$13, 32($sp)
	ldq	$14, 40($sp)
	ldq	$15, 48($sp)
	lda	$sp, 56($sp)
	lda	$sp, 64($sp)
	.cfi_restore	$9
	.cfi_restore	$10
	.cfi_restore	$11
@@ -417,7 +413,7 @@ entUnaUser:
	.cfi_restore	$13
	.cfi_restore	$14
	.cfi_restore	$15
	.cfi_adjust_cfa_offset	-56
	.cfi_adjust_cfa_offset	-64
	br	ret_from_sys_call
CFI_END_OSF_FRAME entUna

+2 −1
Original line number Diff line number Diff line
@@ -13,6 +13,7 @@
#include <linux/log2.h>
#include <linux/dma-map-ops.h>
#include <linux/iommu-helper.h>
#include <linux/string_choices.h>

#include <asm/io.h>
#include <asm/hwrpb.h>
@@ -212,7 +213,7 @@ static int pci_dac_dma_supported(struct pci_dev *dev, u64 mask)

	/* If both conditions above are met, we are fine. */
	DBGA("pci_dac_dma_supported %s from %ps\n",
	     ok ? "yes" : "no", __builtin_return_address(0));
	     str_yes_no(ok), __builtin_return_address(0));

	return ok;
}
Loading