* [PATCH] disable writable pagetables on FreeBSD
@ 2005-04-30 2:30 Kip Macy
2005-04-30 8:20 ` Keir Fraser
2005-04-30 8:54 ` Keir Fraser
0 siblings, 2 replies; 5+ messages in thread
From: Kip Macy @ 2005-04-30 2:30 UTC (permalink / raw)
To: xen-devel
Presumably as a result of recent changes, FreeBSD no longer works with
writable page tables. In the short-term I'm more interested in
functionality than performance. This patch disables them and fixes a
compile issue.
# This is a BitKeeper generated diff -Nru style patch.
#
# ChangeSet
# 2005/04/29 19:26:00-07:00 kmacy@curly.lab.netapp.com
# disable writable pagetables + compile fix
# Signed-off-by: Kip Macy <kmacy@fsmware.com>
#
# freebsd-5.3-xen-sparse/i386-xen/include/xenpmap.h
# 2005/04/29 19:25:58-07:00 kmacy@curly.lab.netapp.com +5 -3
# disable writable pagetables + compile fix
#
diff -Nru a/freebsd-5.3-xen-sparse/i386-xen/include/xenpmap.h
b/freebsd-5.3-xen-sparse/i386-xen/include/xenpmap.h
--- a/freebsd-5.3-xen-sparse/i386-xen/include/xenpmap.h 2005-04-28
19:30:44 -07:00
+++ b/freebsd-5.3-xen-sparse/i386-xen/include/xenpmap.h 2005-04-28
19:30:44 -07:00
@@ -59,7 +59,9 @@
#define PMAP_DEC_REF_PAGE(a)
#endif
+#if 0
#define WRITABLE_PAGETABLES
+#endif
#define ALWAYS_SYNC 0
#ifdef PT_DEBUG
@@ -118,18 +120,18 @@
#define PT_SET_VA(_ptp,_npte,sync) do { \
PMAP_REF((_ptp), xpmap_ptom(_npte)); \
- xen_queue_pt_update((pt_entry_t *)vtomach(_ptp), \
+ xen_queue_pt_update(vtomach(_ptp), \
xpmap_ptom(_npte)); \
if (sync || ALWAYS_SYNC) xen_flush_queue(); \
} while (/*CONSTCOND*/0)
#define PT_SET_VA_MA(_ptp,_npte,sync) do { \
PMAP_REF((_ptp), (_npte)); \
- xen_queue_pt_update((pt_entry_t *)vtomach(_ptp), _npte);\
+ xen_queue_pt_update(vtomach(_ptp), _npte); \
if (sync || ALWAYS_SYNC) xen_flush_queue(); \
} while (/*CONSTCOND*/0)
#define PT_CLEAR_VA(_ptp, sync) do { \
PMAP_REF((pt_entry_t *)(_ptp), 0); \
- xen_queue_pt_update((pt_entry_t *)vtomach(_ptp), 0); \
+ xen_queue_pt_update(vtomach(_ptp), 0); \
if (sync || ALWAYS_SYNC) \
xen_flush_queue(); \
} while (/*CONSTCOND*/0)
^ permalink raw reply [flat|nested] 5+ messages in thread* Re: [PATCH] disable writable pagetables on FreeBSD 2005-04-30 2:30 [PATCH] disable writable pagetables on FreeBSD Kip Macy @ 2005-04-30 8:20 ` Keir Fraser 2005-04-30 15:12 ` Kip Macy 2005-04-30 8:54 ` Keir Fraser 1 sibling, 1 reply; 5+ messages in thread From: Keir Fraser @ 2005-04-30 8:20 UTC (permalink / raw) To: Kip Macy; +Cc: xen-devel On 30 Apr 2005, at 03:30, Kip Macy wrote: > Presumably as a result of recent changes, FreeBSD no longer works with > writable page tables. In the short-term I'm more interested in > functionality than performance. This patch disables them and fixes a > compile issue. The obvious change is we reenabled batched wrpt mode. This requires the guest to deal with reading page directory entries that have the present bit (bit 0) cleared, even though that entry is logically present. :-) You may hav eforgotten to handle this, since it was not required all the while we were using emulation mode only. -- Keir ^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH] disable writable pagetables on FreeBSD 2005-04-30 8:20 ` Keir Fraser @ 2005-04-30 15:12 ` Kip Macy 0 siblings, 0 replies; 5+ messages in thread From: Kip Macy @ 2005-04-30 15:12 UTC (permalink / raw) To: Keir Fraser; +Cc: xen-devel On 4/30/05, Keir Fraser <Keir.Fraser@cl.cam.ac.uk> wrote: > > On 30 Apr 2005, at 03:30, Kip Macy wrote: > > > Presumably as a result of recent changes, FreeBSD no longer works with > > writable page tables. In the short-term I'm more interested in > > functionality than performance. This patch disables them and fixes a > > compile issue. > > The obvious change is we reenabled batched wrpt mode. This requires the > guest to deal with reading page directory entries that have the present > bit (bit 0) cleared, even though that entry is logically present. :-) > > You may hav eforgotten to handle this, since it was not required all > the while we were using emulation mode only. Entirely possible. There is only one place in the machine-independent code where we check for it. Removing it there doesn't help. It may require changing the machine-dependent code (I hope not, I'd rather it be a bug in my port or in xen). -Kip ^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH] disable writable pagetables on FreeBSD 2005-04-30 2:30 [PATCH] disable writable pagetables on FreeBSD Kip Macy 2005-04-30 8:20 ` Keir Fraser @ 2005-04-30 8:54 ` Keir Fraser 2005-04-30 15:15 ` Kip Macy 1 sibling, 1 reply; 5+ messages in thread From: Keir Fraser @ 2005-04-30 8:54 UTC (permalink / raw) To: Kip Macy; +Cc: xen-devel > Presumably as a result of recent changes, FreeBSD no longer works with > writable page tables. In the short-term I'm more interested in > functionality than performance. This patch disables them and fixes a > compile issue. Your mail client eats patches (at the very least, hard tabs become soft). I haven't applied this patch, or the 'dump guest core if enable-dump true' patch because of this problem. The two you sent links for applied okay, and I manually applied the fix to xc_ptrace.c for paravirtualised guests. I'll take the other two if you send links, or as attachments, or if you work out how to fix your mail client. :-) I somewhat prefer the last option as it's easier to automatically pull the patch out of the email. -- Keir ^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH] disable writable pagetables on FreeBSD 2005-04-30 8:54 ` Keir Fraser @ 2005-04-30 15:15 ` Kip Macy 0 siblings, 0 replies; 5+ messages in thread From: Kip Macy @ 2005-04-30 15:15 UTC (permalink / raw) To: Keir Fraser; +Cc: xen-devel [-- Attachment #1: Type: text/plain, Size: 1012 bytes --] At some point I may switch to a "real" mail reader, in the meantime I'll have to send them as attachments. -Kip On 4/30/05, Keir Fraser <Keir.Fraser@cl.cam.ac.uk> wrote: > > Presumably as a result of recent changes, FreeBSD no longer works with > > writable page tables. In the short-term I'm more interested in > > functionality than performance. This patch disables them and fixes a > > compile issue. > > Your mail client eats patches (at the very least, hard tabs become > soft). I haven't applied this patch, or the 'dump guest core if > enable-dump true' patch because of this problem. > > The two you sent links for applied okay, and I manually applied the > fix to xc_ptrace.c for paravirtualised guests. > > I'll take the other two if you send links, or as attachments, or if > you work out how to fix your mail client. :-) I somewhat prefer the > last option as it's easier to automatically pull the patch out of the > email. > > -- Keir > [-- Warning: decoded text below may be mangled, UTF-8 assumed --] [-- Attachment #2: dump-enable.patch --] [-- Type: text/x-patch; name="dump-enable.patch", Size: 1711 bytes --] # This is a BitKeeper generated diff -Nru style patch. # # ChangeSet # 2005/04/29 23:01:40-07:00 kmacy@curly.lab.netapp.com # dump guest core if enable-dump is set # Signed-off-by: Kip Macy <kmacy@fsmware.com> # # tools/python/xen/xend/XendRoot.py # 2005/04/29 23:01:32-07:00 kmacy@curly.lab.netapp.com +3 -0 # add enable-dump check # # tools/python/xen/xend/XendDomain.py # 2005/04/29 23:01:32-07:00 kmacy@curly.lab.netapp.com +2 -0 # dump core if enabled # diff -Nru a/tools/python/xen/xend/XendDomain.py b/tools/python/xen/xend/XendDomain.py --- a/tools/python/xen/xend/XendDomain.py 2005-04-29 07:53:37 -07:00 +++ b/tools/python/xen/xend/XendDomain.py 2005-04-29 07:53:37 -07:00 @@ -255,6 +255,8 @@ eserver.inject('xend.domain.exit', [name, id, reason]) self.domain_restart_schedule(id, reason) else: + if xroot.get_enable_dump() == 'true': + xc.domain_dumpcore(dom = int(id), corefile = "/var/xen/dump/%s.%s.core"%(name,id)) eserver.inject('xend.domain.exit', [name, id, 'crash']) destroyed += 1 self.final_domain_destroy(id) diff -Nru a/tools/python/xen/xend/XendRoot.py b/tools/python/xen/xend/XendRoot.py --- a/tools/python/xen/xend/XendRoot.py 2005-04-29 07:53:37 -07:00 +++ b/tools/python/xen/xend/XendRoot.py 2005-04-29 07:53:37 -07:00 @@ -255,6 +255,9 @@ def get_network_script(self): return self.get_config_value('network-script', 'network') + def get_enable_dump(self): + return self.get_config_value('enable-dump', 'false') + def get_vif_bridge(self): return self.get_config_value('vif-bridge', 'xen-br0') [-- Warning: decoded text below may be mangled, UTF-8 assumed --] [-- Attachment #3: wrpt-disable.patch --] [-- Type: text/x-patch; name="wrpt-disable.patch", Size: 1795 bytes --] # This is a BitKeeper generated diff -Nru style patch. # # ChangeSet # 2005/04/29 19:26:00-07:00 kmacy@curly.lab.netapp.com # disable writable pagetables + compile fix # Signed-off-by: Kip Macy <kmacy@fsmware.com> # # freebsd-5.3-xen-sparse/i386-xen/include/xenpmap.h # 2005/04/29 19:25:58-07:00 kmacy@curly.lab.netapp.com +5 -3 # disable writable pagetables + compile fix # diff -Nru a/freebsd-5.3-xen-sparse/i386-xen/include/xenpmap.h b/freebsd-5.3-xen-sparse/i386-xen/include/xenpmap.h --- a/freebsd-5.3-xen-sparse/i386-xen/include/xenpmap.h 2005-04-29 08:12:11 -07:00 +++ b/freebsd-5.3-xen-sparse/i386-xen/include/xenpmap.h 2005-04-29 08:12:11 -07:00 @@ -59,7 +59,9 @@ #define PMAP_DEC_REF_PAGE(a) #endif +#if 0 #define WRITABLE_PAGETABLES +#endif #define ALWAYS_SYNC 0 #ifdef PT_DEBUG @@ -118,18 +120,18 @@ #define PT_SET_VA(_ptp,_npte,sync) do { \ PMAP_REF((_ptp), xpmap_ptom(_npte)); \ - xen_queue_pt_update((pt_entry_t *)vtomach(_ptp), \ + xen_queue_pt_update(vtomach(_ptp), \ xpmap_ptom(_npte)); \ if (sync || ALWAYS_SYNC) xen_flush_queue(); \ } while (/*CONSTCOND*/0) #define PT_SET_VA_MA(_ptp,_npte,sync) do { \ PMAP_REF((_ptp), (_npte)); \ - xen_queue_pt_update((pt_entry_t *)vtomach(_ptp), _npte);\ + xen_queue_pt_update(vtomach(_ptp), _npte); \ if (sync || ALWAYS_SYNC) xen_flush_queue(); \ } while (/*CONSTCOND*/0) #define PT_CLEAR_VA(_ptp, sync) do { \ PMAP_REF((pt_entry_t *)(_ptp), 0); \ - xen_queue_pt_update((pt_entry_t *)vtomach(_ptp), 0); \ + xen_queue_pt_update(vtomach(_ptp), 0); \ if (sync || ALWAYS_SYNC) \ xen_flush_queue(); \ } while (/*CONSTCOND*/0) [-- Attachment #4: Type: text/plain, Size: 138 bytes --] _______________________________________________ Xen-devel mailing list Xen-devel@lists.xensource.com http://lists.xensource.com/xen-devel ^ permalink raw reply [flat|nested] 5+ messages in thread
end of thread, other threads:[~2005-04-30 15:15 UTC | newest] Thread overview: 5+ messages (download: mbox.gz follow: Atom feed -- links below jump to the message on this page -- 2005-04-30 2:30 [PATCH] disable writable pagetables on FreeBSD Kip Macy 2005-04-30 8:20 ` Keir Fraser 2005-04-30 15:12 ` Kip Macy 2005-04-30 8:54 ` Keir Fraser 2005-04-30 15:15 ` Kip Macy
This is an external index of several public inboxes, see mirroring instructions on how to clone and mirror all data and code used by this external index.