/DragonOS/kernel/crates/rbpf/tests/ |
H A D | ubpf_jit_x86_64.rs | 39 let mut vm = rbpf::EbpfVmNoData::new(Some(&prog)).unwrap(); in test_jit_add() localVariable 40 vm.jit_compile().unwrap(); in test_jit_add() 42 assert_eq!(vm.execute_program_jit().unwrap(), 0x3); in test_jit_add() 71 let mut vm = rbpf::EbpfVmNoData::new(Some(&prog)).unwrap(); in test_jit_alu64_arith() localVariable 72 vm.jit_compile().unwrap(); in test_jit_alu64_arith() 74 assert_eq!(vm.execute_program_jit().unwrap(), 0x2a); in test_jit_alu64_arith() 107 let mut vm = rbpf::EbpfVmNoData::new(Some(&prog)).unwrap(); in test_jit_alu64_bit() localVariable 108 vm.jit_compile().unwrap(); in test_jit_alu64_bit() 110 assert_eq!(vm.execute_program_jit().unwrap(), 0x11); in test_jit_alu64_bit() 139 let mut vm = rbpf::EbpfVmNoData::new(Some(&prog)).unwrap(); in test_jit_alu_arith() localVariable [all …]
|
H A D | ubpf_vm.rs | 38 let vm = rbpf::EbpfVmNoData::new(Some(&prog)).unwrap(); in test_vm_add() localVariable 39 assert_eq!(vm.execute_program().unwrap(), 0x3); in test_vm_add() 67 let vm = rbpf::EbpfVmNoData::new(Some(&prog)).unwrap(); in test_vm_alu64_arith() localVariable 68 assert_eq!(vm.execute_program().unwrap(), 0x2a); in test_vm_alu64_arith() 100 let vm = rbpf::EbpfVmNoData::new(Some(&prog)).unwrap(); in test_vm_alu64_bit() localVariable 101 assert_eq!(vm.execute_program().unwrap(), 0x11); in test_vm_alu64_bit() 129 let vm = rbpf::EbpfVmNoData::new(Some(&prog)).unwrap(); in test_vm_alu_arith() localVariable 130 assert_eq!(vm.execute_program().unwrap(), 0x2a); in test_vm_alu_arith() 160 let vm = rbpf::EbpfVmNoData::new(Some(&prog)).unwrap(); in test_vm_alu_bit() localVariable 161 assert_eq!(vm.execute_program().unwrap(), 0x11); in test_vm_alu_bit() [all …]
|
H A D | misc.rs | 149 let mut vm = rbpf::EbpfVmFixedMbuff::new(Some(prog), 0x40, 0x50).unwrap(); in test_vm_block_port() localVariable 150 vm.register_helper(helpers::BPF_TRACE_PRINTK_IDX, helpers::bpf_trace_printf) in test_vm_block_port() 153 let res = vm.execute_program(packet).unwrap(); in test_vm_block_port() 215 let mut vm = rbpf::EbpfVmFixedMbuff::new(Some(prog), 0x40, 0x50).unwrap(); in test_jit_block_port() localVariable 216 vm.register_helper(helpers::BPF_TRACE_PRINTK_IDX, helpers::bpf_trace_printf) in test_jit_block_port() 218 vm.jit_compile().unwrap(); in test_jit_block_port() 221 let res = vm.execute_program_jit(packet).unwrap(); in test_jit_block_port() 246 let vm = rbpf::EbpfVmMbuff::new(Some(prog)).unwrap(); in test_vm_mbuff() localVariable 247 assert_eq!(vm.execute_program(mem, &mbuff).unwrap(), 0x2211); in test_vm_mbuff() 280 let vm = rbpf::EbpfVmMbuff::new(Some(program.into_bytes())).unwrap(); in test_vm_mbuff_with_rust_api() localVariable [all …]
|
H A D | cranelift.rs | 18 let mut vm = rbpf::EbpfVmNoData::new(Some(&prog)).unwrap(); localVariable 19 vm.cranelift_compile().unwrap(); 20 assert_eq!(vm.execute_program_cranelift().unwrap(), $expected); 28 let mut vm = rbpf::EbpfVmRaw::new(Some(&prog)).unwrap(); localVariable 29 vm.cranelift_compile().unwrap(); 30 assert_eq!(vm.execute_program_cranelift(mem).unwrap(), $expected); 273 let mut vm = rbpf::EbpfVmNoData::new(Some(&prog)).unwrap(); in test_cranelift_call() localVariable 274 vm.register_helper(0, helpers::gather_bytes).unwrap(); in test_cranelift_call() 275 vm.cranelift_compile().unwrap(); in test_cranelift_call() 276 assert_eq!(vm.execute_program_cranelift().unwrap(), 0x0102030405); in test_cranelift_call() [all …]
|
H A D | ubpf_verifier.rs | 30 let vm = rbpf::EbpfVmNoData::new(Some(prog)).unwrap(); in test_verifier_err_endian_size() localVariable 31 vm.execute_program().unwrap(); in test_verifier_err_endian_size() 42 let vm = rbpf::EbpfVmNoData::new(Some(prog)).unwrap(); in test_verifier_err_incomplete_lddw() localVariable 43 vm.execute_program().unwrap(); in test_verifier_err_incomplete_lddw() 55 let vm = rbpf::EbpfVmNoData::new(Some(&prog)).unwrap(); in test_verifier_err_infinite_loop() localVariable 56 vm.execute_program().unwrap(); in test_verifier_err_infinite_loop() 68 let vm = rbpf::EbpfVmNoData::new(Some(&prog)).unwrap(); in test_verifier_err_invalid_reg_dst() localVariable 69 vm.execute_program().unwrap(); in test_verifier_err_invalid_reg_dst() 81 let vm = rbpf::EbpfVmNoData::new(Some(&prog)).unwrap(); in test_verifier_err_invalid_reg_src() localVariable 82 vm.execute_program().unwrap(); in test_verifier_err_invalid_reg_src() [all …]
|
/DragonOS/kernel/crates/rbpf/examples/ |
H A D | uptime.rs | 38 let mut vm = rbpf::EbpfVmNoData::new(Some(prog1)).unwrap(); in main() localVariable 40 assert_eq!(vm.execute_program().unwrap(), 0x3); in main() 50 vm.set_program(prog2).unwrap(); in main() 51 vm.register_helper(helpers::BPF_KTIME_GETNS_IDX, helpers::bpf_time_getns) in main() 58 vm.jit_compile().unwrap(); in main() 60 time = unsafe { vm.execute_program_jit().unwrap() }; in main() 65 time = vm.execute_program().unwrap(); in main()
|
H A D | load_elf.rs | 92 let mut vm = rbpf::EbpfVmFixedMbuff::new(Some(prog), 0x40, 0x50).unwrap(); in main() localVariable 93 vm.register_helper(helpers::BPF_TRACE_PRINTK_IDX, helpers::bpf_trace_printf) in main() 96 let res = vm.execute_program(packet1).unwrap(); in main() 102 vm.jit_compile().unwrap(); in main() 104 let res = unsafe { vm.execute_program_jit(packet2).unwrap() }; in main() 111 let res = vm.execute_program(packet2).unwrap(); in main()
|
H A D | rbpf_plugin.rs | 92 let mut vm = rbpf::EbpfVmRaw::new(Some(&bytecode)).unwrap(); in main() localVariable 95 vm.register_helper(5, _unwind).unwrap(); in main() 107 vm.jit_compile().unwrap(); in main() 108 result = vm.execute_program_jit(&mut memory).unwrap(); in main() 119 vm.cranelift_compile().unwrap(); in main() 120 result = vm.execute_program_cranelift(&mut memory).unwrap(); in main() 123 result = vm.execute_program(&mut memory).unwrap(); in main()
|
/DragonOS/kernel/src/perf/ |
H A D | kprobe.rs | 42 let mut vm = in do_set_bpf_prog() localVariable 44 vm.register_helper_set(BPF_HELPER_FUN_SET.get()) in do_set_bpf_prog() 47 let callback = Box::new(KprobePerfCallBack::new(file, vm)); in do_set_bpf_prog() 56 vm: EbpfVmRawOwned, field 60 fn new(bpf_prog_file: Arc<BpfProg>, vm: EbpfVmRawOwned) -> Self { in new() 63 vm, in new() 79 .vm in call()
|
/DragonOS/kernel/src/virt/kvm/ |
H A D | mod.rs | 8 use vm::Vm; 14 pub mod vm; module 51 pub fn vm(id: usize) -> Option<Vm> { in vm() function
|
H A D | vcpu_dev.rs | 14 use crate::virt::kvm::vm; 165 let vcpu = vm(0).unwrap().vcpu[0].clone(); in ioctl() 186 let vcpu = vm(0).unwrap().vcpu[0].clone(); in ioctl()
|
H A D | vm_dev.rs | 16 use crate::virt::kvm::vm; 179 let mut current_vm = vm(0).unwrap(); in ioctl() 220 let mut current_vm = vm(0).unwrap(); in kvm_vm_ioctl_create_vcpu()
|
H A D | host_mem.rs | 4 use super::{vcpu::Vcpu, vm}; 82 let kvm = vm(0).unwrap(); in kvm_vcpu_memslots()
|
/DragonOS/kernel/src/process/ |
H A D | exec.rs | 99 vm: Arc<AddressSpace>, field 118 vm: Arc<AddressSpace>, in new() 128 vm, in new() 134 pub fn vm(&self) -> &Arc<AddressSpace> { in vm() method 135 &self.vm in vm() 186 assert!(param.vm().is_current()); in load_binary_file()
|
/DragonOS/kernel/src/arch/x86_64/kvm/ |
H A D | mod.rs | 4 use crate::virt::kvm::vm; 60 let vcpu = VmxVcpu::new(id, vm(0).unwrap()).unwrap(); in kvm_arch_vcpu_create()
|
/DragonOS/kernel/src/arch/x86_64/kvm/vmx/ |
H A D | vmexit.rs | 4 use crate::virt::kvm::vm; 240 let kvm = vm(0).unwrap(); in vmexit_handler()
|
H A D | vcpu.rs | 16 use crate::virt::kvm::vm::Vm;
|
/DragonOS/kernel/src/mm/ |
H A D | ucontext.rs | 76 let vm = ProcessManager::current_pcb() in current() localVariable 81 return Ok(vm); in current() 1723 vm: &mut InnerAddressSpace, in new() 1744 vm.map_anonymous( in new() 1760 vm.mprotect( in new() 1780 user_stack.initial_extend(vm, stack_size)?; in new() 1787 vm: &mut InnerAddressSpace, in initial_extend() 1796 vm.map_anonymous( in initial_extend() 1822 vm: &mut InnerAddressSpace, in extend() 1831 vm.map_anonymous( in extend()
|
/DragonOS/kernel/crates/rbpf/ |
H A D | README.md | 281 let vm = rbpf::EbpfVmNoData::new(Some(prog)).unwrap(); 284 assert_eq!(vm.execute_program().unwrap(), 0x3); 308 let mut vm = rbpf::EbpfVmRaw::new(Some(prog)).unwrap(); 311 assert_eq!(vm.execute_program(mem).unwrap(), 0x11); 315 vm.jit_compile().unwrap(); 319 unsafe { assert_eq!(vm.execute_program_jit(mem).unwrap(), 0x11); } 354 let mut vm = rbpf::EbpfVmMbuff::new(Some(prog)).unwrap(); 357 assert_eq!(vm.execute_program(mem, mbuff).unwrap(), 0x2211); 361 vm.jit_compile().unwrap(); 366 assert_eq!(vm.execute_program_jit(mem, mbuff).unwrap(), 0x2211); [all …]
|
/DragonOS/docs/community/ChangeLog/V0.1.x/ |
H A D | V0.1.9.md | 93 - bugfix: 修正fork的时候没有正确拷贝vm holes的bug ([#433](https://github.com/DragonOS-Community/DragonOS/pull/4… 1134 修正fork的时候没有正确拷贝vm holes的bug (#433) 1434 * 增加vm ioctl 1462 * rename hypervisor to vm & solve some deadlock bugs
|
/DragonOS/kernel/src/libs/ |
H A D | elf.rs | 533 let binding = param.vm().clone(); in load()
|