Skip to content

Commit

Permalink
Merge branch 'akpm' (patches from Andrew)
Browse files Browse the repository at this point in the history
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
  • Loading branch information
Linus Torvalds committed Nov 20, 2021
2 parents 61564e7 + c1e6311 commit 923dcc5
Show file tree
Hide file tree
Showing 22 changed files with 254 additions and 116 deletions.
1 change: 1 addition & 0 deletions arch/arm/Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -1463,6 +1463,7 @@ config HIGHMEM
bool "High Memory Support"
depends on MMU
select KMAP_LOCAL
select KMAP_LOCAL_NON_LINEAR_PTE_ARRAY
help
The address space of ARM processors is only 4 Gigabytes large
and it has to accommodate user address space, kernel address
Expand Down
26 changes: 0 additions & 26 deletions arch/hexagon/include/asm/timer-regs.h

This file was deleted.

3 changes: 1 addition & 2 deletions arch/hexagon/include/asm/timex.h
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,10 @@
#define _ASM_TIMEX_H

#include <asm-generic/timex.h>
#include <asm/timer-regs.h>
#include <asm/hexagon_vm.h>

/* Using TCX0 as our clock. CLOCK_TICK_RATE scheduled to be removed. */
#define CLOCK_TICK_RATE TCX0_CLK_RATE
#define CLOCK_TICK_RATE 19200

#define ARCH_HAS_READ_CURRENT_TIMER

Expand Down
1 change: 1 addition & 0 deletions arch/hexagon/kernel/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
vmlinux.lds
12 changes: 10 additions & 2 deletions arch/hexagon/kernel/time.c
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,10 @@
#include <linux/of_irq.h>
#include <linux/module.h>

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

#define TIMER_ENABLE BIT(0)

/*
* For the clocksource we need:
* pcycle frequency (600MHz)
Expand All @@ -33,6 +34,13 @@ cycles_t pcycle_freq_mhz;
cycles_t thread_freq_mhz;
cycles_t sleep_clk_freq;

/*
* 8x50 HDD Specs 5-8. Simulator co-sim not fixed until
* release 1.1, and then it's "adjustable" and probably not defaulted.
*/
#define RTOS_TIMER_INT 3
#define RTOS_TIMER_REGS_ADDR 0xAB000000UL

static struct resource rtos_timer_resources[] = {
{
.start = RTOS_TIMER_REGS_ADDR,
Expand Down Expand Up @@ -80,7 +88,7 @@ static int set_next_event(unsigned long delta, struct clock_event_device *evt)
iowrite32(0, &rtos_timer->clear);

iowrite32(delta, &rtos_timer->match);
iowrite32(1 << TIMER_ENABLE, &rtos_timer->enable);
iowrite32(TIMER_ENABLE, &rtos_timer->enable);
return 0;
}

Expand Down
4 changes: 4 additions & 0 deletions arch/hexagon/lib/io.c
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ void __raw_readsw(const void __iomem *addr, void *data, int len)
*dst++ = *src;

}
EXPORT_SYMBOL(__raw_readsw);

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


}
EXPORT_SYMBOL(__raw_writesw);

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


}
EXPORT_SYMBOL(__raw_readsl);

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


}
EXPORT_SYMBOL(__raw_writesl);
20 changes: 12 additions & 8 deletions fs/proc/vmcore.c
Original file line number Diff line number Diff line change
Expand Up @@ -154,9 +154,13 @@ ssize_t read_from_oldmem(char *buf, size_t count,
nr_bytes = count;

/* If pfn is not ram, return zeros for sparse dump files */
if (!pfn_is_ram(pfn))
memset(buf, 0, nr_bytes);
else {
if (!pfn_is_ram(pfn)) {
tmp = 0;
if (!userbuf)
memset(buf, 0, nr_bytes);
else if (clear_user(buf, nr_bytes))
tmp = -EFAULT;
} else {
if (encrypted)
tmp = copy_oldmem_page_encrypted(pfn, buf,
nr_bytes,
Expand All @@ -165,12 +169,12 @@ ssize_t read_from_oldmem(char *buf, size_t count,
else
tmp = copy_oldmem_page(pfn, buf, nr_bytes,
offset, userbuf);

if (tmp < 0) {
up_read(&vmcore_cb_rwsem);
return tmp;
}
}
if (tmp < 0) {
up_read(&vmcore_cb_rwsem);
return tmp;
}

*ppos += nr_bytes;
count -= nr_bytes;
buf += nr_bytes;
Expand Down
12 changes: 12 additions & 0 deletions include/linux/hugetlb_cgroup.h
Original file line number Diff line number Diff line change
Expand Up @@ -128,6 +128,13 @@ static inline void resv_map_dup_hugetlb_cgroup_uncharge_info(
css_get(resv_map->css);
}

static inline void resv_map_put_hugetlb_cgroup_uncharge_info(
struct resv_map *resv_map)
{
if (resv_map->css)
css_put(resv_map->css);
}

extern int hugetlb_cgroup_charge_cgroup(int idx, unsigned long nr_pages,
struct hugetlb_cgroup **ptr);
extern int hugetlb_cgroup_charge_cgroup_rsvd(int idx, unsigned long nr_pages,
Expand Down Expand Up @@ -211,6 +218,11 @@ static inline void resv_map_dup_hugetlb_cgroup_uncharge_info(
{
}

static inline void resv_map_put_hugetlb_cgroup_uncharge_info(
struct resv_map *resv_map)
{
}

static inline int hugetlb_cgroup_charge_cgroup(int idx, unsigned long nr_pages,
struct hugetlb_cgroup **ptr)
{
Expand Down
15 changes: 15 additions & 0 deletions include/linux/ipc_namespace.h
Original file line number Diff line number Diff line change
Expand Up @@ -131,6 +131,16 @@ static inline struct ipc_namespace *get_ipc_ns(struct ipc_namespace *ns)
return ns;
}

static inline struct ipc_namespace *get_ipc_ns_not_zero(struct ipc_namespace *ns)
{
if (ns) {
if (refcount_inc_not_zero(&ns->ns.count))
return ns;
}

return NULL;
}

extern void put_ipc_ns(struct ipc_namespace *ns);
#else
static inline struct ipc_namespace *copy_ipcs(unsigned long flags,
Expand All @@ -147,6 +157,11 @@ static inline struct ipc_namespace *get_ipc_ns(struct ipc_namespace *ns)
return ns;
}

static inline struct ipc_namespace *get_ipc_ns_not_zero(struct ipc_namespace *ns)
{
return ns;
}

static inline void put_ipc_ns(struct ipc_namespace *ns)
{
}
Expand Down
2 changes: 1 addition & 1 deletion include/linux/sched/task.h
Original file line number Diff line number Diff line change
Expand Up @@ -158,7 +158,7 @@ static inline struct vm_struct *task_stack_vm_area(const struct task_struct *t)
* Protects ->fs, ->files, ->mm, ->group_info, ->comm, keyring
* subscriptions and synchronises with wait4(). Also used in procfs. Also
* pins the final release of task.io_context. Also protects ->cpuset and
* ->cgroup.subsys[]. And ->vfork_done.
* ->cgroup.subsys[]. And ->vfork_done. And ->sysvshm.shm_clist.
*
* Nests both inside and outside of read_lock(&tasklist_lock).
* It must not be nested with write_lock_irq(&tasklist_lock),
Expand Down
Loading

0 comments on commit 923dcc5

Please sign in to comment.