当前位置:首页>Linux>Linux KVM在ARM64环境多VCPU的演示

Linux KVM在ARM64环境多VCPU的演示

  • 2026-02-05 22:49:44
Linux KVM在ARM64环境多VCPU的演示
Linux KVM在ARM64环境下的演示中,VM只有一个VCPU,如果是多个VCPU,那么这个演示需要做一些增强。
vCPU对应到Host里面的一个线程,在Guest看来是一颗物理CPU。将这些组件放一起的示意图如下:
以ARM VHE使能的情况为例子。当VCPU对应的Linux thread执行ioctl(KVM_RUN)进入内核,内核会保存Host的寄存器,加载Guest的状态(如页表基地址),然后执行eret的指令(x86 上是VMLAUNCH),eret会根据SPSR_EL2寄存器的内容,自动将CPU从EL2 (Host) 降级到 EL1 (Guest)。地址空间会同时切换,它会激活Guest的页表(通过VTTBR_EL2 寄存器),此时物理地址的翻译将切换到虚拟机的Stage-2模式。
eret完后后将直接以原生速度运行VM里面的二进制指令。此时CPU是直接运行VM里的代码,但它受到硬件限制(如ARM的非安全EL1/EL0),只能使用分配给VM的内存,无法访问超出之外的Host的内存。

当Guest运行过程中产生了一个异常(比如访问了不存在的硬件地址),硬件会自动触发“异常向量表(Vector Table)”。KVM会在EL2设置一套专门的向量表。当 Guest“翻车”陷出时,CPU会自动跳转到KVM预设的代码,这部分代码将加载Linux thread的环境,随后KVM_RUN返回到Linux thread用户态部分,由用户态进行“翻车”的处理。

多个VCPU的时候原先的Guest里面Hello world示例需要进行修改。汇编部分,会对两个VCPU根据CPU ID设置不同的Stack:

.global _start_start:    /* Read MPIDR_EL1 to get CPU ID */    mrs x0, mpidr_el1       /* Read Multiprocessor Affinity Register */    and x0, x0, #0xFF       /* Extract Aff0 (CPU ID) */    /* Calculate stack pointer for this CPU */    /* CPU 0: 0x04020000, CPU 1: 0x04030000, etc. */    ldr x30, =stack_top     /* Base stack address */    mov x1, #0x10000        /* 64KB stack per CPU */    madd x30, x0, x1, x30   /* stack_top + (cpu_id * 0x10000) */    mov sp, x30             /* Set stack address */    bl main                 /* Branch to main() */    /* After main returns, enter WFI loop instead of shutting down */    /* This allows all VCPUs to complete their work */sleep:    wfi                     /* Wait for interrupt */    b sleep                 /* Endless loop */.global system_offsystem_off:    ldr x0, =0x84000008     /* SYSTEM_OFF function ID - shutdown entire VM */    hvc #0                  /* Hypervisor call */    b sleep                 /* Fallback to sleep if HVC returns */

而system_off过程不会被调用,这是因为一个VCPU调用它以后,将关闭整个System,这将影响另外一个正在运行的VCPU的过程。所以这里bl main,在打印完成后,进入到wfi状态。

hello_world.c将分别往不同UART打印内容C0!或者C1!,这里减少了字符串长度使得输出简略些:

volatile unsigned int * const UART0DR = (unsigned int *) 0x10000000;volatile unsigned int * const UART1DR = (unsigned int *) 0x10008000;voidprint_uart0(constchar *s){    while(*s != '\0') { /* Loop until end of string */        *UART0DR = (unsigned int)(*s); /* Transmit char */        s++; /* Next char */    }}voidprint_uart1(constchar *s){    while(*s != '\0') { /* Loop until end of string */        *UART1DR = (unsigned int)(*s); /* Transmit char */        s++; /* Next char */    }}// Read MPIDR_EL1 to get CPU IDunsignedlongget_cpu_id(){    unsigned long mpidr;    asmvolatile("mrs %0, mpidr_el1" : "=r" (mpidr));    return mpidr & 0xFF// Extract Aff0 field (CPU ID)}voidmain(){    unsigned long cpu_id = get_cpu_id();    if (cpu_id == 0) {        print_uart0("C0!\n");    } else if (cpu_id == 1) {        print_uart1("C1!\n");    } else {        print_uart0("C?\n");    }}

kvm_test.c在main里面会创建两个VCPU。这两个VCPU,只需要进行一次的Memory mapping设置,因为这个属于VM范畴的资源。对每个VCPU要分别设置它们的CPU ID寄存器MPIDR_EL1和PC寄存器:

intmain(){    int ret;    uint64_t *mem;    size_t mmap_size;    /* Get the KVM file descriptor */    kvm = open("/dev/kvm", O_RDWR | O_CLOEXEC);    if (kvm < 0) {        printf("Cannot open '/dev/kvm': %s"strerror(errno));        return kvm;    }    /* Make sure we have the stable version of the API */    ret = ioctl(kvm, KVM_GET_API_VERSION, NULL);    if (ret < 0) {        printf("System call 'KVM_GET_API_VERSION' failed: %s"strerror(errno));        return ret;    }    if (ret != 12) {        printf("expected KVM API Version 12 got: %d", ret);        return -1;    }    /* Create a VM and receive the VM file descriptor */    printf("Creating VM\n");    vmfd = ioctl_exit_on_error(kvm, KVM_CREATE_VM, "KVM_CREATE_VM", (unsigned long0);    printf("Setting up memory\n");    /*     * MEMORY MAP     * One memory block of 0x1000 B will be assigned to every part of the memory:     *     * Start      | Name  | Description     * -----------+-------+------------     * 0x00000000 | ROM   |     * 0x04000000 | RAM   |     * 0x04010000 | Heap  | increases     * 0x0401F000 | Stack | decreases, so the stack pointer is initially 0x04020000     * 0x10000000 | MMIO  | UART0     * 0x10008000 | MMIO  | UART1     */    check_vm_extension(KVM_CAP_USER_MEMORY, "KVM_CAP_USER_MEMORY");    /* ROM Memory */    memory_mappings[0].guest_phys_addr = 0x0;    memory_mappings[0].memory_size = MEMORY_BLOCK_SIZE;    mem = allocate_memory_to_vm(memory_mappings[0].memory_size, memory_mappings[0].guest_phys_addr);    memory_mappings[0].userspace_addr = mem;    /* RAM Memory */    memory_mappings[1].guest_phys_addr = 0x04000000;    memory_mappings[1].memory_size = MEMORY_BLOCK_SIZE;    mem = allocate_memory_to_vm(memory_mappings[1].memory_size, memory_mappings[1].guest_phys_addr);    memory_mappings[1].userspace_addr = mem;    ret = copy_elf_into_memory();    if (ret < 0)        return ret;    /* Heap Memory */    mem = allocate_memory_to_vm(MEMORY_BLOCK_SIZE * 20x04010000);    /* Stack Memory - allocate 64KB (0x10000) per CPU */    /* CPU 0 stack: 0x04020000, CPU 1 stack: 0x04030000 */    mem = allocate_memory_to_vm(MEMORY_BLOCK_SIZE * NUM_VCPUS, 0x04020000);    /* MMIO Memory - UART0 */    check_vm_extension(KVM_CAP_READONLY_MEM, "KVM_CAP_READONLY_MEM"); // This will cause a write to 0x10000000, to result in a KVM_EXIT_MMIO.    mem = allocate_memory_to_vm(MEMORY_BLOCK_SIZE, 0x10000000, KVM_MEM_READONLY);    /* MMIO Memory - UART1 */    mem = allocate_memory_to_vm(MEMORY_BLOCK_SIZE, 0x10008000, KVM_MEM_READONLY);    /* Get CPU information for VCPU init */    printf("Retrieving physical CPU information\n");    struct kvm_vcpu_init preferred_target;    ioctl_exit_on_error(vmfd, KVM_ARM_PREFERRED_TARGET, "KVM_ARM_PREFERRED_TARGET", &preferred_target);    /* Enable the PSCI v0.2 CPU feature, to be able to shut down the VM */    check_vm_extension(KVM_CAP_ARM_PSCI_0_2, "KVM_CAP_ARM_PSCI_0_2");    preferred_target.features[0] |= 1 << KVM_ARM_VCPU_PSCI_0_2;    /* Get VCPU mmap size */    ret = ioctl_exit_on_error(kvm, KVM_GET_VCPU_MMAP_SIZE, "KVM_GET_VCPU_MMAP_SIZE"NULL);    mmap_size = ret;    if (mmap_size < sizeof(struct kvm_run))        printf("KVM_GET_VCPU_MMAP_SIZE unexpectedly small");    uint64_t entry_addr = get_entry_address();    printf("Entry address: 0x%08lX\n", entry_addr);    /* Create and initialize VCPUs */    for (int i = 0; i < NUM_VCPUS; i++) {        printf("\nCreating VCPU %d\n", i);        vcpus[i].vcpu_id = i;        vcpus[i].mmio_buffer_index = 0;        memset(vcpus[i].mmio_buffer, 0, MAX_VM_RUNS);        /* Create a virtual CPU and receive its file descriptor */        vcpus[i].vcpufd = ioctl_exit_on_error(vmfd, KVM_CREATE_VCPU, "KVM_CREATE_VCPU", (unsigned long) i);        /* Map the shared kvm_run structure and following data. */        void *void_mem = mmap(NULL, mmap_size, PROT_READ | PROT_WRITE, MAP_SHARED, vcpus[i].vcpufd, 0);        vcpus[i].run = static_cast<kvm_run *>(void_mem);        if (!vcpus[i].run) {            printf("Error while mmap vcpu %d\n", i);            return -1;        }        /* Initialize VCPU */        printf("Initializing VCPU %d\n", i);        ioctl_exit_on_error(vcpus[i].vcpufd, KVM_ARM_VCPU_INIT, "KVM_ARM_VCPU_INIT", &preferred_target);        /* Set MPIDR_EL1 register to identify CPU ID */        check_vm_extension(KVM_CAP_ONE_REG, "KVM_CAP_ONE_REG");        uint64_t mpidr_value = 0x80000000 | i; // Set CPU ID in Aff0 field        uint64_t mpidr_id = KVM_REG_ARM64 | KVM_REG_SIZE_U64 | KVM_REG_ARM_CORE | (2 * (offsetof(struct kvm_regs, regs) / sizeof(__u32)) + 5); // MPIDR_EL1 offset        struct kvm_one_reg mpidr_reg = {.id = mpidr_id, .addr = (uint64_t)&mpidr_value};        printf("Setting MPIDR_EL1 for VCPU %d to 0x%08lX\n", i, mpidr_value);        ret = ioctl(vcpus[i].vcpufd, KVM_SET_ONE_REG, &mpidr_reg);        if (ret < 0) {            printf("Warning: Could not set MPIDR_EL1 for VCPU %d (this is normal, KVM sets it automatically)\n", i);        }        /* Set program counter to entry address */        uint64_t pc_index = offsetof(struct kvm_regs, regs.pc) / sizeof(__u32);        uint64_t pc_id = KVM_REG_ARM64 | KVM_REG_SIZE_U64 | KVM_REG_ARM_CORE | pc_index;        printf("Setting program counter for VCPU %d to entry address 0x%08lX\n", i, entry_addr);        struct kvm_one_reg pc = {.id = pc_id, .addr = (uint64_t)&entry_addr};        ret = ioctl_exit_on_error(vcpus[i].vcpufd, KVM_SET_ONE_REG, "KVM_SET_ONE_REG", &pc);        if (ret < 0)            return ret;    }    /* Create threads for each VCPU */    pthread_t threads[NUM_VCPUS];    printf("\nStarting VCPU threads\n");    for (int i = 0; i < NUM_VCPUS; i++) {        ret = pthread_create(&threads[i], NULL, vcpu_thread, &vcpus[i]);        if (ret != 0) {            printf("Failed to create thread for VCPU %d: %s\n", i, strerror(ret));            return -1;        }    }    /* Wait for all VCPU threads to complete */    printf("Waiting for VCPU threads to complete\n");    for (int i = 0; i < NUM_VCPUS; i++) {        ret = pthread_join(threads[i], NULL);        if (ret != 0) {            printf("Failed to join thread for VCPU %d: %s\n", i, strerror(ret));        }    }    printf("\nAll VCPUs completed\n");    /* Clean up VCPUs */    for (int i = 0; i < NUM_VCPUS; i++) {        close_fd(vcpus[i].vcpufd);    }    close_fd(vmfd);    close_fd(kvm);    return 0;}

随后创建两个pthread线程,这两个线程将是两个VCPU的上下文,VCPU的执行将局限在这两个线程中:

/** * VCPU thread function - each VCPU runs in its own thread */void *vcpu_thread(void *arg){    struct vcpu_data *vcpu = (struct vcpu_data *)arg;    int ret;    printf("[VCPU %d] Thread started\n", vcpu->vcpu_id);    /* Repeatedly run code and handle VM exits. */    bool shut_down = false;    for (int i = 0; i < MAX_VM_RUNS && !shut_down; i++) {        ret = ioctl(vcpu->vcpufd, KVM_RUN, NULL);        if (ret < 0) {            printf("[VCPU %d] System call 'KVM_RUN' failed: %d - %s\n", vcpu->vcpu_id, errno, strerror(errno));            printf("[VCPU %d] Error Numbers: EINTR=%d; ENOEXEC=%d; ENOSYS=%d; EPERM=%d\n", vcpu->vcpu_id, EINTR, ENOEXEC, ENOSYS, EPERM);            return NULL;        }        pthread_mutex_lock(&print_mutex);        printf("\n[VCPU %d] KVM_RUN Loop %d:\n", vcpu->vcpu_id, i+1);        switch (vcpu->run->exit_reason) {            case KVM_EXIT_MMIO:                printf("[VCPU %d] Exit Reason: KVM_EXIT_MMIO\n", vcpu->vcpu_id);                if (mmio_exit_handler(vcpu)) {                    printf("[VCPU %d] Output complete, exiting loop\n", vcpu->vcpu_id);                    shut_down = true;                }                break;            case KVM_EXIT_SYSTEM_EVENT:                // This happens when the VCPU has done a HVC based PSCI call.                printf("[VCPU %d] Exit Reason: KVM_EXIT_SYSTEM_EVENT\n", vcpu->vcpu_id);                print_system_event_exit_reason(vcpu);                shut_down = true;                break;            case KVM_EXIT_INTR:                printf("[VCPU %d] Exit Reason: KVM_EXIT_INTR\n", vcpu->vcpu_id);                i--; // Don't count this iteration                break;            case KVM_EXIT_FAIL_ENTRY:                printf("[VCPU %d] Exit Reason: KVM_EXIT_FAIL_ENTRY\n", vcpu->vcpu_id);                break;            case KVM_EXIT_INTERNAL_ERROR:                printf("[VCPU %d] Exit Reason: KVM_EXIT_INTERNAL_ERROR\n", vcpu->vcpu_id);                break;            default:                printf("[VCPU %d] Exit Reason: other\n", vcpu->vcpu_id);        }        pthread_mutex_unlock(&print_mutex);    }    pthread_mutex_lock(&print_mutex);    printf("\n[VCPU %d] VM MMIO Output:\n", vcpu->vcpu_id);    for(int i = 0; i < vcpu->mmio_buffer_index; i++) {        printf("%c", vcpu->mmio_buffer[i]);    }    printf("\n");    printf("[VCPU %d] Thread finished\n", vcpu->vcpu_id);    pthread_mutex_unlock(&print_mutex);    return NULL;}

每个线程的具体过程就是循环调用KVM_RUN。KVM_RUN陷入KVM的内核态时,会将VCPU上的程序在pthread的上下文里面通过eret的方式切换运行。而当VCPU上的程序写UART的时候,将产生异常,返回到KVM,进一步返回到调用KVM_RUN的pthread的用户态部分,表示有MMIO的操作。

MMIO的处理函数mmio_exit_handler,做了特殊判断,当看到打印\n的时候,意味着在VCPU上的程序完成打印,从而不会继续通过KVM_RUN调度VCPU的执行了。这里没有使用system_off调用,所以KVM_EXIT_SYSTEM_EVENT的情况不会进入:

/** * Handles a MMIO exit from KVM_RUN. * Returns true if the output is complete (ends with newline). */boolmmio_exit_handler(struct vcpu_data *vcpu){    printf("[VCPU %d] Is Write: %d\n", vcpu->vcpu_id, vcpu->run->mmio.is_write);    if (vcpu->run->mmio.is_write) {        printf("[VCPU %d] Length: %d\n", vcpu->vcpu_id, vcpu->run->mmio.len);        uint64_t data = 0;        for (int j = 0; j < vcpu->run->mmio.len; j++) {            data |= vcpu->run->mmio.data[j]<<8*j;        }        vcpu->mmio_buffer[vcpu->mmio_buffer_index] = data;        vcpu->mmio_buffer_index++;        printf("[VCPU %d] Guest wrote 0x%08lX to 0x%08llX\n", vcpu->vcpu_id, data, vcpu->run->mmio.phys_addr);        // Check if output is complete (ends with newline)        if (data == '\n') {            return true;        }    }    return false;}

运行结果如下:

# ./kvm_testCreating VMSetting up memoryOpening ELF fileIt contains 3 sectionsSection 0 needs to be loadedSection loaded. Host address: 0xffffa9e5e000 - Guest address: 0x00000000Section 1 needs to be loadedSection loaded. Host address: 0xffffa9e56000 - Guest address: 0x04000000Section 2 does not need to be loadedClosing ELF fileRetrieving physical CPU informationEntry address: 0x00000000Creating VCPU 0Initializing VCPU 0Setting MPIDR_EL1 for VCPU 0 to 0x80000000Warning: Could not set MPIDR_EL1 for VCPU 0 (this is normal, KVM sets it automatically)Setting program counter for VCPU 0 to entry address 0x00000000Creating VCPU 1Initializing VCPU 1Setting MPIDR_EL1 for VCPU 1 to 0x80000001Warning: Could not set MPIDR_EL1 for VCPU 1 (this is normal, KVM sets it automatically)Setting program counter for VCPU 1 to entry address 0x00000000Starting VCPU threads[VCPU 0] Thread startedWaiting for VCPU threads to complete[VCPU 1] Thread started[VCPU 0] KVM_RUN Loop 1:[VCPU 0] Exit Reason: KVM_EXIT_MMIO[VCPU 0] Is Write: 1[VCPU 0] Length: 4[VCPU 0] Guest wrote 0x00000043 to 0x10000000[VCPU 0] KVM_RUN Loop 2:[VCPU 0] Exit Reason: KVM_EXIT_MMIO[VCPU 0] Is Write: 1[VCPU 0] Length: 4[VCPU 0] Guest wrote 0x00000030 to 0x10000000[VCPU 1] KVM_RUN Loop 1:[VCPU 1] Exit Reason: KVM_EXIT_MMIO[VCPU 1] Is Write: 1[VCPU 1] Length: 4[VCPU 1] Guest wrote 0x00000043 to 0x10008000[VCPU 0] KVM_RUN Loop 3:[VCPU 0] Exit Reason: KVM_EXIT_MMIO[VCPU 0] Is Write: 1[VCPU 0] Length: 4[VCPU 0] Guest wrote 0x00000021 to 0x10000000[VCPU 1] KVM_RUN Loop 2:[VCPU 1] Exit Reason: KVM_EXIT_MMIO[VCPU 1] Is Write: 1[VCPU 1] Length: 4[VCPU 1] Guest wrote 0x00000031 to 0x10008000[VCPU 0] KVM_RUN Loop 4:[VCPU 0] Exit Reason: KVM_EXIT_MMIO[VCPU 0] Is Write: 1[VCPU 0] Length: 4[VCPU 0] Guest wrote 0x0000000A to 0x10000000[VCPU 0] Output complete, exiting loop[VCPU 0] VM MMIO Output:C0![VCPU 0] Thread finished[VCPU 1] KVM_RUN Loop 3:[VCPU 1] Exit Reason: KVM_EXIT_MMIO[VCPU 1] Is Write: 1[VCPU 1] Length: 4[VCPU 1] Guest wrote 0x00000021 to 0x10008000[VCPU 1] KVM_RUN Loop 4:[VCPU 1] Exit Reason: KVM_EXIT_MMIO[VCPU 1] Is Write: 1[VCPU 1] Length: 4[VCPU 1] Guest wrote 0x0000000A to 0x10008000[VCPU 1] Output complete, exiting loop[VCPU 1] VM MMIO Output:C1![VCPU 1] Thread finishedAll VCPUs completed
可以看到C0!和C1!先后打印出来了。

最新文章

随机文章

基本 文件 流程 错误 SQL 调试
  1. 请求信息 : 2026-02-07 15:17:44 HTTP/2.0 GET : https://f.mffb.com.cn/a/473784.html
  2. 运行时间 : 0.304157s [ 吞吐率:3.29req/s ] 内存消耗:4,645.52kb 文件加载:140
  3. 缓存信息 : 0 reads,0 writes
  4. 会话信息 : SESSION_ID=2138b1a2c3015f144fea49a5b35e24eb
  1. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/public/index.php ( 0.79 KB )
  2. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/autoload.php ( 0.17 KB )
  3. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/composer/autoload_real.php ( 2.49 KB )
  4. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/composer/platform_check.php ( 0.90 KB )
  5. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/composer/ClassLoader.php ( 14.03 KB )
  6. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/composer/autoload_static.php ( 4.90 KB )
  7. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-helper/src/helper.php ( 8.34 KB )
  8. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-validate/src/helper.php ( 2.19 KB )
  9. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-orm/src/helper.php ( 1.47 KB )
  10. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-orm/stubs/load_stubs.php ( 0.16 KB )
  11. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/Exception.php ( 1.69 KB )
  12. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-container/src/Facade.php ( 2.71 KB )
  13. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/symfony/deprecation-contracts/function.php ( 0.99 KB )
  14. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/symfony/polyfill-mbstring/bootstrap.php ( 8.26 KB )
  15. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/symfony/polyfill-mbstring/bootstrap80.php ( 9.78 KB )
  16. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/symfony/var-dumper/Resources/functions/dump.php ( 1.49 KB )
  17. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-dumper/src/helper.php ( 0.18 KB )
  18. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/symfony/var-dumper/VarDumper.php ( 4.30 KB )
  19. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/App.php ( 15.30 KB )
  20. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-container/src/Container.php ( 15.76 KB )
  21. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/psr/container/src/ContainerInterface.php ( 1.02 KB )
  22. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/app/provider.php ( 0.19 KB )
  23. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/Http.php ( 6.04 KB )
  24. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-helper/src/helper/Str.php ( 7.29 KB )
  25. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/Env.php ( 4.68 KB )
  26. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/app/common.php ( 0.03 KB )
  27. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/helper.php ( 18.78 KB )
  28. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/Config.php ( 5.54 KB )
  29. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/config/app.php ( 0.95 KB )
  30. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/config/cache.php ( 0.78 KB )
  31. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/config/console.php ( 0.23 KB )
  32. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/config/cookie.php ( 0.56 KB )
  33. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/config/database.php ( 2.48 KB )
  34. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/facade/Env.php ( 1.67 KB )
  35. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/config/filesystem.php ( 0.61 KB )
  36. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/config/lang.php ( 0.91 KB )
  37. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/config/log.php ( 1.35 KB )
  38. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/config/middleware.php ( 0.19 KB )
  39. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/config/route.php ( 1.89 KB )
  40. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/config/session.php ( 0.57 KB )
  41. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/config/trace.php ( 0.34 KB )
  42. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/config/view.php ( 0.82 KB )
  43. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/app/event.php ( 0.25 KB )
  44. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/Event.php ( 7.67 KB )
  45. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/app/service.php ( 0.13 KB )
  46. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/app/AppService.php ( 0.26 KB )
  47. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/Service.php ( 1.64 KB )
  48. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/Lang.php ( 7.35 KB )
  49. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/lang/zh-cn.php ( 13.70 KB )
  50. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/initializer/Error.php ( 3.31 KB )
  51. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/initializer/RegisterService.php ( 1.33 KB )
  52. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/services.php ( 0.14 KB )
  53. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/service/PaginatorService.php ( 1.52 KB )
  54. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/service/ValidateService.php ( 0.99 KB )
  55. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/service/ModelService.php ( 2.04 KB )
  56. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-trace/src/Service.php ( 0.77 KB )
  57. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/Middleware.php ( 6.72 KB )
  58. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/initializer/BootService.php ( 0.77 KB )
  59. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-orm/src/Paginator.php ( 11.86 KB )
  60. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-validate/src/Validate.php ( 63.20 KB )
  61. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-orm/src/Model.php ( 23.55 KB )
  62. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-orm/src/model/concern/Attribute.php ( 21.05 KB )
  63. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-orm/src/model/concern/AutoWriteData.php ( 4.21 KB )
  64. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-orm/src/model/concern/Conversion.php ( 6.44 KB )
  65. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-orm/src/model/concern/DbConnect.php ( 5.16 KB )
  66. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-orm/src/model/concern/ModelEvent.php ( 2.33 KB )
  67. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-orm/src/model/concern/RelationShip.php ( 28.29 KB )
  68. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-helper/src/contract/Arrayable.php ( 0.09 KB )
  69. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-helper/src/contract/Jsonable.php ( 0.13 KB )
  70. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-orm/src/model/contract/Modelable.php ( 0.09 KB )
  71. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/Db.php ( 2.88 KB )
  72. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-orm/src/DbManager.php ( 8.52 KB )
  73. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/Log.php ( 6.28 KB )
  74. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/Manager.php ( 3.92 KB )
  75. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/psr/log/src/LoggerTrait.php ( 2.69 KB )
  76. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/psr/log/src/LoggerInterface.php ( 2.71 KB )
  77. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/Cache.php ( 4.92 KB )
  78. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/psr/simple-cache/src/CacheInterface.php ( 4.71 KB )
  79. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-helper/src/helper/Arr.php ( 16.63 KB )
  80. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/cache/driver/File.php ( 7.84 KB )
  81. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/cache/Driver.php ( 9.03 KB )
  82. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/contract/CacheHandlerInterface.php ( 1.99 KB )
  83. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/app/Request.php ( 0.09 KB )
  84. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/Request.php ( 55.78 KB )
  85. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/app/middleware.php ( 0.25 KB )
  86. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/Pipeline.php ( 2.61 KB )
  87. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-trace/src/TraceDebug.php ( 3.40 KB )
  88. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/middleware/SessionInit.php ( 1.94 KB )
  89. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/Session.php ( 1.80 KB )
  90. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/session/driver/File.php ( 6.27 KB )
  91. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/contract/SessionHandlerInterface.php ( 0.87 KB )
  92. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/session/Store.php ( 7.12 KB )
  93. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/Route.php ( 23.73 KB )
  94. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/route/RuleName.php ( 5.75 KB )
  95. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/route/Domain.php ( 2.53 KB )
  96. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/route/RuleGroup.php ( 22.43 KB )
  97. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/route/Rule.php ( 26.95 KB )
  98. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/route/RuleItem.php ( 9.78 KB )
  99. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/route/app.php ( 1.72 KB )
  100. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/facade/Route.php ( 4.70 KB )
  101. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/route/dispatch/Controller.php ( 4.74 KB )
  102. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/route/Dispatch.php ( 10.44 KB )
  103. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/app/controller/Index.php ( 4.81 KB )
  104. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/app/BaseController.php ( 2.05 KB )
  105. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-orm/src/facade/Db.php ( 0.93 KB )
  106. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-orm/src/db/connector/Mysql.php ( 5.44 KB )
  107. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-orm/src/db/PDOConnection.php ( 52.47 KB )
  108. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-orm/src/db/Connection.php ( 8.39 KB )
  109. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-orm/src/db/ConnectionInterface.php ( 4.57 KB )
  110. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-orm/src/db/builder/Mysql.php ( 16.58 KB )
  111. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-orm/src/db/Builder.php ( 24.06 KB )
  112. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-orm/src/db/BaseBuilder.php ( 27.50 KB )
  113. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-orm/src/db/Query.php ( 15.71 KB )
  114. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-orm/src/db/BaseQuery.php ( 45.13 KB )
  115. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-orm/src/db/concern/TimeFieldQuery.php ( 7.43 KB )
  116. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-orm/src/db/concern/AggregateQuery.php ( 3.26 KB )
  117. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-orm/src/db/concern/ModelRelationQuery.php ( 20.07 KB )
  118. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-orm/src/db/concern/ParamsBind.php ( 3.66 KB )
  119. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-orm/src/db/concern/ResultOperation.php ( 7.01 KB )
  120. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-orm/src/db/concern/WhereQuery.php ( 19.37 KB )
  121. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-orm/src/db/concern/JoinAndViewQuery.php ( 7.11 KB )
  122. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-orm/src/db/concern/TableFieldInfo.php ( 2.63 KB )
  123. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-orm/src/db/concern/Transaction.php ( 2.77 KB )
  124. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/log/driver/File.php ( 5.96 KB )
  125. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/contract/LogHandlerInterface.php ( 0.86 KB )
  126. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/log/Channel.php ( 3.89 KB )
  127. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/event/LogRecord.php ( 1.02 KB )
  128. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-helper/src/Collection.php ( 16.47 KB )
  129. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/facade/View.php ( 1.70 KB )
  130. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/View.php ( 4.39 KB )
  131. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/Response.php ( 8.81 KB )
  132. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/response/View.php ( 3.29 KB )
  133. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/Cookie.php ( 6.06 KB )
  134. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-view/src/Think.php ( 8.38 KB )
  135. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/contract/TemplateHandlerInterface.php ( 1.60 KB )
  136. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-template/src/Template.php ( 46.61 KB )
  137. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-template/src/template/driver/File.php ( 2.41 KB )
  138. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-template/src/template/contract/DriverInterface.php ( 0.86 KB )
  139. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/runtime/temp/067d451b9a0c665040f3f1bdd3293d68.php ( 11.98 KB )
  140. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-trace/src/Html.php ( 4.42 KB )
  1. CONNECT:[ UseTime:0.001036s ] mysql:host=127.0.0.1;port=3306;dbname=f_mffb;charset=utf8mb4
  2. SHOW FULL COLUMNS FROM `fenlei` [ RunTime:0.001556s ]
  3. SELECT * FROM `fenlei` WHERE `fid` = 0 [ RunTime:0.004556s ]
  4. SELECT * FROM `fenlei` WHERE `fid` = 63 [ RunTime:0.001387s ]
  5. SHOW FULL COLUMNS FROM `set` [ RunTime:0.001495s ]
  6. SELECT * FROM `set` [ RunTime:0.000837s ]
  7. SHOW FULL COLUMNS FROM `article` [ RunTime:0.001474s ]
  8. SELECT * FROM `article` WHERE `id` = 473784 LIMIT 1 [ RunTime:0.001951s ]
  9. UPDATE `article` SET `lasttime` = 1770448665 WHERE `id` = 473784 [ RunTime:0.037261s ]
  10. SELECT * FROM `fenlei` WHERE `id` = 67 LIMIT 1 [ RunTime:0.028465s ]
  11. SELECT * FROM `article` WHERE `id` < 473784 ORDER BY `id` DESC LIMIT 1 [ RunTime:0.016383s ]
  12. SELECT * FROM `article` WHERE `id` > 473784 ORDER BY `id` ASC LIMIT 1 [ RunTime:0.014881s ]
  13. SELECT * FROM `article` WHERE `id` < 473784 ORDER BY `id` DESC LIMIT 10 [ RunTime:0.014339s ]
  14. SELECT * FROM `article` WHERE `id` < 473784 ORDER BY `id` DESC LIMIT 10,10 [ RunTime:0.005605s ]
  15. SELECT * FROM `article` WHERE `id` < 473784 ORDER BY `id` DESC LIMIT 20,10 [ RunTime:0.002068s ]
0.310188s