From mboxrd@z Thu Jan 1 00:00:00 1970 From: Marcelo Tosatti Subject: [patch 03/12] KVM: allow userspace to open access to ACPI pmtimer Date: Thu, 29 May 2008 19:22:52 -0300 Message-ID: <20080529222828.673134528@localhost.localdomain> References: <20080529222249.563011248@localhost.localdomain> Cc: Chris Wright , Glauber Costa , Anthony Liguori , kvm@vger.kernel.org, Marcelo Tosatti To: Avi Kivity Return-path: Received: from mx1.redhat.com ([66.187.233.31]:41074 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1756193AbYE2Wdg (ORCPT ); Thu, 29 May 2008 18:33:36 -0400 Content-Disposition: inline; filename=kvm-open-pmtimer-real Sender: kvm-owner@vger.kernel.org List-ID: Signed-off-by: Marcelo Tosatti Index: kvm/arch/x86/kvm/x86.c =================================================================== --- kvm.orig/arch/x86/kvm/x86.c +++ kvm/arch/x86/kvm/x86.c @@ -27,6 +27,7 @@ #include #include #include +#include #include #include @@ -1765,13 +1766,18 @@ static void kvm_init_msr_list(void) static int kvm_init_ioport_list(void) { - allowed_open_ioports = kmalloc(sizeof(struct kvm_ioport) + + allowed_open_ioports = kmalloc(sizeof(struct kvm_ioport) * 2 + sizeof(struct kvm_ioport_list), GFP_KERNEL); if (!allowed_open_ioports) return -ENOMEM; allowed_open_ioports->nranges = 1; allowed_open_ioports->ioports[0].addr = 0x80; allowed_open_ioports->ioports[0].len = 1; + if (pmtmr_ioport) { + allowed_open_ioports->nranges++; + allowed_open_ioports->ioports[1].addr = pmtmr_ioport; + allowed_open_ioports->ioports[1].len = 4; + } return 0; } --