From: Jan Kiszka <jan.kiszka@web.de>
To: Avi Kivity <avi@redhat.com>
Cc: kvm@vger.kernel.org, Marcelo Tosatti <mtosatti@redhat.com>,
Jinsong Liu <jinsong.liu@intel.com>
Subject: Re: [PATCH] KVM: Fix tsc deadline timer without irqchip_in_kernel()
Date: Sun, 02 Oct 2011 18:28:14 +0200 [thread overview]
Message-ID: <4E88911E.4060702@web.de> (raw)
In-Reply-To: <1317549066-10582-1-git-send-email-avi@redhat.com>
[-- Attachment #1: Type: text/plain, Size: 1271 bytes --]
On 2011-10-02 11:51, Avi Kivity wrote:
> vcpu->arch.apic may be NULL.
>
> Signed-off-by: Avi Kivity <avi@redhat.com>
> ---
> arch/x86/kvm/x86.c | 9 +++++++--
> 1 files changed, 7 insertions(+), 2 deletions(-)
>
> diff --git a/arch/x86/kvm/x86.c b/arch/x86/kvm/x86.c
> index 83b839f..aa11707 100644
> --- a/arch/x86/kvm/x86.c
> +++ b/arch/x86/kvm/x86.c
> @@ -600,6 +600,8 @@ static bool guest_cpuid_has_fsgsbase(struct kvm_vcpu *vcpu)
> static void update_cpuid(struct kvm_vcpu *vcpu)
> {
> struct kvm_cpuid_entry2 *best;
> + struct kvm_lapic *apic = vcpu->arch.apic;
> + u32 timer_mode_mask;
>
> best = kvm_find_cpuid_entry(vcpu, 1, 0);
> if (!best)
> @@ -615,9 +617,12 @@ static void update_cpuid(struct kvm_vcpu *vcpu)
> if (boot_cpu_data.x86_vendor == X86_VENDOR_INTEL &&
> best->function == 0x1) {
> best->ecx |= bit(X86_FEATURE_TSC_DEADLINE_TIMER);
> - vcpu->arch.apic->lapic_timer.timer_mode_mask = (3 << 17);
> + timer_mode_mask = 3 << 17;
> } else
> - vcpu->arch.apic->lapic_timer.timer_mode_mask = (1 << 17);
> + timer_mode_mask = 1 << 17;
> +
> + if (apic)
> + apic->lapic_timer.timer_mode_mask = timer_mode_mask;
Coding style... While at it, you could also fix braces for that else.
Jan
[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 262 bytes --]
next prev parent reply other threads:[~2011-10-02 16:28 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-10-02 9:51 [PATCH] KVM: Fix tsc deadline timer without irqchip_in_kernel() Avi Kivity
2011-10-02 16:28 ` Jan Kiszka [this message]
2011-10-02 16:30 ` Avi Kivity
2011-10-02 16:33 ` Jan Kiszka
2011-10-02 17:01 ` Avi Kivity
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=4E88911E.4060702@web.de \
--to=jan.kiszka@web.de \
--cc=avi@redhat.com \
--cc=jinsong.liu@intel.com \
--cc=kvm@vger.kernel.org \
--cc=mtosatti@redhat.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.