From mboxrd@z Thu Jan 1 00:00:00 1970 From: Jan Kiszka Subject: Re: [PATCH] KVM: Fix tsc deadline timer without irqchip_in_kernel() Date: Sun, 02 Oct 2011 18:28:14 +0200 Message-ID: <4E88911E.4060702@web.de> References: <1317549066-10582-1-git-send-email-avi@redhat.com> Mime-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="------------enig64ADF932AF66FA006C1AAA30" Cc: kvm@vger.kernel.org, Marcelo Tosatti , Jinsong Liu To: Avi Kivity Return-path: Received: from fmmailgate02.web.de ([217.72.192.227]:46992 "EHLO fmmailgate02.web.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751138Ab1JBQ2R (ORCPT ); Sun, 2 Oct 2011 12:28:17 -0400 In-Reply-To: <1317549066-10582-1-git-send-email-avi@redhat.com> Sender: kvm-owner@vger.kernel.org List-ID: This is an OpenPGP/MIME signed message (RFC 2440 and 3156) --------------enig64ADF932AF66FA006C1AAA30 Content-Type: text/plain; charset=ISO-8859-15 Content-Transfer-Encoding: quoted-printable On 2011-10-02 11:51, Avi Kivity wrote: > vcpu->arch.apic may be NULL. >=20 > Signed-off-by: Avi Kivity > --- > arch/x86/kvm/x86.c | 9 +++++++-- > 1 files changed, 7 insertions(+), 2 deletions(-) >=20 > 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_vcp= u *vcpu) > static void update_cpuid(struct kvm_vcpu *vcpu) > { > struct kvm_cpuid_entry2 *best; > + struct kvm_lapic *apic =3D vcpu->arch.apic; > + u32 timer_mode_mask; > =20 > best =3D 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 =3D=3D X86_VENDOR_INTEL && > best->function =3D=3D 0x1) { > best->ecx |=3D bit(X86_FEATURE_TSC_DEADLINE_TIMER); > - vcpu->arch.apic->lapic_timer.timer_mode_mask =3D (3 << 17); > + timer_mode_mask =3D 3 << 17; > } else > - vcpu->arch.apic->lapic_timer.timer_mode_mask =3D (1 << 17); > + timer_mode_mask =3D 1 << 17; > + > + if (apic) > + apic->lapic_timer.timer_mode_mask =3D timer_mode_mask; Coding style... While at it, you could also fix braces for that else. Jan --------------enig64ADF932AF66FA006C1AAA30 Content-Type: application/pgp-signature; name="signature.asc" Content-Description: OpenPGP digital signature Content-Disposition: attachment; filename="signature.asc" -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.16 (GNU/Linux) Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/ iEYEARECAAYFAk6IkR8ACgkQitSsb3rl5xRx1gCgiDIY6WF68pV+280FnZtXKNTI GXsAnRk26X2hDG/2YyP712fZj/6fpK7g =o52A -----END PGP SIGNATURE----- --------------enig64ADF932AF66FA006C1AAA30--