Commit 97aa7468 authored by Heiko Carstens's avatar Heiko Carstens

s390/vmcp: use page_to_virt instead of page_to_phys

Fix wrong usage of page_to_phys/phys_to_page.

Note: this currently doesn't fix a real bug, since virtual addresses
are indentical to physical ones.
Acked-by: default avatarThomas Richter <tmricht@linux.ibm.com>
Signed-off-by: default avatarHeiko Carstens <hca@linux.ibm.com>
parent a60bffe5
...@@ -72,7 +72,7 @@ static void vmcp_response_alloc(struct vmcp_session *session) ...@@ -72,7 +72,7 @@ static void vmcp_response_alloc(struct vmcp_session *session)
if (order > 2) if (order > 2)
page = cma_alloc(vmcp_cma, nr_pages, 0, false); page = cma_alloc(vmcp_cma, nr_pages, 0, false);
if (page) { if (page) {
session->response = (char *)page_to_phys(page); session->response = (char *)page_to_virt(page);
session->cma_alloc = 1; session->cma_alloc = 1;
return; return;
} }
...@@ -89,7 +89,7 @@ static void vmcp_response_free(struct vmcp_session *session) ...@@ -89,7 +89,7 @@ static void vmcp_response_free(struct vmcp_session *session)
order = get_order(session->bufsize); order = get_order(session->bufsize);
nr_pages = ALIGN(session->bufsize, PAGE_SIZE) >> PAGE_SHIFT; nr_pages = ALIGN(session->bufsize, PAGE_SIZE) >> PAGE_SHIFT;
if (session->cma_alloc) { if (session->cma_alloc) {
page = phys_to_page((unsigned long)session->response); page = virt_to_page((unsigned long)session->response);
cma_release(vmcp_cma, page, nr_pages); cma_release(vmcp_cma, page, nr_pages);
session->cma_alloc = 0; session->cma_alloc = 0;
} else { } else {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment