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: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date:	Thu, 03 Apr 2008 17:05:46 -0700
From:	Jeremy Fitzhardinge <jeremy@...p.org>
To:	KAMEZAWA Hiroyuki <kamezawa.hiroyu@...fujitsu.com>,
	Yasunori Goto <y-goto@...fujitsu.com>,
	Dave Hansen <dave@...ux.vnet.ibm.com>
Cc:	Ingo Molnar <mingo@...e.hu>, LKML <linux-kernel@...r.kernel.org>,
	Christoph Lameter <clameter@....com>
Subject: [PATCH 6 of 6] xen-balloon: define a section_ops

Define a xen_balloon_section_ops to control how xen balloon pages are onlined.

Signed-off-by: Jeremy Fitzhardinge <jeremy.fitzhardinge@...rix.com>
---
 drivers/xen/balloon.c |   17 ++++++++++++++++-
 1 file changed, 16 insertions(+), 1 deletion(-)

diff --git a/drivers/xen/balloon.c b/drivers/xen/balloon.c
--- a/drivers/xen/balloon.c
+++ b/drivers/xen/balloon.c
@@ -139,6 +139,21 @@
 	}
 }
 
+/* Only online a page if there's some memory backing it */
+static bool xen_online_page(struct page *page)
+{
+    unsigned long pfn = page_to_pfn(page);
+
+    if (get_phys_to_machine(pfn) == INVALID_P2M_ENTRY)
+	return false;
+
+    return online_page(page);
+}
+
+static const struct section_ops xen_balloon_section_ops = {
+    .online_page = xen_online_page
+};
+
 /* hotplug some memory we can add pages to */
 static void balloon_expand(unsigned pages)
 {
@@ -165,7 +180,7 @@
 	start_pfn = res->start >> PAGE_SHIFT;
 	end_pfn = (res->end + 1) >> PAGE_SHIFT;
 
-	ret = add_memory_resource(0, res, &default_section_ops);
+	ret = add_memory_resource(0, res, &xen_balloon_section_ops);
 	if (ret)
 		goto release_res;
 


--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ