M68knommu fixes include:
. fix interrupt range check for ColdFire SIMR interrupt controller . add support for gapless sections flat format binary (needed by RISC-V) -----BEGIN PGP SIGNATURE----- iQIzBAABCgAdFiEEmsfM6tQwfNjBOxr3TiQVqaG9L4AFAmCQjRUACgkQTiQVqaG9 L4ADMg//d2y2BjROaMQdV4ykd06/GrulZNRWvVSdDDmR8O5NU3z5zhmyeVuB0mHA OYn/wbWzuqmD7JVpJijytTUFsvtpsMkqRdL56xApFYfJ5RK9VEs34aonBko9C0Fp d7e7Wc++HdNEhUh2klFn7w4cMsOGAj9WHyC8h3bGOqXroYobFv+Zd8l+xlNl152o Hiqh5VL8+cBe1Bo+daVarISofc1O4DkXlQrQVQAwB+H2fM0n1F7YXPW2/kMOc76W cAd9w5otz+ACWhX5CnScmEFHUE5QM4yutllb8w6sVpFZly1p/9pBZna+BT5t22JJ Uv65nGIqLyVP9nnCSyeH3BPr+KUe50rX4Squb9qJpikowjLesghX+voivG1EkgkG A/3WUX/kXG/zBo96taedSPo6ZLmuW1wcyY2NrIPll78Q80W4VBI1a2pkA2vm0/1Z 0VoxAYCYO+tGhzS4xDnvNl1+VQb7NEwrzySdh+TFh0hvhv3CGOnPsiT/kZ9CSgjI IkuvTXO/XTf4TRjKtwOGkZKrIrPqpVCt565h6i8s1h7qZf9vK3tIQPKpDQ04Dth5 iE9ncQd7KYTCORsYWE0XrD5BztbwpbMqtD1usX2NXZWPqY4ciLucCPnR1i21qQZ5 V1ld8KKXdu5gvQX50dGsoQXlggeYgDjvsXW1dJNMRzprHiNq7Bc= =ZbEq -----END PGP SIGNATURE----- Merge tag 'm68knommu-for-v5.13' of git://git.kernel.org/pub/scm/linux/kernel/git/gerg/m68knommu Pull m68knommu updates from Greg Ungerer: - a fix for interrupt number range checking for the ColdFire SIMR interrupt controller. - changes for the binfmt_flat binary loader to allow RISC-V nommu support it needs to be able to accept flat binaries that have no gap between the text and data sections. * tag 'm68knommu-for-v5.13' of git://git.kernel.org/pub/scm/linux/kernel/git/gerg/m68knommu: m68k: coldfire: fix irq ranges riscv: Disable data start offset in flat binaries binfmt_flat: allow not offsetting data start
This commit is contained in:
Коммит
51e6f07cb1
|
@ -68,9 +68,9 @@ static void intc_irq_mask(struct irq_data *d)
|
|||
{
|
||||
unsigned int irq = d->irq - MCFINT_VECBASE;
|
||||
|
||||
if (MCFINTC2_SIMR && (irq > 128))
|
||||
if (MCFINTC2_SIMR && (irq > 127))
|
||||
__raw_writeb(irq - 128, MCFINTC2_SIMR);
|
||||
else if (MCFINTC1_SIMR && (irq > 64))
|
||||
else if (MCFINTC1_SIMR && (irq > 63))
|
||||
__raw_writeb(irq - 64, MCFINTC1_SIMR);
|
||||
else
|
||||
__raw_writeb(irq, MCFINTC0_SIMR);
|
||||
|
@ -80,9 +80,9 @@ static void intc_irq_unmask(struct irq_data *d)
|
|||
{
|
||||
unsigned int irq = d->irq - MCFINT_VECBASE;
|
||||
|
||||
if (MCFINTC2_CIMR && (irq > 128))
|
||||
if (MCFINTC2_CIMR && (irq > 127))
|
||||
__raw_writeb(irq - 128, MCFINTC2_CIMR);
|
||||
else if (MCFINTC1_CIMR && (irq > 64))
|
||||
else if (MCFINTC1_CIMR && (irq > 63))
|
||||
__raw_writeb(irq - 64, MCFINTC1_CIMR);
|
||||
else
|
||||
__raw_writeb(irq, MCFINTC0_CIMR);
|
||||
|
@ -115,9 +115,9 @@ static unsigned int intc_irq_startup(struct irq_data *d)
|
|||
}
|
||||
|
||||
irq -= MCFINT_VECBASE;
|
||||
if (MCFINTC2_ICR0 && (irq > 128))
|
||||
if (MCFINTC2_ICR0 && (irq > 127))
|
||||
__raw_writeb(5, MCFINTC2_ICR0 + irq - 128);
|
||||
else if (MCFINTC1_ICR0 && (irq > 64))
|
||||
else if (MCFINTC1_ICR0 && (irq > 63))
|
||||
__raw_writeb(5, MCFINTC1_ICR0 + irq - 64);
|
||||
else
|
||||
__raw_writeb(5, MCFINTC0_ICR0 + irq);
|
||||
|
|
|
@ -33,6 +33,7 @@ config RISCV
|
|||
select ARCH_WANT_DEFAULT_TOPDOWN_MMAP_LAYOUT if MMU
|
||||
select ARCH_WANT_FRAME_POINTERS
|
||||
select ARCH_WANT_HUGE_PMD_SHARE if 64BIT
|
||||
select BINFMT_FLAT_NO_DATA_START_OFFSET if !MMU
|
||||
select CLONE_BACKWARDS
|
||||
select CLINT_TIMER if !MMU
|
||||
select COMMON_CLK
|
||||
|
|
|
@ -112,6 +112,9 @@ config BINFMT_FLAT_ARGVP_ENVP_ON_STACK
|
|||
config BINFMT_FLAT_OLD_ALWAYS_RAM
|
||||
bool
|
||||
|
||||
config BINFMT_FLAT_NO_DATA_START_OFFSET
|
||||
bool
|
||||
|
||||
config BINFMT_FLAT_OLD
|
||||
bool "Enable support for very old legacy flat binaries"
|
||||
depends on BINFMT_FLAT
|
||||
|
|
|
@ -74,6 +74,12 @@
|
|||
#define MAX_SHARED_LIBS (1)
|
||||
#endif
|
||||
|
||||
#ifdef CONFIG_BINFMT_FLAT_NO_DATA_START_OFFSET
|
||||
#define DATA_START_OFFSET_WORDS (0)
|
||||
#else
|
||||
#define DATA_START_OFFSET_WORDS (MAX_SHARED_LIBS)
|
||||
#endif
|
||||
|
||||
struct lib_info {
|
||||
struct {
|
||||
unsigned long start_code; /* Start of text segment */
|
||||
|
@ -576,7 +582,8 @@ static int load_flat_file(struct linux_binprm *bprm,
|
|||
goto err;
|
||||
}
|
||||
|
||||
len = data_len + extra + MAX_SHARED_LIBS * sizeof(unsigned long);
|
||||
len = data_len + extra +
|
||||
DATA_START_OFFSET_WORDS * sizeof(unsigned long);
|
||||
len = PAGE_ALIGN(len);
|
||||
realdatastart = vm_mmap(NULL, 0, len,
|
||||
PROT_READ|PROT_WRITE|PROT_EXEC, MAP_PRIVATE, 0);
|
||||
|
@ -591,7 +598,7 @@ static int load_flat_file(struct linux_binprm *bprm,
|
|||
goto err;
|
||||
}
|
||||
datapos = ALIGN(realdatastart +
|
||||
MAX_SHARED_LIBS * sizeof(unsigned long),
|
||||
DATA_START_OFFSET_WORDS * sizeof(unsigned long),
|
||||
FLAT_DATA_ALIGN);
|
||||
|
||||
pr_debug("Allocated data+bss+stack (%u bytes): %lx\n",
|
||||
|
@ -622,7 +629,8 @@ static int load_flat_file(struct linux_binprm *bprm,
|
|||
memp_size = len;
|
||||
} else {
|
||||
|
||||
len = text_len + data_len + extra + MAX_SHARED_LIBS * sizeof(u32);
|
||||
len = text_len + data_len + extra +
|
||||
DATA_START_OFFSET_WORDS * sizeof(u32);
|
||||
len = PAGE_ALIGN(len);
|
||||
textpos = vm_mmap(NULL, 0, len,
|
||||
PROT_READ | PROT_EXEC | PROT_WRITE, MAP_PRIVATE, 0);
|
||||
|
@ -638,7 +646,7 @@ static int load_flat_file(struct linux_binprm *bprm,
|
|||
|
||||
realdatastart = textpos + ntohl(hdr->data_start);
|
||||
datapos = ALIGN(realdatastart +
|
||||
MAX_SHARED_LIBS * sizeof(u32),
|
||||
DATA_START_OFFSET_WORDS * sizeof(u32),
|
||||
FLAT_DATA_ALIGN);
|
||||
|
||||
reloc = (__be32 __user *)
|
||||
|
@ -714,7 +722,7 @@ static int load_flat_file(struct linux_binprm *bprm,
|
|||
ret = result;
|
||||
pr_err("Unable to read code+data+bss, errno %d\n", ret);
|
||||
vm_munmap(textpos, text_len + data_len + extra +
|
||||
MAX_SHARED_LIBS * sizeof(u32));
|
||||
DATA_START_OFFSET_WORDS * sizeof(u32));
|
||||
goto err;
|
||||
}
|
||||
}
|
||||
|
|
Загрузка…
Ссылка в новой задаче