Skip to content

Commit bce6824

Browse files
author
Ingo Molnar
committed
Merge branch 'x86/core' into x86/build, to avoid conflicts
Signed-off-by: Ingo Molnar <mingo@kernel.org>
2 parents 494b516 + c0554d2 commit bce6824

Some content is hidden

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

42 files changed

+475
-246
lines changed

Documentation/fb/uvesafb.txt

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,8 @@ than x86. Check the v86d documentation for a list of currently supported
1515
arches.
1616

1717
v86d source code can be downloaded from the following website:
18-
http://dev.gentoo.org/~spock/projects/uvesafb
18+
19+
https://github.com/mjanusz/v86d
1920

2021
Please refer to the v86d documentation for detailed configuration and
2122
installation instructions.
@@ -177,7 +178,7 @@ from the Video BIOS if you set pixclock to 0 in fb_var_screeninfo.
177178

178179
--
179180
Michal Januszewski <spock@gentoo.org>
180-
Last updated: 2009-03-30
181+
Last updated: 2017-10-10
181182

182183
Documentation of the uvesafb options is loosely based on vesafb.txt.
183184

MAINTAINERS

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1251,7 +1251,7 @@ N: meson
12511251

12521252
ARM/Annapurna Labs ALPINE ARCHITECTURE
12531253
M: Tsahee Zidenberg <tsahee@annapurnalabs.com>
1254-
M: Antoine Tenart <antoine.tenart@free-electrons.com>
1254+
M: Antoine Tenart <antoine.tenart@bootlin.com>
12551255
L: linux-arm-kernel@lists.infradead.org (moderated for non-subscribers)
12561256
S: Maintained
12571257
F: arch/arm/mach-alpine/
@@ -15395,7 +15395,7 @@ S: Maintained
1539515395
UVESAFB DRIVER
1539615396
M: Michal Januszewski <spock@gentoo.org>
1539715397
L: linux-fbdev@vger.kernel.org
15398-
W: http://dev.gentoo.org/~spock/projects/uvesafb/
15398+
W: https://github.com/mjanusz/v86d
1539915399
S: Maintained
1540015400
F: Documentation/fb/uvesafb.txt
1540115401
F: drivers/video/fbdev/uvesafb.*

arch/arm/boot/dts/at91-sama5d2_ptc_ek.dts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@
1111
#include "sama5d2-pinfunc.h"
1212
#include <dt-bindings/mfd/atmel-flexcom.h>
1313
#include <dt-bindings/gpio/gpio.h>
14+
#include <dt-bindings/pinctrl/at91.h>
1415

1516
/ {
1617
model = "Atmel SAMA5D2 PTC EK";
@@ -299,6 +300,7 @@
299300
<PIN_PA30__NWE_NANDWE>,
300301
<PIN_PB2__NRD_NANDOE>;
301302
bias-pull-up;
303+
atmel,drive-strength = <ATMEL_PIO_DRVSTR_ME>;
302304
};
303305

304306
ale_cle_rdy_cs {

arch/arm/boot/dts/bcm63138.dtsi

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -106,21 +106,23 @@
106106
global_timer: timer@1e200 {
107107
compatible = "arm,cortex-a9-global-timer";
108108
reg = <0x1e200 0x20>;
109-
interrupts = <GIC_PPI 11 IRQ_TYPE_LEVEL_HIGH>;
109+
interrupts = <GIC_PPI 11 IRQ_TYPE_EDGE_RISING>;
110110
clocks = <&axi_clk>;
111111
};
112112

113113
local_timer: local-timer@1e600 {
114114
compatible = "arm,cortex-a9-twd-timer";
115115
reg = <0x1e600 0x20>;
116-
interrupts = <GIC_PPI 13 IRQ_TYPE_LEVEL_HIGH>;
116+
interrupts = <GIC_PPI 13 (GIC_CPU_MASK_SIMPLE(2) |
117+
IRQ_TYPE_EDGE_RISING)>;
117118
clocks = <&axi_clk>;
118119
};
119120

120121
twd_watchdog: watchdog@1e620 {
121122
compatible = "arm,cortex-a9-twd-wdt";
122123
reg = <0x1e620 0x20>;
123-
interrupts = <GIC_PPI 14 IRQ_TYPE_LEVEL_HIGH>;
124+
interrupts = <GIC_PPI 14 (GIC_CPU_MASK_SIMPLE(2) |
125+
IRQ_TYPE_LEVEL_HIGH)>;
124126
};
125127

126128
armpll: armpll {
@@ -158,7 +160,7 @@
158160
serial0: serial@600 {
159161
compatible = "brcm,bcm6345-uart";
160162
reg = <0x600 0x1b>;
161-
interrupts = <GIC_SPI 32 0>;
163+
interrupts = <GIC_SPI 32 IRQ_TYPE_LEVEL_HIGH>;
162164
clocks = <&periph_clk>;
163165
clock-names = "periph";
164166
status = "disabled";
@@ -167,7 +169,7 @@
167169
serial1: serial@620 {
168170
compatible = "brcm,bcm6345-uart";
169171
reg = <0x620 0x1b>;
170-
interrupts = <GIC_SPI 33 0>;
172+
interrupts = <GIC_SPI 33 IRQ_TYPE_LEVEL_HIGH>;
171173
clocks = <&periph_clk>;
172174
clock-names = "periph";
173175
status = "disabled";
@@ -180,7 +182,7 @@
180182
reg = <0x2000 0x600>, <0xf0 0x10>;
181183
reg-names = "nand", "nand-int-base";
182184
status = "disabled";
183-
interrupts = <GIC_SPI 38 0>;
185+
interrupts = <GIC_SPI 38 IRQ_TYPE_LEVEL_HIGH>;
184186
interrupt-names = "nand";
185187
};
186188

arch/arm/boot/dts/stm32mp157c.dtsi

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1078,8 +1078,8 @@
10781078
interrupts = <GIC_SPI 86 IRQ_TYPE_LEVEL_HIGH>;
10791079
clocks = <&rcc SPI6_K>;
10801080
resets = <&rcc SPI6_R>;
1081-
dmas = <&mdma1 34 0x0 0x40008 0x0 0x0 0>,
1082-
<&mdma1 35 0x0 0x40002 0x0 0x0 0>;
1081+
dmas = <&mdma1 34 0x0 0x40008 0x0 0x0>,
1082+
<&mdma1 35 0x0 0x40002 0x0 0x0>;
10831083
dma-names = "rx", "tx";
10841084
status = "disabled";
10851085
};

arch/arm/boot/dts/sun8i-r40.dtsi

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -800,8 +800,7 @@
800800
};
801801

802802
hdmi_phy: hdmi-phy@1ef0000 {
803-
compatible = "allwinner,sun8i-r40-hdmi-phy",
804-
"allwinner,sun50i-a64-hdmi-phy";
803+
compatible = "allwinner,sun8i-r40-hdmi-phy";
805804
reg = <0x01ef0000 0x10000>;
806805
clocks = <&ccu CLK_BUS_HDMI1>, <&ccu CLK_HDMI_SLOW>,
807806
<&ccu 7>, <&ccu 16>;

arch/arm64/kvm/guest.c

Lines changed: 54 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,6 +57,45 @@ static u64 core_reg_offset_from_id(u64 id)
5757
return id & ~(KVM_REG_ARCH_MASK | KVM_REG_SIZE_MASK | KVM_REG_ARM_CORE);
5858
}
5959

60+
static int validate_core_offset(const struct kvm_one_reg *reg)
61+
{
62+
u64 off = core_reg_offset_from_id(reg->id);
63+
int size;
64+
65+
switch (off) {
66+
case KVM_REG_ARM_CORE_REG(regs.regs[0]) ...
67+
KVM_REG_ARM_CORE_REG(regs.regs[30]):
68+
case KVM_REG_ARM_CORE_REG(regs.sp):
69+
case KVM_REG_ARM_CORE_REG(regs.pc):
70+
case KVM_REG_ARM_CORE_REG(regs.pstate):
71+
case KVM_REG_ARM_CORE_REG(sp_el1):
72+
case KVM_REG_ARM_CORE_REG(elr_el1):
73+
case KVM_REG_ARM_CORE_REG(spsr[0]) ...
74+
KVM_REG_ARM_CORE_REG(spsr[KVM_NR_SPSR - 1]):
75+
size = sizeof(__u64);
76+
break;
77+
78+
case KVM_REG_ARM_CORE_REG(fp_regs.vregs[0]) ...
79+
KVM_REG_ARM_CORE_REG(fp_regs.vregs[31]):
80+
size = sizeof(__uint128_t);
81+
break;
82+
83+
case KVM_REG_ARM_CORE_REG(fp_regs.fpsr):
84+
case KVM_REG_ARM_CORE_REG(fp_regs.fpcr):
85+
size = sizeof(__u32);
86+
break;
87+
88+
default:
89+
return -EINVAL;
90+
}
91+
92+
if (KVM_REG_SIZE(reg->id) == size &&
93+
IS_ALIGNED(off, size / sizeof(__u32)))
94+
return 0;
95+
96+
return -EINVAL;
97+
}
98+
6099
static int get_core_reg(struct kvm_vcpu *vcpu, const struct kvm_one_reg *reg)
61100
{
62101
/*
@@ -76,6 +115,9 @@ static int get_core_reg(struct kvm_vcpu *vcpu, const struct kvm_one_reg *reg)
76115
(off + (KVM_REG_SIZE(reg->id) / sizeof(__u32))) >= nr_regs)
77116
return -ENOENT;
78117

118+
if (validate_core_offset(reg))
119+
return -EINVAL;
120+
79121
if (copy_to_user(uaddr, ((u32 *)regs) + off, KVM_REG_SIZE(reg->id)))
80122
return -EFAULT;
81123

@@ -98,6 +140,9 @@ static int set_core_reg(struct kvm_vcpu *vcpu, const struct kvm_one_reg *reg)
98140
(off + (KVM_REG_SIZE(reg->id) / sizeof(__u32))) >= nr_regs)
99141
return -ENOENT;
100142

143+
if (validate_core_offset(reg))
144+
return -EINVAL;
145+
101146
if (KVM_REG_SIZE(reg->id) > sizeof(tmp))
102147
return -EINVAL;
103148

@@ -107,17 +152,25 @@ static int set_core_reg(struct kvm_vcpu *vcpu, const struct kvm_one_reg *reg)
107152
}
108153

109154
if (off == KVM_REG_ARM_CORE_REG(regs.pstate)) {
110-
u32 mode = (*(u32 *)valp) & PSR_AA32_MODE_MASK;
155+
u64 mode = (*(u64 *)valp) & PSR_AA32_MODE_MASK;
111156
switch (mode) {
112157
case PSR_AA32_MODE_USR:
158+
if (!system_supports_32bit_el0())
159+
return -EINVAL;
160+
break;
113161
case PSR_AA32_MODE_FIQ:
114162
case PSR_AA32_MODE_IRQ:
115163
case PSR_AA32_MODE_SVC:
116164
case PSR_AA32_MODE_ABT:
117165
case PSR_AA32_MODE_UND:
166+
if (!vcpu_el1_is_32bit(vcpu))
167+
return -EINVAL;
168+
break;
118169
case PSR_MODE_EL0t:
119170
case PSR_MODE_EL1t:
120171
case PSR_MODE_EL1h:
172+
if (vcpu_el1_is_32bit(vcpu))
173+
return -EINVAL;
121174
break;
122175
default:
123176
err = -EINVAL;

arch/arm64/mm/hugetlbpage.c

Lines changed: 43 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -117,11 +117,14 @@ static pte_t get_clear_flush(struct mm_struct *mm,
117117

118118
/*
119119
* If HW_AFDBM is enabled, then the HW could turn on
120-
* the dirty bit for any page in the set, so check
121-
* them all. All hugetlb entries are already young.
120+
* the dirty or accessed bit for any page in the set,
121+
* so check them all.
122122
*/
123123
if (pte_dirty(pte))
124124
orig_pte = pte_mkdirty(orig_pte);
125+
126+
if (pte_young(pte))
127+
orig_pte = pte_mkyoung(orig_pte);
125128
}
126129

127130
if (valid) {
@@ -320,11 +323,40 @@ pte_t huge_ptep_get_and_clear(struct mm_struct *mm,
320323
return get_clear_flush(mm, addr, ptep, pgsize, ncontig);
321324
}
322325

326+
/*
327+
* huge_ptep_set_access_flags will update access flags (dirty, accesssed)
328+
* and write permission.
329+
*
330+
* For a contiguous huge pte range we need to check whether or not write
331+
* permission has to change only on the first pte in the set. Then for
332+
* all the contiguous ptes we need to check whether or not there is a
333+
* discrepancy between dirty or young.
334+
*/
335+
static int __cont_access_flags_changed(pte_t *ptep, pte_t pte, int ncontig)
336+
{
337+
int i;
338+
339+
if (pte_write(pte) != pte_write(huge_ptep_get(ptep)))
340+
return 1;
341+
342+
for (i = 0; i < ncontig; i++) {
343+
pte_t orig_pte = huge_ptep_get(ptep + i);
344+
345+
if (pte_dirty(pte) != pte_dirty(orig_pte))
346+
return 1;
347+
348+
if (pte_young(pte) != pte_young(orig_pte))
349+
return 1;
350+
}
351+
352+
return 0;
353+
}
354+
323355
int huge_ptep_set_access_flags(struct vm_area_struct *vma,
324356
unsigned long addr, pte_t *ptep,
325357
pte_t pte, int dirty)
326358
{
327-
int ncontig, i, changed = 0;
359+
int ncontig, i;
328360
size_t pgsize = 0;
329361
unsigned long pfn = pte_pfn(pte), dpfn;
330362
pgprot_t hugeprot;
@@ -336,19 +368,23 @@ int huge_ptep_set_access_flags(struct vm_area_struct *vma,
336368
ncontig = find_num_contig(vma->vm_mm, addr, ptep, &pgsize);
337369
dpfn = pgsize >> PAGE_SHIFT;
338370

371+
if (!__cont_access_flags_changed(ptep, pte, ncontig))
372+
return 0;
373+
339374
orig_pte = get_clear_flush(vma->vm_mm, addr, ptep, pgsize, ncontig);
340-
if (!pte_same(orig_pte, pte))
341-
changed = 1;
342375

343-
/* Make sure we don't lose the dirty state */
376+
/* Make sure we don't lose the dirty or young state */
344377
if (pte_dirty(orig_pte))
345378
pte = pte_mkdirty(pte);
346379

380+
if (pte_young(orig_pte))
381+
pte = pte_mkyoung(pte);
382+
347383
hugeprot = pte_pgprot(pte);
348384
for (i = 0; i < ncontig; i++, ptep++, addr += pgsize, pfn += dpfn)
349385
set_pte_at(vma->vm_mm, addr, ptep, pfn_pte(pfn, hugeprot));
350386

351-
return changed;
387+
return 1;
352388
}
353389

354390
void huge_ptep_set_wrprotect(struct mm_struct *mm,

arch/x86/include/asm/asm.h

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -130,6 +130,9 @@
130130
# define _ASM_EXTABLE(from, to) \
131131
_ASM_EXTABLE_HANDLE(from, to, ex_handler_default)
132132

133+
# define _ASM_EXTABLE_UA(from, to) \
134+
_ASM_EXTABLE_HANDLE(from, to, ex_handler_uaccess)
135+
133136
# define _ASM_EXTABLE_FAULT(from, to) \
134137
_ASM_EXTABLE_HANDLE(from, to, ex_handler_fault)
135138

@@ -165,8 +168,8 @@
165168
jmp copy_user_handle_tail
166169
.previous
167170

168-
_ASM_EXTABLE(100b,103b)
169-
_ASM_EXTABLE(101b,103b)
171+
_ASM_EXTABLE_UA(100b, 103b)
172+
_ASM_EXTABLE_UA(101b, 103b)
170173
.endm
171174

172175
#else
@@ -182,6 +185,9 @@
182185
# define _ASM_EXTABLE(from, to) \
183186
_ASM_EXTABLE_HANDLE(from, to, ex_handler_default)
184187

188+
# define _ASM_EXTABLE_UA(from, to) \
189+
_ASM_EXTABLE_HANDLE(from, to, ex_handler_uaccess)
190+
185191
# define _ASM_EXTABLE_FAULT(from, to) \
186192
_ASM_EXTABLE_HANDLE(from, to, ex_handler_fault)
187193

arch/x86/include/asm/extable.h

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,8 @@ struct pt_regs;
2929
(b)->handler = (tmp).handler - (delta); \
3030
} while (0)
3131

32-
extern int fixup_exception(struct pt_regs *regs, int trapnr);
32+
extern int fixup_exception(struct pt_regs *regs, int trapnr,
33+
unsigned long error_code, unsigned long fault_addr);
3334
extern int fixup_bug(struct pt_regs *regs, int trapnr);
3435
extern bool ex_has_fault_handler(unsigned long ip);
3536
extern void early_fixup_exception(struct pt_regs *regs, int trapnr);

arch/x86/include/asm/fpu/internal.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -226,7 +226,7 @@ static inline void copy_fxregs_to_kernel(struct fpu *fpu)
226226
"3: movl $-2,%[err]\n\t" \
227227
"jmp 2b\n\t" \
228228
".popsection\n\t" \
229-
_ASM_EXTABLE(1b, 3b) \
229+
_ASM_EXTABLE_UA(1b, 3b) \
230230
: [err] "=r" (err) \
231231
: "D" (st), "m" (*st), "a" (lmask), "d" (hmask) \
232232
: "memory")

arch/x86/include/asm/futex.h

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@
2020
"3:\tmov\t%3, %1\n" \
2121
"\tjmp\t2b\n" \
2222
"\t.previous\n" \
23-
_ASM_EXTABLE(1b, 3b) \
23+
_ASM_EXTABLE_UA(1b, 3b) \
2424
: "=r" (oldval), "=r" (ret), "+m" (*uaddr) \
2525
: "i" (-EFAULT), "0" (oparg), "1" (0))
2626

@@ -36,8 +36,8 @@
3636
"4:\tmov\t%5, %1\n" \
3737
"\tjmp\t3b\n" \
3838
"\t.previous\n" \
39-
_ASM_EXTABLE(1b, 4b) \
40-
_ASM_EXTABLE(2b, 4b) \
39+
_ASM_EXTABLE_UA(1b, 4b) \
40+
_ASM_EXTABLE_UA(2b, 4b) \
4141
: "=&a" (oldval), "=&r" (ret), \
4242
"+m" (*uaddr), "=&r" (tem) \
4343
: "r" (oparg), "i" (-EFAULT), "1" (0))

arch/x86/include/asm/ptrace.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,8 +37,10 @@ struct pt_regs {
3737
unsigned short __esh;
3838
unsigned short fs;
3939
unsigned short __fsh;
40+
/* On interrupt, gs and __gsh store the vector number. */
4041
unsigned short gs;
4142
unsigned short __gsh;
43+
/* On interrupt, this is the error code. */
4244
unsigned long orig_ax;
4345
unsigned long ip;
4446
unsigned short cs;

0 commit comments

Comments
 (0)