From patchwork Thu Jun 29 17:26:45 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?b?UmFkaW0gS3LEjW3DocWZ?= X-Patchwork-Id: 9817487 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id B804260365 for ; Thu, 29 Jun 2017 17:27:00 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id A2FBF28886 for ; Thu, 29 Jun 2017 17:27:00 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 9737B28897; Thu, 29 Jun 2017 17:27:00 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.9 required=2.0 tests=BAYES_00,HK_RANDOM_FROM, RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 346BD28886 for ; Thu, 29 Jun 2017 17:27:00 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752921AbdF2R07 (ORCPT ); Thu, 29 Jun 2017 13:26:59 -0400 Received: from mx1.redhat.com ([209.132.183.28]:54172 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752343AbdF2R06 (ORCPT ); Thu, 29 Jun 2017 13:26:58 -0400 Received: from smtp.corp.redhat.com (int-mx04.intmail.prod.int.phx2.redhat.com [10.5.11.14]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 6D230A2881; Thu, 29 Jun 2017 17:26:57 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mx1.redhat.com 6D230A2881 Authentication-Results: ext-mx01.extmail.prod.ext.phx2.redhat.com; dmarc=none (p=none dis=none) header.from=redhat.com Authentication-Results: ext-mx01.extmail.prod.ext.phx2.redhat.com; spf=pass smtp.mailfrom=rkrcmar@redhat.com DKIM-Filter: OpenDKIM Filter v2.11.0 mx1.redhat.com 6D230A2881 Received: from potion (unknown [10.43.2.65]) by smtp.corp.redhat.com (Postfix) with SMTP id 35E884F6B3; Thu, 29 Jun 2017 17:26:53 +0000 (UTC) Received: by potion (sSMTP sendmail emulation); Thu, 29 Jun 2017 19:26:52 +0200 From: =?UTF-8?q?Radim=20Kr=C4=8Dm=C3=A1=C5=99?= To: kvm@vger.kernel.org Cc: Paolo Bonzini , David Matlack , Peter Feiner Subject: [kvm-unit-tests PATCH 1/3] x86/vmx: fix EPT - MMIO access Date: Thu, 29 Jun 2017 19:26:45 +0200 Message-Id: <20170629172647.22188-2-rkrcmar@redhat.com> In-Reply-To: <20170629172647.22188-1-rkrcmar@redhat.com> References: <20170629172647.22188-1-rkrcmar@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.14 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.25]); Thu, 29 Jun 2017 17:26:57 +0000 (UTC) Sender: kvm-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: kvm@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP Reading the memory mapped page with x2apic is a bug. Use the generic reader instead. An alternative would be to disable x2apic. Signed-off-by: Radim Krčmář Reviewed-by: Peter Feiner --- x86/vmx_tests.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/x86/vmx_tests.c b/x86/vmx_tests.c index 1f439522cad8..7be016ce4fbc 100644 --- a/x86/vmx_tests.c +++ b/x86/vmx_tests.c @@ -1031,7 +1031,7 @@ static int ept_init_common(bool have_ad) install_ept(pml4, (unsigned long)data_page1, (unsigned long)data_page2, EPT_RA | EPT_WA | EPT_EA); - apic_version = *((u32 *)0xfee00030UL); + apic_version = apic_read(APIC_LVR); return VMX_TEST_START; }