免费注册 查看新帖 |

Chinaunix

  平台 论坛 博客 文库
最近访问板块 发新帖
查看: 2282 | 回复: 0
打印 上一主题 下一主题

[VMware] xen下编译vmmon通过, 运行vmware虚拟机出错 [复制链接]

论坛徽章:
0
跳转到指定楼层
1 [收藏(0)] [报告]
发表于 2006-09-15 13:15 |只看该作者 |倒序浏览
我打算在xen dom0中运行vmware, 可以编译通过, 启动虚拟机时提示如下错误:

  1. Vmx86_RunVM start: /root/vmmon/vmmon-only/vmcore/moduleloop.c:59
  2. Vmx86_RunVM running: /root/vmmon/vmmon-only/vmcore/moduleloop.c:62
  3. Vmx86_RunVM running: /root/vmmon/vmmon-only/vmcore/moduleloop.c:72
  4. Vmx86_RunVM running: /root/vmmon/vmmon-only/vmcore/moduleloop.c:75
  5. Vmx86_RunVM running: /root/vmmon/vmmon-only/vmcore/moduleloop.c:82
  6. Vmx86_RunVM running: /root/vmmon/vmmon-only/vmcore/moduleloop.c:84
  7. Task_Switch start: /root/vmmon/vmmon-only/common/task.c:522
  8. Task_Switch running: /root/vmmon/vmmon-only/common/task.c:524
  9. Task_Switch running: /root/vmmon/vmmon-only/common/task.c:528
  10. Task_Switch running: /root/vmmon/vmmon-only/common/task.c:532
  11. Task_Switch running: /root/vmmon/vmmon-only/common/task.c:535
  12. Task_Switch running: /root/vmmon/vmmon-only/common/task.c:542
  13. Task_Switch running: /root/vmmon/vmmon-only/common/task.c:548
  14. Task_Switch running: /root/vmmon/vmmon-only/common/task.c:577
  15. Task_Switch running: /root/vmmon/vmmon-only/common/task.c:590
  16. Task_Switch running: /root/vmmon/vmmon-only/common/task.c:603
  17. Task_Switch running: /root/vmmon/vmmon-only/common/task.c:613
  18. Task_Switch running: /root/vmmon/vmmon-only/common/task.c:622
  19. SetupTemporaryGDT is running : /root/vmmon/vmmon-only/common/task.c:165
  20. SetupTemporaryGDT is running : /root/vmmon/vmmon-only/common/task.c:167
  21. SetupTemporaryGDT is running : /root/vmmon/vmmon-only/common/task.c:201
  22. SetupTemporaryGDT is running : /root/vmmon/vmmon-only/common/task.c:204
  23. SetupTemporaryGDT is running : /root/vmmon/vmmon-only/common/task.c:206
  24. Task_Switch running: /root/vmmon/vmmon-only/common/task.c:624
  25. Task_Switch running: /root/vmmon/vmmon-only/common/task.c:626
  26. Task_Switch running: /root/vmmon/vmmon-only/common/task.c:630
  27. Task_Switch running: /root/vmmon/vmmon-only/common/task.c:632
  28. Task_Switch desc: fe80e040
  29. general protection fault: 0000 [#1]
  30. SMP
  31. Modules linked in: vmnet vmmon crc32c libcrc32c iscsi_tcp scsi_transport_iscsi scsi_mod ipv6 ide_cd cdrom mousedev tsdev psmouse shpchp pci_hotplug serio_raw amd_k7_agp agpgart amd76x_edac via686a edac_mc i2c_isa i2c_viapro i2c_core rtc pcspkr evdev serial_core parport_pc parport ext3 jbd mbcache dm_mirror dm_snapshot dm_mod ide_generic ide_disk uhci_hcd via82cxxx generic ide_core usbcore tulip thermal processor fan
  32. CPU:    0
  33. EIP:    0061:[<ce21656b>]    Tainted: P      VLI
  34. EFLAGS: 00010296   (2.6.17-2-xen-k7 #1)
  35. EIP is at Task_Switch+0x37d/0xcf2 [vmmon]
  36. eax: 0000001e   ebx: fe80e040   ecx: b02bb934   edx: fffff8bb
  37. esi: 0000efff   edi: fe800000   ebp: ce121000   esp: c55e9dec
  38. ds: 007b   es: 007b   ss: 0069
  39. Process vmware-vmx (pid: 4152, threadinfo=c55e8000 task=b0d78a50)
  40. Stack: <0>ce21a7c0 fe80e040 00000000 c5f08000 00000246 8005003b a3d8fdf0 00000640
  41.        0000e040 00000000 00000033 efff0054 fe800000 ce121000 0000006b c5f08000
  42.        00000000 ce219329 b01136d9 cd1700c0 ca68f260 000007d8 000007d8 ce21084f
  43. Call Trace:
  44. <ce219329> Vmx86_RunVM+0xb2/0x42b [vmmon]  <b01136d9> try_to_wake_up+0x2dd/0x2e7
  45. <ce21084f> LinuxDriver_Ioctl+0x14c/0x91a [vmmon]  <b01127d2> __wake_up_common+0x2f/0x53
  46. <b011450a> __wake_up+0x2a/0x3d  <b012c6a8> wake_futex+0x3a/0x44
  47. <b012c966> futex_wake+0x77/0xad  <b012cc15> do_futex+0x1f2/0x771
  48. <b011c87b> do_setitimer+0x3e3/0x51e  <b015f21f> do_ioctl+0x47/0x5d
  49. <b015f487> vfs_ioctl+0x252/0x264  <b011ca2a> sys_setitimer+0x74/0x7f
  50. <b015f4e1> sys_ioctl+0x48/0x5f  <b010480b> syscall_call+0x7/0xb
  51. Code: 5c 24 30 03 9d 02 04 00 00 68 78 02 00 00 68 3f a7 21 ce 68 7e a7 21 ce e8 ca 31 f0 e1 83 c4 24 53 68 c0 a7 21 ce e8 bc 31 f0 e1 <8a> 43 05 83 e0 0f 0f b6 c0 50 68 d6 a7 21 ce e8 a8 31 f0 e1 68
  52. EIP: [<ce21656b>] Task_Switch+0x37d/0xcf2 [vmmon] SS:ESP 0069:c55e9dec
复制代码

我修改了vmmon的代码,增加printk进行调试, 发现是在/root/vmmon/vmmon-only/common/task.c的634行中出现了错误.
错误周围的代码如下

  1.    if (trReg) {
  2.       printk("Task_Switch running: %s:%d\n", __FILE__, __LINE__);
  3.       /* To return to the task, mark it as unused. */
  4.       Descriptor *desc;
  5.       DTR      *hostContextGDT = GetHostContextGDT(crosspage);
  6.       printk("Task_Switch running: %s:%d\n", __FILE__, __LINE__);
  7.       desc = (Descriptor *)(HOST_KERNEL_LA_2_VA(hostContextGDT->offset) + trReg);
  8.       printk("Task_Switch running: %s:%d\n", __FILE__, __LINE__);
  9.       printk("Task_Switch desc: %x\n", desc);
  10.       printk("Task_Switch Desc_Type: %d\n", Desc_Type(desc));
  11.       printk("Task_Switch running: %s:%d\n", __FILE__, __LINE__);
  12.       if (Desc_Type(desc) == TASK_DESC_BUSY) {
  13.          Desc_SetType(desc, TASK_DESC);
  14.          printk("Task_Switch running: %s:%d\n", __FILE__, __LINE__);
  15.       }
  16.    }
复制代码

634行为printk("Task_Switch desc: %x\n", desc), Desc_SetType(desc, TASK_DESC)为未修改的代码中包含的行.

HOST_KERNEL_LA_2_VA在common/hostKernel.h中定义, common/hostKernel.h内容如下

  1. root@guoliang:~/vmmon/vmmon-only# more common/hostKernel.h
  2. /* ****************************************************************************
  3. * Copyright 1998 VMware, Inc.  All rights reserved. -- VMware Confidential
  4. * ***************************************************************************/

  5. /*
  6. * hostKernel.h --
  7. *
  8. *    Definition of HOST_KERNEL_* --hpreg
  9. */


  10. #ifndef __HOST_KERNEL_H__
  11. #   define __HOST_KERNEL_H__


  12. #   ifdef linux
  13. /*
  14. * In some cases, this files needs to include Linux kernel header file
  15. * asm/page.h.
  16. *
  17. * However, asm/page.h defines PAGE_SHIFT, PAGE_SIZE, PAGE_MASK, PAGE_OFFSET
  18. * and VMware header file vm_basic_types.h defines PAGE_SHIFT, PAGE_SIZE,
  19. * PAGE_MASK, PAGE_OFFSET. PAGE_MASK and PAGE_OFFSET are defined differently
  20. * (XXX we should really prefix the VMware version with VM_ to prevent any
  21. * further confusion), but fortunately the driver does not use them.
  22. *
  23. * So in this file, we must solve the definition conflict for files that
  24. * include both this file and vm_basic_types.h. 2 cases can occur:
  25. *
  26. * 1) this file is included before vm_basic_types.h is included. This is fine,
  27. *    because vm_basic_types.h only defines PAGE_* if they don't exist yet.
  28. *
  29. * 2) vm_basic_types.h is included before this file is included.
  30. * We must undefine
  31. *    PAGE_* in between. But this only works if asm/page.h is not included
  32. *    before this file is included.
  33. *
  34. * In summary: if you make sure you do not include asm/page.h before you
  35. * include this file, then we guarantee that:
  36. * . This file and vm_basic_types.h can be included in any order
  37. * . asm/page.h will be included
  38. * . The PAGE_* definitions will come from asm/page.h
  39. *
  40. *   --hpreg
  41. */

  42. /* Must come before any kernel header file --hpreg */
  43. #      include "driver-config.h"

  44. #      undef PAGE_SHIFT
  45. #      undef PAGE_SIZE
  46. #      undef PAGE_MASK
  47. #      undef PAGE_OFFSET

  48. /* For __PAGE_OFFSET --hpreg */
  49. #      include <asm/page.h>

  50. #      define HOST_KERNEL_VA_2_LA(_x) (_x)
  51. #      define HOST_KERNEL_LA_2_VA(_x) (_x)
  52. #   endif

  53. #   ifdef WINNT_DDK
  54. /* For VA and LA --hpreg */
  55. #      include "vm_basic_types.h"

  56. #      define HOST_KERNEL_VA_2_LA(_addr) ((LA)(_addr))
  57. #      define HOST_KERNEL_LA_2_VA(_addr) ((VA)(_addr))
  58. #   endif


  59. #endif /* __HOST_KERNEL_H__ */

复制代码

附件是我修改过的vmmon的内容.
请问为什么会出现这样的问题? HOST_KERNEL_VA_2_LA是用来做什么的?
我使用的xen版本为debian中的3.0-unstable+hg11292-2, dom0 kernel版本为linux-image-2.6.17-2-xen-k7        2.6.17-8
vmware版本为VMware Server 1.0.0 build-28343, 使用最新的vmware server和vmware player也遇到了类似的问题.

[ 本帖最后由 blue_stone 于 2006-9-15 13:21 编辑 ]

vmmon.tar.gz

145.7 KB, 下载次数: 51

vmmon压缩包

您需要登录后才可以回帖 登录 | 注册

本版积分规则 发表回复

  

北京盛拓优讯信息技术有限公司. 版权所有 京ICP备16024965号-6 北京市公安局海淀分局网监中心备案编号:11010802020122 niuxiaotong@pcpop.com 17352615567
未成年举报专区
中国互联网协会会员  联系我们:huangweiwei@itpub.net
感谢所有关心和支持过ChinaUnix的朋友们 转载本站内容请注明原作者名及出处

清除 Cookies - ChinaUnix - Archiver - WAP - TOP