Lines Matching refs:expectation
5597 struct apic_reg_virt_expectation *expectation) in apic_reg_virt_exit_expectation() argument
5619 expectation->val = MAGIC_VAL_1; in apic_reg_virt_exit_expectation()
5620 expectation->virt_fn = apic_virt_identity; in apic_reg_virt_exit_expectation()
5621 expectation->virtualize_apic_accesses = in apic_reg_virt_exit_expectation()
5625 expectation->rd_exit_reason = VMX_APIC_ACCESS; in apic_reg_virt_exit_expectation()
5626 expectation->wr_exit_reason = VMX_APIC_ACCESS; in apic_reg_virt_exit_expectation()
5630 expectation->rd_exit_reason = VMX_VMCALL; in apic_reg_virt_exit_expectation()
5631 expectation->wr_exit_reason = VMX_VMCALL; in apic_reg_virt_exit_expectation()
5632 expectation->virt_fn = apic_virt_nibble1; in apic_reg_virt_exit_expectation()
5635 expectation->rd_exit_reason = VMX_APIC_ACCESS; in apic_reg_virt_exit_expectation()
5636 expectation->wr_exit_reason = VMX_APIC_ACCESS; in apic_reg_virt_exit_expectation()
5639 expectation->rd_exit_reason = VMX_VMCALL; in apic_reg_virt_exit_expectation()
5657 expectation->wr_exit_reason = VMX_APIC_WRITE; in apic_reg_virt_exit_expectation()
5663 expectation->wr_exit_reason = VMX_APIC_ACCESS; in apic_reg_virt_exit_expectation()
5666 expectation->wr_exit_reason = VMX_VMCALL; in apic_reg_virt_exit_expectation()
5667 expectation->virt_fn = apic_virt_nibble1; in apic_reg_virt_exit_expectation()
5670 expectation->wr_exit_reason = VMX_VMCALL; in apic_reg_virt_exit_expectation()
5671 expectation->virt_fn = apic_virt_byte3; in apic_reg_virt_exit_expectation()
5674 expectation->rd_exit_reason = VMX_APIC_ACCESS; in apic_reg_virt_exit_expectation()
5675 expectation->wr_exit_reason = VMX_APIC_ACCESS; in apic_reg_virt_exit_expectation()
5677 } else if (!expectation->virtualize_apic_accesses) { in apic_reg_virt_exit_expectation()
5684 expectation->rd_exit_reason = VMX_VMCALL; in apic_reg_virt_exit_expectation()
5685 expectation->wr_exit_reason = VMX_VMCALL; in apic_reg_virt_exit_expectation()
5912 u32 reg, struct apic_reg_virt_expectation *expectation, in test_xapic_rd() argument
5915 u32 val = expectation->val; in test_xapic_rd()
5916 u32 exit_reason_want = expectation->rd_exit_reason; in test_xapic_rd()
5927 args->virt_fn = expectation->virt_fn; in test_xapic_rd()
5930 if (!expectation->virtualize_apic_accesses) { in test_xapic_rd()
5965 u32 reg, struct apic_reg_virt_expectation *expectation, in test_xapic_wr() argument
5968 u32 val = expectation->val; in test_xapic_wr()
5969 u32 exit_reason_want = expectation->wr_exit_reason; in test_xapic_wr()
5972 expectation->virtualize_apic_accesses && in test_xapic_wr()
5986 if (virtualized || !expectation->virtualize_apic_accesses) { in test_xapic_wr()
6025 u32 want = expectation->virt_fn(val); in test_xapic_wr()
6027 got = expectation->virt_fn(got); in test_xapic_wr()
6031 } else if (!expectation->virtualize_apic_accesses && !checked) { in test_xapic_wr()
6037 } else if (!expectation->virtualize_apic_accesses && checked) { in test_xapic_wr()
6191 struct apic_reg_virt_expectation expectation = {}; in apic_reg_virt_test() local
6195 reg, apic_reg_virt_config, &expectation); in apic_reg_virt_test()
6201 test_xapic_rd(reg, &expectation, apic_access_address, in apic_reg_virt_test()
6203 test_xapic_wr(reg, &expectation, apic_access_address, in apic_reg_virt_test()
6272 struct virt_x2apic_mode_expectation *expectation) in virt_x2apic_mode_rd_expectation() argument
6276 expectation->rd_exit_reason = VMX_VMCALL; in virt_x2apic_mode_rd_expectation()
6277 expectation->virt_fn = virt_x2apic_mode_identity; in virt_x2apic_mode_rd_expectation()
6279 expectation->rd_val = MAGIC_VAL_1; in virt_x2apic_mode_rd_expectation()
6281 expectation->virt_fn = virt_x2apic_mode_nibble1; in virt_x2apic_mode_rd_expectation()
6283 expectation->virt_fn = virt_x2apic_mode_nibble1; in virt_x2apic_mode_rd_expectation()
6284 expectation->rd_behavior = X2APIC_ACCESS_VIRTUALIZED; in virt_x2apic_mode_rd_expectation()
6287 expectation->rd_val = MAGIC_VAL_1; in virt_x2apic_mode_rd_expectation()
6288 expectation->virt_fn = virt_x2apic_mode_nibble1; in virt_x2apic_mode_rd_expectation()
6289 expectation->rd_behavior = X2APIC_ACCESS_VIRTUALIZED; in virt_x2apic_mode_rd_expectation()
6291 expectation->rd_val = apic_read(reg); in virt_x2apic_mode_rd_expectation()
6292 expectation->rd_behavior = X2APIC_ACCESS_PASSED_THROUGH; in virt_x2apic_mode_rd_expectation()
6294 expectation->rd_behavior = X2APIC_ACCESS_TRIGGERS_GP; in virt_x2apic_mode_rd_expectation()
6382 struct virt_x2apic_mode_expectation *expectation) in virt_x2apic_mode_wr_expectation() argument
6384 expectation->wr_exit_reason = VMX_VMCALL; in virt_x2apic_mode_wr_expectation()
6385 expectation->wr_val = MAGIC_VAL_1; in virt_x2apic_mode_wr_expectation()
6386 expectation->wr_only = false; in virt_x2apic_mode_wr_expectation()
6389 special_processing_applies(reg, &expectation->wr_val, in virt_x2apic_mode_wr_expectation()
6391 expectation->wr_behavior = X2APIC_ACCESS_VIRTUALIZED; in virt_x2apic_mode_wr_expectation()
6393 expectation->wr_exit_reason = VMX_APIC_WRITE; in virt_x2apic_mode_wr_expectation()
6395 get_x2apic_wr_val(reg, &expectation->wr_val)) { in virt_x2apic_mode_wr_expectation()
6396 expectation->wr_behavior = X2APIC_ACCESS_PASSED_THROUGH; in virt_x2apic_mode_wr_expectation()
6398 expectation->wr_only = true; in virt_x2apic_mode_wr_expectation()
6400 expectation->wr_exit_reason = VMX_EXTINT; in virt_x2apic_mode_wr_expectation()
6402 expectation->wr_behavior = X2APIC_ACCESS_TRIGGERS_GP; in virt_x2apic_mode_wr_expectation()
6408 expectation->wr_val = 0; in virt_x2apic_mode_wr_expectation()
6414 struct virt_x2apic_mode_expectation *expectation) in virt_x2apic_mode_exit_expectation() argument
6426 config->virtual_interrupt_delivery, expectation); in virt_x2apic_mode_exit_expectation()
6430 config->virtual_interrupt_delivery, expectation); in virt_x2apic_mode_exit_expectation()
6720 u32 reg, struct virt_x2apic_mode_expectation *expectation, in test_x2apic_rd() argument
6723 u64 val = expectation->rd_val; in test_x2apic_rd()
6724 u32 exit_reason_want = expectation->rd_exit_reason; in test_x2apic_rd()
6733 args->should_gp = expectation->rd_behavior == X2APIC_ACCESS_TRIGGERS_GP; in test_x2apic_rd()
6734 args->virt_fn = expectation->virt_fn; in test_x2apic_rd()
6737 if (expectation->rd_behavior == X2APIC_ACCESS_VIRTUALIZED) in test_x2apic_rd()
6759 u32 reg, struct virt_x2apic_mode_expectation *expectation, in test_x2apic_wr() argument
6762 u64 val = expectation->wr_val; in test_x2apic_wr()
6763 u32 exit_reason_want = expectation->wr_exit_reason; in test_x2apic_wr()
6774 args->should_gp = expectation->wr_behavior == X2APIC_ACCESS_TRIGGERS_GP; in test_x2apic_wr()
6777 if (expectation->wr_behavior == X2APIC_ACCESS_VIRTUALIZED) in test_x2apic_wr()
6779 if (expectation->wr_behavior == X2APIC_ACCESS_PASSED_THROUGH && !expectation->wr_only) in test_x2apic_wr()
6816 if (expectation->wr_behavior == X2APIC_ACCESS_VIRTUALIZED) { in test_x2apic_wr()
6822 } else if (expectation->wr_behavior == X2APIC_ACCESS_PASSED_THROUGH) { in test_x2apic_wr()
6823 if (!expectation->wr_only) { in test_x2apic_wr()
6979 struct virt_x2apic_mode_expectation expectation; in virt_x2apic_mode_test() local
6982 reg, virt_x2apic_mode_config, &expectation); in virt_x2apic_mode_test()
6984 test_x2apic_rd(reg, &expectation, virtual_apic_page); in virt_x2apic_mode_test()
6985 test_x2apic_wr(reg, &expectation, virtual_apic_page); in virt_x2apic_mode_test()