<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom">
  <channel>
    <title>tobyjiang</title>
    <description>个人博客</description>
    <link>https://frankjkl.github.io/</link>
    <atom:link href="https://frankjkl.github.io/feed.xml" rel="self" type="application/rss+xml"/>
    <pubDate>Mon, 08 Apr 2019 03:05:18 +0000</pubDate>
    <lastBuildDate>Mon, 08 Apr 2019 03:05:18 +0000</lastBuildDate>
    <generator>Jekyll v3.7.4</generator>
    
      <item>
        <title>KVM同步脏页位图到Qemu</title>
        <description>本篇文章基于qemu2.6.0，Linux3.10.0内核，x86体系结构。Qemu与KVM同步脏页位图主要分为Qemu与KVM两部分，我们先来看看Qemu部分。

</description>
        <pubDate>Sun, 07 Apr 2019 00:00:00 +0000</pubDate>
        <link>https://frankjkl.github.io/2019/04/07/QemuKVM-Qemu%E5%90%8C%E6%AD%A5KVM%E8%84%8F%E9%A1%B5%E4%BD%8D%E5%9B%BE/</link>
        <guid isPermaLink="true">https://frankjkl.github.io/2019/04/07/QemuKVM-Qemu%E5%90%8C%E6%AD%A5KVM%E8%84%8F%E9%A1%B5%E4%BD%8D%E5%9B%BE/</guid>
        
        <category>Qemu</category>
        
        <category>KVM</category>
        
        <category>脏页位图</category>
        
        
        <category>热迁移</category>
        
      </item>
    
      <item>
        <title>Linux内核的引导启动</title>
        <description>
Linux内核启动流程分为如下几个阶段：

&lt;ol&gt;
  &lt;li&gt;BIOS启动阶段&lt;/li&gt;
  &lt;li&gt;实模式setup阶段&lt;/li&gt;
  &lt;li&gt;保护模式 startup_32&lt;/li&gt;
  &lt;li&gt;内核启动start_kernel()&lt;/li&gt;
  &lt;li&gt;内核启动时的参数传递&lt;/li&gt;
&lt;/ol&gt;

下面我们一一进行分析。阅读整篇文章的同时，可以参考内核源代码文档 Documentation\i386\boot.txt。本篇文章基于Linux 2.6.24

</description>
        <pubDate>Tue, 12 Mar 2019 00:00:00 +0000</pubDate>
        <link>https://frankjkl.github.io/2019/03/12/Linux%E5%86%85%E6%A0%B8-%E5%BC%95%E5%AF%BC%E5%90%AF%E5%8A%A8/</link>
        <guid isPermaLink="true">https://frankjkl.github.io/2019/03/12/Linux%E5%86%85%E6%A0%B8-%E5%BC%95%E5%AF%BC%E5%90%AF%E5%8A%A8/</guid>
        
        <category>smp</category>
        
        <category>系统引导和初始化</category>
        
        
        <category>Linux内核</category>
        
      </item>
    
      <item>
        <title>SMP系统的引导</title>
        <description>
本篇文章基于Linux 2.6.32，x86体系结构

系统的引导和初始化阶段是个特例，因为在这个阶段里系统中只有一个“上下文”，只能由一个处理器来处理。在这个阶段里，也就是在系统刚加电或“总清（reset）”之后，系统中暂时只有一个处理器运行，这个处理器称之为“&lt;strong&gt;引导处理器&lt;/strong&gt;”BP；其余的处理器则处于暂停状态，称为&lt;strong&gt;“应用处理器”AP&lt;/strong&gt;。“引导处理器”完成整个系统的引导和初始化，并创建起多个进程，从而可以由多个处理器同时参与处理时，才启动所有的“应用处理器”，让他们完成自身的初始化以后，投入运行。参考intel手册：

&lt;blockquote&gt;
  The MP initialization protocol defines two classes of processors: the bootstrap processor (BSP) and the application processors (APs). Following a power-up or RESET of an MP system, system hardware dynamically selects one of the processors on the system bus as the BSP. The remaining processors are designated as APs.
&lt;/blockquote&gt;

我们在这里关心的是“引导处理器”怎样为各个“应用处理器”做好准备，然后启动其运行的过程。

</description>
        <pubDate>Sun, 10 Mar 2019 00:00:00 +0000</pubDate>
        <link>https://frankjkl.github.io/2019/03/10/Linux%E5%86%85%E6%A0%B8-SMP%E7%B3%BB%E7%BB%9F%E7%9A%84%E5%BC%95%E5%AF%BC/</link>
        <guid isPermaLink="true">https://frankjkl.github.io/2019/03/10/Linux%E5%86%85%E6%A0%B8-SMP%E7%B3%BB%E7%BB%9F%E7%9A%84%E5%BC%95%E5%AF%BC/</guid>
        
        <category>smp</category>
        
        <category>系统引导和初始化</category>
        
        
        <category>Linux内核</category>
        
      </item>
    
      <item>
        <title>smp_processor_id()获取当前执行cpuid</title>
        <description>基于Linux 2.6.32内核进行分析，看本篇文章前，建议先看看&lt;a href=&quot;https://frankjkl.github.io/2019/03/08/Linux%E5%86%85%E6%A0%B8-percpu%E5%8F%98%E9%87%8F/&quot;&gt;percpu变量&lt;/a&gt;这篇文章

smp_processor_id()用来获取当前cpu的id，首先来看smp_processor_id的定义：

&lt;div class=&quot;language-c highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;&lt;span class=&quot;cp&quot;&gt;# define smp_processor_id() raw_smp_processor_id()
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

接下来：

&lt;div class=&quot;language-c highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;&lt;span class=&quot;cp&quot;&gt;#define raw_smp_processor_id() (percpu_read(cpu_number))
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

</description>
        <pubDate>Sat, 09 Mar 2019 00:00:00 +0000</pubDate>
        <link>https://frankjkl.github.io/2019/03/09/Linux%E5%86%85%E6%A0%B8-smp_processor_id/</link>
        <guid isPermaLink="true">https://frankjkl.github.io/2019/03/09/Linux%E5%86%85%E6%A0%B8-smp_processor_id/</guid>
        
        <category>smp_processor_id</category>
        
        <category>percpu变量</category>
        
        
        <category>Linux内核</category>
        
      </item>
    
      <item>
        <title>同步与互斥_percpu变量</title>
        <description>本篇文章基于Linux 2.6.24

percpu变量的关键就是：&lt;strong&gt;要求根据CPU的个数，在内存中生成多份拷贝，并且能够根据变量名和CPU编号，正确的对各个CPU的变量进行寻址。&lt;/strong&gt;

采用per-cpu变量有下列好处：所需数据很可能存在于处理器的缓存中，因此可以更快速地访问。如果在多处理器系统中多个CPU可能同时访问变量，会引发一些通信方面的问题，采用percpu变量恰好规避了这个问题。

</description>
        <pubDate>Fri, 08 Mar 2019 00:00:00 +0000</pubDate>
        <link>https://frankjkl.github.io/2019/03/08/Linux%E5%86%85%E6%A0%B8-percpu%E5%8F%98%E9%87%8F/</link>
        <guid isPermaLink="true">https://frankjkl.github.io/2019/03/08/Linux%E5%86%85%E6%A0%B8-percpu%E5%8F%98%E9%87%8F/</guid>
        
        <category>同步与互斥</category>
        
        <category>percpu变量</category>
        
        
        <category>Linux内核</category>
        
      </item>
    
      <item>
        <title>在Jekyll博客添加gitment评论系统</title>
        <description>&lt;ul id=&quot;markdown-toc&quot;&gt;
  &lt;li&gt;&lt;a href=&quot;#1在setting---oauth-application-注册页面完成注册&quot; id=&quot;markdown-toc-1在setting---oauth-application-注册页面完成注册&quot;&gt;1、在setting - OAuth Application 注册页面完成注册&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;
本文章转载于http://xichen.pub/2018/01/31/2018-01-31-gitment/，并在其基础上进行完善

&lt;h2 id=&quot;1在setting---oauth-application-注册页面完成注册&quot;&gt;1、在&lt;a href=&quot;https://github.com/settings/applications/new&quot;&gt;setting - OAuth Application 注册页面&lt;/a&gt;完成注册&lt;/h2&gt;

&lt;div class=&quot;highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;Application Name: gitment评论 //随便填
Homepage Url: https://frankjkl.github.io //博客的域名
Application description: //随便填，留空也可以
Authorization Callback URL: https://frankjkl.github.io //一定要写自己Github Pages的URL
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

注册成功后会得到&lt;code class=&quot;highlighter-rouge&quot;&gt;Client ID&lt;/code&gt;和&lt;code class=&quot;highlighter-rouge&quot;&gt;Client Secret&lt;/code&gt;

</description>
        <pubDate>Tue, 08 Jan 2019 00:00:00 +0000</pubDate>
        <link>https://frankjkl.github.io/2019/01/08/blogbuild-%E5%9C%A8Jekyll%E5%8D%9A%E5%AE%A2%E6%B7%BB%E5%8A%A0gitment%E8%AF%84%E8%AE%BA%E7%B3%BB%E7%BB%9F/</link>
        <guid isPermaLink="true">https://frankjkl.github.io/2019/01/08/blogbuild-%E5%9C%A8Jekyll%E5%8D%9A%E5%AE%A2%E6%B7%BB%E5%8A%A0gitment%E8%AF%84%E8%AE%BA%E7%B3%BB%E7%BB%9F/</guid>
        
        <category>Gitment</category>
        
        
        <category>博客构建</category>
        
      </item>
    
      <item>
        <title>MMIO Emulation</title>
        <description>&lt;ul id=&quot;markdown-toc&quot;&gt;
  &lt;li&gt;&lt;a href=&quot;#mmio地址引起的ept退出&quot; id=&quot;markdown-toc-mmio地址引起的ept退出&quot;&gt;MMIO地址引起的EPT退出&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;h1 id=&quot;mmio地址引起的ept退出&quot;&gt;MMIO地址引起的EPT退出&lt;/h1&gt;

MMIO是通过设置spte的保留位来标志的。虚拟机内部第一次访问MMIO的gpa时，发生了EPT_VIOLATION然后check gpa发现对应的pfn不存在（QEMU没有注册），那么认为这是个MMIO，于是set_mmio_spte来标志它的spte是一个MMIO。后面再次访问这个gpa时就发生EPT_MISCONFIG了，进而愉快地调用handle_ept_misconfig -&amp;gt; handle_mmio_page_fault -&amp;gt; x86_emulate_instruction 来处理所有的MMIO操作了。

handle_ept_violation-&amp;gt;kvm_mmu_page_fault-&amp;gt;handle_mmio_page_fault

</description>
        <pubDate>Mon, 07 Jan 2019 00:00:00 +0000</pubDate>
        <link>https://frankjkl.github.io/2019/01/07/MMIO-Emulation/</link>
        <guid isPermaLink="true">https://frankjkl.github.io/2019/01/07/MMIO-Emulation/</guid>
        
        <category>MMIO</category>
        
        <category>EPT</category>
        
        
        <category>Qemu-KVM</category>
        
      </item>
    
      <item>
        <title>同步一个 fork</title>
        <description>
fork 了别人的仓库后，原作者又更新了仓库，如何将自己的代码和原仓库保持一致？本文将给你解答。

</description>
        <pubDate>Sun, 12 Apr 2015 15:14:54 +0000</pubDate>
        <link>https://frankjkl.github.io/2015/04/12/Syncing-a-fork/</link>
        <guid isPermaLink="true">https://frankjkl.github.io/2015/04/12/Syncing-a-fork/</guid>
        
        <category>GitHub</category>
        
        <category>同步</category>
        
        <category>fork</category>
        
        
        <category>GitHub</category>
        
      </item>
    
      <item>
        <title>Jekyll 搭建静态博客</title>
        <description>
一直以来都想搭建一个自己的博客，但是近半年做项目太忙，再加上教研室的网络很坑爹，所以也一直没顾得上。之前用过 WordPress 托管在免费的京东云擎上，但是速度太慢。在知乎上看到一些相关的内容，于是选择了在github上用jekyll搭建博客。

</description>
        <pubDate>Sun, 15 Feb 2015 22:14:54 +0000</pubDate>
        <link>https://frankjkl.github.io/2015/02/15/create-my-blog-with-jekyll/</link>
        <guid isPermaLink="true">https://frankjkl.github.io/2015/02/15/create-my-blog-with-jekyll/</guid>
        
        <category>jekyll</category>
        
        <category>RubyGems</category>
        
        
        <category>jekyll</category>
        
      </item>
    
  </channel>
</rss>
