Fuad Tabba | 5c73843 | 2019-12-02 11:02:42 +0000 | [diff] [blame] | 1 | /* |
| 2 | * Copyright 2019 The Hafnium Authors. |
| 3 | * |
Andrew Walbran | e959ec1 | 2020-06-17 15:01:09 +0100 | [diff] [blame] | 4 | * Use of this source code is governed by a BSD-style |
| 5 | * license that can be found in the LICENSE file or at |
| 6 | * https://opensource.org/licenses/BSD-3-Clause. |
Fuad Tabba | 5c73843 | 2019-12-02 11:02:42 +0000 | [diff] [blame] | 7 | */ |
| 8 | |
| 9 | #pragma once |
| 10 | |
Olivier Deprez | c5203fb | 2022-09-29 13:49:24 +0200 | [diff] [blame] | 11 | #include "hf/arch/types.h" |
| 12 | |
Fuad Tabba | 5c73843 | 2019-12-02 11:02:42 +0000 | [diff] [blame] | 13 | #include "hf/addr.h" |
Daniel Boulby | 801f8ef | 2022-06-27 14:21:01 +0100 | [diff] [blame] | 14 | #include "hf/interrupt_desc.h" |
Fuad Tabba | 5c73843 | 2019-12-02 11:02:42 +0000 | [diff] [blame] | 15 | #include "hf/spinlock.h" |
| 16 | |
Andrew Walbran | b5ab43c | 2020-04-30 11:32:54 +0100 | [diff] [blame] | 17 | #include "vmapi/hf/ffa.h" |
Fuad Tabba | 5c73843 | 2019-12-02 11:02:42 +0000 | [diff] [blame] | 18 | |
Madhukar Pappireddy | 8415405 | 2022-06-21 18:30:25 -0500 | [diff] [blame] | 19 | /** Action for non secure interrupt by SPMC. */ |
| 20 | #define NS_ACTION_QUEUED 0 |
| 21 | #define NS_ACTION_ME 1 |
| 22 | #define NS_ACTION_SIGNALED 2 |
Madhukar Pappireddy | 8415405 | 2022-06-21 18:30:25 -0500 | [diff] [blame] | 23 | |
Fuad Tabba | 5c73843 | 2019-12-02 11:02:42 +0000 | [diff] [blame] | 24 | enum vcpu_state { |
Fuad Tabba | b0ef2a4 | 2019-12-19 11:19:25 +0000 | [diff] [blame] | 25 | /** The vCPU is switched off. */ |
Fuad Tabba | 5c73843 | 2019-12-02 11:02:42 +0000 | [diff] [blame] | 26 | VCPU_STATE_OFF, |
| 27 | |
Fuad Tabba | b0ef2a4 | 2019-12-19 11:19:25 +0000 | [diff] [blame] | 28 | /** The vCPU is currently running. */ |
Fuad Tabba | 5c73843 | 2019-12-02 11:02:42 +0000 | [diff] [blame] | 29 | VCPU_STATE_RUNNING, |
| 30 | |
Madhukar Pappireddy | b11e0d1 | 2021-08-02 19:44:35 -0500 | [diff] [blame] | 31 | /** The vCPU is waiting to be allocated CPU cycles to do work. */ |
| 32 | VCPU_STATE_WAITING, |
| 33 | |
| 34 | /** |
| 35 | * The vCPU is blocked and waiting for some work to complete on |
| 36 | * its behalf. |
| 37 | */ |
| 38 | VCPU_STATE_BLOCKED, |
| 39 | |
| 40 | /** The vCPU has been preempted by an interrupt. */ |
| 41 | VCPU_STATE_PREEMPTED, |
Fuad Tabba | 5c73843 | 2019-12-02 11:02:42 +0000 | [diff] [blame] | 42 | |
Fuad Tabba | b0ef2a4 | 2019-12-19 11:19:25 +0000 | [diff] [blame] | 43 | /** The vCPU is waiting for an interrupt. */ |
Fuad Tabba | 5c73843 | 2019-12-02 11:02:42 +0000 | [diff] [blame] | 44 | VCPU_STATE_BLOCKED_INTERRUPT, |
| 45 | |
Fuad Tabba | b0ef2a4 | 2019-12-19 11:19:25 +0000 | [diff] [blame] | 46 | /** The vCPU has aborted. */ |
Fuad Tabba | 5c73843 | 2019-12-02 11:02:42 +0000 | [diff] [blame] | 47 | VCPU_STATE_ABORTED, |
| 48 | }; |
| 49 | |
Madhukar Pappireddy | fe297a3 | 2022-06-21 16:42:13 -0500 | [diff] [blame] | 50 | /** Refer to section 7 of the FF-A v1.1 EAC0 spec. */ |
| 51 | enum partition_runtime_model { |
| 52 | RTM_NONE, |
| 53 | /** Runtime model for FFA_RUN. */ |
| 54 | RTM_FFA_RUN, |
| 55 | /** Runtime model for FFA_MSG_SEND_DIRECT_REQUEST. */ |
| 56 | RTM_FFA_DIR_REQ, |
| 57 | /** Runtime model for Secure Interrupt handling. */ |
| 58 | RTM_SEC_INTERRUPT, |
| 59 | /** Runtime model for SP Initialization. */ |
| 60 | RTM_SP_INIT, |
| 61 | }; |
| 62 | |
Madhukar Pappireddy | 5992fbc | 2022-06-21 17:15:16 -0500 | [diff] [blame] | 63 | /** Refer to section 8.2.3 of the FF-A EAC0 spec. */ |
| 64 | enum schedule_mode { |
| 65 | NONE, |
| 66 | /** Normal world scheduled mode. */ |
| 67 | NWD_MODE, |
| 68 | /** SPMC scheduled mode. */ |
| 69 | SPMC_MODE, |
| 70 | }; |
| 71 | |
Fuad Tabba | 5c73843 | 2019-12-02 11:02:42 +0000 | [diff] [blame] | 72 | struct interrupts { |
| 73 | /** Bitfield keeping track of which interrupts are enabled. */ |
Daniel Boulby | 4ca50f0 | 2022-07-29 18:29:34 +0100 | [diff] [blame] | 74 | struct interrupt_bitmap interrupt_enabled; |
Fuad Tabba | 5c73843 | 2019-12-02 11:02:42 +0000 | [diff] [blame] | 75 | /** Bitfield keeping track of which interrupts are pending. */ |
Daniel Boulby | 4ca50f0 | 2022-07-29 18:29:34 +0100 | [diff] [blame] | 76 | struct interrupt_bitmap interrupt_pending; |
Manish Pandey | 35e452f | 2021-02-18 21:36:34 +0000 | [diff] [blame] | 77 | /** Bitfield recording the interrupt pin configuration. */ |
Daniel Boulby | 4ca50f0 | 2022-07-29 18:29:34 +0100 | [diff] [blame] | 78 | struct interrupt_bitmap interrupt_type; |
Fuad Tabba | 5c73843 | 2019-12-02 11:02:42 +0000 | [diff] [blame] | 79 | /** |
| 80 | * The number of interrupts which are currently both enabled and |
Manish Pandey | 35e452f | 2021-02-18 21:36:34 +0000 | [diff] [blame] | 81 | * pending. Count independently virtual IRQ and FIQ interrupt types |
| 82 | * i.e. the sum of the two counters is the number of bits set in |
| 83 | * interrupt_enable & interrupt_pending. |
Fuad Tabba | 5c73843 | 2019-12-02 11:02:42 +0000 | [diff] [blame] | 84 | */ |
Manish Pandey | 35e452f | 2021-02-18 21:36:34 +0000 | [diff] [blame] | 85 | uint32_t enabled_and_pending_irq_count; |
| 86 | uint32_t enabled_and_pending_fiq_count; |
Fuad Tabba | 5c73843 | 2019-12-02 11:02:42 +0000 | [diff] [blame] | 87 | }; |
| 88 | |
| 89 | struct vcpu_fault_info { |
| 90 | ipaddr_t ipaddr; |
| 91 | vaddr_t vaddr; |
| 92 | vaddr_t pc; |
| 93 | uint32_t mode; |
| 94 | }; |
| 95 | |
Madhukar Pappireddy | 5992fbc | 2022-06-21 17:15:16 -0500 | [diff] [blame] | 96 | struct call_chain { |
| 97 | /** Previous node in the SP call chain. */ |
| 98 | struct vcpu *prev_node; |
| 99 | |
| 100 | /** Next node in the SP call chain. */ |
| 101 | struct vcpu *next_node; |
| 102 | }; |
| 103 | |
Fuad Tabba | 5c73843 | 2019-12-02 11:02:42 +0000 | [diff] [blame] | 104 | struct vcpu { |
| 105 | struct spinlock lock; |
| 106 | |
| 107 | /* |
| 108 | * The state is only changed in the context of the vCPU being run. This |
| 109 | * ensures the scheduler can easily keep track of the vCPU state as |
| 110 | * transitions are indicated by the return code from the run call. |
| 111 | */ |
| 112 | enum vcpu_state state; |
| 113 | |
| 114 | struct cpu *cpu; |
| 115 | struct vm *vm; |
| 116 | struct arch_regs regs; |
| 117 | struct interrupts interrupts; |
| 118 | |
| 119 | /* |
| 120 | * Determine whether the 'regs' field is available for use. This is set |
| 121 | * to false when a vCPU is about to run on a physical CPU, and is set |
Olivier Deprez | 3caed1c | 2021-02-05 12:07:36 +0100 | [diff] [blame] | 122 | * back to true when it is descheduled. This is not relevant for the |
| 123 | * primary VM vCPUs in the normal world (or the "other world VM" vCPUs |
| 124 | * in the secure world) as they are pinned to physical CPUs and there |
| 125 | * is no contention to take care of. |
Fuad Tabba | 5c73843 | 2019-12-02 11:02:42 +0000 | [diff] [blame] | 126 | */ |
| 127 | bool regs_available; |
Olivier Deprez | ee9d6a9 | 2019-11-26 09:14:11 +0000 | [diff] [blame] | 128 | |
| 129 | /* |
| 130 | * If the current vCPU is executing as a consequence of a |
| 131 | * FFA_MSG_SEND_DIRECT_REQ invocation, then this member holds the |
| 132 | * originating VM ID from which the call originated. |
| 133 | * The value HF_INVALID_VM_ID implies the vCPU is not executing as |
| 134 | * a result of a prior FFA_MSG_SEND_DIRECT_REQ invocation. |
| 135 | */ |
| 136 | ffa_vm_id_t direct_request_origin_vm_id; |
Manish Pandey | a5f39fb | 2020-09-11 09:47:11 +0100 | [diff] [blame] | 137 | |
Madhukar Pappireddy | b11e0d1 | 2021-08-02 19:44:35 -0500 | [diff] [blame] | 138 | /** Determine whether partition is currently handling managed exit. */ |
Manish Pandey | a5f39fb | 2020-09-11 09:47:11 +0100 | [diff] [blame] | 139 | bool processing_managed_exit; |
Madhukar Pappireddy | f675bb6 | 2021-08-03 12:57:10 -0500 | [diff] [blame] | 140 | |
| 141 | /** |
| 142 | * Determine whether vCPU is currently handling secure interrupt. |
| 143 | */ |
| 144 | bool processing_secure_interrupt; |
| 145 | bool secure_interrupt_deactivated; |
| 146 | |
| 147 | /** |
| 148 | * INTID of the current secure interrupt being processed by this vCPU. |
| 149 | */ |
| 150 | uint32_t current_sec_interrupt_id; |
| 151 | |
| 152 | /** |
| 153 | * Track current vCPU which got pre-empted when secure interrupt |
| 154 | * triggered. |
| 155 | */ |
| 156 | struct vcpu *preempted_vcpu; |
Madhukar Pappireddy | dd6fdfb | 2021-12-14 12:30:36 -0600 | [diff] [blame] | 157 | |
| 158 | /** |
| 159 | * Current value of the Priority Mask register which is saved/restored |
| 160 | * during secure interrupt handling. |
| 161 | */ |
| 162 | uint8_t priority_mask; |
Madhukar Pappireddy | 0aaadbb | 2021-12-16 20:58:10 -0600 | [diff] [blame] | 163 | |
| 164 | /** |
| 165 | * Per FF-A v1.1-Beta0 spec section 8.3, an SP can use multiple |
| 166 | * mechanisms to signal completion of secure interrupt handling. SP |
| 167 | * can invoke explicit FF-A ABIs, namely FFA_MSG_WAIT and FFA_RUN, |
| 168 | * when in WAITING/BLOCKED state respectively, but has to perform |
| 169 | * implicit signal completion mechanism by dropping the priority |
| 170 | * of the virtual secure interrupt when SPMC signaled the virtual |
| 171 | * interrupt in PREEMPTED state(The vCPU was preempted by a Self S-Int |
| 172 | * while running). This variable helps SPMC to keep a track of such |
| 173 | * mechanism and perform appropriate bookkeeping. |
| 174 | */ |
| 175 | bool implicit_completion_signal; |
Madhukar Pappireddy | fe297a3 | 2022-06-21 16:42:13 -0500 | [diff] [blame] | 176 | |
Madhukar Pappireddy | 5992fbc | 2022-06-21 17:15:16 -0500 | [diff] [blame] | 177 | /** SP call chain. */ |
| 178 | struct call_chain call_chain; |
| 179 | |
| 180 | /** |
| 181 | * Indicates if the current vCPU is running in SPMC scheduled |
| 182 | * mode or Normal World scheduled mode. |
| 183 | */ |
| 184 | enum schedule_mode scheduling_mode; |
| 185 | |
Madhukar Pappireddy | 8415405 | 2022-06-21 18:30:25 -0500 | [diff] [blame] | 186 | /** |
Madhukar Pappireddy | 94da32d | 2023-02-22 16:04:10 -0600 | [diff] [blame] | 187 | * If the action in response to a non-secure or other-secure interrupt |
| 188 | * is to queue it, this field is used to save and restore the current |
| 189 | * priority mask. |
Madhukar Pappireddy | 8415405 | 2022-06-21 18:30:25 -0500 | [diff] [blame] | 190 | */ |
Madhukar Pappireddy | 94da32d | 2023-02-22 16:04:10 -0600 | [diff] [blame] | 191 | uint8_t prev_interrupt_priority; |
Madhukar Pappireddy | c40f55f | 2022-06-22 11:00:41 -0500 | [diff] [blame] | 192 | |
Madhukar Pappireddy | fe297a3 | 2022-06-21 16:42:13 -0500 | [diff] [blame] | 193 | /** Partition Runtime Model. */ |
| 194 | enum partition_runtime_model rt_model; |
Madhukar Pappireddy | 2f76e49 | 2022-09-06 15:21:59 -0500 | [diff] [blame] | 195 | |
| 196 | /** |
| 197 | * Direct response message has been intercepted to handle virtual |
| 198 | * secure interrupt for a S-EL0 partition. |
| 199 | */ |
| 200 | bool direct_resp_intercepted; |
| 201 | |
| 202 | /** Save direct response message args to be resumed later. */ |
| 203 | struct ffa_value direct_resp_ffa_value; |
Olivier Deprez | 181074b | 2023-02-02 14:53:23 +0100 | [diff] [blame] | 204 | |
| 205 | struct vcpu *next_boot; |
Fuad Tabba | 5c73843 | 2019-12-02 11:02:42 +0000 | [diff] [blame] | 206 | }; |
| 207 | |
| 208 | /** Encapsulates a vCPU whose lock is held. */ |
| 209 | struct vcpu_locked { |
| 210 | struct vcpu *vcpu; |
| 211 | }; |
| 212 | |
Olivier Deprez | 0b6f10a | 2020-08-05 18:21:33 +0200 | [diff] [blame] | 213 | /** Container for two vcpu_locked structures. */ |
| 214 | struct two_vcpu_locked { |
| 215 | struct vcpu_locked vcpu1; |
| 216 | struct vcpu_locked vcpu2; |
| 217 | }; |
| 218 | |
Fuad Tabba | 5c73843 | 2019-12-02 11:02:42 +0000 | [diff] [blame] | 219 | struct vcpu_locked vcpu_lock(struct vcpu *vcpu); |
Olivier Deprez | 0b6f10a | 2020-08-05 18:21:33 +0200 | [diff] [blame] | 220 | struct two_vcpu_locked vcpu_lock_both(struct vcpu *vcpu1, struct vcpu *vcpu2); |
Fuad Tabba | 5c73843 | 2019-12-02 11:02:42 +0000 | [diff] [blame] | 221 | void vcpu_unlock(struct vcpu_locked *locked); |
| 222 | void vcpu_init(struct vcpu *vcpu, struct vm *vm); |
| 223 | void vcpu_on(struct vcpu_locked vcpu, ipaddr_t entry, uintreg_t arg); |
Andrew Walbran | b5ab43c | 2020-04-30 11:32:54 +0100 | [diff] [blame] | 224 | ffa_vcpu_index_t vcpu_index(const struct vcpu *vcpu); |
Fuad Tabba | 5c73843 | 2019-12-02 11:02:42 +0000 | [diff] [blame] | 225 | bool vcpu_is_off(struct vcpu_locked vcpu); |
Max Shvetsov | 40108e7 | 2020-08-27 12:39:50 +0100 | [diff] [blame] | 226 | bool vcpu_secondary_reset_and_start(struct vcpu_locked vcpu_locked, |
| 227 | ipaddr_t entry, uintreg_t arg); |
Fuad Tabba | 5c73843 | 2019-12-02 11:02:42 +0000 | [diff] [blame] | 228 | |
| 229 | bool vcpu_handle_page_fault(const struct vcpu *current, |
| 230 | struct vcpu_fault_info *f); |
Olivier Deprez | 2ebae3a | 2020-06-11 16:34:30 +0200 | [diff] [blame] | 231 | |
J-Alves | 7ac4905 | 2022-02-08 17:20:53 +0000 | [diff] [blame] | 232 | void vcpu_set_phys_core_idx(struct vcpu *vcpu); |
Olivier Deprez | 632249e | 2022-09-26 09:18:31 +0200 | [diff] [blame] | 233 | void vcpu_set_boot_info_gp_reg(struct vcpu *vcpu); |
| 234 | |
Olivier Deprez | 181074b | 2023-02-02 14:53:23 +0100 | [diff] [blame] | 235 | void vcpu_update_boot(struct vcpu *vcpu); |
| 236 | struct vcpu *vcpu_get_boot_vcpu(void); |
J-Alves | 7ac4905 | 2022-02-08 17:20:53 +0000 | [diff] [blame] | 237 | |
Daniel Boulby | 4ca50f0 | 2022-07-29 18:29:34 +0100 | [diff] [blame] | 238 | static inline bool vcpu_is_virt_interrupt_enabled(struct interrupts *interrupts, |
| 239 | uint32_t intid) |
| 240 | { |
| 241 | return interrupt_bitmap_get_value(&interrupts->interrupt_enabled, |
| 242 | intid) == 1U; |
| 243 | } |
| 244 | |
| 245 | static inline void vcpu_virt_interrupt_set_enabled( |
| 246 | struct interrupts *interrupts, uint32_t intid) |
| 247 | { |
| 248 | interrupt_bitmap_set_value(&interrupts->interrupt_enabled, intid); |
| 249 | } |
| 250 | |
| 251 | static inline void vcpu_virt_interrupt_clear_enabled( |
| 252 | struct interrupts *interrupts, uint32_t intid) |
| 253 | { |
| 254 | interrupt_bitmap_clear_value(&interrupts->interrupt_enabled, intid); |
| 255 | } |
| 256 | |
| 257 | static inline bool vcpu_is_virt_interrupt_pending(struct interrupts *interrupts, |
| 258 | uint32_t intid) |
| 259 | { |
| 260 | return interrupt_bitmap_get_value(&interrupts->interrupt_pending, |
| 261 | intid) == 1U; |
| 262 | } |
| 263 | |
| 264 | static inline void vcpu_virt_interrupt_set_pending( |
| 265 | struct interrupts *interrupts, uint32_t intid) |
| 266 | { |
| 267 | interrupt_bitmap_set_value(&interrupts->interrupt_pending, intid); |
| 268 | } |
| 269 | |
| 270 | static inline void vcpu_virt_interrupt_clear_pending( |
| 271 | struct interrupts *interrupts, uint32_t intid) |
| 272 | { |
| 273 | interrupt_bitmap_clear_value(&interrupts->interrupt_pending, intid); |
| 274 | } |
| 275 | |
| 276 | static inline enum interrupt_type vcpu_virt_interrupt_get_type( |
| 277 | struct interrupts *interrupts, uint32_t intid) |
| 278 | { |
| 279 | return (enum interrupt_type)interrupt_bitmap_get_value( |
| 280 | &interrupts->interrupt_type, intid); |
| 281 | } |
| 282 | |
| 283 | static inline void vcpu_virt_interrupt_set_type(struct interrupts *interrupts, |
| 284 | uint32_t intid, |
| 285 | enum interrupt_type type) |
| 286 | { |
| 287 | if (type == INTERRUPT_TYPE_IRQ) { |
| 288 | interrupt_bitmap_clear_value(&interrupts->interrupt_type, |
| 289 | intid); |
| 290 | } else { |
| 291 | interrupt_bitmap_set_value(&interrupts->interrupt_type, intid); |
| 292 | } |
| 293 | } |
| 294 | |
Manish Pandey | 35e452f | 2021-02-18 21:36:34 +0000 | [diff] [blame] | 295 | static inline void vcpu_irq_count_increment(struct vcpu_locked vcpu_locked) |
| 296 | { |
| 297 | vcpu_locked.vcpu->interrupts.enabled_and_pending_irq_count++; |
| 298 | } |
| 299 | |
| 300 | static inline void vcpu_irq_count_decrement(struct vcpu_locked vcpu_locked) |
| 301 | { |
| 302 | vcpu_locked.vcpu->interrupts.enabled_and_pending_irq_count--; |
| 303 | } |
| 304 | |
| 305 | static inline void vcpu_fiq_count_increment(struct vcpu_locked vcpu_locked) |
| 306 | { |
| 307 | vcpu_locked.vcpu->interrupts.enabled_and_pending_fiq_count++; |
| 308 | } |
| 309 | |
| 310 | static inline void vcpu_fiq_count_decrement(struct vcpu_locked vcpu_locked) |
| 311 | { |
| 312 | vcpu_locked.vcpu->interrupts.enabled_and_pending_fiq_count--; |
| 313 | } |
| 314 | |
Daniel Boulby | 4ca50f0 | 2022-07-29 18:29:34 +0100 | [diff] [blame] | 315 | static inline void vcpu_interrupt_count_increment( |
| 316 | struct vcpu_locked vcpu_locked, struct interrupts *interrupts, |
| 317 | uint32_t intid) |
| 318 | { |
| 319 | if (vcpu_virt_interrupt_get_type(interrupts, intid) == |
| 320 | INTERRUPT_TYPE_IRQ) { |
| 321 | vcpu_irq_count_increment(vcpu_locked); |
| 322 | } else { |
| 323 | vcpu_fiq_count_increment(vcpu_locked); |
| 324 | } |
| 325 | } |
| 326 | |
| 327 | static inline void vcpu_interrupt_count_decrement( |
| 328 | struct vcpu_locked vcpu_locked, struct interrupts *interrupts, |
| 329 | uint32_t intid) |
| 330 | { |
| 331 | if (vcpu_virt_interrupt_get_type(interrupts, intid) == |
| 332 | INTERRUPT_TYPE_IRQ) { |
| 333 | vcpu_irq_count_decrement(vcpu_locked); |
| 334 | } else { |
| 335 | vcpu_fiq_count_decrement(vcpu_locked); |
| 336 | } |
| 337 | } |
| 338 | |
Manish Pandey | 35e452f | 2021-02-18 21:36:34 +0000 | [diff] [blame] | 339 | static inline uint32_t vcpu_interrupt_irq_count_get( |
| 340 | struct vcpu_locked vcpu_locked) |
| 341 | { |
| 342 | return vcpu_locked.vcpu->interrupts.enabled_and_pending_irq_count; |
| 343 | } |
| 344 | |
| 345 | static inline uint32_t vcpu_interrupt_fiq_count_get( |
| 346 | struct vcpu_locked vcpu_locked) |
| 347 | { |
| 348 | return vcpu_locked.vcpu->interrupts.enabled_and_pending_fiq_count; |
| 349 | } |
| 350 | |
| 351 | static inline uint32_t vcpu_interrupt_count_get(struct vcpu_locked vcpu_locked) |
| 352 | { |
| 353 | return vcpu_locked.vcpu->interrupts.enabled_and_pending_irq_count + |
| 354 | vcpu_locked.vcpu->interrupts.enabled_and_pending_fiq_count; |
| 355 | } |
Madhukar Pappireddy | 5992fbc | 2022-06-21 17:15:16 -0500 | [diff] [blame] | 356 | |
| 357 | static inline void vcpu_call_chain_extend(struct vcpu *vcpu1, |
| 358 | struct vcpu *vcpu2) |
| 359 | { |
| 360 | vcpu1->call_chain.next_node = vcpu2; |
| 361 | vcpu2->call_chain.prev_node = vcpu1; |
| 362 | } |
| 363 | |
| 364 | static inline void vcpu_call_chain_remove_node(struct vcpu *vcpu1, |
| 365 | struct vcpu *vcpu2) |
| 366 | { |
| 367 | vcpu1->call_chain.prev_node = NULL; |
| 368 | vcpu2->call_chain.next_node = NULL; |
| 369 | } |