From mboxrd@z Thu Jan 1 00:00:00 1970 From: Paolo Bonzini Subject: Re: [PATCH 04/12] KVM: x86: Validate guest writes to MSR_IA32_APICBASE Date: Thu, 16 Jan 2014 15:07:15 +0100 Message-ID: <52D7E793.5080005@redhat.com> References: <158b5c8094a923e76ba3aff41052408efa8429df.1388857646.git.jan.kiszka@web.de> Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Cc: Gleb Natapov , Marcelo Tosatti , kvm To: Jan Kiszka Return-path: Received: from mail-qc0-f181.google.com ([209.85.216.181]:33160 "EHLO mail-qc0-f181.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752501AbaAPOHX (ORCPT ); Thu, 16 Jan 2014 09:07:23 -0500 Received: by mail-qc0-f181.google.com with SMTP id e9so2337686qcy.12 for ; Thu, 16 Jan 2014 06:07:22 -0800 (PST) In-Reply-To: <158b5c8094a923e76ba3aff41052408efa8429df.1388857646.git.jan.kiszka@web.de> Sender: kvm-owner@vger.kernel.org List-ID: Il 04/01/2014 18:47, Jan Kiszka ha scritto: > + u64 old_state = vcpu->arch.apic_base & > + (MSR_IA32_APICBASE_ENABLE | X2APIC_ENABLE); > + u64 new_state = msr_info->data & > + (MSR_IA32_APICBASE_ENABLE | X2APIC_ENABLE); > + u64 reserved_bits = ((~0ULL) << boot_cpu_data.x86_phys_bits) | 0x2ff | > + (guest_cpuid_has_x2apic(vcpu) ? 0 : X2APIC_ENABLE); > + Should this use the guest CPUID instead? > + if (!msr_info->host_initiated && Is this check on host_initiated just for backwards compatibility, or is there another case that I am missing? Paolo