自定义博客皮肤VIP专享

*博客头图:

格式为PNG、JPG,宽度*高度大于1920*100像素,不超过2MB,主视觉建议放在右侧,请参照线上博客头图

请上传大于1920*100像素的图片!

博客底图:

图片格式为PNG、JPG,不超过1MB,可上下左右平铺至整个背景

栏目图:

图片格式为PNG、JPG,图片宽度*高度为300*38像素,不超过0.5MB

主标题颜色:

RGB颜色,例如:#AFAFAF

Hover:

RGB颜色,例如:#AFAFAF

副标题颜色:

RGB颜色,例如:#AFAFAF

自定义博客皮肤

-+
  • 博客(22)
  • 资源 (2)
  • 收藏
  • 关注

原创 Q&A:vfio为何是group粒度的,vfio_container与iommu_domain的关系

vfio为何是group粒度的,而不是device粒度的? vfio group的概念其实继承自iommu group,那问题就转换为iommu的最小隔离单位是如何定义的。

2023-04-30 23:29:04 182

原创 vfio-pci-passthrough (代码分析,已上传PDF:https://download.csdn.net/download/shirleylinyuer/1089846。博客中慢慢添加)

PS:尚未有时间从PDF中整理出来,如着急查看全文版请参考https://download.csdn.net/download/shirleylinyuer/10898465Summary➢ What is VFIO/IOMMU? Why want them?➢ VFIO – qemu part➢ VFIO – kernel part➢ VFIO usage: how to p...

2019-01-05 22:54:53 1157

原创 Qemu: How to create the bridge device, bus, and pci device.

How to create bridge device, bus, and pci device.As we all know, the "device and bus" architecture in qemu is that, a pcidevice should attach to a pci bus, and a pci bus should add to a bridgedevi...

2018-11-05 21:18:32 655

原创 Qemu内存管理代码分析3:guest ram 的初始化及分配

文章根据qemu (tag: v3.0.0-rc1) 的代码讲解,主要讲述函数过程调用,隐去具体细节。一、1. 全局MemoryRegion: system_memory以及system_io的初始化        2. GPA (guest physical address) 与HVA (host virtual address)的公共代码的分析,稍后会分别针对x86_64架构以及s39...

2018-11-01 00:36:53 784

原创 Qemu内存管理主要结构体分析2:MemoryRegion/AddressSpace/FlatView

文章主要分析qemu在guest内存管理中用到的主要结构体MemoryRegion、AddressSpace、FlatView、MemoryListener一、简介1. Multiple types of MemoryRegion (MemoryRegion直接操作内存,每一棵MR树的树根对应一个RAMBlock,其host即为通过mmap()分配的HVA)  - RAM: a rang...

2018-10-31 23:40:37 2168

原创 Qemu内存管理代码分析1:qemu (tag: v3.0.0-rc1) 命令行配置guest ram及machine_class_init的QOM调用

基于qemu (tag: v3.0.0-rc1)的代码分析,本文主要讲述两部分:一、概述qemu命令行配置guest ram (e.g. -m size=?,slot=n,maxmem=??)涉及的主要函数和调用过程二、默认的guest ram配置是在machine_class_init()函数中,代码分析QOM中.class_init()的初始化及调用过程。最后分别给出...

2018-10-31 23:14:33 467

原创 leetcode-653. Two Sum IV - Input is a BST (C语言 中序遍历构造有序int数组)

653. Two Sum IV - Input is a BSTGiven a Binary Search Tree and a target number, return true if there exist two elements in the BST such that their sum is equal to the given target.解法:中序遍历BST树并按照从小...

2018-10-15 19:17:04 266

原创 leetcode-637. Average of Levels in Binary Tree (C语言,层次遍历,队列实现)

637. Average of Levels in Binary TreeMethod:层次遍历,将每一层的所有TreeNode都存储在一个临时队列Queue里面,再循环遍历每一层。用c语言的话需要自己创建队列Queue,即一个Queue中的每个QNode是TreeNode类型的,还要实现它的enQueue操作。/** * Definition for a binary tree nod...

2018-10-15 00:54:15 342

原创 872. Leaf-Similar Trees (C语言,递归)

题目:https://leetcode.com/problems/leaf-similar-trees/description/比较2个BST树的叶子节点是否从左往右一致相同。思路:前序遍历递归,当为叶子结点时赋值给数组。注意点:1.遍历时的传参,传了一个数组及其未来长度的地址(有了长度,意味着下标值也就有了)/** * Definition for a binary tree ...

2018-10-12 00:01:14 252

原创 674. Longest Continuous Increasing Subsequence - C语言

Given an unsorted array of integers, find the length of longest continuous increasing subsequence (subarray).My method:int findLengthOfLCIS(int* nums, int numsSize) {    int i, j, k, cmp;    int...

2018-10-07 19:33:41 168

原创 830. Positions of Large Groups - C语言

830. Positions of Large GroupsIn a string S of lowercase letters, these letters form consecutive groups of the same character.For example, a string like S = "abbxxxxzyy" has the groups "a", "bb", ...

2018-10-02 00:34:33 218

原创 (有部分参考)445. Add Two Numbers II - C语言

445. Add Two Numbers IIYou are given two non-empty linked lists representing two non-negative integers. The most significant digit comes first and each of their nodes contain a single digit. Add the...

2018-09-30 17:45:59 242

原创 Leetcode-206. Reverse Linked List (C语言 头插法)

Reverse a singly linked list.Example:Input: 1->2->3->4->5->NULLOutput: 5->4->3->2->1->NULLMy method/** * Definition for singly-linked list. * struct ListNode ...

2018-09-27 16:49:25 367

原创 Leetcode-468. Validate IP Address (C Language)

Problem: to check whether an input string is a valid IPv4 address or IPv6 address or neither.Tip:要十分注意边界条件,编译了好几次才通过 =.=||代码:int toInt(char tmp[], int len) {    int i;    int sum = 0;    if ...

2018-09-16 02:14:46 300

原创 Leetcode-804. Unique Morse Code Words (C Language)

2018-09-14 14:08:03 282

原创 Leetcode-561. Array Partition I (C Language)

The problem:Given an array of 2n integers, your task is to group these integers into n pairs of integer, say (a1, b1), (a2, b2), ..., (an, bn) which makes sum of min(ai, bi) for all i from 1 to n as...

2018-09-09 14:28:11 198

原创 Leetcode-283. Move Zeroes (C Language)

The Problem: Given an array nums, write a function to move all 0's to the end of it while maintaining the relative order of the non-zero elements.Example:Input: [0,1,0,3,12]Output: [1,3,12,0,0...

2018-09-09 14:06:06 222

原创 Good links for working with Linux

6. 30 Linux System Monitoring Tools Every SysAdmin Should Knowhttps://www.cyberciti.biz/tips/top-linux-monitoring-tools.html5. kprobe/ftrace/tracepoint/trace eventhttps://www.ibm.com/developerw...

2018-05-24 10:51:07 256

原创 How to debug qemu using trace-event?

The following steps is an example to use trace-event (the tracing infrastrucure) to print useful qemu logs.1. git clone git://git.qemu-project.org/qemu.git2. cd qemu3. Make sure you add trace_xxx(args...

2018-05-11 16:13:03 920

原创 Introduce ipmi device emulations via qemu/virsh cmd line for the power management of the hypervisor

Introduce ipmi device emulations for the power management of the hypervisorI. IPMI (intelligent platform maintenance interface)II. Use the qemu & virsh command line as the "startcmd" parameter for...

2018-03-09 11:41:22 1698

原创 QEMU/Libvirt xml/virt-install: Three common ways(virbr0/macvtap/bridge) to add the netdev for the vm

方法一:借助于libvirt自带的virbr0。特征:采用NAT方式,让虚拟机拥有内部IP地址。- 前提:在host上启动‘default’网络设备。如果已经安装了libvirt,会默认在系统中创建一个名为virbr0的bridge以及一个名为default的网络设备。# brctl showbridge name    bridge id        STP enabled    interf...

2018-02-27 16:45:19 975

原创 How to debug qemu and libvirt using gdb

Think about this: you are going to start a virtual machine using qemu command line or libvirt xml or virt-install command line, but fails due to some errors. Now you would like to see what is going on

2018-01-20 18:07:10 550

vfio-pci-passthrough

1. What is VFIO/IOMMU? Why want them? 2. VFIO – qemu part code 3. VFIO – kernel part code 4. VFIO usage: how to passthrough a pci device

2019-01-05

TortoiseSVN

TortoiseSVN可用作备份服务器

2013-03-19

空空如也

TA创建的收藏夹 TA关注的收藏夹

TA关注的人

提示
确定要删除当前文章?
取消 删除