KVM/QEMU

这是很早的一点知识积累了 ,不是很专业,留作自己复习用:

--->

KVM is a Linux kernel driver that together with QEMU (http://wiki.qemu.org), an open source

machine emulator, provides an open source virtualization infrastructure based on Linux. KVM
and QEMU together act as a virtual machine manager that can boot and run operating systems in
virtual machines. 
-->
host kernel refers to the underlying instance of Linux with the KVM
driver that acts as the hypervisor. The term guest refers to the operating system, such as Linux,
that runs in a virtual machine.A virtual machine will be referred to as a “VM”.
(just a virtual pc)
-->
QEMU (pronounced KYOO-em-yoo) is a software-based machine emulator that emulates a
variety of CPUs and hardware systems. KVM is a Linux kernel device driver that provides
virtual CPU services to QEMU. The two software components work together as a virtual
machine manager.
-->
QEMU is a Linux user-space application that runs on the host Linux instance and is used to start
and manage a virtual machine. QEMU provides the following:
-->
The host Linux kernel is booted first, typically by u-boot (an open source bootloader). U-boot
passes the kernel a har dwar e device tree that lists and describes all system hardware resources
available to the host kernel (CPUs/cores, memory, interrupt controller and I/O).
-->
Similarly, when a guest OS is booted in a KVM/QEMU virtual machine, QEMU passes it a
guest device tree that describes all the hardware resources in the VM. QEMU is supplied the
guest device tree as an argument when it is started, and the device tree may be updated by
QEMU before starting the guest OS. 
--->telnet who in kvm_virtio_enet_xaui_ipsec_Tranport_Mode_Netperf remember in rhuath not changed qemu-ifup
set -v
ifconfig fm2-10g down
ifconfig fm2-10g hw ether 00:E0:0C:00:00:FD
ifconfig fm2-10g 200.200.200.20 netmask 255.255.255.0
ifconfig fm2-10g up
route add default dev fm2-10g
remember telnet which one has nothing with the two port back to back .

using qemu-ifup will create a brige between host and guest. Then the guest will have a virtual net.

-->Both types of VMs contain 4 kinds of resources:

    CPUs. Each VM contains one or more CPUs. See Virtual CPUs for further information on virtual CPUs.
    Memory. VMs are assigned memory by QEMU. See Virtual Machine Memory for information about approaches to assigning memory.
    Virtual I/O devices. Virtual I/O devices are devices presented to the VM as a hardware device, but are emulated in software by KVM/QEMU. Virtual machine reference contains detailed information about each virtual I/O device.
    Assigned Physical I/O devices. SoC I/O devices can be assigned/mapped to VMs, making the device a private resource of the VM, and allowing the guest OS direct access to a device's registers. See Direct mapping of memory and I/O devices for details on how I/O devices are assigned.

    ********************Virtual machine memory************************
There are three ways to allocate memory of guest:
    
1. Allocation via malloc
2. Direct mapped memory
==>    
Building a Relocatable Kernel. This option is applicable to 32-bit kernels only. 64-bit kernels do not support relocation.
Advanced setup --->
    [*] Prompt for advanced kernel configuration option
        [*] Build a relocatable kernel 
The aim of  this option is to use direct mapped memory:

Direct mapped memory allows the assignment of a physical region of memory (physically contiguous) to the VM. This approach is required if using a direct mapped I/O device that performs DMA.

See Direct mapping of memory and I/O devices for details on direct mapped memory.

There are several important implications to this approach of allocating memory:

The host Linux kernel must be told via the mem argument that it only can access a subset of a system's physical memory, with the remainder available for use by guests.he VM sees the true physical address of memory-- guest physical addresses are equal to true physical.

he guest OS must be able to run at a non-zero physical address. For Linux, this means that the kernel must be built as relocatable (kconfig option CONFIG_RELOCATABLE=y, see Building Linux with KVM).

==> p5040ds-64b dose not support direct mapped memory way.


3. Allocation via hugetlbfs 
For hugetlbfs and malloc allocated memory, the guest device tree contains a memory node with a size of zero which QEMU updates with the memory size.

Example:

memory {
                device_type = "memory";
                reg = <0x0 0x0>; // Filled by QEMU
};

-----------------------------------------------------------------------------------------------------------------------------------------------------------------
local.conf location:
/home/hanhan/sdk1.3_rc2_E550064_ISO/QorIQ-SDK-V1.3-20121023-yocto/build_p5040ds-64b_release/conf

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值