/* SPDX-License-Identifier: GPL-2.0-only */ /* * Copyright 2012 Michael Ellerman, IBM Corporation. * Copyright 2012 Benjamin Herrenschmidt, IBM Corporation
*/
#ifdef CONFIG_KVM_XICS /* * We use a two-level tree to store interrupt source information. * There are up to 1024 ICS nodes, each of which can represent * 1024 sources.
*/ #define KVMPPC_XICS_MAX_ICS_ID 1023 #define KVMPPC_XICS_ICS_SHIFT 10 #define KVMPPC_XICS_IRQ_PER_ICS (1 << KVMPPC_XICS_ICS_SHIFT) #define KVMPPC_XICS_SRC_MASK (KVMPPC_XICS_IRQ_PER_ICS - 1)
/* * Interrupt source numbers below this are reserved, for example * 0 is "no interrupt", and 2 is used for IPIs.
*/ #define KVMPPC_XICS_FIRST_IRQ 16 #define KVMPPC_XICS_NR_IRQS ((KVMPPC_XICS_MAX_ICS_ID + 1) * \
KVMPPC_XICS_IRQ_PER_ICS)
/* Priority value to use for disabling an interrupt */ #define MASKED 0xff
#define PQ_PRESENTED 1 #define PQ_QUEUED 2
/* State for one irq source */ struct ics_irq_state {
u32 number;
u32 server;
u32 pq_state;
u8 priority;
u8 saved_priority;
u8 resend;
u8 masked_pending;
u8 lsi; /* level-sensitive interrupt */
u8 exists; int intr_cpu;
u32 host_irq;
};
/* Atomic ICP state, updated with a single compare & swap */ union kvmppc_icp_state { unsignedlong raw; struct {
u8 out_ee:1;
u8 need_resend:1;
u8 cppr;
u8 mfrr;
u8 pending_pri;
u32 xisr;
};
};
/* One bit per ICS */ #define ICP_RESEND_MAP_SIZE (KVMPPC_XICS_MAX_ICS_ID / BITS_PER_LONG + 1)
/* Real mode might find something too hard, here's the action * it might request from virtual mode
*/ #define XICS_RM_KICK_VCPU 0x1 #define XICS_RM_CHECK_RESEND 0x2 #define XICS_RM_NOTIFY_EOI 0x8
u32 rm_action; struct kvm_vcpu *rm_kick_target; struct kvmppc_icp *rm_resend_icp;
u32 rm_reject;
u32 rm_eoied_irq;
/* Counters for each reason we exited real mode */ unsignedlong n_rm_kick_vcpu; unsignedlong n_rm_check_resend; unsignedlong n_rm_notify_eoi; /* Counters for handling ICP processing in real mode */ unsignedlong n_check_resend; unsignedlong n_reject;
/* Debug stuff for real mode */ union kvmppc_icp_state rm_dbgstate; struct kvm_vcpu *rm_dbgtgt;
};
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.