QEMU源码全解析 —— 内存虚拟化(2)

接前一篇文章:

本文内容参考:

《趣谈Linux操作系统》 —— 刘超,极客时间

《QEMU/KVM》源码解析与应用 —— 李强,机械工业出版社

QEMU内存管理模型

特此致谢!

QEMU内存初始化

1. 基本结构

在开始介绍内存初始化的时候,首先需要对QEMU中几个与内存相关的数据结构进行介绍。

(1)AddressSpace

首先是AddressSpace结构。AddressSpace结构用来表示一个虚拟机或者虚拟CPU能够访问的所有物理地址。注意,这里的“访问”和“能够访问”并不是一回事。与进程的地址空间一样,一个进程的虚拟地址空间为4GB(32位),但这并不是说操作系统需要为进程分配这么大的空间。同样,QEMU中的AddressSpace表示的是一段地址空间,整个系统可以有一个全局的地址空间,CPU可以有自己的地址空间视角,设备也可以有自己的地址空间视角。

AddressSpace的意义从名字就可以看出,是针对整个地址空间,最顶层的内存管理结构。对于x86架构来说,其实是有两种寻址方式的,一种是memory一种是IO。相应的QEMU会维护两个AddressSpace结构,address_space_memory和address_space_io。

AddressSpace的定义在include/qemu/typedefs.h中,如下:

typedef struct AddressSpace AddressSpace;

而struct AddressSpace的定义在include/exec/memory.h中,代码如下:

/*** struct AddressSpace: describes a mapping of addresses to #MemoryRegion objects*/
struct AddressSpace {/* private: */struct rcu_head rcu;char *name;MemoryRegion *root;/* Accessed via RCU.  */struct FlatView *current_map;int ioeventfd_nb;struct MemoryRegionIoeventfd *ioeventfds;QTAILQ_HEAD(, MemoryListener) listeners;QTAILQ_ENTRY(AddressSpace) address_spaces_link;
};

根据struct AddressSpace的注释,此结构描述了一个到MemoryRegion对象的地址映射。

其中:

  • MemoryRegion *root成员表示AddressSpace对应的一个根MemoryRegion。
  • struct FlatView *current_map成员表示该地址空间是一个平坦模式下的视图。
  • QEMU的其它子系统可以注册地址变更的事件,所有注册的信息都通过QTAILQ_HEAD(, MemoryListener) listeners成员连接起来。
  • 所有的AddressSpace通过address_spaces_link这个node连接起来(QTAILQ_ENTRY(AddressSpace) address_spaces_link),链表头是address_spaces。

AddressSpace的定义其实比较简单,有两个QEMU内存管理框架的核心结构,就是MemoryRegion和FlatView,两者配合使用,MemoryRegion是基础(MemoryRegion),用于正向管理;Flatview用于反向查找。

对于一个地址空间(AddressSpace),会有多个内存区域(MemoryRegion)组成树型结构。这其中,root是这棵树的根。另外,还有一个MemoryListener链表,当内存区域发生变化的时候,需要做一些动作,使得用户态和内核态能够协同,就是由这些MemoryListener来完成的。

在QEMU monitor中输入“info qtree”,可以看到所有的AddressSpace,如下所示:

$ qemu-system-x86_64 -vnc :1 -monitor stdio
QEMU 6.2.0 monitor - type 'help' for more information
(qemu) info mtree
address-space: memory0000000000000000-ffffffffffffffff (prio 0, i/o): system0000000000000000-0000000007ffffff (prio 0, ram): alias ram-below-4g @pc.ram 0000000000000000-0000000007ffffff0000000000000000-ffffffffffffffff (prio -1, i/o): pci00000000000a0000-00000000000bffff (prio 1, i/o): vga-lowmem00000000000c0000-00000000000dffff (prio 1, rom): pc.rom00000000000e0000-00000000000fffff (prio 1, rom): alias isa-bios @pc.bios 0000000000020000-000000000003ffff00000000fd000000-00000000fdffffff (prio 1, ram): vga.vram00000000feb80000-00000000feb9ffff (prio 1, i/o): e1000-mmio00000000febb0000-00000000febb0fff (prio 1, i/o): vga.mmio00000000febb0000-00000000febb017f (prio 0, i/o): edid00000000febb0400-00000000febb041f (prio 0, i/o): vga ioports remapped00000000febb0500-00000000febb0515 (prio 0, i/o): bochs dispi interface00000000febb0600-00000000febb0607 (prio 0, i/o): qemu extended regs00000000fffc0000-00000000ffffffff (prio 0, rom): pc.bios00000000000a0000-00000000000bffff (prio 1, i/o): alias smram-region @pci 00000000000a0000-00000000000bffff00000000000c0000-00000000000c3fff (prio 1, ram): alias pam-rom @pc.ram 00000000000c0000-00000000000c3fff00000000000c4000-00000000000c7fff (prio 1, ram): alias pam-rom @pc.ram 00000000000c4000-00000000000c7fff00000000000c8000-00000000000cbfff (prio 1, ram): alias pam-rom @pc.ram 00000000000c8000-00000000000cbfff00000000000cb000-00000000000cdfff (prio 1000, ram): alias kvmvapic-rom @pc.ram 00000000000cb000-00000000000cdfff00000000000cc000-00000000000cffff (prio 1, ram): alias pam-rom @pc.ram 00000000000cc000-00000000000cffff00000000000d0000-00000000000d3fff (prio 1, ram): alias pam-rom @pc.ram 00000000000d0000-00000000000d3fff00000000000d4000-00000000000d7fff (prio 1, ram): alias pam-rom @pc.ram 00000000000d4000-00000000000d7fff00000000000d8000-00000000000dbfff (prio 1, ram): alias pam-rom @pc.ram 00000000000d8000-00000000000dbfff00000000000dc000-00000000000dffff (prio 1, ram): alias pam-rom @pc.ram 00000000000dc000-00000000000dffff00000000000e0000-00000000000e3fff (prio 1, ram): alias pam-rom @pc.ram 00000000000e0000-00000000000e3fff00000000000e4000-00000000000e7fff (prio 1, ram): alias pam-rom @pc.ram 00000000000e4000-00000000000e7fff00000000000e8000-00000000000ebfff (prio 1, ram): alias pam-ram @pc.ram 00000000000e8000-00000000000ebfff00000000000ec000-00000000000effff (prio 1, ram): alias pam-ram @pc.ram 00000000000ec000-00000000000effff00000000000f0000-00000000000fffff (prio 1, ram): alias pam-rom @pc.ram 00000000000f0000-00000000000fffff00000000fec00000-00000000fec00fff (prio 0, i/o): ioapic00000000fed00000-00000000fed003ff (prio 0, i/o): hpet00000000fee00000-00000000feefffff (prio 4096, i/o): apic-msiaddress-space: I/O0000000000000000-000000000000ffff (prio 0, i/o): io0000000000000000-0000000000000007 (prio 0, i/o): dma-chan0000000000000008-000000000000000f (prio 0, i/o): dma-cont0000000000000020-0000000000000021 (prio 0, i/o): pic0000000000000040-0000000000000043 (prio 0, i/o): pit0000000000000060-0000000000000060 (prio 0, i/o): i8042-data0000000000000061-0000000000000061 (prio 0, i/o): pcspk0000000000000064-0000000000000064 (prio 0, i/o): i8042-cmd0000000000000070-0000000000000071 (prio 0, i/o): rtc0000000000000070-0000000000000070 (prio 0, i/o): rtc-index000000000000007e-000000000000007f (prio 0, i/o): kvmvapic0000000000000080-0000000000000080 (prio 0, i/o): ioport800000000000000081-0000000000000083 (prio 0, i/o): dma-page0000000000000087-0000000000000087 (prio 0, i/o): dma-page0000000000000089-000000000000008b (prio 0, i/o): dma-page000000000000008f-000000000000008f (prio 0, i/o): dma-page0000000000000092-0000000000000092 (prio 0, i/o): port9200000000000000a0-00000000000000a1 (prio 0, i/o): pic00000000000000b2-00000000000000b3 (prio 0, i/o): apm-io00000000000000c0-00000000000000cf (prio 0, i/o): dma-chan00000000000000d0-00000000000000df (prio 0, i/o): dma-cont00000000000000f0-00000000000000f0 (prio 0, i/o): ioportF00000000000000170-0000000000000177 (prio 0, i/o): ide00000000000001ce-00000000000001d1 (prio 0, i/o): vbe00000000000001f0-00000000000001f7 (prio 0, i/o): ide0000000000000376-0000000000000376 (prio 0, i/o): ide0000000000000378-000000000000037f (prio 0, i/o): parallel00000000000003b4-00000000000003b5 (prio 0, i/o): vga00000000000003ba-00000000000003ba (prio 0, i/o): vga00000000000003c0-00000000000003cf (prio 0, i/o): vga00000000000003d4-00000000000003d5 (prio 0, i/o): vga00000000000003da-00000000000003da (prio 0, i/o): vga00000000000003f1-00000000000003f5 (prio 0, i/o): fdc00000000000003f6-00000000000003f6 (prio 0, i/o): ide00000000000003f7-00000000000003f7 (prio 0, i/o): fdc00000000000003f8-00000000000003ff (prio 0, i/o): serial00000000000004d0-00000000000004d0 (prio 0, i/o): elcr00000000000004d1-00000000000004d1 (prio 0, i/o): elcr0000000000000510-0000000000000511 (prio 0, i/o): fwcfg0000000000000514-000000000000051b (prio 0, i/o): fwcfg.dma0000000000000600-000000000000063f (prio 0, i/o): piix4-pm0000000000000600-0000000000000603 (prio 0, i/o): acpi-evt0000000000000604-0000000000000605 (prio 0, i/o): acpi-cnt0000000000000608-000000000000060b (prio 0, i/o): acpi-tmr0000000000000700-000000000000073f (prio 0, i/o): pm-smbus0000000000000cf8-0000000000000cfb (prio 0, i/o): pci-conf-idx0000000000000cf9-0000000000000cf9 (prio 1, i/o): piix3-reset-control0000000000000cfc-0000000000000cff (prio 0, i/o): pci-conf-data0000000000005658-0000000000005658 (prio 0, i/o): vmport000000000000ae00-000000000000ae17 (prio 0, i/o): acpi-pci-hotplug000000000000af00-000000000000af1f (prio 0, i/o): acpi-cpu-hotplug000000000000afe0-000000000000afe3 (prio 0, i/o): acpi-gpe0000000000000c000-000000000000c03f (prio 1, i/o): e1000-io000000000000c040-000000000000c04f (prio 1, i/o): piix-bmdma-container000000000000c040-000000000000c043 (prio 0, i/o): piix-bmdma000000000000c044-000000000000c047 (prio 0, i/o): bmdma000000000000c048-000000000000c04b (prio 0, i/o): piix-bmdma000000000000c04c-000000000000c04f (prio 0, i/o): bmdmaaddress-space: cpu-memory-00000000000000000-ffffffffffffffff (prio 0, i/o): system0000000000000000-0000000007ffffff (prio 0, ram): alias ram-below-4g @pc.ram 0000000000000000-0000000007ffffff0000000000000000-ffffffffffffffff (prio -1, i/o): pci00000000000a0000-00000000000bffff (prio 1, i/o): vga-lowmem00000000000c0000-00000000000dffff (prio 1, rom): pc.rom00000000000e0000-00000000000fffff (prio 1, rom): alias isa-bios @pc.bios 0000000000020000-000000000003ffff00000000fd000000-00000000fdffffff (prio 1, ram): vga.vram00000000feb80000-00000000feb9ffff (prio 1, i/o): e1000-mmio00000000febb0000-00000000febb0fff (prio 1, i/o): vga.mmio00000000febb0000-00000000febb017f (prio 0, i/o): edid00000000febb0400-00000000febb041f (prio 0, i/o): vga ioports remapped00000000febb0500-00000000febb0515 (prio 0, i/o): bochs dispi interface00000000febb0600-00000000febb0607 (prio 0, i/o): qemu extended regs00000000fffc0000-00000000ffffffff (prio 0, rom): pc.bios00000000000a0000-00000000000bffff (prio 1, i/o): alias smram-region @pci 00000000000a0000-00000000000bffff00000000000c0000-00000000000c3fff (prio 1, ram): alias pam-rom @pc.ram 00000000000c0000-00000000000c3fff00000000000c4000-00000000000c7fff (prio 1, ram): alias pam-rom @pc.ram 00000000000c4000-00000000000c7fff00000000000c8000-00000000000cbfff (prio 1, ram): alias pam-rom @pc.ram 00000000000c8000-00000000000cbfff00000000000cb000-00000000000cdfff (prio 1000, ram): alias kvmvapic-rom @pc.ram 00000000000cb000-00000000000cdfff00000000000cc000-00000000000cffff (prio 1, ram): alias pam-rom @pc.ram 00000000000cc000-00000000000cffff00000000000d0000-00000000000d3fff (prio 1, ram): alias pam-rom @pc.ram 00000000000d0000-00000000000d3fff00000000000d4000-00000000000d7fff (prio 1, ram): alias pam-rom @pc.ram 00000000000d4000-00000000000d7fff00000000000d8000-00000000000dbfff (prio 1, ram): alias pam-rom @pc.ram 00000000000d8000-00000000000dbfff00000000000dc000-00000000000dffff (prio 1, ram): alias pam-rom @pc.ram 00000000000dc000-00000000000dffff00000000000e0000-00000000000e3fff (prio 1, ram): alias pam-rom @pc.ram 00000000000e0000-00000000000e3fff00000000000e4000-00000000000e7fff (prio 1, ram): alias pam-rom @pc.ram 00000000000e4000-00000000000e7fff00000000000e8000-00000000000ebfff (prio 1, ram): alias pam-ram @pc.ram 00000000000e8000-00000000000ebfff00000000000ec000-00000000000effff (prio 1, ram): alias pam-ram @pc.ram 00000000000ec000-00000000000effff00000000000f0000-00000000000fffff (prio 1, ram): alias pam-rom @pc.ram 00000000000f0000-00000000000fffff00000000fec00000-00000000fec00fff (prio 0, i/o): ioapic00000000fed00000-00000000fed003ff (prio 0, i/o): hpet00000000fee00000-00000000feefffff (prio 4096, i/o): apic-msiaddress-space: cpu-smm-00000000000000000-ffffffffffffffff (prio 0, i/o): memory0000000000000000-00000000ffffffff (prio 1, i/o): alias smram @smram 0000000000000000-00000000ffffffff0000000000000000-ffffffffffffffff (prio 0, i/o): alias memory @system 0000000000000000-ffffffffffffffffaddress-space: i440FX0000000000000000-ffffffffffffffff (prio 0, i/o): bus master containeraddress-space: PIIX30000000000000000-ffffffffffffffff (prio 0, i/o): bus master containeraddress-space: VGA0000000000000000-ffffffffffffffff (prio 0, i/o): bus master containeraddress-space: e10000000000000000000-ffffffffffffffff (prio 0, i/o): bus master container0000000000000000-ffffffffffffffff (prio 0, i/o): alias bus master @system 0000000000000000-ffffffffffffffffaddress-space: piix3-ide0000000000000000-ffffffffffffffff (prio 0, i/o): bus master containeraddress-space: PIIX4_PM0000000000000000-ffffffffffffffff (prio 0, i/o): bus master containermemory-region: pc.ram0000000000000000-0000000007ffffff (prio 0, ram): pc.rammemory-region: pc.bios00000000fffc0000-00000000ffffffff (prio 0, rom): pc.biosmemory-region: pci0000000000000000-ffffffffffffffff (prio -1, i/o): pci00000000000a0000-00000000000bffff (prio 1, i/o): vga-lowmem00000000000c0000-00000000000dffff (prio 1, rom): pc.rom00000000000e0000-00000000000fffff (prio 1, rom): alias isa-bios @pc.bios 0000000000020000-000000000003ffff00000000fd000000-00000000fdffffff (prio 1, ram): vga.vram00000000feb80000-00000000feb9ffff (prio 1, i/o): e1000-mmio00000000febb0000-00000000febb0fff (prio 1, i/o): vga.mmio00000000febb0000-00000000febb017f (prio 0, i/o): edid00000000febb0400-00000000febb041f (prio 0, i/o): vga ioports remapped00000000febb0500-00000000febb0515 (prio 0, i/o): bochs dispi interface00000000febb0600-00000000febb0607 (prio 0, i/o): qemu extended regs00000000fffc0000-00000000ffffffff (prio 0, rom): pc.biosmemory-region: smram0000000000000000-00000000ffffffff (prio 0, i/o): smram00000000000a0000-00000000000bffff (prio 0, ram): alias smram-low @pc.ram 00000000000a0000-00000000000bffffmemory-region: system0000000000000000-ffffffffffffffff (prio 0, i/o): system0000000000000000-0000000007ffffff (prio 0, ram): alias ram-below-4g @pc.ram 0000000000000000-0000000007ffffff0000000000000000-ffffffffffffffff (prio -1, i/o): pci00000000000a0000-00000000000bffff (prio 1, i/o): vga-lowmem00000000000c0000-00000000000dffff (prio 1, rom): pc.rom00000000000e0000-00000000000fffff (prio 1, rom): alias isa-bios @pc.bios 0000000000020000-000000000003ffff00000000fd000000-00000000fdffffff (prio 1, ram): vga.vram00000000feb80000-00000000feb9ffff (prio 1, i/o): e1000-mmio00000000febb0000-00000000febb0fff (prio 1, i/o): vga.mmio00000000febb0000-00000000febb017f (prio 0, i/o): edid00000000febb0400-00000000febb041f (prio 0, i/o): vga ioports remapped00000000febb0500-00000000febb0515 (prio 0, i/o): bochs dispi interface00000000febb0600-00000000febb0607 (prio 0, i/o): qemu extended regs00000000fffc0000-00000000ffffffff (prio 0, rom): pc.bios00000000000a0000-00000000000bffff (prio 1, i/o): alias smram-region @pci 00000000000a0000-00000000000bffff00000000000c0000-00000000000c3fff (prio 1, ram): alias pam-rom @pc.ram 00000000000c0000-00000000000c3fff00000000000c4000-00000000000c7fff (prio 1, ram): alias pam-rom @pc.ram 00000000000c4000-00000000000c7fff00000000000c8000-00000000000cbfff (prio 1, ram): alias pam-rom @pc.ram 00000000000c8000-00000000000cbfff00000000000cb000-00000000000cdfff (prio 1000, ram): alias kvmvapic-rom @pc.ram 00000000000cb000-00000000000cdfff00000000000cc000-00000000000cffff (prio 1, ram): alias pam-rom @pc.ram 00000000000cc000-00000000000cffff00000000000d0000-00000000000d3fff (prio 1, ram): alias pam-rom @pc.ram 00000000000d0000-00000000000d3fff00000000000d4000-00000000000d7fff (prio 1, ram): alias pam-rom @pc.ram 00000000000d4000-00000000000d7fff00000000000d8000-00000000000dbfff (prio 1, ram): alias pam-rom @pc.ram 00000000000d8000-00000000000dbfff00000000000dc000-00000000000dffff (prio 1, ram): alias pam-rom @pc.ram 00000000000dc000-00000000000dffff00000000000e0000-00000000000e3fff (prio 1, ram): alias pam-rom @pc.ram 00000000000e0000-00000000000e3fff00000000000e4000-00000000000e7fff (prio 1, ram): alias pam-rom @pc.ram 00000000000e4000-00000000000e7fff00000000000e8000-00000000000ebfff (prio 1, ram): alias pam-ram @pc.ram 00000000000e8000-00000000000ebfff00000000000ec000-00000000000effff (prio 1, ram): alias pam-ram @pc.ram 00000000000ec000-00000000000effff00000000000f0000-00000000000fffff (prio 1, ram): alias pam-rom @pc.ram 00000000000f0000-00000000000fffff00000000fec00000-00000000fec00fff (prio 0, i/o): ioapic00000000fed00000-00000000fed003ff (prio 0, i/o): hpet00000000fee00000-00000000feefffff (prio 4096, i/o): apic-msi
  • address-space: memory

第一个是系统全局的AddressSpace,表示虚拟机能够访问的所有地址。

  • address-space: I/O

I/O表示x86系统下I/O端口的地址空间。

  • address-space: cpu-memory-0

cpu-memory-x表示CPU视角下的地址空间。

  • i440FX和PIIX3

i440FX和PIIX3是设备视角下的地址空间,虽然大部分情况下很多都是相同的,但是逻辑意义并不一样。

至此,QEMU中与内存相关的第一个数据结构AddressSpace就讲解完了。

(2)MemoryRegion

第二个是基本数据结构是MemoryRegion。MemoryRegion结构的定义在include/exec/memory.h中,如下:

#define TYPE_MEMORY_REGION "memory-region"
DECLARE_INSTANCE_CHECKER(MemoryRegion, MEMORY_REGION,TYPE_MEMORY_REGION)

在此不详细展开宏,而直接给出struct MemoryRegion定义,也在include/exec/memory.h中,代码如下:

/** MemoryRegion:** A struct representing a memory region.*/
struct MemoryRegion {Object parent_obj;/* private: *//* The following fields should fit in a cache line */bool romd_mode;bool ram;bool subpage;bool readonly; /* For RAM regions */bool nonvolatile;bool rom_device;bool flush_coalesced_mmio;uint8_t dirty_log_mask;bool is_iommu;RAMBlock *ram_block;Object *owner;/* owner as TYPE_DEVICE. Used for re-entrancy checks in MR access hotpath */DeviceState *dev;const MemoryRegionOps *ops;void *opaque;MemoryRegion *container;int mapped_via_alias; /* Mapped via an alias, container might be NULL */Int128 size;hwaddr addr;void (*destructor)(MemoryRegion *mr);uint64_t align;bool terminates;bool ram_device;bool enabled;bool warning_printed; /* For reservations */uint8_t vga_logging_count;MemoryRegion *alias;hwaddr alias_offset;int32_t priority;QTAILQ_HEAD(, MemoryRegion) subregions;QTAILQ_ENTRY(MemoryRegion) subregions_link;QTAILQ_HEAD(, CoalescedMemoryRange) coalesced;const char *name;unsigned ioeventfd_nb;MemoryRegionIoeventfd *ioeventfds;RamDiscardManager *rdm; /* Only for RAM *//* For devices designed to perform re-entrant IO into their own IO MRs */bool disable_reentrancy_guard;
};

MemoryRegion表示的是虚拟机中的一段内存区域(对比:AddressSpace结构用来表示一个虚拟机或者虚拟CPU能够访问的所有物理地址,其描述了一个到MemoryRegion对象的地址映射)。MemoryRegion是内存模拟中的核心结构,整个内存的模拟都是通过MemoryRegion构成的无环图完成的。图的叶子节点是实际分配给虚拟机的物理内存或者MMIO,中间节点则表示内存总线,内存控制是其它MemoryRegion的别名。AddressSpace与MemoryRegion的关系如下图所示:

对于MemoryRegion各成员的详细讲解,请看下回。

本文来自互联网用户投稿,该文观点仅代表作者本人,不代表本站立场。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如若转载,请注明出处:http://www.mzph.cn/news/665813.shtml

如若内容造成侵权/违法违规/事实不符,请联系多彩编程网进行投诉反馈email:809451989@qq.com,一经查实,立即删除!

相关文章

springboot153相亲网站

简介 【毕设源码推荐 javaweb 项目】基于springbootvue 的 适用于计算机类毕业设计,课程设计参考与学习用途。仅供学习参考, 不得用于商业或者非法用途,否则,一切后果请用户自负。 看运行截图看 第五章 第四章 获取资料方式 **项…

预充电阻原理作用,直流预充电电路设计指南

最初将电池连接到具有容性输入的负载时,当负载电容充电至电池电压时,会出现电流涌入。 对于大型电池(具有低源电阻)和强大的负载(输入端具有大电容器),浪涌电流可以很容易地达到 1000 A 的峰值。…

Ps:自动对齐图层

Ps菜单:编辑/自动对齐图层 Edit/Auto-Align Layers 自动对齐图层 Auto-Align Layers命令通过分析选中图层上的图像,识别出图像间的共同特征点(如边缘、纹理或特定标记等),然后基于这些特征点变换(移动、旋转…

阻塞队列(超详细易懂)

目录 一、阻塞队列 1.阻塞队列概述 2.生产者消费者模型 3.阻塞队列的作用 4.标准库中的阻塞队列类 5.例子:简单生产者消费者模型 二、阻塞队列模拟实现 1.实现循环队列(可跳过) 1.1简述环形队列 1.2代码实现 2.实现阻塞队列 2.1实…

探索前端开发框架:React、Angular 和 Vue 的对决(一)

🤍 前端开发工程师、技术日更博主、已过CET6 🍨 阿珊和她的猫_CSDN博客专家、23年度博客之星前端领域TOP1 🕠 牛客高级专题作者、打造专栏《前端面试必备》 、《2024面试高频手撕题》 🍚 蓝桥云课签约作者、上架课程《Vue.js 和 E…

webpack配置

一、很多基础方面的配置被vuecli所集成一般项目都是使用vuecli,不会真正的去从0-1进行webpack配置: 1、vuecli中的webpack基础配置: (1)入口文件默认在src/main;输出在dist; (2)集成了大量的插件和加载器:babel-loader 处理 JavaScript 文件、使用 css-loader 和 style-load…

基于控制台的购书系统(Java 语言实现)

📚博客主页:爱敲代码的小杨. ✨专栏:《Java SE语法》|《数据结构与算法》 ❤️感谢大家点赞👍🏻收藏⭐评论✍🏻,您的三连就是我持续更新的动力❤️ 🙏小杨水平有限,欢…

C++棋类小游戏2

今天给大家带来我花了1周时间自创的小游戏的升级版,博主还是一名小学生,希望大家提提意见。这是我写的最长的C代码,希望大家喜欢,不要抄袭,任何编译器都可以。 以前版本——C自创棋类小游戏-CSDN博客 C内容提示&…

苹果CMS挖片网升级版视频主题模版源码

自适应视频站正版高级挖片网收录模板,模板不错,是挖片网的升级版。 源码下载:https://download.csdn.net/download/m0_66047725/88799583 更多资源下载:关注我。

解决maven 在IDEA 下载依赖包速度慢的问题

1.idea界面双击shift键 2.打开setting.xml文件 复制粘贴 <?xml version"1.0" encoding"UTF-8"?> <settings xmlns"http://maven.apache.org/SETTINGS/1.0.0"xmlns:xsi"http://www.w3.org/2001/XMLSchema-instance"xsi:sc…

深度学习实战 | 卷积神经网络LeNet手写数字识别(带手写板GUI界面)

引言 在深度学习领域&#xff0c;卷积神经网络&#xff08;Convolutional Neural Network, CNN&#xff09;是一种广泛应用于图像识别任务的神经网络结构。LeNet是一种经典的CNN结构&#xff0c;被广泛应用于基础的图像分类任务。本文将介绍如何使用LeNet卷积神经网络实现手写…

(已解决)spingboot 后端发送QQ邮箱验证码

打开QQ邮箱pop3请求服务&#xff1a;&#xff08;按照QQ邮箱引导操作&#xff09; 导入依赖&#xff08;不是maven项目就自己添加jar包&#xff09;&#xff1a; <!-- 邮件发送--><dependency><groupId>org.springframework.boot</groupId><…

vite打包原理

vite 工程化开发&#xff1a;打包工具 启动速度很快 核心原理还是webpack 把webpack封装了&#xff0c;把webpack对象封装了 和vue2整体结构几乎一致 webpack两种模式&#xff1a;开发&生产 代码打包编译&#xff0c;本地起一个web服务器实时预览编译后的结果 build 命令模…

2024.2.3

单向循环链表的头插 头删 尾插和尾删 //头结点插入 Linklist insere_element(Linklist head,datatype element) {Linklist screat();s->dataelement;if(NULLhead){heads;}else{Linklist phead;while(p->next!head){pp->next;}s->nexthead;heads;p->nexthead;}r…

太强了,AI数字人从制作到变现一次搞定

AI数字人从制作到变现 如果说GPT类大模型是我们人类的第二大脑&#xff0c;数字人就是我们人类在互联网上的第二个身体。随着 AI 的迅速发展&#xff0c;2024 年 AI 模型开始从大型语言模型向大型视觉模型转变。数字人技术作为其分支之一&#xff0c;正日益成为科技、娱乐、教…

Unity项目从built-in升级到URP(包含早期版本和2023版本)

unity不同版本的升级URP的方式不一样&#xff0c;但是大体流程是相似的 首先是加载URP包 Windows -> package manager,在unity registry中找到Universal RP 2023版本&#xff1a; 更早的版本&#xff1a; 创建URP资源和渲染器​​ 有些版本在加载时会自动创建&#…

ProcessSlot构建流程分析

ProcessorSlot ProcessorSlot构建流程 // com.alibaba.csp.sentinel.CtSph#lookProcessChain private Entry entryWithPriority(ResourceWrapper resourceWrapper, int count, boolean prioritized, Object... args)throws BlockException {// 省略创建 Context 的代码// 黑盒…

Optimizer:基于.Net开发的、提升Windows系统性能的终极开源工具

我们电脑使用久了后&#xff0c;就会产生大量的垃圾文件、无用的配置等&#xff0c;手动删除非常麻烦&#xff0c;今天推荐一个开源工具&#xff0c;可以快速帮助我们更好的优化Windos电脑。 01 项目简介 Optimizer是一个面向Windows系统的优化工具&#xff0c;旨在提升计算机…

vulhub中spring的CVE-2022-22947漏洞复现

Spring Cloud Gateway是Spring中的一个API网关。其3.1.0及3.0.6版本&#xff08;包含&#xff09;以前存在一处SpEL表达式注入漏洞&#xff0c;当攻击者可以访问Actuator API的情况下&#xff0c;将可以利用该漏洞执行任意命令。 参考链接&#xff1a; https://tanzu.vmware.c…

【用Unity开发一款横板跳跃游戏部分需要学习的技术点指南】

*** 用Unity开发一款横板跳跃游戏部分需要学习的技术点指南 空洞骑士是一款基于横板平台跳跃的传统风格2D动作冒险游戏&#xff0c;庞大的游戏世界交错相通&#xff0c;玩家控制小虫子去探索幽深黑暗的洞穴&#xff0c;成为了一代人茶余饭后的惦念&#xff0c;深受玩家喜爱。 …