From: Mike Rapoport <rppt@kernel.org>
To: Linus Torvalds <torvalds@linux-foundation.org>
Cc: Andrew Morton <akpm@linux-foundation.org>,
devicetree@vger.kernel.org, iommu@lists.linux-foundation.org,
kasan-dev@googlegroups.com, kvm@vger.kernel.org,
linux-alpha@vger.kernel.org,
linux-arm-kernel@lists.infradead.org, linux-efi@vger.kernel.org,
linux-kernel@vger.kernel.org, linux-mips@vger.kernel.org,
linux-mm@kvack.org, linux-riscv@lists.infradead.org,
linux-s390@vger.kernel.org, linux-sh@vger.kernel.org,
linux-snps-arc@lists.infradead.org, linux-um@lists.infradead.org,
linux-usb@vger.kernel.org, linuxppc-dev@lists.ozlabs.org,
sparclinux@vger.kernel.org, xen-devel@lists.xenproject.org,
Mike Rapoport <rppt@linux.ibm.com>
Subject: [PATCH 2/3] xen/x86: free_p2m_page: use memblock_free_ptr() to free a virtual pointer
Date: Thu, 23 Sep 2021 10:43:34 +0300 [thread overview]
Message-ID: <20210923074335.12583-3-rppt@kernel.org> (raw)
In-Reply-To: <20210923074335.12583-1-rppt@kernel.org>
From: Mike Rapoport <rppt@linux.ibm.com>
free_p2m_page() wrongly passes a virtual pointer to memblock_free() that
treats it as a physical address.
Call memblock_free_ptr() instead that gets a virtual address to free the
memory.
Signed-off-by: Mike Rapoport <rppt@linux.ibm.com>
---
arch/x86/xen/p2m.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/arch/x86/xen/p2m.c b/arch/x86/xen/p2m.c
index 5e6e236977c7..141bb9dbd2fb 100644
--- a/arch/x86/xen/p2m.c
+++ b/arch/x86/xen/p2m.c
@@ -197,7 +197,7 @@ static void * __ref alloc_p2m_page(void)
static void __ref free_p2m_page(void *p)
{
if (unlikely(!slab_is_available())) {
- memblock_free((unsigned long)p, PAGE_SIZE);
+ memblock_free_ptr(p, PAGE_SIZE);
return;
}
--
2.28.0
next prev parent reply other threads:[~2021-09-23 7:44 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-09-23 7:43 [PATCH 0/3] memblock: cleanup memblock_free interface Mike Rapoport
2021-09-23 7:43 ` [PATCH 1/3] arch_numa: simplify numa_distance allocation Mike Rapoport
2021-09-23 7:43 ` Mike Rapoport [this message]
2021-09-23 8:10 ` [PATCH 2/3] xen/x86: free_p2m_page: use memblock_free_ptr() to free a virtual pointer Juergen Gross
2021-09-23 7:43 ` [PATCH 3/3] memblock: cleanup memblock_free interface Mike Rapoport
2021-09-23 8:15 ` Juergen Gross
2021-09-23 9:47 ` Christophe Leroy
2021-09-23 12:01 ` Mike Rapoport
2021-09-23 13:54 ` Christophe Leroy
2021-09-24 5:32 ` Mike Rapoport
2021-09-23 12:44 ` Shahab Vahedi
2021-09-23 16:01 ` [PATCH 0/3] " Linus Torvalds
2021-09-23 19:45 ` Mike Rapoport
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20210923074335.12583-3-rppt@kernel.org \
--to=rppt@kernel.org \
--cc=akpm@linux-foundation.org \
--cc=devicetree@vger.kernel.org \
--cc=iommu@lists.linux-foundation.org \
--cc=kasan-dev@googlegroups.com \
--cc=kvm@vger.kernel.org \
--cc=linux-alpha@vger.kernel.org \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-efi@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-mips@vger.kernel.org \
--cc=linux-mm@kvack.org \
--cc=linux-riscv@lists.infradead.org \
--cc=linux-s390@vger.kernel.org \
--cc=linux-sh@vger.kernel.org \
--cc=linux-snps-arc@lists.infradead.org \
--cc=linux-um@lists.infradead.org \
--cc=linux-usb@vger.kernel.org \
--cc=linuxppc-dev@lists.ozlabs.org \
--cc=rppt@linux.ibm.com \
--cc=sparclinux@vger.kernel.org \
--cc=torvalds@linux-foundation.org \
--cc=xen-devel@lists.xenproject.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).