2019-01-01ãã1å¹´éã®è¨äºä¸è¦§
BPFã®ããã°ã©ã ã¿ã¤ãã®ä¸ã¤ã«BPF_PROG_TYPE_RAW_TRACEPOINTãããã¾ã (commit)ï¼ãããå©ç¨ããã¨tracepointã®å¤æåã®å¼æ°ã«ã¢ã¯ã»ã¹ãããã¨ãã§ãã¾ãï¼ ä¾ã¨ãã¦kernel/sched/core.cã§å®ç¾©ãããsched_swtich ã®tracepointãèãã¾ãï¼ trace_sched_sâ¦
kprobeãtracepointãªã©ã«ã¢ã¿ããããBPFããã°ã©ã ã¯ï¼BPF_FUNC_probe_read()é¢æ°ã§ã«ã¼ãã«å ã®ãã¼ã¿æ§é ã«ã¢ã¯ã»ã¹ãããã¨ãã§ãã¾ãï¼ããã¯probe_kernel_read()ã®ã©ããã¼ã§ï¼ããå¤ãªé åã«ã¢ã¯ã»ã¹ãããããå ´åï¼page faultãçºçããå ´åï¼ã¯-Eâ¦
"rust domain socket"ã¨ãã§æ¤ç´¢ããã¨ããããå¼ã£ããããã©ãããããã©ã¤ãã©ãªã®æ´æ°ãæ©ãã¦æ å ±ãå¤ãã£ããããã®ã§ããã«ç¾ç¶ãæ¸ãã¾ãï¼ãã®æç« ãããã«å¤ããªããããããªãã®ã§å¾ããèªã人ã¯æ³¨æãã¦ãã ãã..ï¼ åºæ¬ std::os::unix::net å â¦
rust 1.39ã§async/awaitæ§æãå®å®åããã¾ãï¼ å··ã§è©±é¡ã®æ©è½ã§ããï¼asycn/awaitä½ãåããã...ã¨ãããã¨ã§è©±é¡ã«ä¹ãé ããªãããã«async/awaitãå©ç¨ãã¦echo serverãå®è£ ãã¦ã¿ã¾ãï¼ OSã¯Linuxã対象ã§ãï¼ã½ã¼ã¹ã¯ããã«ããã¾ãï¼ echo server aâ¦
以åIOAPICãMSI/MSI-Xãå©ç¨ããããã¤ã¹ã§x2apicãå©ç¨ããã«ã¯interrupt remapingãå©ç¨ããã¨æ¸ãã¾ããï¼ ä»åå®éã®ãããã³ã°ã調ã¹ããã¨ããã£ãã®ã§ï¼ããã«è¦ç¹ãã¾ã¨ãã¾ãï¼ å³ã¯VT-dã®ããã¥ã¡ã³ãããã®å¼ç¨ã§ãï¼ åæ Interrupt Remappingâ¦
å°ãã¿ï¼ Linuxã§è¤æ°ã®ä»®æ³ãã¼ã¸ãä¸ã¤ã®ç©çãã¼ã¸ã«ãããã³ã°ããæ¹æ³ã§ãï¼ é£ç¶ããä»®æ³ãã¼ã¸ãå ¨ã¦åãç©çãã¼ã¸ã«ãããã³ã°ãããã¨ãããã¨ããã£ã¦ï¼åççã«ã¯ãã¼ã¸ãã¼ãã«ã§åãé åãæãã ãã§ãï¼ã§ãã¦ã¼ã¶ç©ºéããã¯ã©ããããã ã£ãâ¦
AFLã¨ã¯ American Fuzzy Lop (AFL)ã¯ãã¡ã¸ã³ã°ãã¼ã«ã®ä¸ã¤ã§ãï¼ ãã¡ã¸ã³ã°ã¨ã¯ããã°ã©ã ã®èå¼±æ§æ¤æ»ææ³ã®ä¸ã¤ã§ï¼ç°¡åã«è¨ã£ã¦ãã¾ãã°ããããã°ã©ã ãã©ã³ãã ãªå¼æ°ã§å®è¡ãããã¨ãç¹°ãè¿ãã¦ï¼ããã°ã©ã ãã¯ã©ãã·ã¥ãããããªå ¥åãæ¢ããã¨ãâ¦
DIMMã«åºããä¸æ®çºæ§ã¡ã¢ãª(NVDIMM*1 )ã¯ACPIããã©ã®ããã«æ±ããããã¨ããã¡ã¢ï¼ TL;DR ACPIã®NFIT (NVDIMM Firmware Interaface Table)ã«æ å ±ãå ¥ã£ã¦ãã¾ãï¼ QEMUã§ã®ã¨ãã¥ã¬ã¼ã·ã§ã³ QEMUã®NVDIMMã¨ãã¥ã¬ã¼ã·ã§ã³ã§ç¢ºèªãã¾ãï¼ https://github.coâ¦
HAXM (Hardware Accelerated Execution Manager)ã¯Intelãä½æãã¦ãããã¤ãã¼ãã¤ã¶ã§ãï¼ãã¨ã¯Android Emulatorã®ããã¯ã¨ã³ãã¨ãã¦éçºãéå§ããããã®ã®ããã§ãï¼ ä»¥ä¸ã®ãããªç¹å¾´ãããã¾ãï¼ KVMã®ãããªã¤ã³ã¿ãã§ã¼ã¹ QEMUã®ãµãã¼ã ã¯ãã¹ãâ¦
KVMã«ã¯ããã¤ãæºä»®æ³åã¤ã³ã¿ãã§ã¼ã¹ãåå¨ãã¾ãï¼ KVMã¯HWã«ããä»®æ³åæ¯æ´æ©æ§ãå©ç¨ãã¦ã²ã¹ããå®è¡ããã®ã§ï¼æºä»®æ³åæ©è½ã使ç¨ããªãã¦ãä»»æã®OSãå®è¡ã§ãã¾ããï¼æºä»®æ³åæ©è½ãå©ç¨ãããã¨ã§VMã®ããã©ã¼ãã³ã¹ãåä¸ã§ããå ´åãããã¾ãï¼â¦
åæ x86/Intelã®è©±ã§ãï¼AMDã§ãå¤ååæ§ï¼ cpuidå½ä»¤ã®åãæ±ã cpuidå½ä»¤ã¯KVMå ã§å¦çããã¾ãï¼ å ·ä½çã«ã¯ arch/x86/kvm/vmx.c:handle_cpuid() => arch/x86/kvm/cpuid.c:kvm_emulate_cpuid() => arch/x86/kvm/cpuid.c:kvm_cpuid() => arch/x86/kvm/cpuâ¦
é¢é£ãããã¬ã¤ã Iterator libcore/iter/traits/itetarot.rs pub trait Iterator { type Item; fn next(&mut self) -> Option<Self::Item>; ... } ã¤ãã¬ã¼ã¿ã®é¢æ°ã®ããã®ãã¬ã¤ã next()ããå®è£ ããã°ï¼ãã¨ã¯ããã©ã«ãå®ç¾©ãåå¨ IntoIterator libcore/iter/trait</self::item>â¦
åå 以ä¸ã§å©ç¨ããplaygroundã®ãªã³ã¯ ã¹ã©ã¤ã¹ããã®Arcã®ä½æ Arcã®ã½ã¼ã¹ãã¿ã¦ãã¦æ°ã¥ãã¾ãããï¼impl<T: Clone> From<&[T]> for Arc<[T]>ãªã©ãå®è£ ããã¦ããï¼Copyãããã¯Cloneãå®è£ ããã¦ããã¹ã©ã¤ã¹ããArcãä½æãããã¨ãã§ãã¾ãï¼ï¼RCãåæ§ã§ãï¼</t:>â¦
ååã«å¼ãç¶ãï¼ä»åº¦ã¯Mutexã®è©±ã§ãï¼ Raph Levienæ°ã®å³ãå¼ç¨ããã¨ï¼Mutexã¯ä»¥ä¸ã®ãããªæ§é ã«ãªã£ã¦ãã¾ãï¼ Raph Levien, Copyright 2017 Google Inc., released under Creative Commons BY ã¾ãï¼ãã¼ã¿æ§é ã¨ãã¦ã¯ä»¥ä¸ã®ããã«å®ç¾©ããã¦ãã¾ãï¼â¦
rustã®ã¹ãã¼ããã¤ã³ã¿ã®æ§æã«ã¤ãã¦ã¯ï¼Raph Levienæ°ã®ä»¥ä¸ã®å³ãåèã«ãªãã¾ãï¼ Rust container cheat sheet ä»åã¯ããã§ç¹ã«Arcã«ã¤ãã¦è¦ã¦ããããã¨æãã¾ãï¼ Arcã¯ä»¥ä¸ã®ããã«å®ç¾©ããã¦ãã¾ãï¼ä¸é¨æç²ï¼ï¼ pub struct Arc<T: ?Sized> { ptr: NonNull<ArcInner<T>></arcinner<t></t:>â¦
åå説æããããã«ï¼KVMã§ã¯ï¼ã²ã¹ãã®ãã¤ãã¼ã³ã¼ã«ï¼Intel CPUã®å ´åã¯VMCALLå½ä»¤ï¼AMDã®å ´åã¯VMMCALLå½ä»¤ï¼ã¯KVMå´ã§å¦çããï¼ioctlå´ã«æ»ããã¨ãªãã²ã¹ãã«æ»ãã¾ãï¼ QEMU/KVMã«ããã¦ï¼ç¬èªã«ãã¤ãã¼ã³ã¼ã«ã追å ãã¦QEMUå´ã§å¦çããã«ã¯ä¿®æ£ãâ¦
主ã«ã¤ãã³ãã«ã¼ãã¨KVMå¨ãï¼ QEMU v3.1.0 Linux v4.20 ã¿ã¼ã²ãã: x86 QEMU Main Loop QEMUã®ä¸»å¦çã¯GLibã使ã£ãã¤ãã³ãã«ã¼ãï¼ ã²ã¹ãã®vCPUã¯å¥ã®ã¹ã¬ããã§å®è¡ï¼å¾è¿°ï¼ vl.c:main() => vl.c:main_loop() => util/main-loop.c:main_loop_wait() =â¦