diff mbox series

[SRU,focal-gcp,v2,1/1] UBUNTU: SAUCE: (no-up) x86/mm: Fixing notify_range_enc_status_changed incorrect argument

Message ID 20231025182652.143307-2-john.cabaj@canonical.com
State New
Headers show
Series Incorrect argument from SEV live-migration fix | expand

Commit Message

John Cabaj Oct. 25, 2023, 6:26 p.m. UTC
BugLink: https://bugs.launchpad.net/bugs/2040337

ac3f9c9f1b37 introduced change to notify_range_enc_status_changed()
to accept page size instead of number of pages, but function was not updated.

Signed-off-by: John Cabaj <john.cabaj@canonical.com>
---
 arch/x86/mm/mem_encrypt.c | 2 +-
 arch/x86/mm/pageattr.c    | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)
diff mbox series

Patch

diff --git a/arch/x86/mm/mem_encrypt.c b/arch/x86/mm/mem_encrypt.c
index aa912f6e525b..2bab25cdd026 100644
--- a/arch/x86/mm/mem_encrypt.c
+++ b/arch/x86/mm/mem_encrypt.c
@@ -391,7 +391,7 @@  static int __init early_set_memory_enc_dec(unsigned long vaddr,
 
 	ret = 0;
 
-	notify_range_enc_status_changed(start, PAGE_ALIGN(size) >> PAGE_SHIFT, enc);
+	notify_range_enc_status_changed(start, size, enc);
 out:
 	__flush_tlb_all();
 	return ret;
diff --git a/arch/x86/mm/pageattr.c b/arch/x86/mm/pageattr.c
index 2468ef8c983e..5631fe734d8a 100644
--- a/arch/x86/mm/pageattr.c
+++ b/arch/x86/mm/pageattr.c
@@ -1984,7 +1984,7 @@  static int __set_memory_enc_dec(unsigned long addr, int numpages, bool enc)
 	 * Notify hypervisor that a given memory range is mapped encrypted
 	 * or decrypted.
 	 */
-	notify_range_enc_status_changed(addr, numpages, enc);
+	notify_range_enc_status_changed(addr, numpages << PAGE_SHIFT, enc);
 
 	return ret;
 }