JustKernel

Ray Of Hope

multipage support for netback driver + Xen

Here are some of my learnings from my work on multipage support for netback driver. Learnings related to how we are making use of multi page and also how netback and netfron communicate. driver/xen/xen_probe.c keeps monitoring the backend and frontend states and calls the appropriate driver.otherend_changed(drivers/net/netfront or driver/net/netback) function. xenbus.c : static DEFINE_XENBUS_DRIVER(netback, , .probe […]

Posted in virtualization, Xen | No Comments

Broadwell + Xen + Classic guest kernel + WRITE_FAULT + SMAP Violation.

Recently faced an issue where classic guest kernel (2.6.*) were faulting on Broadwell hardware. From the day 1 doubt was on SMAP feature that is exclusive to Broadwell but had to prove it. Approach: Compiled the guest kernel with instrumentation but can’t use it as the guest on Broadwell hangs just during reboot. (I compiled […]

Posted in virtualization, Xen | No Comments

QEMU Networking Vhost-user & Transport Infiniband – series 4, recipient path

Finally got the receive path working from app2 running on server2 to VM2. Now I can see the rx stats in “ifconfig eth0” increasing for every packet transmitted to it. What was the problem: The problem was with the handling of the available ring and used ring. Its a rx case and I was treating […]

Posted in vhost-user, vhost-user, virtio-net | No Comments

QEMU Networking Vhost-user & Transport Infiniband – series 3, vring implementation

This description and understanding is based on the vhost-user implementation and the vapp sample application shared by the VirtualOpenSystems. vhost_client.c new_vhost_client() { vhost_client = new client(); //create a new clietn. vhost_client->page_size = VHOST_CLIENT_PAGE_SIZE; vhost_client->memory.nregions = VHOST_CLIENT_VRING_NUM; 2 : 1 for tx and 1 for Rx. each region is backed by the socket and mapped to […]

Posted in vhost-user, virtio-net | No Comments

QEMU Networking Vhost-user & Transport Infiniband – series 2 – code flow.

hw/virtio/vhost.c static const vhostops user_ops { .backend_type = VHOST_BACKEND_TYPE_USER .vhost_call = vhost_user_call .vhost_status = vhost_user_status } static const vhostops user_ops { .backend_type = VHOST_BACKEND_TYPE_kernel .vhost_call = vhost_kerne_call .vhost_status = 0 } vhost_set_backend_type() { select whether to use vhost-kernel or vhost-user } vhost_user_call() { vhost_dev_init() { 1) set the backend type 2. init the backend //vhost_backend_init […]

Posted in vhost-user, virtio-net | No Comments

QEMU Networking Vhost-user & Transport Infiniband – series 1, general architecture

Objective: Get the maximum performance for VM to VM communication using Infiniband backend utilizing RDMA. Design: server1 running VM1—>Usermode app running on server1—–RDMA TRANSPORT—->App2 running on server2—>vm2 running on server 2. brief description: vm1 is executed on server1 using emulated virtio-net(frontend) adapter and vhost-user backend. PACKETH runs on vm1 and generates the broadcast packet. App1 […]

Posted in qemu, vhost-user, virtio-net, virtualization | 2 Comments

Cubieboard2 board bringup with Linux

Download Requirements: 1) Download linux kernel (local dir = linux): git clone https://github.com/talex5/linux.git 2) Download uboot (directory u-boot-sunxi) from git clone https://github.com/linux-sunxi/u-boot-sunxi.git . git checkout origin/sunxi-next. sunxi-next branch contains the code that allows the uboot to boot in hypervisor mode. 3) Download sunxi-tools (local dir = sunxi-tools) from git://github.com/linux-sunxi/sunxi-tools.git . 4) Download sunxi-boards (local dir […]

Posted in VirtualDroid -Android Virtualization | No Comments

QEMU + Simple Network rate limiter from Linux Host side.

Simple Network rate limiter from Linux Host side : Controlling the flow using ring buffer. diff –git a/hw/net/virtio-net.c b/hw/net/virtio-net.c index 613f144..df620f7 100644 — a/hw/net/virtio-net.c +++ b/hw/net/virtio-net.c @@ -218,6 +218,7 @@ static void rxfilter_notify(NetClientState *nc) static char *mac_strdup_printf(const uint8_t *mac) { + printf(“Hello world \n”); return g_strdup_printf(“%.2x:%.2x:%.2x:%.2x:%.2x:%.2x”, mac[0], mac[1], mac[2], mac[3], mac[4], mac[5]); } @@ -1050,13 […]

Posted in qemu, virtualization | No Comments

QEMU + crude and simple rate limiter

For Windows paravirtualized guest NDIS driver. Manage the flow in ring buffer. iff –git a/NetKVM/NDIS5/Common/ParaNdis-Common.c b/NetKVM/NDIS5/Common/ParaNdis-Common.c index fe84133..c2cbf00 100644 — a/NetKVM/NDIS5/Common/ParaNdis-Common.c +++ b/NetKVM/NDIS5/Common/ParaNdis-Common.c @@ -805,7 +805,7 @@ NDIS_STATUS ParaNdis_InitializeContext( pContext->ReuseBufferProc = ReuseReceiveBufferRegular; – + NdisInitializeEvent(&pContext->ResetEvent); DEBUG_EXIT_STATUS(0, status); return status; @@ -1433,7 +1433,7 @@ void ReuseReceiveBufferRegular(PARANDIS_ADAPTER *pContext, pIONetDescriptor pBuf /********************************************************** It is called from Rx processing […]

Posted in qemu, virtualization | No Comments

QEMU + CPU Hotunplug design

The basic design decision that we have taken while designing cpu hotunplug functionality for qemu is that the kernel mode fd (in KVM) associated with the usermode vcpu will not be deleted. It will remain there. Only the mmapped memory associated the usermode thread (vcpu) will be deleted from the kernel. If we get a […]

Posted in qemu | No Comments