cregit-Linux how code gets into the kernel

Release 4.14 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 Tosatti1557.69%133.33%
Paolo Bonzini1038.46%133.33%
Jason (Hui) 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 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 v->kvm->arch.vpic->output; } else return 0; }

Contributors

PersonTokensPropCommitsCommitProp
Yang Zhang2748.21%125.00%
Steve Rutherford2442.86%125.00%
David Hildenbrand47.14%125.00%
Eddie Dong11.79%125.00%
Total56100.00%4100.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 Zhang2238.60%111.11%
Gleb Natapov1729.82%333.33%
Eddie Dong1221.05%222.22%
Qing He47.02%111.11%
Andrey Smetanin11.75%111.11%
Paolo Bonzini11.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 Zhang3063.83%120.00%
Eddie Dong919.15%240.00%
Gleb Natapov714.89%120.00%
Paolo 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 Rutherford3653.73%150.00%
Yang 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 Natapov2545.45%342.86%
Yang Zhang1425.45%114.29%
Eddie Dong1221.82%114.29%
Qing He35.45%114.29%
Paolo 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 Dong1568.18%150.00%
Paolo 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 Tosatti20100.00%1100.00%
Total20100.00%1100.00%


Overall Contributors

PersonTokensPropCommitsCommitProp
Yang Zhang12830.92%14.55%
Steve Rutherford8219.81%14.55%
Eddie Dong6515.70%313.64%
Gleb Natapov5212.56%313.64%
Marcelo Tosatti419.90%29.09%
Paolo Bonzini204.83%29.09%
Qing He71.69%14.55%
Bandan Das51.21%14.55%
David Hildenbrand40.97%14.55%
Sheng Yang30.72%14.55%
Xiantao Zhang20.48%14.55%
Avi Kivity10.24%14.55%
Jason (Hui) Wang10.24%14.55%
Paul Gortmaker10.24%14.55%
Andrey Smetanin10.24%14.55%
Nicolas Kaiser10.24%14.55%
Total414100.00%22100.00%
Directory: arch/x86/kvm
Information contained on this website is for historical information purposes only and does not indicate or represent copyright ownership.
Created with cregit.