Notice
Recent Posts
Recent Comments
Link
«   2024/05   »
1 2 3 4
5 6 7 8 9 10 11
12 13 14 15 16 17 18
19 20 21 22 23 24 25
26 27 28 29 30 31
Tags more
Archives
Today
Total
관리 메뉴

Pure Software Engineer :)

[Xen] User level inter virtual machine communication 본문

Software Engineering/Linux

[Xen] User level inter virtual machine communication

HelloJaewon 2012. 11. 1. 22:31

dom0에는 (2.6.32.39 이후 버전) user level process가 VM간에 통신을 할 수 있도록 guest OS level에서 page를 할당할 수 있는 디바이스(gntalloc)를 제공한다.

(참고 http://cateee.net/lkddb/web-lkddb/XEN_GRANT_DEV_ALLOC.html)


이를 통해 사용자 어플리케이션은 디바이스(gntalloc)을 통해 커널 메모리를 할당받아 다른 VM이 접근할수 있도록 access 권한을 주고 나서 이 페이지를 통해 메시지를 주고 받을 수 있다.


하지만 2.6.32.39 이후 버전부터 gntalloc device가 적용되어 있으므로 그 이전의 dom0를 사용하기 위해서는 직접 패치를 해줘야 했다.


여기서는 2.6.32.39버전의 dom0에 적용하기 위해 2.6.39.4버전에 있는 gntalloc 디바이스를 패치하도록 한다.


우선 2.6.39.4버전에서 2.6.32.39버전으로 복사해야할 파일들은 다음과 같다.

drivers/xen/gntalloc.c

include/xen/gntalloc.h

include/linux/atomic.h


그 다음 다음의 내용을 각 파일에 추가한다.

config 파일에 다음 내용 추가

CONFIG_XEN_GRANT_DEV_ALLOC=m


drivers/xen/Makefile 파일에 다음 내용 추가

obj-$(CONFIG_XEN_GRANT_DEV_ALLOC)    +=    xen-gntalloc.o

xen-gntalloc-y    :=    gntalloc.o


drivesr/xen/Kconfig 파일에 다음 내용 추가

config XEN_GRANT_DEV_ALLOC

    tristate "User-space grant reference allocator driver"

    depends on XEN

    default m

    help

        Allows userspace processes to create pages with access granted

        to other domains. This can be used to implement frontend drivers

        or as part of an inter-domain shared memory channel.


이제 다 됐다.


컴파일이 성공적으로 되었다면 drivers/xen 아래에 xen-gntalloc* 파일이 생겼을 것이다.

그리고 dom0 를 재부팅하고 나서 /dev/xen 아래에 gntalloc 이 보인다면 끝!!!!