cregit-Linux how code gets into the kernel

Release 4.10 arch/x86/kvm/irq.c

Directory: arch/x86/kvm
/*
 * irq.c: API for in kernel interrupt controller
 * Copyright (c) 2007, Intel Corporation.
 * Copyright 2009 Red Hat, Inc. and/or its affiliates.
 *
 * This program is free software; you can redistribute it and/or modify it
 * under the terms and conditions of the GNU General Public License,
 * version 2, as published by the Free Software Foundation.
 *
 * This program is distributed in the hope it will be useful, but WITHOUT
 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
 * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License for
 * more details.
 *
 * You should have received a copy of the GNU General Public License along with
 * this program; if not, write to the Free Software Foundation, Inc., 59 Temple
 * Place - Suite 330, Boston, MA 02111-1307 USA.
 * Authors:
 *   Yaozu (Eddie) Dong <Eddie.dong@intel.com>
 *
 */

#include <linux/export.h>
#include <linux/kvm_host.h>

#include "irq.h"
#include "i8254.h"
#include "x86.h"

/*
 * check if there are pending timer events
 * to be processed.
 */

int kvm_cpu_has_pending_timer(struct kvm_vcpu *vcpu) { if (lapic_in_kernel(vcpu)) return apic_has_pending_timer(vcpu); return 0; }

Contributors

PersonTokensPropCommitsCommitProp
marcelo tosattimarcelo tosatti1557.69%133.33%
paolo bonzinipaolo bonzini1038.46%133.33%
jason wangjason wang13.85%133.33%
Total26100.00%3100.00%

EXPORT_SYMBOL(kvm_cpu_has_pending_timer); /* * check if there is a pending userspace external interrupt */
static int pending_userspace_extint(struct kvm_vcpu *v) { return v->arch.pending_external_vector != -1; }

Contributors

PersonTokensPropCommitsCommitProp
steve rutherfordsteve rutherford21100.00%1100.00%
Total21100.00%1100.00%

/* * check if there is pending interrupt from * non-APIC source without intack. */
static int kvm_cpu_has_extint(struct kvm_vcpu *v) { u8 accept = kvm_apic_accept_pic_intr(v); if (accept) { if (irqchip_split(v->kvm)) return pending_userspace_extint(v); else return pic_irqchip(v->kvm)->output; } else return 0; }

Contributors

PersonTokensPropCommitsCommitProp
yang zhangyang zhang3054.55%133.33%
steve rutherfordsteve rutherford2443.64%133.33%
eddie dongeddie dong11.82%133.33%
Total55100.00%3100.00%

/* * check if there is injectable interrupt: * when virtual interrupt delivery enabled, * interrupt from apic will handled by hardware, * we don't need to check it here. */
int kvm_cpu_has_injectable_intr(struct kvm_vcpu *v) { if (!lapic_in_kernel(v)) return v->arch.interrupt.pending; if (kvm_cpu_has_extint(v)) return 1; if (kvm_vcpu_apicv_active(v)) return 0; return kvm_apic_has_interrupt(v) != -1; /* LAPIC */ }

Contributors

PersonTokensPropCommitsCommitProp
yang zhangyang zhang2238.60%111.11%
gleb natapovgleb natapov1729.82%333.33%
eddie dongeddie dong1221.05%222.22%
qing heqing he47.02%111.11%
paolo bonzinipaolo bonzini11.75%111.11%
andrey smetaninandrey smetanin11.75%111.11%
Total57100.00%9100.00%

/* * check if there is pending interrupt without * intack. */
int kvm_cpu_has_interrupt(struct kvm_vcpu *v) { if (!lapic_in_kernel(v)) return v->arch.interrupt.pending; if (kvm_cpu_has_extint(v)) return 1; return kvm_apic_has_interrupt(v) != -1; /* LAPIC */ }

Contributors

PersonTokensPropCommitsCommitProp
yang zhangyang zhang3063.83%120.00%
eddie dongeddie dong919.15%240.00%
gleb natapovgleb natapov714.89%120.00%
paolo bonzinipaolo bonzini12.13%120.00%
Total47100.00%5100.00%

EXPORT_SYMBOL_GPL(kvm_cpu_has_interrupt); /* * Read pending interrupt(from non-APIC source) * vector and intack. */
static int kvm_cpu_get_extint(struct kvm_vcpu *v) { if (kvm_cpu_has_extint(v)) { if (irqchip_split(v->kvm)) { int vector = v->arch.pending_external_vector; v->arch.pending_external_vector = -1; return vector; } else return kvm_pic_read_irq(v->kvm); /* PIC */ } else return -1; }

Contributors

PersonTokensPropCommitsCommitProp
steve rutherfordsteve rutherford3653.73%150.00%
yang zhangyang zhang3146.27%150.00%
Total67100.00%2100.00%

/* * Read pending interrupt vector and intack. */
int kvm_cpu_get_interrupt(struct kvm_vcpu *v) { int vector; if (!lapic_in_kernel(v)) return v->arch.interrupt.nr; vector = kvm_cpu_get_extint(v); if (vector != -1) return vector; /* PIC */ return kvm_get_apic_interrupt(v); /* APIC */ }

Contributors

PersonTokensPropCommitsCommitProp
gleb natapovgleb natapov2545.45%342.86%
yang zhangyang zhang1425.45%114.29%
eddie dongeddie dong1221.82%114.29%
qing heqing he35.45%114.29%
paolo bonzinipaolo bonzini11.82%114.29%
Total55100.00%7100.00%

EXPORT_SYMBOL_GPL(kvm_cpu_get_interrupt);
void kvm_inject_pending_timer_irqs(struct kvm_vcpu *vcpu) { if (lapic_in_kernel(vcpu)) kvm_inject_apic_timer_irqs(vcpu); }

Contributors

PersonTokensPropCommitsCommitProp
eddie dongeddie dong1568.18%150.00%
paolo bonzinipaolo bonzini731.82%150.00%
Total22100.00%2100.00%

EXPORT_SYMBOL_GPL(kvm_inject_pending_timer_irqs);
void __kvm_migrate_timers(struct kvm_vcpu *vcpu) { __kvm_migrate_apic_timer(vcpu); __kvm_migrate_pit_timer(vcpu); }

Contributors

PersonTokensPropCommitsCommitProp
marcelo tosattimarcelo tosatti20100.00%1100.00%
Total20100.00%1100.00%


Overall Contributors

PersonTokensPropCommitsCommitProp
yang zhangyang zhang13131.72%14.76%
steve rutherfordsteve rutherford8219.85%14.76%
eddie dongeddie dong6515.74%314.29%
gleb natapovgleb natapov5212.59%314.29%
marcelo tosattimarcelo tosatti419.93%29.52%
paolo bonzinipaolo bonzini204.84%29.52%
qing heqing he71.69%14.76%
bandan dasbandan das51.21%14.76%
sheng yangsheng yang30.73%14.76%
xiantao zhangxiantao zhang20.48%14.76%
andrey smetaninandrey smetanin10.24%14.76%
paul gortmakerpaul gortmaker10.24%14.76%
jason wangjason wang10.24%14.76%
nicolas kaisernicolas kaiser10.24%14.76%
avi kivityavi kivity10.24%14.76%
Total413100.00%21100.00%
Directory: arch/x86/kvm
Information contained on this website is for historical information purposes only and does not indicate or represent copyright ownership.