All of lore.kernel.org
 help / color / mirror / Atom feed
From: Joerg Roedel <joro@8bytes.org>
To: Eduard - Gabriel Munteanu <eduard.munteanu@linux360.ro>
Cc: avi@redhat.com, aliguori@us.ibm.com, qemu-devel@nongnu.org,
	kvm@vger.kernel.org
Subject: Re: [RFC PATCH] AMD IOMMU emulation
Date: Mon, 24 May 2010 17:40:30 +0200	[thread overview]
Message-ID: <20100524154030.GE1237@8bytes.org> (raw)
In-Reply-To: <1274363407-24862-1-git-send-email-eduard.munteanu@linux360.ro>

Hi Eduard,

On Thu, May 20, 2010 at 04:50:07PM +0300, Eduard - Gabriel Munteanu wrote:
> +  --enable-amd-iommu-emul) amd_iommu="yes"
> +  ;;

A compile-time option is a good idea.

> +/* MMIO registers */
> +#define MMIO_DEVICE_TABLE       0x0000
> +#define MMIO_COMMAND_BASE       0x0008
> +#define MMIO_EVENT_BASE         0x0010
> +#define MMIO_CONTROL            0x0018
> +#define MMIO_EXCL_BASE          0x0020
> +#define MMIO_EXCL_LIMIT         0x0028
> +#define MMIO_COMMAND_HEAD       0x2000
> +#define MMIO_COMMAND_TAIL       0x2008
> +#define MMIO_EVENT_HEAD         0x2010
> +#define MMIO_EVENT_TAIL         0x2018
> +#define MMIO_STATUS             0x2020
> +
> +#define MMIO_SIZE               0x2028

This size should be a power-of-two value. In this case probably 0x4000.

> +#define MMIO_DEVTAB_SIZE_MASK   ((1UL << 12) - 1)
> +#define MMIO_DEVTAB_BASE_MASK   (((1UL << 52) - 1) & ~MMIO_DEVTAB_SIZE_MASK)

You must use ULL to be 32bit safe. This is also true for the defines
below.

[...]

Otherwise the code looks good so far. Seems like the next step should be
some work on a qemu dma-layer where you can hook the translation into.

	Joerg


WARNING: multiple messages have this Message-ID (diff)
From: Joerg Roedel <joro@8bytes.org>
To: Eduard - Gabriel Munteanu <eduard.munteanu@linux360.ro>
Cc: aliguori@us.ibm.com, avi@redhat.com, kvm@vger.kernel.org,
	qemu-devel@nongnu.org
Subject: [Qemu-devel] Re: [RFC PATCH] AMD IOMMU emulation
Date: Mon, 24 May 2010 17:40:30 +0200	[thread overview]
Message-ID: <20100524154030.GE1237@8bytes.org> (raw)
In-Reply-To: <1274363407-24862-1-git-send-email-eduard.munteanu@linux360.ro>

Hi Eduard,

On Thu, May 20, 2010 at 04:50:07PM +0300, Eduard - Gabriel Munteanu wrote:
> +  --enable-amd-iommu-emul) amd_iommu="yes"
> +  ;;

A compile-time option is a good idea.

> +/* MMIO registers */
> +#define MMIO_DEVICE_TABLE       0x0000
> +#define MMIO_COMMAND_BASE       0x0008
> +#define MMIO_EVENT_BASE         0x0010
> +#define MMIO_CONTROL            0x0018
> +#define MMIO_EXCL_BASE          0x0020
> +#define MMIO_EXCL_LIMIT         0x0028
> +#define MMIO_COMMAND_HEAD       0x2000
> +#define MMIO_COMMAND_TAIL       0x2008
> +#define MMIO_EVENT_HEAD         0x2010
> +#define MMIO_EVENT_TAIL         0x2018
> +#define MMIO_STATUS             0x2020
> +
> +#define MMIO_SIZE               0x2028

This size should be a power-of-two value. In this case probably 0x4000.

> +#define MMIO_DEVTAB_SIZE_MASK   ((1UL << 12) - 1)
> +#define MMIO_DEVTAB_BASE_MASK   (((1UL << 52) - 1) & ~MMIO_DEVTAB_SIZE_MASK)

You must use ULL to be 32bit safe. This is also true for the defines
below.

[...]

Otherwise the code looks good so far. Seems like the next step should be
some work on a qemu dma-layer where you can hook the translation into.

	Joerg

  reply	other threads:[~2010-05-24 15:40 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-05-20 13:50 [RFC PATCH] AMD IOMMU emulation Eduard - Gabriel Munteanu
2010-05-20 13:50 ` [Qemu-devel] " Eduard - Gabriel Munteanu
2010-05-24 15:40 ` Joerg Roedel [this message]
2010-05-24 15:40   ` [Qemu-devel] " Joerg Roedel
2010-05-24 20:10   ` Blue Swirl
2010-05-24 20:10     ` Blue Swirl
2010-05-25  8:39     ` Joerg Roedel
2010-05-25  8:39       ` Joerg Roedel
2010-05-25 11:23       ` Eduard - Gabriel Munteanu
2010-05-25 19:16       ` Blue Swirl
2010-05-25 19:16         ` Blue Swirl

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=20100524154030.GE1237@8bytes.org \
    --to=joro@8bytes.org \
    --cc=aliguori@us.ibm.com \
    --cc=avi@redhat.com \
    --cc=eduard.munteanu@linux360.ro \
    --cc=kvm@vger.kernel.org \
    --cc=qemu-devel@nongnu.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.