Commit af709adf authored by Linus Torvalds's avatar Linus Torvalds
Browse files

Merge tag 'mm-hotfixes-stable-2024-04-05-11-30' of...

Merge tag 'mm-hotfixes-stable-2024-04-05-11-30' of git://git.kernel.org/pub/scm/linux/kernel/git/akpm/mm

Pull misc fixes from Andrew Morton:
 "8 hotfixes, 3 are cc:stable

  There are a couple of fixups for this cycle's vmalloc changes and one
  for the stackdepot changes. And a fix for a very old x86 PAT issue
  which can cause a warning splat"

* tag 'mm-hotfixes-stable-2024-04-05-11-30' of git://git.kernel.org/pub/scm/linux/kernel/git/akpm/mm:
  stackdepot: rename pool_index to pool_index_plus_1
  x86/mm/pat: fix VM_PAT handling in COW mappings
  MAINTAINERS: change vmware.com addresses to broadcom.com
  selftests/mm: include strings.h for ffsl
  mm: vmalloc: fix lockdep warning
  mm: vmalloc: bail out early in find_vmap_area() if vmap is not init
  init: open output files from cpio unpacking with O_LARGEFILE
  mm/secretmem: fix GUP-fast succeeding on secretmem folios
parents c7830236 a6c1d9cb
Loading
Loading
Loading
Loading
+5 −0
Original line number Diff line number Diff line
@@ -20,6 +20,7 @@ Adam Oldham <oldhamca@gmail.com>
Adam Radford <aradford@gmail.com>
Adriana Reus <adi.reus@gmail.com> <adriana.reus@intel.com>
Adrian Bunk <bunk@stusta.de>
Ajay Kaher <ajay.kaher@broadcom.com> <akaher@vmware.com>
Akhil P Oommen <quic_akhilpo@quicinc.com> <akhilpo@codeaurora.org>
Alan Cox <alan@lxorguk.ukuu.org.uk>
Alan Cox <root@hraefn.swansea.linux.org.uk>
@@ -36,6 +37,7 @@ Alexei Avshalom Lazar <quic_ailizaro@quicinc.com> <ailizaro@codeaurora.org>
Alexei Starovoitov <ast@kernel.org> <alexei.starovoitov@gmail.com>
Alexei Starovoitov <ast@kernel.org> <ast@fb.com>
Alexei Starovoitov <ast@kernel.org> <ast@plumgrid.com>
Alexey Makhalov <alexey.amakhalov@broadcom.com> <amakhalov@vmware.com>
Alex Hung <alexhung@gmail.com> <alex.hung@canonical.com>
Alex Shi <alexs@kernel.org> <alex.shi@intel.com>
Alex Shi <alexs@kernel.org> <alex.shi@linaro.org>
@@ -110,6 +112,7 @@ Brendan Higgins <brendan.higgins@linux.dev> <brendanhiggins@google.com>
Brian Avery <b.avery@hp.com>
Brian King <brking@us.ibm.com>
Brian Silverman <bsilver16384@gmail.com> <brian.silverman@bluerivertech.com>
Bryan Tan <bryan-bt.tan@broadcom.com> <bryantan@vmware.com>
Cai Huoqing <cai.huoqing@linux.dev> <caihuoqing@baidu.com>
Can Guo <quic_cang@quicinc.com> <cang@codeaurora.org>
Carl Huang <quic_cjhuang@quicinc.com> <cjhuang@codeaurora.org>
@@ -529,6 +532,7 @@ Rocky Liao <quic_rjliao@quicinc.com> <rjliao@codeaurora.org>
Roman Gushchin <roman.gushchin@linux.dev> <guro@fb.com>
Roman Gushchin <roman.gushchin@linux.dev> <guroan@gmail.com>
Roman Gushchin <roman.gushchin@linux.dev> <klamm@yandex-team.ru>
Ronak Doshi <ronak.doshi@broadcom.com> <doshir@vmware.com>
Muchun Song <muchun.song@linux.dev> <songmuchun@bytedance.com>
Muchun Song <muchun.song@linux.dev> <smuchun@gmail.com>
Ross Zwisler <zwisler@kernel.org> <ross.zwisler@linux.intel.com>
@@ -651,6 +655,7 @@ Viresh Kumar <vireshk@kernel.org> <viresh.kumar@st.com>
Viresh Kumar <vireshk@kernel.org> <viresh.linux@gmail.com>
Viresh Kumar <viresh.kumar@linaro.org> <viresh.kumar@linaro.org>
Viresh Kumar <viresh.kumar@linaro.org> <viresh.kumar@linaro.com>
Vishnu Dasa <vishnu.dasa@broadcom.com> <vdasa@vmware.com>
Vivek Aknurwar <quic_viveka@quicinc.com> <viveka@codeaurora.org>
Vivien Didelot <vivien.didelot@gmail.com> <vivien.didelot@savoirfairelinux.com>
Vlad Dogaru <ddvlad@gmail.com> <vlad.dogaru@intel.com>
+23 −22
Original line number Diff line number Diff line
@@ -16733,9 +16733,9 @@ F: include/uapi/linux/ppdev.h
PARAVIRT_OPS INTERFACE
M:	Juergen Gross <jgross@suse.com>
R:	Ajay Kaher <akaher@vmware.com>
R:	Alexey Makhalov <amakhalov@vmware.com>
R:	VMware PV-Drivers Reviewers <pv-drivers@vmware.com>
R:	Ajay Kaher <ajay.kaher@broadcom.com>
R:	Alexey Makhalov <alexey.amakhalov@broadcom.com>
R:	Broadcom internal kernel review list <bcm-kernel-feedback-list@broadcom.com>
L:	virtualization@lists.linux.dev
L:	x86@kernel.org
S:	Supported
@@ -23654,9 +23654,9 @@ S: Supported
F:	drivers/misc/vmw_balloon.c
VMWARE HYPERVISOR INTERFACE
M:	Ajay Kaher <akaher@vmware.com>
M:	Alexey Makhalov <amakhalov@vmware.com>
R:	VMware PV-Drivers Reviewers <pv-drivers@vmware.com>
M:	Ajay Kaher <ajay.kaher@broadcom.com>
M:	Alexey Makhalov <alexey.amakhalov@broadcom.com>
R:	Broadcom internal kernel review list <bcm-kernel-feedback-list@broadcom.com>
L:	virtualization@lists.linux.dev
L:	x86@kernel.org
S:	Supported
@@ -23665,33 +23665,34 @@ F: arch/x86/include/asm/vmware.h
F:	arch/x86/kernel/cpu/vmware.c
VMWARE PVRDMA DRIVER
M:	Bryan Tan <bryantan@vmware.com>
M:	Vishnu Dasa <vdasa@vmware.com>
R:	VMware PV-Drivers Reviewers <pv-drivers@vmware.com>
M:	Bryan Tan <bryan-bt.tan@broadcom.com>
M:	Vishnu Dasa <vishnu.dasa@broadcom.com>
R:	Broadcom internal kernel review list <bcm-kernel-feedback-list@broadcom.com>
L:	linux-rdma@vger.kernel.org
S:	Supported
F:	drivers/infiniband/hw/vmw_pvrdma/
VMWARE PVSCSI DRIVER
M:	Vishal Bhakta <vbhakta@vmware.com>
R:	VMware PV-Drivers Reviewers <pv-drivers@vmware.com>
M:	Vishal Bhakta <vishal.bhakta@broadcom.com>
R:	Broadcom internal kernel review list <bcm-kernel-feedback-list@broadcom.com>
L:	linux-scsi@vger.kernel.org
S:	Supported
F:	drivers/scsi/vmw_pvscsi.c
F:	drivers/scsi/vmw_pvscsi.h
VMWARE VIRTUAL PTP CLOCK DRIVER
R:	Ajay Kaher <akaher@vmware.com>
R:	Alexey Makhalov <amakhalov@vmware.com>
R:	VMware PV-Drivers Reviewers <pv-drivers@vmware.com>
M:	Nick Shi <nick.shi@broadcom.com>
R:	Ajay Kaher <ajay.kaher@broadcom.com>
R:	Alexey Makhalov <alexey.amakhalov@broadcom.com>
R:	Broadcom internal kernel review list <bcm-kernel-feedback-list@broadcom.com>
L:	netdev@vger.kernel.org
S:	Supported
F:	drivers/ptp/ptp_vmw.c
VMWARE VMCI DRIVER
M:	Bryan Tan <bryantan@vmware.com>
M:	Vishnu Dasa <vdasa@vmware.com>
R:	VMware PV-Drivers Reviewers <pv-drivers@vmware.com>
M:	Bryan Tan <bryan-bt.tan@broadcom.com>
M:	Vishnu Dasa <vishnu.dasa@broadcom.com>
R:	Broadcom internal kernel review list <bcm-kernel-feedback-list@broadcom.com>
L:	linux-kernel@vger.kernel.org
S:	Supported
F:	drivers/misc/vmw_vmci/
@@ -23706,16 +23707,16 @@ F: drivers/input/mouse/vmmouse.c
F:	drivers/input/mouse/vmmouse.h
VMWARE VMXNET3 ETHERNET DRIVER
M:	Ronak Doshi <doshir@vmware.com>
R:	VMware PV-Drivers Reviewers <pv-drivers@vmware.com>
M:	Ronak Doshi <ronak.doshi@broadcom.com>
R:	Broadcom internal kernel review list <bcm-kernel-feedback-list@broadcom.com>
L:	netdev@vger.kernel.org
S:	Supported
F:	drivers/net/vmxnet3/
VMWARE VSOCK VMCI TRANSPORT DRIVER
M:	Bryan Tan <bryantan@vmware.com>
M:	Vishnu Dasa <vdasa@vmware.com>
R:	VMware PV-Drivers Reviewers <pv-drivers@vmware.com>
M:	Bryan Tan <bryan-bt.tan@broadcom.com>
M:	Vishnu Dasa <vishnu.dasa@broadcom.com>
R:	Broadcom internal kernel review list <bcm-kernel-feedback-list@broadcom.com>
L:	linux-kernel@vger.kernel.org
S:	Supported
F:	net/vmw_vsock/vmci_transport*
+35 −14
Original line number Diff line number Diff line
@@ -947,6 +947,38 @@ static void free_pfn_range(u64 paddr, unsigned long size)
		memtype_free(paddr, paddr + size);
}

static int get_pat_info(struct vm_area_struct *vma, resource_size_t *paddr,
		pgprot_t *pgprot)
{
	unsigned long prot;

	VM_WARN_ON_ONCE(!(vma->vm_flags & VM_PAT));

	/*
	 * We need the starting PFN and cachemode used for track_pfn_remap()
	 * that covered the whole VMA. For most mappings, we can obtain that
	 * information from the page tables. For COW mappings, we might now
	 * suddenly have anon folios mapped and follow_phys() will fail.
	 *
	 * Fallback to using vma->vm_pgoff, see remap_pfn_range_notrack(), to
	 * detect the PFN. If we need the cachemode as well, we're out of luck
	 * for now and have to fail fork().
	 */
	if (!follow_phys(vma, vma->vm_start, 0, &prot, paddr)) {
		if (pgprot)
			*pgprot = __pgprot(prot);
		return 0;
	}
	if (is_cow_mapping(vma->vm_flags)) {
		if (pgprot)
			return -EINVAL;
		*paddr = (resource_size_t)vma->vm_pgoff << PAGE_SHIFT;
		return 0;
	}
	WARN_ON_ONCE(1);
	return -EINVAL;
}

/*
 * track_pfn_copy is called when vma that is covering the pfnmap gets
 * copied through copy_page_range().
@@ -957,20 +989,13 @@ static void free_pfn_range(u64 paddr, unsigned long size)
int track_pfn_copy(struct vm_area_struct *vma)
{
	resource_size_t paddr;
	unsigned long prot;
	unsigned long vma_size = vma->vm_end - vma->vm_start;
	pgprot_t pgprot;

	if (vma->vm_flags & VM_PAT) {
		/*
		 * reserve the whole chunk covered by vma. We need the
		 * starting address and protection from pte.
		 */
		if (follow_phys(vma, vma->vm_start, 0, &prot, &paddr)) {
			WARN_ON_ONCE(1);
		if (get_pat_info(vma, &paddr, &pgprot))
			return -EINVAL;
		}
		pgprot = __pgprot(prot);
		/* reserve the whole chunk covered by vma. */
		return reserve_pfn_range(paddr, vma_size, &pgprot, 1);
	}

@@ -1045,7 +1070,6 @@ void untrack_pfn(struct vm_area_struct *vma, unsigned long pfn,
		 unsigned long size, bool mm_wr_locked)
{
	resource_size_t paddr;
	unsigned long prot;

	if (vma && !(vma->vm_flags & VM_PAT))
		return;
@@ -1053,11 +1077,8 @@ void untrack_pfn(struct vm_area_struct *vma, unsigned long pfn,
	/* free the chunk starting from pfn or the whole chunk */
	paddr = (resource_size_t)pfn << PAGE_SHIFT;
	if (!paddr && !size) {
		if (follow_phys(vma, vma->vm_start, 0, &prot, &paddr)) {
			WARN_ON_ONCE(1);
		if (get_pat_info(vma, &paddr, NULL))
			return;
		}

		size = vma->vm_end - vma->vm_start;
	}
	free_pfn_range(paddr, size);
+2 −2
Original line number Diff line number Diff line
@@ -13,10 +13,10 @@ static inline bool folio_is_secretmem(struct folio *folio)
	/*
	 * Using folio_mapping() is quite slow because of the actual call
	 * instruction.
	 * We know that secretmem pages are not compound and LRU so we can
	 * We know that secretmem pages are not compound, so we can
	 * save a couple of cycles here.
	 */
	if (folio_test_large(folio) || !folio_test_lru(folio))
	if (folio_test_large(folio))
		return false;

	mapping = (struct address_space *)
+3 −4
Original line number Diff line number Diff line
@@ -44,8 +44,7 @@ typedef u32 depot_stack_handle_t;
union handle_parts {
	depot_stack_handle_t handle;
	struct {
		/* pool_index is offset by 1 */
		u32 pool_index	: DEPOT_POOL_INDEX_BITS;
		u32 pool_index_plus_1	: DEPOT_POOL_INDEX_BITS;
		u32 offset		: DEPOT_OFFSET_BITS;
		u32 extra		: STACK_DEPOT_EXTRA_BITS;
	};
Loading