···11+/*22+ * Copyright (C) 2016,2017 ARM Limited, All Rights Reserved.33+ * Author: Marc Zyngier <marc.zyngier@arm.com>44+ *55+ * This program is free software; you can redistribute it and/or modify66+ * it under the terms of the GNU General Public License version 2 as77+ * published by the Free Software Foundation.88+ *99+ * This program is distributed in the hope that it will be useful,1010+ * but WITHOUT ANY WARRANTY; without even the implied warranty of1111+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the1212+ * GNU General Public License for more details.1313+ *1414+ * You should have received a copy of the GNU General Public License1515+ * along with this program. If not, see <http://www.gnu.org/licenses/>.1616+ */1717+1818+#ifndef __LINUX_IRQCHIP_ARM_GIC_V4_H1919+#define __LINUX_IRQCHIP_ARM_GIC_V4_H2020+2121+struct its_vpe;2222+2323+/* Embedded in kvm.arch */2424+struct its_vm {2525+ struct fwnode_handle *fwnode;2626+ struct irq_domain *domain;2727+ struct page *vprop_page;2828+ struct its_vpe **vpes;2929+ int nr_vpes;3030+ irq_hw_number_t db_lpi_base;3131+ unsigned long *db_bitmap;3232+ int nr_db_lpis;3333+};3434+3535+/* Embedded in kvm_vcpu.arch */3636+struct its_vpe {3737+ struct page *vpt_page;3838+ struct its_vm *its_vm;3939+ /* Doorbell interrupt */4040+ int irq;4141+ irq_hw_number_t vpe_db_lpi;4242+ /*4343+ * This collection ID is used to indirect the target4444+ * redistributor for this VPE. The ID itself isn't involved in4545+ * programming of the ITS.4646+ */4747+ u16 col_idx;4848+ /* Unique (system-wide) VPE identifier */4949+ u16 vpe_id;5050+ /* Implementation Defined Area Invalid */5151+ bool idai;5252+ /* Pending VLPIs on schedule out? */5353+ bool pending_last;5454+};5555+5656+/*5757+ * struct its_vlpi_map: structure describing the mapping of a5858+ * VLPI. Only to be interpreted in the context of a physical interrupt5959+ * it complements. To be used as the vcpu_info passed to6060+ * irq_set_vcpu_affinity().6161+ *6262+ * @vm: Pointer to the GICv4 notion of a VM6363+ * @vpe: Pointer to the GICv4 notion of a virtual CPU (VPE)6464+ * @vintid: Virtual LPI number6565+ * @db_enabled: Is the VPE doorbell to be generated?6666+ */6767+struct its_vlpi_map {6868+ struct its_vm *vm;6969+ struct its_vpe *vpe;7070+ u32 vintid;7171+ bool db_enabled;7272+};7373+7474+enum its_vcpu_info_cmd_type {7575+ MAP_VLPI,7676+ GET_VLPI,7777+ PROP_UPDATE_VLPI,7878+ PROP_UPDATE_AND_INV_VLPI,7979+ SCHEDULE_VPE,8080+ DESCHEDULE_VPE,8181+ INVALL_VPE,8282+};8383+8484+struct its_cmd_info {8585+ enum its_vcpu_info_cmd_type cmd_type;8686+ union {8787+ struct its_vlpi_map *map;8888+ u8 config;8989+ };9090+};9191+9292+#endif