Re: 2.6.0-test9-mm4 (only) and vmware
From: Christopher Li
Date: Wed Nov 19 2003 - 21:33:04 EST
Thanks, I post a totally untested patch follows, but the testing of
which kernel has this feature is not completed yet.
Is there a way to reliably detect which kernel has this change?
Look at all the ifdef I need to make to keep the module working
with other kernels. :-(
Best Regards,
Chris
--- /tmp/p5diffhtml.tmp1.27140 2003-11-19 18:28:07.000000000 -0800
+++ /modules/shared/linux/compat_version.h 2003-11-19 18:25:12.000000000 -0800
@@ -96,5 +96,10 @@
# define KERNEL_2_5_5
#endif
+#if LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 0)
+/* New status return pointer in vmop->nopage() */
+/* FIXME: We need to test against 2.6.0-test9-mm4 */
+# define KERNEL_2_6_0_TEST9_MM4
+#endif
#endif /* __COMPAT_VERSION_H__ */
--- /tmp/p5diffhtml.tmp1.27140 2003-11-19 18:28:07.000000000 -0800
+++ /modules/vmmon/linux/driver.c 2003-11-19 18:26:28.000000000 -0800
@@ -548,6 +548,11 @@
*-----------------------------------------------------------------------------
*/
+#ifdef KERNEL_2_6_0_TEST9_MM4
+static struct page *LinuxDriverNoPage(struct vm_area_struct *vma, //IN
+ unsigned long address, //IN
+ int *type) //OUT
+#else
#ifdef KERNEL_2_4_0
static struct page *LinuxDriverNoPage(struct vm_area_struct *vma, //IN
unsigned long address, //IN
@@ -557,6 +562,7 @@
unsigned long address, //IN
int write_access) //IN
#endif
+#endif
{
VMLinux *vmLinux = (VMLinux *) vma->vm_file->private_data;
unsigned long pg;
@@ -566,6 +572,11 @@
return 0;
}
get_page(virt_to_page(vmLinux->pages4Gb[pg]));
+#ifdef KERNEL_2_6_0_TEST9_MM4
+ if (type) {
+ *type = VM_FAULT_MINOR;
+ }
+#endif
#ifdef KERNEL_2_4_0
return virt_to_page(vmLinux->pages4Gb[pg]);
#else
On Wed, Nov 19, 2003 at 05:47:18PM -0800, William Lee Irwin III wrote:
> On Wed, Nov 19, 2003 at 05:34:25PM -0500, Christopher Li wrote:
> > Can send me a few more lines of the log file before and after that message? I can take
> > a look at what is going on there. Most likely vmmon driver get confused.
>
> You should have a vm_ops->nopage() method that didn't get updated.
> The formerly-unused argument got turned into a status return pointer,
> so you need to do something like:
>
> struct page *vmmon_nopage(struct vm_area_struct *vma, unsigned long addr, int *type)
> {
> ...
> if (type)
> *type = VM_FAULT_MINOR;
> return page;
> }
>
> It should also give off a big fat warning about initialization from
> incompatible pointer types when compiled.
>
>
> -- wli
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/