Skip to content

Commit 8244e09

Browse files
committed
2 parents c94c3ae + 702d3ec commit 8244e09

129 files changed

Lines changed: 1067 additions & 393 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

Makefile

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
VERSION = 4
22
PATCHLEVEL = 9
3-
SUBLEVEL = 272
3+
SUBLEVEL = 274
44
EXTRAVERSION =
55
NAME = Roaring Lionus
66

@@ -834,12 +834,11 @@ KBUILD_CFLAGS += $(call cc-disable-warning, tautological-compare)
834834
# See modpost pattern 2
835835
KBUILD_CFLAGS += $(call cc-option, -mno-global-merge,)
836836
KBUILD_CFLAGS += $(call cc-option, -fcatch-undefined-behavior)
837-
else
837+
endif
838838

839839
# These warnings generated too much noise in a regular build.
840840
# Use make W=1 to enable them (see scripts/Makefile.extrawarn)
841841
KBUILD_CFLAGS += $(call cc-disable-warning, unused-but-set-variable)
842-
endif
843842

844843
ifeq ($(ld-name),lld)
845844
KBUILD_LDFLAGS += -O2

arch/arm/kernel/setup.c

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -590,9 +590,11 @@ void notrace cpu_init(void)
590590
* In Thumb-2, msr with an immediate value is not allowed.
591591
*/
592592
#ifdef CONFIG_THUMB2_KERNEL
593-
#define PLC "r"
593+
#define PLC_l "l"
594+
#define PLC_r "r"
594595
#else
595-
#define PLC "I"
596+
#define PLC_l "I"
597+
#define PLC_r "I"
596598
#endif
597599

598600
/*
@@ -614,15 +616,15 @@ void notrace cpu_init(void)
614616
"msr cpsr_c, %9"
615617
:
616618
: "r" (stk),
617-
PLC (PSR_F_BIT | PSR_I_BIT | IRQ_MODE),
619+
PLC_r (PSR_F_BIT | PSR_I_BIT | IRQ_MODE),
618620
"I" (offsetof(struct stack, irq[0])),
619-
PLC (PSR_F_BIT | PSR_I_BIT | ABT_MODE),
621+
PLC_r (PSR_F_BIT | PSR_I_BIT | ABT_MODE),
620622
"I" (offsetof(struct stack, abt[0])),
621-
PLC (PSR_F_BIT | PSR_I_BIT | UND_MODE),
623+
PLC_r (PSR_F_BIT | PSR_I_BIT | UND_MODE),
622624
"I" (offsetof(struct stack, und[0])),
623-
PLC (PSR_F_BIT | PSR_I_BIT | FIQ_MODE),
625+
PLC_r (PSR_F_BIT | PSR_I_BIT | FIQ_MODE),
624626
"I" (offsetof(struct stack, fiq[0])),
625-
PLC (PSR_F_BIT | PSR_I_BIT | SVC_MODE)
627+
PLC_l (PSR_F_BIT | PSR_I_BIT | SVC_MODE)
626628
: "r14");
627629
#endif
628630
}

arch/arm/mach-omap2/board-n8x0.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -327,6 +327,7 @@ static int n8x0_mmc_get_cover_state(struct device *dev, int slot)
327327

328328
static void n8x0_mmc_callback(void *data, u8 card_mask)
329329
{
330+
#ifdef CONFIG_MMC_OMAP
330331
int bit, *openp, index;
331332

332333
if (board_is_n800()) {
@@ -344,7 +345,6 @@ static void n8x0_mmc_callback(void *data, u8 card_mask)
344345
else
345346
*openp = 0;
346347

347-
#ifdef CONFIG_MMC_OMAP
348348
omap_mmc_notify_cover_event(mmc_device, index, *openp);
349349
#else
350350
pr_warn("MMC: notify cover event not available\n");

arch/arm64/kernel/perf_event.c

Lines changed: 28 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -750,6 +750,28 @@ static void armv8pmu_disable_event(struct perf_event *event)
750750
raw_spin_unlock_irqrestore(&events->pmu_lock, flags);
751751
}
752752

753+
static void armv8pmu_start(struct arm_pmu *cpu_pmu)
754+
{
755+
unsigned long flags;
756+
struct pmu_hw_events *events = this_cpu_ptr(cpu_pmu->hw_events);
757+
758+
raw_spin_lock_irqsave(&events->pmu_lock, flags);
759+
/* Enable all counters */
760+
armv8pmu_pmcr_write(armv8pmu_pmcr_read() | ARMV8_PMU_PMCR_E);
761+
raw_spin_unlock_irqrestore(&events->pmu_lock, flags);
762+
}
763+
764+
static void armv8pmu_stop(struct arm_pmu *cpu_pmu)
765+
{
766+
unsigned long flags;
767+
struct pmu_hw_events *events = this_cpu_ptr(cpu_pmu->hw_events);
768+
769+
raw_spin_lock_irqsave(&events->pmu_lock, flags);
770+
/* Disable all counters */
771+
armv8pmu_pmcr_write(armv8pmu_pmcr_read() & ~ARMV8_PMU_PMCR_E);
772+
raw_spin_unlock_irqrestore(&events->pmu_lock, flags);
773+
}
774+
753775
static irqreturn_t armv8pmu_handle_irq(int irq_num, void *dev)
754776
{
755777
u32 pmovsr;
@@ -775,6 +797,11 @@ static irqreturn_t armv8pmu_handle_irq(int irq_num, void *dev)
775797
*/
776798
regs = get_irq_regs();
777799

800+
/*
801+
* Stop the PMU while processing the counter overflows
802+
* to prevent skews in group events.
803+
*/
804+
armv8pmu_stop(cpu_pmu);
778805
for (idx = 0; idx < cpu_pmu->num_events; ++idx) {
779806
struct perf_event *event = cpuc->events[idx];
780807
struct hw_perf_event *hwc;
@@ -799,6 +826,7 @@ static irqreturn_t armv8pmu_handle_irq(int irq_num, void *dev)
799826
if (perf_event_overflow(event, &data, regs))
800827
cpu_pmu->disable(event);
801828
}
829+
armv8pmu_start(cpu_pmu);
802830

803831
/*
804832
* Handle the pending perf events.
@@ -812,28 +840,6 @@ static irqreturn_t armv8pmu_handle_irq(int irq_num, void *dev)
812840
return IRQ_HANDLED;
813841
}
814842

815-
static void armv8pmu_start(struct arm_pmu *cpu_pmu)
816-
{
817-
unsigned long flags;
818-
struct pmu_hw_events *events = this_cpu_ptr(cpu_pmu->hw_events);
819-
820-
raw_spin_lock_irqsave(&events->pmu_lock, flags);
821-
/* Enable all counters */
822-
armv8pmu_pmcr_write(armv8pmu_pmcr_read() | ARMV8_PMU_PMCR_E);
823-
raw_spin_unlock_irqrestore(&events->pmu_lock, flags);
824-
}
825-
826-
static void armv8pmu_stop(struct arm_pmu *cpu_pmu)
827-
{
828-
unsigned long flags;
829-
struct pmu_hw_events *events = this_cpu_ptr(cpu_pmu->hw_events);
830-
831-
raw_spin_lock_irqsave(&events->pmu_lock, flags);
832-
/* Disable all counters */
833-
armv8pmu_pmcr_write(armv8pmu_pmcr_read() & ~ARMV8_PMU_PMCR_E);
834-
raw_spin_unlock_irqrestore(&events->pmu_lock, flags);
835-
}
836-
837843
static int armv8pmu_get_event_idx(struct pmu_hw_events *cpuc,
838844
struct perf_event *event)
839845
{

arch/mips/lib/mips-atomic.c

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@
3737
*/
3838
notrace void arch_local_irq_disable(void)
3939
{
40-
preempt_disable();
40+
preempt_disable_notrace();
4141

4242
__asm__ __volatile__(
4343
" .set push \n"
@@ -53,15 +53,15 @@ notrace void arch_local_irq_disable(void)
5353
: /* no inputs */
5454
: "memory");
5555

56-
preempt_enable();
56+
preempt_enable_notrace();
5757
}
5858
EXPORT_SYMBOL(arch_local_irq_disable);
5959

6060
notrace unsigned long arch_local_irq_save(void)
6161
{
6262
unsigned long flags;
6363

64-
preempt_disable();
64+
preempt_disable_notrace();
6565

6666
__asm__ __volatile__(
6767
" .set push \n"
@@ -78,7 +78,7 @@ notrace unsigned long arch_local_irq_save(void)
7878
: /* no inputs */
7979
: "memory");
8080

81-
preempt_enable();
81+
preempt_enable_notrace();
8282

8383
return flags;
8484
}
@@ -88,7 +88,7 @@ notrace void arch_local_irq_restore(unsigned long flags)
8888
{
8989
unsigned long __tmp1;
9090

91-
preempt_disable();
91+
preempt_disable_notrace();
9292

9393
__asm__ __volatile__(
9494
" .set push \n"
@@ -106,7 +106,7 @@ notrace void arch_local_irq_restore(unsigned long flags)
106106
: "0" (flags)
107107
: "memory");
108108

109-
preempt_enable();
109+
preempt_enable_notrace();
110110
}
111111
EXPORT_SYMBOL(arch_local_irq_restore);
112112

arch/powerpc/boot/dts/fsl/p1010si-post.dtsi

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -122,7 +122,15 @@
122122
};
123123

124124
/include/ "pq3-i2c-0.dtsi"
125+
i2c@3000 {
126+
fsl,i2c-erratum-a004447;
127+
};
128+
125129
/include/ "pq3-i2c-1.dtsi"
130+
i2c@3100 {
131+
fsl,i2c-erratum-a004447;
132+
};
133+
126134
/include/ "pq3-duart-0.dtsi"
127135
/include/ "pq3-espi-0.dtsi"
128136
spi0: spi@7000 {

arch/powerpc/boot/dts/fsl/p2041si-post.dtsi

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -389,7 +389,23 @@
389389
};
390390

391391
/include/ "qoriq-i2c-0.dtsi"
392+
i2c@118000 {
393+
fsl,i2c-erratum-a004447;
394+
};
395+
396+
i2c@118100 {
397+
fsl,i2c-erratum-a004447;
398+
};
399+
392400
/include/ "qoriq-i2c-1.dtsi"
401+
i2c@119000 {
402+
fsl,i2c-erratum-a004447;
403+
};
404+
405+
i2c@119100 {
406+
fsl,i2c-erratum-a004447;
407+
};
408+
393409
/include/ "qoriq-duart-0.dtsi"
394410
/include/ "qoriq-duart-1.dtsi"
395411
/include/ "qoriq-gpio-0.dtsi"

arch/x86/kernel/fpu/signal.c

Lines changed: 13 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -276,15 +276,23 @@ static int __fpu__restore_sig(void __user *buf, void __user *buf_fx, int size)
276276
return 0;
277277
}
278278

279-
if (!access_ok(VERIFY_READ, buf, size))
279+
if (!access_ok(VERIFY_READ, buf, size)) {
280+
fpu__clear(fpu);
280281
return -EACCES;
282+
}
281283

282284
fpu__activate_curr(fpu);
283285

284-
if (!static_cpu_has(X86_FEATURE_FPU))
285-
return fpregs_soft_set(current, NULL,
286-
0, sizeof(struct user_i387_ia32_struct),
287-
NULL, buf) != 0;
286+
if (!static_cpu_has(X86_FEATURE_FPU)) {
287+
int ret = fpregs_soft_set(current, NULL, 0,
288+
sizeof(struct user_i387_ia32_struct),
289+
NULL, buf);
290+
291+
if (ret)
292+
fpu__clear(fpu);
293+
294+
return ret != 0;
295+
}
288296

289297
if (use_xsave()) {
290298
struct _fpx_sw_bytes fx_sw_user;

drivers/char/adsprpc.c

Lines changed: 29 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -317,6 +317,8 @@ struct fastrpc_channel_ctx {
317317
/* Indicates, if channel is restricted to secure node only */
318318
int secure;
319319
struct fastrpc_dsp_capabilities dsp_cap_kernel;
320+
/* Indicates whether the channel supports unsigned PD */
321+
bool unsigned_support;
320322
};
321323

322324
struct fastrpc_apps {
@@ -2040,9 +2042,12 @@ static void fastrpc_init(struct fastrpc_apps *me)
20402042
me->channel[i].sesscount = 0;
20412043
/* All channels are secure by default except CDSP */
20422044
me->channel[i].secure = SECURE_CHANNEL;
2045+
me->channel[i].unsigned_support = false;
20432046
}
20442047
/* Set CDSP channel to non secure */
20452048
me->channel[CDSP_DOMAIN_ID].secure = NON_SECURE_CHANNEL;
2049+
/* Set CDSP channel unsigned_support to true*/
2050+
me->channel[CDSP_DOMAIN_ID].unsigned_support = true;
20462051
}
20472052

20482053
static int fastrpc_release_current_dsp_process(struct fastrpc_file *fl);
@@ -2204,6 +2209,20 @@ static int fastrpc_init_process(struct fastrpc_file *fl,
22042209
struct fastrpc_buf *imem = NULL;
22052210
unsigned long imem_dma_attr = 0;
22062211
char *proc_name = NULL;
2212+
int unsigned_request = (uproc->attrs & FASTRPC_MODE_UNSIGNED_MODULE);
2213+
int cid = fl->cid;
2214+
struct fastrpc_channel_ctx *chan = &me->channel[cid];
2215+
2216+
if (chan->unsigned_support &&
2217+
fl->dev_minor == MINOR_NUM_DEV) {
2218+
/* Make sure third party applications */
2219+
/* can spawn only unsigned PD when */
2220+
/* channel configured as secure. */
2221+
if (chan->secure && !unsigned_request) {
2222+
err = -ECONNREFUSED;
2223+
goto bail;
2224+
}
2225+
}
22072226

22082227
VERIFY(err, 0 == (err = fastrpc_channel_open(fl)));
22092228
if (err)
@@ -3773,29 +3792,32 @@ static int fastrpc_get_info(struct fastrpc_file *fl, uint32_t *info)
37733792
{
37743793
int err = 0;
37753794
uint32_t cid;
3795+
struct fastrpc_apps *me = &gfa;
37763796

37773797
VERIFY(err, fl != NULL);
37783798
if (err)
37793799
goto bail;
37803800
err = fastrpc_set_process_info(fl);
37813801
if (err)
37823802
goto bail;
3803+
cid = *info;
37833804
if (fl->cid == -1) {
3784-
cid = *info;
3805+
struct fastrpc_channel_ctx *chan = &me->channel[cid];
3806+
37853807
VERIFY(err, cid < NUM_CHANNELS);
37863808
if (err)
37873809
goto bail;
37883810
/* Check to see if the device node is non-secure */
37893811
if (fl->dev_minor == MINOR_NUM_DEV &&
37903812
fl->apps->secure_flag == true) {
37913813
/*
3792-
* For non secure device node check and make sure that
3793-
* the channel allows non-secure access
3794-
* If not, bail. Session will not start.
3795-
* cid will remain -1 and client will not be able to
3796-
* invoke any other methods without failure
3814+
* If an app is trying to offload to a secure remote
3815+
* channel by opening the non-secure device node, allow
3816+
* the access if the subsystem supports unsigned
3817+
* offload. Untrusted apps will be restricted.
37973818
*/
3798-
if (fl->apps->channel[cid].secure == SECURE_CHANNEL) {
3819+
if (chan->secure == SECURE_CHANNEL &&
3820+
!chan->unsigned_support) {
37993821
err = -EPERM;
38003822
pr_err("adsprpc: GetInfo failed dev %d, cid %d, secure %d\n",
38013823
fl->dev_minor, cid,

drivers/char/adsprpc_shared.h

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -325,4 +325,19 @@ static inline struct smq_phy_page *smq_phy_page_start(uint32_t sc,
325325
return (struct smq_phy_page *)(&buf[nTotal]);
326326
}
327327

328+
enum fastrpc_proc_attr {
329+
/* Macro for Debug attr */
330+
FASTRPC_MODE_DEBUG = 1 << 0,
331+
/* Macro for Ptrace */
332+
FASTRPC_MODE_PTRACE = 1 << 1,
333+
/* Macro for CRC Check */
334+
FASTRPC_MODE_CRC = 1 << 2,
335+
/* Macro for Unsigned PD */
336+
FASTRPC_MODE_UNSIGNED_MODULE = 1 << 3,
337+
/* Macro for Adaptive QoS */
338+
FASTRPC_MODE_ADAPTIVE_QOS = 1 << 4,
339+
/* Macro for System Process */
340+
FASTRPC_MODE_SYSTEM_PROCESS = 1 << 5,
341+
};
342+
328343
#endif

0 commit comments

Comments
 (0)