lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite for Android: free password hash cracker in your pocket
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20180920173026.141333-9-namit@vmware.com>
Date:   Thu, 20 Sep 2018 10:30:14 -0700
From:   Nadav Amit <namit@...are.com>
To:     Greg Kroah-Hartman <gregkh@...uxfoundation.org>,
        Arnd Bergmann <arnd@...db.de>
CC:     <linux-kernel@...r.kernel.org>,
        Xavier Deguillard <xdeguillard@...are.com>,
        Nadav Amit <namit@...are.com>
Subject: [PATCH v2 08/20] vmw_balloon: rename VMW_BALLOON_2M_SHIFT to VMW_BALLOON_2M_ORDER

The name of the macro'd VMW_BALLOON_2M_SHIFT is misleading. The value
reflects 2M huge-page order. Unfortunately, we cannot use
HPAGE_PMD_ORDER, since it is not defined when transparent huge-pages are
off, so we need to define our own one.

Rename it to VMW_BALLOON_2M_ORDER. No functional change.

Signed-off-by: Nadav Amit <namit@...are.com>
---
 drivers/misc/vmw_balloon.c | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/drivers/misc/vmw_balloon.c b/drivers/misc/vmw_balloon.c
index 4e067d269706..626abe65eddb 100644
--- a/drivers/misc/vmw_balloon.c
+++ b/drivers/misc/vmw_balloon.c
@@ -77,7 +77,7 @@ enum vmwballoon_capabilities {
 					| VMW_BALLOON_BATCHED_2M_CMDS \
 					| VMW_BALLOON_SIGNALLED_WAKEUP_CMD)
 
-#define VMW_BALLOON_2M_SHIFT		(9)
+#define VMW_BALLOON_2M_ORDER		(PMD_SHIFT - PAGE_SHIFT)
 #define VMW_BALLOON_NUM_PAGE_SIZES	(2)
 
 /*
@@ -348,7 +348,7 @@ static bool vmballoon_send_guest_id(struct vmballoon *b)
 static u16 vmballoon_page_size(bool is_2m_page)
 {
 	if (is_2m_page)
-		return 1 << VMW_BALLOON_2M_SHIFT;
+		return 1 << VMW_BALLOON_2M_ORDER;
 
 	return 1;
 }
@@ -387,7 +387,7 @@ static struct page *vmballoon_alloc_page(bool is_2m_page)
 {
 	if (is_2m_page)
 		return alloc_pages(VMW_HUGE_PAGE_ALLOC_FLAGS,
-				   VMW_BALLOON_2M_SHIFT);
+				   VMW_BALLOON_2M_ORDER);
 
 	return alloc_page(VMW_PAGE_ALLOC_FLAGS);
 }
@@ -395,7 +395,7 @@ static struct page *vmballoon_alloc_page(bool is_2m_page)
 static void vmballoon_free_page(struct page *page, bool is_2m_page)
 {
 	if (is_2m_page)
-		__free_pages(page, VMW_BALLOON_2M_SHIFT);
+		__free_pages(page, VMW_BALLOON_2M_ORDER);
 	else
 		__free_page(page);
 }
-- 
2.17.1

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ