public inbox for kvm@vger.kernel.org
 help / color / mirror / Atom feed
From: Joerg Roedel <joerg.roedel@amd.com>
To: Avi Kivity <avi@redhat.com>
Cc: kvm@vger.kernel.org
Subject: Re: [PATCH 1/2] userspace: fix module load errors with kernel 2.6.27 and DMAR enabled
Date: Wed, 21 Jan 2009 19:12:53 +0100	[thread overview]
Message-ID: <20090121181253.GA14021@amd.com> (raw)
In-Reply-To: <1229349294-3656-1-git-send-email-joerg.roedel@amd.com>

Hi Avi,

what about these patches?

On Mon, Dec 15, 2008 at 02:54:53PM +0100, Joerg Roedel wrote:
> Signed-off-by: Joerg Roedel <joerg.roedel@amd.com>
> ---
>  configure                           |    7 +++++++
>  kernel/x86/Kbuild                   |    2 ++
>  kernel/x86/external-module-compat.h |    8 ++++++++
>  kernel/x86/hack-module.awk          |    2 ++
>  4 files changed, 19 insertions(+), 0 deletions(-)
> 
> diff --git a/configure b/configure
> index 4e88961..f7c0534 100755
> --- a/configure
> +++ b/configure
> @@ -15,6 +15,7 @@ qemu_opts=()
>  cross_prefix=
>  arch=`uname -m`
>  target_exec=
> +kvm_vtd_iommu="n"
>  # don't use uname if kerneldir is set
>  no_uname=
>  depmod_version=
> @@ -111,6 +112,11 @@ case $arch in
>          ;;
>  esac
>  
> +# test for IOMMU support in the kernel we build for
> +if [ -f "$kernelsourcedir/virt/kvm/vtd.c" ]; then
> +	kvm_vtd_iommu="y"
> +fi
> +
>  processor=${arch#*-}
>  arch=${arch%%-*}
>  
> @@ -170,4 +176,5 @@ EOF
>  
>  cat <<EOF > kernel/config.kbuild
>  EXT_CONFIG_KVM_TRACE=$kvm_trace
> +KVM_USE_VTD_IOMMU=$kvm_vtd_iommu
>  EOF
> diff --git a/kernel/x86/Kbuild b/kernel/x86/Kbuild
> index c4723b1..faee1e7 100644
> --- a/kernel/x86/Kbuild
> +++ b/kernel/x86/Kbuild
> @@ -10,8 +10,10 @@ ifeq ($(EXT_CONFIG_KVM_TRACE),y)
>  kvm-objs += kvm_trace.o
>  endif
>  ifeq ($(CONFIG_DMAR),y)
> +ifeq ($(KVM_USE_VTD_IOMMU),y)
>  kvm-objs += vtd.o
>  endif
> +endif
>  kvm-intel-objs := vmx.o vmx-debug.o ../external-module-compat.o
>  kvm-amd-objs := svm.o ../external-module-compat.o
>  
> diff --git a/kernel/x86/external-module-compat.h b/kernel/x86/external-module-compat.h
> index b5e11e2..ac78b81 100644
> --- a/kernel/x86/external-module-compat.h
> +++ b/kernel/x86/external-module-compat.h
> @@ -335,6 +335,14 @@ struct kvm_desc_ptr {
>  #define FEATURE_CONTROL_VMXON_ENABLED	(1<<2)
>  #endif
>  
> +#if defined(CONFIG_DMAR) || defined(CONFIG_IOMMU_API)
> +#define KVM_IOMMU_SUPPORT 1
> +#endif
> +
> +#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,28)
> +#undef KVM_IOMMU_SUPPORT
> +#endif
> +
>  #if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,29)
>  
>  struct mtrr_var_range {
> diff --git a/kernel/x86/hack-module.awk b/kernel/x86/hack-module.awk
> index 2ad0951..8d2806f 100644
> --- a/kernel/x86/hack-module.awk
> +++ b/kernel/x86/hack-module.awk
> @@ -75,6 +75,8 @@ BEGIN { split("INIT_WORK tsc_khz desc_struct ldttss_desc64 desc_ptr " \
>  
>  /\kvm_.*_fops\.owner = module;/ { $0 = "IF_ANON_INODES_DOES_REFCOUNTS(" $0 ")" }
>  
> +{sub(/CONFIG_DMAR/, "KVM_IOMMU_SUPPORT");}
> +
>  { print }
>  
>  /kvm_x86_ops->run/ {
> -- 
> 1.5.6.4
> 

-- 
           | Advanced Micro Devices GmbH
 Operating | Karl-Hammerschmidt-Str. 34, 85609 Dornach bei München
 System    | 
 Research  | Geschäftsführer: Jochen Polster, Thomas M. McCoy, Giuliano Meroni
 Center    | Sitz: Dornach, Gemeinde Aschheim, Landkreis München
           | Registergericht München, HRB Nr. 43632


      parent reply	other threads:[~2009-01-21 18:13 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-12-15 13:54 [PATCH 1/2] userspace: fix module load errors with kernel 2.6.27 and DMAR enabled Joerg Roedel
2008-12-15 13:54 ` [PATCH 2/2] userspace: enable build with IOMMU_API enabled Joerg Roedel
2009-01-21 18:12 ` Joerg Roedel [this message]

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=20090121181253.GA14021@amd.com \
    --to=joerg.roedel@amd.com \
    --cc=avi@redhat.com \
    --cc=kvm@vger.kernel.org \
    /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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox