Skip to content

Commit 923dcc5

Browse files
committed
Merge branch 'akpm' (patches from Andrew)
Merge misc fixes from Andrew Morton: "15 patches. Subsystems affected by this patch series: ipc, hexagon, mm (swap, slab-generic, kmemleak, hugetlb, kasan, damon, and highmem), and proc" * emailed patches from Andrew Morton <akpm@linux-foundation.org>: proc/vmcore: fix clearing user buffer by properly using clear_user() kmap_local: don't assume kmap PTEs are linear arrays in memory mm/damon/dbgfs: fix missed use of damon_dbgfs_lock mm/damon/dbgfs: use '__GFP_NOWARN' for user-specified size buffer allocation kasan: test: silence intentional read overflow warnings hugetlb, userfaultfd: fix reservation restore on userfaultfd error hugetlb: fix hugetlb cgroup refcounting during mremap mm: kmemleak: slob: respect SLAB_NOLEAKTRACE flag hexagon: ignore vmlinux.lds hexagon: clean up timer-regs.h hexagon: export raw I/O routines for modules mm: emit the "free" trace report before freeing memory in kmem_cache_free() shm: extend forced shm destroy to support objects from several IPC nses ipc: WARN if trying to remove ipc object which is absent mm/swap.c:put_pages_list(): reinitialise the page list
2 parents 61564e7 + c1e6311 commit 923dcc5

File tree

22 files changed

+254
-116
lines changed

22 files changed

+254
-116
lines changed

arch/arm/Kconfig

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1463,6 +1463,7 @@ config HIGHMEM
14631463
bool "High Memory Support"
14641464
depends on MMU
14651465
select KMAP_LOCAL
1466+
select KMAP_LOCAL_NON_LINEAR_PTE_ARRAY
14661467
help
14671468
The address space of ARM processors is only 4 Gigabytes large
14681469
and it has to accommodate user address space, kernel address

arch/hexagon/include/asm/timer-regs.h

Lines changed: 0 additions & 26 deletions
This file was deleted.

arch/hexagon/include/asm/timex.h

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,11 +7,10 @@
77
#define _ASM_TIMEX_H
88

99
#include <asm-generic/timex.h>
10-
#include <asm/timer-regs.h>
1110
#include <asm/hexagon_vm.h>
1211

1312
/* Using TCX0 as our clock. CLOCK_TICK_RATE scheduled to be removed. */
14-
#define CLOCK_TICK_RATE TCX0_CLK_RATE
13+
#define CLOCK_TICK_RATE 19200
1514

1615
#define ARCH_HAS_READ_CURRENT_TIMER
1716

arch/hexagon/kernel/.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
vmlinux.lds

arch/hexagon/kernel/time.c

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,9 +17,10 @@
1717
#include <linux/of_irq.h>
1818
#include <linux/module.h>
1919

20-
#include <asm/timer-regs.h>
2120
#include <asm/hexagon_vm.h>
2221

22+
#define TIMER_ENABLE BIT(0)
23+
2324
/*
2425
* For the clocksource we need:
2526
* pcycle frequency (600MHz)
@@ -33,6 +34,13 @@ cycles_t pcycle_freq_mhz;
3334
cycles_t thread_freq_mhz;
3435
cycles_t sleep_clk_freq;
3536

37+
/*
38+
* 8x50 HDD Specs 5-8. Simulator co-sim not fixed until
39+
* release 1.1, and then it's "adjustable" and probably not defaulted.
40+
*/
41+
#define RTOS_TIMER_INT 3
42+
#define RTOS_TIMER_REGS_ADDR 0xAB000000UL
43+
3644
static struct resource rtos_timer_resources[] = {
3745
{
3846
.start = RTOS_TIMER_REGS_ADDR,
@@ -80,7 +88,7 @@ static int set_next_event(unsigned long delta, struct clock_event_device *evt)
8088
iowrite32(0, &rtos_timer->clear);
8189

8290
iowrite32(delta, &rtos_timer->match);
83-
iowrite32(1 << TIMER_ENABLE, &rtos_timer->enable);
91+
iowrite32(TIMER_ENABLE, &rtos_timer->enable);
8492
return 0;
8593
}
8694

arch/hexagon/lib/io.c

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@ void __raw_readsw(const void __iomem *addr, void *data, int len)
2727
*dst++ = *src;
2828

2929
}
30+
EXPORT_SYMBOL(__raw_readsw);
3031

3132
/*
3233
* __raw_writesw - read words a short at a time
@@ -47,6 +48,7 @@ void __raw_writesw(void __iomem *addr, const void *data, int len)
4748

4849

4950
}
51+
EXPORT_SYMBOL(__raw_writesw);
5052

5153
/* Pretty sure len is pre-adjusted for the length of the access already */
5254
void __raw_readsl(const void __iomem *addr, void *data, int len)
@@ -62,6 +64,7 @@ void __raw_readsl(const void __iomem *addr, void *data, int len)
6264

6365

6466
}
67+
EXPORT_SYMBOL(__raw_readsl);
6568

6669
void __raw_writesl(void __iomem *addr, const void *data, int len)
6770
{
@@ -76,3 +79,4 @@ void __raw_writesl(void __iomem *addr, const void *data, int len)
7679

7780

7881
}
82+
EXPORT_SYMBOL(__raw_writesl);

fs/proc/vmcore.c

Lines changed: 12 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -154,9 +154,13 @@ ssize_t read_from_oldmem(char *buf, size_t count,
154154
nr_bytes = count;
155155

156156
/* If pfn is not ram, return zeros for sparse dump files */
157-
if (!pfn_is_ram(pfn))
158-
memset(buf, 0, nr_bytes);
159-
else {
157+
if (!pfn_is_ram(pfn)) {
158+
tmp = 0;
159+
if (!userbuf)
160+
memset(buf, 0, nr_bytes);
161+
else if (clear_user(buf, nr_bytes))
162+
tmp = -EFAULT;
163+
} else {
160164
if (encrypted)
161165
tmp = copy_oldmem_page_encrypted(pfn, buf,
162166
nr_bytes,
@@ -165,12 +169,12 @@ ssize_t read_from_oldmem(char *buf, size_t count,
165169
else
166170
tmp = copy_oldmem_page(pfn, buf, nr_bytes,
167171
offset, userbuf);
168-
169-
if (tmp < 0) {
170-
up_read(&vmcore_cb_rwsem);
171-
return tmp;
172-
}
173172
}
173+
if (tmp < 0) {
174+
up_read(&vmcore_cb_rwsem);
175+
return tmp;
176+
}
177+
174178
*ppos += nr_bytes;
175179
count -= nr_bytes;
176180
buf += nr_bytes;

include/linux/hugetlb_cgroup.h

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -128,6 +128,13 @@ static inline void resv_map_dup_hugetlb_cgroup_uncharge_info(
128128
css_get(resv_map->css);
129129
}
130130

131+
static inline void resv_map_put_hugetlb_cgroup_uncharge_info(
132+
struct resv_map *resv_map)
133+
{
134+
if (resv_map->css)
135+
css_put(resv_map->css);
136+
}
137+
131138
extern int hugetlb_cgroup_charge_cgroup(int idx, unsigned long nr_pages,
132139
struct hugetlb_cgroup **ptr);
133140
extern int hugetlb_cgroup_charge_cgroup_rsvd(int idx, unsigned long nr_pages,
@@ -211,6 +218,11 @@ static inline void resv_map_dup_hugetlb_cgroup_uncharge_info(
211218
{
212219
}
213220

221+
static inline void resv_map_put_hugetlb_cgroup_uncharge_info(
222+
struct resv_map *resv_map)
223+
{
224+
}
225+
214226
static inline int hugetlb_cgroup_charge_cgroup(int idx, unsigned long nr_pages,
215227
struct hugetlb_cgroup **ptr)
216228
{

include/linux/ipc_namespace.h

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -131,6 +131,16 @@ static inline struct ipc_namespace *get_ipc_ns(struct ipc_namespace *ns)
131131
return ns;
132132
}
133133

134+
static inline struct ipc_namespace *get_ipc_ns_not_zero(struct ipc_namespace *ns)
135+
{
136+
if (ns) {
137+
if (refcount_inc_not_zero(&ns->ns.count))
138+
return ns;
139+
}
140+
141+
return NULL;
142+
}
143+
134144
extern void put_ipc_ns(struct ipc_namespace *ns);
135145
#else
136146
static inline struct ipc_namespace *copy_ipcs(unsigned long flags,
@@ -147,6 +157,11 @@ static inline struct ipc_namespace *get_ipc_ns(struct ipc_namespace *ns)
147157
return ns;
148158
}
149159

160+
static inline struct ipc_namespace *get_ipc_ns_not_zero(struct ipc_namespace *ns)
161+
{
162+
return ns;
163+
}
164+
150165
static inline void put_ipc_ns(struct ipc_namespace *ns)
151166
{
152167
}

include/linux/sched/task.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -158,7 +158,7 @@ static inline struct vm_struct *task_stack_vm_area(const struct task_struct *t)
158158
* Protects ->fs, ->files, ->mm, ->group_info, ->comm, keyring
159159
* subscriptions and synchronises with wait4(). Also used in procfs. Also
160160
* pins the final release of task.io_context. Also protects ->cpuset and
161-
* ->cgroup.subsys[]. And ->vfork_done.
161+
* ->cgroup.subsys[]. And ->vfork_done. And ->sysvshm.shm_clist.
162162
*
163163
* Nests both inside and outside of read_lock(&tasklist_lock).
164164
* It must not be nested with write_lock_irq(&tasklist_lock),

0 commit comments

Comments
 (0)