CC: [email protected]
CC: [email protected]
CC: [email protected]
TO: Yadong Qi <[email protected]>
CC: Paolo Bonzini <[email protected]>

tree:   https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git 
master
head:   c9194f32bfd932e976a158d1af97a63be68a2aab
commit: bf0cd88ce363a2de3684baaa48d3f194acdc516c KVM: x86: emulate 
wait-for-SIPI and SIPI-VMExit
date:   9 months ago
:::::: branch date: 15 hours ago
:::::: commit date: 9 months ago
config: x86_64-randconfig-c001-20210806 (attached as .config)
compiler: clang version 14.0.0 (https://github.com/llvm/llvm-project 
42b9c2a17a0b63cccf3ac197a82f91b28e53e643)
reproduce (this is a W=1 build):
        wget 
https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O 
~/bin/make.cross
        chmod +x ~/bin/make.cross
        # install x86_64 cross compiling tool for clang build
        # apt-get install binutils-x86-64-linux-gnu
        # 
https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=bf0cd88ce363a2de3684baaa48d3f194acdc516c
        git remote add linus 
https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
        git fetch --no-tags linus master
        git checkout bf0cd88ce363a2de3684baaa48d3f194acdc516c
        # save the attached .config to linux build tree
        COMPILER_INSTALL_PATH=$HOME/0day COMPILER=clang make.cross ARCH=x86_64 
clang-analyzer 

If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <[email protected]>


clang-analyzer warnings: (new ones prefixed by >>)
   include/linux/compiler_types.h:303:2: note: expanded from macro 
'_compiletime_assert'
           __compiletime_assert(condition, msg, prefix, suffix)
           ^
   include/linux/compiler_types.h:295:3: note: expanded from macro 
'__compiletime_assert'
                   if (!(condition))                                       \
                   ^
   drivers/i2c/i2c-core-base.c:959:6: note: Loop condition is false.  Exiting 
loop
           if (ACPI_COMPANION(&client->dev))
               ^
   include/linux/acpi.h:43:30: note: expanded from macro 'ACPI_COMPANION'
   #define ACPI_COMPANION(dev)             to_acpi_device_node((dev)->fwnode)
                                           ^
   include/acpi/acpi_bus.h:410:4: note: expanded from macro 
'to_acpi_device_node'
                           container_of(__to_acpi_device_node_fwnode,      \
                           ^
   include/linux/kernel.h:853:2: note: expanded from macro 'container_of'
           BUILD_BUG_ON_MSG(!__same_type(*(ptr), ((type *)0)->member) &&   \
           ^
   note: (skipping 1 expansions in backtrace; use -fmacro-backtrace-limit=0 to 
see all)
   include/linux/compiler_types.h:315:2: note: expanded from macro 
'compiletime_assert'
           _compiletime_assert(condition, msg, __compiletime_assert_, 
__COUNTER__)
           ^
   include/linux/compiler_types.h:303:2: note: expanded from macro 
'_compiletime_assert'
           __compiletime_assert(condition, msg, prefix, suffix)
           ^
   include/linux/compiler_types.h:293:2: note: expanded from macro 
'__compiletime_assert'
           do {                                                            \
           ^
   drivers/i2c/i2c-core-base.c:959:6: note: Assuming the condition is true
           if (ACPI_COMPANION(&client->dev))
               ^
   include/linux/acpi.h:43:30: note: expanded from macro 'ACPI_COMPANION'
   #define ACPI_COMPANION(dev)             to_acpi_device_node((dev)->fwnode)
                                           ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   include/acpi/acpi_bus.h:406:2: note: expanded from macro 
'to_acpi_device_node'
           ({                                                              \
           ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   drivers/i2c/i2c-core-base.c:959:2: note: Taking true branch
           if (ACPI_COMPANION(&client->dev))
           ^
   drivers/i2c/i2c-core-base.c:960:32: note: Assuming the condition is false
                   acpi_device_clear_enumerated(ACPI_COMPANION(&client->dev));
                                                ^
   include/linux/acpi.h:43:30: note: expanded from macro 'ACPI_COMPANION'
   #define ACPI_COMPANION(dev)             to_acpi_device_node((dev)->fwnode)
                                           ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   include/acpi/acpi_bus.h:409:3: note: expanded from macro 
'to_acpi_device_node'
                   is_acpi_device_node(__to_acpi_device_node_fwnode) ?     \
                   ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   drivers/i2c/i2c-core-base.c:960:32: note: '?' condition is false
                   acpi_device_clear_enumerated(ACPI_COMPANION(&client->dev));
                                                ^
   include/linux/acpi.h:43:30: note: expanded from macro 'ACPI_COMPANION'
   #define ACPI_COMPANION(dev)             to_acpi_device_node((dev)->fwnode)
                                           ^
   include/acpi/acpi_bus.h:409:3: note: expanded from macro 
'to_acpi_device_node'
                   is_acpi_device_node(__to_acpi_device_node_fwnode) ?     \
                   ^
   drivers/i2c/i2c-core-base.c:960:32: note: Passing null pointer value via 1st 
parameter 'adev'
                   acpi_device_clear_enumerated(ACPI_COMPANION(&client->dev));
                                                ^
   include/linux/acpi.h:43:30: note: expanded from macro 'ACPI_COMPANION'
   #define ACPI_COMPANION(dev)             to_acpi_device_node((dev)->fwnode)
                                           ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   include/acpi/acpi_bus.h:406:2: note: expanded from macro 
'to_acpi_device_node'
           ({                                                              \
           ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   drivers/i2c/i2c-core-base.c:960:3: note: Calling 
'acpi_device_clear_enumerated'
                   acpi_device_clear_enumerated(ACPI_COMPANION(&client->dev));
                   ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   include/linux/acpi.h:671:22: note: Dereference of null pointer
           adev->flags.visited = false;
           ~~~~~~~~~~~~~~~~~~~~^~~~~~~
   Suppressed 2 warnings (2 in non-user code).
   Use -header-filter=.* to display errors from all non-system headers. Use 
-system-headers to display errors from system headers as well.
   5 warnings generated.
   Suppressed 5 warnings (5 in non-user code).
   Use -header-filter=.* to display errors from all non-system headers. Use 
-system-headers to display errors from system headers as well.
   5 warnings generated.
   Suppressed 5 warnings (5 in non-user code).
   Use -header-filter=.* to display errors from all non-system headers. Use 
-system-headers to display errors from system headers as well.
   5 warnings generated.
   Suppressed 5 warnings (5 in non-user code).
   Use -header-filter=.* to display errors from all non-system headers. Use 
-system-headers to display errors from system headers as well.
   5 warnings generated.
   Suppressed 5 warnings (5 in non-user code).
   Use -header-filter=.* to display errors from all non-system headers. Use 
-system-headers to display errors from system headers as well.
   9 warnings generated.
   Suppressed 9 warnings (9 in non-user code).
   Use -header-filter=.* to display errors from all non-system headers. Use 
-system-headers to display errors from system headers as well.
   9 warnings generated.
   Suppressed 9 warnings (9 in non-user code).
   Use -header-filter=.* to display errors from all non-system headers. Use 
-system-headers to display errors from system headers as well.
   5 warnings generated.
   Suppressed 5 warnings (5 in non-user code).
   Use -header-filter=.* to display errors from all non-system headers. Use 
-system-headers to display errors from system headers as well.
   9 warnings generated.
   Suppressed 9 warnings (9 in non-user code).
   Use -header-filter=.* to display errors from all non-system headers. Use 
-system-headers to display errors from system headers as well.
   11 warnings generated.
>> arch/x86/kvm/vmx/nested.c:3824:7: warning: Access to field 'sipi_vector' 
>> results in a dereference of a null pointer (loaded from variable 'apic') 
>> [clang-analyzer-core.NullDereference]
                                                   apic->sipi_vector & 0xFFUL);
                                                   ^~~~
   arch/x86/kvm/vmx/nested.c:3791:25: note: Calling 'to_vmx'
           struct vcpu_vmx *vmx = to_vmx(vcpu);
                                  ^~~~~~~~~~~~
   arch/x86/kvm/vmx/vmx.h:422:9: note: Left side of '&&' is false
           return container_of(vcpu, struct vcpu_vmx, vcpu);
                  ^
   include/linux/kernel.h:853:61: note: expanded from macro 'container_of'
           BUILD_BUG_ON_MSG(!__same_type(*(ptr), ((type *)0)->member) &&   \
                                                                      ^
   arch/x86/kvm/vmx/vmx.h:422:9: note: Taking false branch
           return container_of(vcpu, struct vcpu_vmx, vcpu);
                  ^
   include/linux/kernel.h:853:2: note: expanded from macro 'container_of'
           BUILD_BUG_ON_MSG(!__same_type(*(ptr), ((type *)0)->member) &&   \
           ^
   include/linux/build_bug.h:39:37: note: expanded from macro 'BUILD_BUG_ON_MSG'
   #define BUILD_BUG_ON_MSG(cond, msg) compiletime_assert(!(cond), msg)
                                       ^
   include/linux/compiler_types.h:315:2: note: expanded from macro 
'compiletime_assert'
           _compiletime_assert(condition, msg, __compiletime_assert_, 
__COUNTER__)
           ^
   include/linux/compiler_types.h:303:2: note: expanded from macro 
'_compiletime_assert'
           __compiletime_assert(condition, msg, prefix, suffix)
           ^
   include/linux/compiler_types.h:295:3: note: expanded from macro 
'__compiletime_assert'
                   if (!(condition))                                       \
                   ^
   arch/x86/kvm/vmx/vmx.h:422:9: note: Loop condition is false.  Exiting loop
           return container_of(vcpu, struct vcpu_vmx, vcpu);
                  ^
   include/linux/kernel.h:853:2: note: expanded from macro 'container_of'
           BUILD_BUG_ON_MSG(!__same_type(*(ptr), ((type *)0)->member) &&   \
           ^
   include/linux/build_bug.h:39:37: note: expanded from macro 'BUILD_BUG_ON_MSG'
   #define BUILD_BUG_ON_MSG(cond, msg) compiletime_assert(!(cond), msg)
                                       ^
   include/linux/compiler_types.h:315:2: note: expanded from macro 
'compiletime_assert'
           _compiletime_assert(condition, msg, __compiletime_assert_, 
__COUNTER__)
           ^
   include/linux/compiler_types.h:303:2: note: expanded from macro 
'_compiletime_assert'
           __compiletime_assert(condition, msg, prefix, suffix)
           ^
   include/linux/compiler_types.h:293:2: note: expanded from macro 
'__compiletime_assert'
           do {                                                            \
           ^
   arch/x86/kvm/vmx/vmx.h:422:2: note: Returning without writing to 
'vcpu->arch.apic'
           return container_of(vcpu, struct vcpu_vmx, vcpu);
           ^
   arch/x86/kvm/vmx/vmx.h:422:2: note: Returning without writing to 
'vcpu->arch.apic', which participates in a condition later
   arch/x86/kvm/vmx/nested.c:3791:25: note: Returning from 'to_vmx'
           struct vcpu_vmx *vmx = to_vmx(vcpu);
                                  ^~~~~~~~~~~~
   arch/x86/kvm/vmx/nested.c:3794:6: note: Assuming field 'nested_run_pending' 
is false
               vmx->nested.nested_run_pending || 
kvm_event_needs_reinjection(vcpu);
               ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   arch/x86/kvm/vmx/nested.c:3794:6: note: Left side of '||' is false
   arch/x86/kvm/vmx/nested.c:3794:40: note: Calling 
'kvm_event_needs_reinjection'
               vmx->nested.nested_run_pending || 
kvm_event_needs_reinjection(vcpu);
                                                 
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   arch/x86/kvm/x86.h:71:9: note: Assuming field 'injected' is false
           return vcpu->arch.exception.injected || 
vcpu->arch.interrupt.injected ||
                  ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   arch/x86/kvm/x86.h:71:9: note: Left side of '||' is false
   arch/x86/kvm/x86.h:71:42: note: Assuming field 'injected' is false
           return vcpu->arch.exception.injected || 
vcpu->arch.interrupt.injected ||
                                                   ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   arch/x86/kvm/x86.h:71:9: note: Left side of '||' is false
           return vcpu->arch.exception.injected || 
vcpu->arch.interrupt.injected ||
                  ^
   arch/x86/kvm/x86.h:71:2: note: Returning without writing to 'vcpu->arch.apic'
           return vcpu->arch.exception.injected || 
vcpu->arch.interrupt.injected ||
           ^
   arch/x86/kvm/x86.h:71:2: note: Returning without writing to 
'vcpu->arch.apic', which participates in a condition later
   arch/x86/kvm/vmx/nested.c:3794:40: note: Returning from 
'kvm_event_needs_reinjection'
               vmx->nested.nested_run_pending || 
kvm_event_needs_reinjection(vcpu);
                                                 
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   arch/x86/kvm/vmx/nested.c:3796:2: note: 'apic' initialized here
           struct kvm_lapic *apic = vcpu->arch.apic;
           ^~~~~~~~~~~~~~~~~~~~~~
   arch/x86/kvm/vmx/nested.c:3802:6: note: Assuming 'block_nested_events' is 
false
           if (!block_nested_events)
               ^~~~~~~~~~~~~~~~~~~~
   arch/x86/kvm/vmx/nested.c:3802:2: note: Taking true branch
           if (!block_nested_events)
           ^
   arch/x86/kvm/vmx/nested.c:3805:6: note: Calling 'lapic_in_kernel'
           if (lapic_in_kernel(vcpu) &&
               ^~~~~~~~~~~~~~~~~~~~~
   arch/x86/kvm/lapic.h:179:6: note: Calling 'static_key_false'
           if (static_key_false(&kvm_no_apic_vcpu))
               ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   include/linux/jump_label.h:264:15: note: Assuming the condition is true
           if (unlikely(static_key_count(key) > 0))
                        ^
   include/linux/compiler.h:78:42: note: expanded from macro 'unlikely'
   # define unlikely(x)    __builtin_expect(!!(x), 0)
                                               ^
   include/linux/jump_label.h:264:2: note: Taking true branch

vim +3824 arch/x86/kvm/vmx/nested.c

d2060bd42e4482 Sean Christopherson 2020-04-22  3788  
a1c77abb8d9338 Sean Christopherson 2020-03-02  3789  static int 
vmx_check_nested_events(struct kvm_vcpu *vcpu)
55d2375e58a61b Sean Christopherson 2018-12-03  3790  {
55d2375e58a61b Sean Christopherson 2018-12-03  3791     struct vcpu_vmx *vmx = 
to_vmx(vcpu);
55d2375e58a61b Sean Christopherson 2018-12-03  3792     unsigned long exit_qual;
55d2375e58a61b Sean Christopherson 2018-12-03  3793     bool 
block_nested_events =
55d2375e58a61b Sean Christopherson 2018-12-03  3794         
vmx->nested.nested_run_pending || kvm_event_needs_reinjection(vcpu);
5ef8acbdd687c9 Oliver Upton        2020-02-07  3795     bool mtf_pending = 
vmx->nested.mtf_pending;
4b9852f4f38909 Liran Alon          2019-08-26  3796     struct kvm_lapic *apic 
= vcpu->arch.apic;
4b9852f4f38909 Liran Alon          2019-08-26  3797  
5ef8acbdd687c9 Oliver Upton        2020-02-07  3798     /*
5ef8acbdd687c9 Oliver Upton        2020-02-07  3799      * Clear the MTF state. 
If a higher priority VM-exit is delivered first,
5ef8acbdd687c9 Oliver Upton        2020-02-07  3800      * this state is 
discarded.
5ef8acbdd687c9 Oliver Upton        2020-02-07  3801      */
5c8beb47466522 Oliver Upton        2020-04-06  3802     if 
(!block_nested_events)
5ef8acbdd687c9 Oliver Upton        2020-02-07  3803             
vmx->nested.mtf_pending = false;
5ef8acbdd687c9 Oliver Upton        2020-02-07  3804  
4b9852f4f38909 Liran Alon          2019-08-26  3805     if 
(lapic_in_kernel(vcpu) &&
4b9852f4f38909 Liran Alon          2019-08-26  3806             
test_bit(KVM_APIC_INIT, &apic->pending_events)) {
4b9852f4f38909 Liran Alon          2019-08-26  3807             if 
(block_nested_events)
4b9852f4f38909 Liran Alon          2019-08-26  3808                     return 
-EBUSY;
684c0422da71da Oliver Upton        2020-02-07  3809             
nested_vmx_update_pending_dbg(vcpu);
e64a8508234afb Liran Alon          2019-11-11  3810             
clear_bit(KVM_APIC_INIT, &apic->pending_events);
bf0cd88ce363a2 Yadong Qi           2020-11-06  3811             if 
(vcpu->arch.mp_state != KVM_MP_STATE_INIT_RECEIVED)
4b9852f4f38909 Liran Alon          2019-08-26  3812                     
nested_vmx_vmexit(vcpu, EXIT_REASON_INIT_SIGNAL, 0, 0);
4b9852f4f38909 Liran Alon          2019-08-26  3813             return 0;
4b9852f4f38909 Liran Alon          2019-08-26  3814     }
55d2375e58a61b Sean Christopherson 2018-12-03  3815  
bf0cd88ce363a2 Yadong Qi           2020-11-06  3816     if 
(lapic_in_kernel(vcpu) &&
bf0cd88ce363a2 Yadong Qi           2020-11-06  3817         
test_bit(KVM_APIC_SIPI, &apic->pending_events)) {
bf0cd88ce363a2 Yadong Qi           2020-11-06  3818             if 
(block_nested_events)
bf0cd88ce363a2 Yadong Qi           2020-11-06  3819                     return 
-EBUSY;
bf0cd88ce363a2 Yadong Qi           2020-11-06  3820  
bf0cd88ce363a2 Yadong Qi           2020-11-06  3821             
clear_bit(KVM_APIC_SIPI, &apic->pending_events);
bf0cd88ce363a2 Yadong Qi           2020-11-06  3822             if 
(vcpu->arch.mp_state == KVM_MP_STATE_INIT_RECEIVED)
bf0cd88ce363a2 Yadong Qi           2020-11-06  3823                     
nested_vmx_vmexit(vcpu, EXIT_REASON_SIPI_SIGNAL, 0,
bf0cd88ce363a2 Yadong Qi           2020-11-06 @3824                             
                apic->sipi_vector & 0xFFUL);
bf0cd88ce363a2 Yadong Qi           2020-11-06  3825             return 0;
bf0cd88ce363a2 Yadong Qi           2020-11-06  3826     }
bf0cd88ce363a2 Yadong Qi           2020-11-06  3827  
5ef8acbdd687c9 Oliver Upton        2020-02-07  3828     /*
5ef8acbdd687c9 Oliver Upton        2020-02-07  3829      * Process any 
exceptions that are not debug traps before MTF.
5ef8acbdd687c9 Oliver Upton        2020-02-07  3830      */
6ce347af1499de Sean Christopherson 2020-04-22  3831     if 
(vcpu->arch.exception.pending && !vmx_pending_dbg_trap(vcpu)) {
5ef8acbdd687c9 Oliver Upton        2020-02-07  3832             if 
(block_nested_events)
5ef8acbdd687c9 Oliver Upton        2020-02-07  3833                     return 
-EBUSY;
6ce347af1499de Sean Christopherson 2020-04-22  3834             if 
(!nested_vmx_check_exception(vcpu, &exit_qual))
6ce347af1499de Sean Christopherson 2020-04-22  3835                     goto 
no_vmexit;
5ef8acbdd687c9 Oliver Upton        2020-02-07  3836             
nested_vmx_inject_exception_vmexit(vcpu, exit_qual);
5ef8acbdd687c9 Oliver Upton        2020-02-07  3837             return 0;
5ef8acbdd687c9 Oliver Upton        2020-02-07  3838     }
5ef8acbdd687c9 Oliver Upton        2020-02-07  3839  
5ef8acbdd687c9 Oliver Upton        2020-02-07  3840     if (mtf_pending) {
5ef8acbdd687c9 Oliver Upton        2020-02-07  3841             if 
(block_nested_events)
5ef8acbdd687c9 Oliver Upton        2020-02-07  3842                     return 
-EBUSY;
5ef8acbdd687c9 Oliver Upton        2020-02-07  3843             
nested_vmx_update_pending_dbg(vcpu);
5ef8acbdd687c9 Oliver Upton        2020-02-07  3844             
nested_vmx_vmexit(vcpu, EXIT_REASON_MONITOR_TRAP_FLAG, 0, 0);
5ef8acbdd687c9 Oliver Upton        2020-02-07  3845             return 0;
5ef8acbdd687c9 Oliver Upton        2020-02-07  3846     }
5ef8acbdd687c9 Oliver Upton        2020-02-07  3847  
6ce347af1499de Sean Christopherson 2020-04-22  3848     if 
(vcpu->arch.exception.pending) {
55d2375e58a61b Sean Christopherson 2018-12-03  3849             if 
(block_nested_events)
55d2375e58a61b Sean Christopherson 2018-12-03  3850                     return 
-EBUSY;
6ce347af1499de Sean Christopherson 2020-04-22  3851             if 
(!nested_vmx_check_exception(vcpu, &exit_qual))
6ce347af1499de Sean Christopherson 2020-04-22  3852                     goto 
no_vmexit;
55d2375e58a61b Sean Christopherson 2018-12-03  3853             
nested_vmx_inject_exception_vmexit(vcpu, exit_qual);
55d2375e58a61b Sean Christopherson 2018-12-03  3854             return 0;
55d2375e58a61b Sean Christopherson 2018-12-03  3855     }
55d2375e58a61b Sean Christopherson 2018-12-03  3856  
d2060bd42e4482 Sean Christopherson 2020-04-22  3857     if 
(nested_vmx_preemption_timer_pending(vcpu)) {
55d2375e58a61b Sean Christopherson 2018-12-03  3858             if 
(block_nested_events)
55d2375e58a61b Sean Christopherson 2018-12-03  3859                     return 
-EBUSY;
55d2375e58a61b Sean Christopherson 2018-12-03  3860             
nested_vmx_vmexit(vcpu, EXIT_REASON_PREEMPTION_TIMER, 0, 0);
55d2375e58a61b Sean Christopherson 2018-12-03  3861             return 0;
55d2375e58a61b Sean Christopherson 2018-12-03  3862     }
55d2375e58a61b Sean Christopherson 2018-12-03  3863  
1cd2f0b0dd9218 Sean Christopherson 2020-04-22  3864     if 
(vcpu->arch.smi_pending && !is_smm(vcpu)) {
1cd2f0b0dd9218 Sean Christopherson 2020-04-22  3865             if 
(block_nested_events)
1cd2f0b0dd9218 Sean Christopherson 2020-04-22  3866                     return 
-EBUSY;
1cd2f0b0dd9218 Sean Christopherson 2020-04-22  3867             goto no_vmexit;
1cd2f0b0dd9218 Sean Christopherson 2020-04-22  3868     }
1cd2f0b0dd9218 Sean Christopherson 2020-04-22  3869  
15ff0b450b6541 Sean Christopherson 2020-04-22  3870     if 
(vcpu->arch.nmi_pending && !vmx_nmi_blocked(vcpu)) {
55d2375e58a61b Sean Christopherson 2018-12-03  3871             if 
(block_nested_events)
55d2375e58a61b Sean Christopherson 2018-12-03  3872                     return 
-EBUSY;
15ff0b450b6541 Sean Christopherson 2020-04-22  3873             if 
(!nested_exit_on_nmi(vcpu))
15ff0b450b6541 Sean Christopherson 2020-04-22  3874                     goto 
no_vmexit;
15ff0b450b6541 Sean Christopherson 2020-04-22  3875  
55d2375e58a61b Sean Christopherson 2018-12-03  3876             
nested_vmx_vmexit(vcpu, EXIT_REASON_EXCEPTION_NMI,
55d2375e58a61b Sean Christopherson 2018-12-03  3877                             
  NMI_VECTOR | INTR_TYPE_NMI_INTR |
55d2375e58a61b Sean Christopherson 2018-12-03  3878                             
  INTR_INFO_VALID_MASK, 0);
55d2375e58a61b Sean Christopherson 2018-12-03  3879             /*
55d2375e58a61b Sean Christopherson 2018-12-03  3880              * The 
NMI-triggered VM exit counts as injection:
55d2375e58a61b Sean Christopherson 2018-12-03  3881              * clear this 
one and block further NMIs.
55d2375e58a61b Sean Christopherson 2018-12-03  3882              */
55d2375e58a61b Sean Christopherson 2018-12-03  3883             
vcpu->arch.nmi_pending = 0;
55d2375e58a61b Sean Christopherson 2018-12-03  3884             
vmx_set_nmi_mask(vcpu, true);
55d2375e58a61b Sean Christopherson 2018-12-03  3885             return 0;
55d2375e58a61b Sean Christopherson 2018-12-03  3886     }
55d2375e58a61b Sean Christopherson 2018-12-03  3887  
15ff0b450b6541 Sean Christopherson 2020-04-22  3888     if 
(kvm_cpu_has_interrupt(vcpu) && !vmx_interrupt_blocked(vcpu)) {
55d2375e58a61b Sean Christopherson 2018-12-03  3889             if 
(block_nested_events)
55d2375e58a61b Sean Christopherson 2018-12-03  3890                     return 
-EBUSY;
15ff0b450b6541 Sean Christopherson 2020-04-22  3891             if 
(!nested_exit_on_intr(vcpu))
15ff0b450b6541 Sean Christopherson 2020-04-22  3892                     goto 
no_vmexit;
55d2375e58a61b Sean Christopherson 2018-12-03  3893             
nested_vmx_vmexit(vcpu, EXIT_REASON_EXTERNAL_INTERRUPT, 0, 0);
55d2375e58a61b Sean Christopherson 2018-12-03  3894             return 0;
55d2375e58a61b Sean Christopherson 2018-12-03  3895     }
55d2375e58a61b Sean Christopherson 2018-12-03  3896  
6ce347af1499de Sean Christopherson 2020-04-22  3897  no_vmexit:
55d2375e58a61b Sean Christopherson 2018-12-03  3898     
vmx_complete_nested_posted_interrupt(vcpu);
55d2375e58a61b Sean Christopherson 2018-12-03  3899     return 0;
55d2375e58a61b Sean Christopherson 2018-12-03  3900  }
55d2375e58a61b Sean Christopherson 2018-12-03  3901  

---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/[email protected]

Attachment: .config.gz
Description: application/gzip

_______________________________________________
kbuild mailing list -- [email protected]
To unsubscribe send an email to [email protected]

Reply via email to