From: Benjamin Herrenschmidt <benh@kernel.crashing.org>
To: Alexey Kardashevskiy <aik@ozlabs.ru>
Cc: linuxppc-dev@lists.ozlabs.org, Paul Mackerras <paulus@samba.org>,
David Gibson <david@gibson.dropbear.id.au>
Subject: Re: [PATCH] powerpc-powernv: added tce_get callback for powernv platform
Date: Wed, 05 Sep 2012 05:41:42 +1000 [thread overview]
Message-ID: <1346787702.3025.7.camel@pasglop> (raw)
In-Reply-To: <1346744158-31190-1-git-send-email-aik@ozlabs.ru>
On Tue, 2012-09-04 at 17:35 +1000, Alexey Kardashevskiy wrote:
> The upcoming VFIO support requires a way to know which
> entry in the TCE map is not empty in order to do cleanup
> at QEMU exit/crash. This patch adds such functionality
> to POWERNV platform code.
>
> Signed-off-by: Alexey Kardashevskiy <aik@ozlabs.ru>
> ---
> arch/powerpc/platforms/powernv/pci.c | 6 ++++++
> 1 file changed, 6 insertions(+)
>
> diff --git a/arch/powerpc/platforms/powernv/pci.c b/arch/powerpc/platforms/powernv/pci.c
> index be3cfc5..61f8068 100644
> --- a/arch/powerpc/platforms/powernv/pci.c
> +++ b/arch/powerpc/platforms/powernv/pci.c
> @@ -447,6 +447,11 @@ static void pnv_tce_free(struct iommu_table *tbl, long index, long npages)
> pnv_tce_invalidate(tbl, tces, tcep - 1);
> }
>
> +static unsigned long pnv_tce_get(struct iommu_table *tbl, long index)
> +{
> + return ((u64 *)tbl->it_base)[index - tbl->it_offset] & IOMMU_PAGE_MASK;
> +}
Why the masking here ?
Cheers,
Ben.
> void pnv_pci_setup_iommu_table(struct iommu_table *tbl,
> void *tce_mem, u64 tce_size,
> u64 dma_offset)
> @@ -597,6 +602,7 @@ void __init pnv_pci_init(void)
> ppc_md.pci_dma_dev_setup = pnv_pci_dma_dev_setup;
> ppc_md.tce_build = pnv_tce_build;
> ppc_md.tce_free = pnv_tce_free;
> + ppc_md.tce_get = pnv_tce_get;
> ppc_md.pci_probe_mode = pnv_pci_probe_mode;
> set_pci_dma_ops(&dma_iommu_ops);
>
next prev parent reply other threads:[~2012-09-04 19:41 UTC|newest]
Thread overview: 28+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <20120821113534.GS29724@truffula.fritz.box>
2012-09-04 7:33 ` [PATCH] vfio: enabled and supported on power (v7) Alexey Kardashevskiy
2012-09-04 7:35 ` [PATCH] powerpc-powernv: added tce_get callback for powernv platform Alexey Kardashevskiy
2012-09-04 19:41 ` Benjamin Herrenschmidt [this message]
2012-09-04 22:35 ` David Gibson
2012-09-05 0:19 ` Alexey Kardashevskiy
2012-09-05 0:32 ` Benjamin Herrenschmidt
2012-09-04 7:36 ` [PATCH] powerpc-kvm: fixing page alignment for TCE Alexey Kardashevskiy
2012-09-20 9:01 ` Alexander Graf
2012-09-04 7:36 ` [PATCH] powerpc-powernv: align BARs to PAGE_SIZE on powernv platform Alexey Kardashevskiy
2012-09-04 19:45 ` Benjamin Herrenschmidt
2012-09-05 0:55 ` Alexey Kardashevskiy
2012-09-05 1:16 ` Benjamin Herrenschmidt
2012-09-05 4:57 ` Alex Williamson
2012-09-05 5:17 ` Benjamin Herrenschmidt
2012-09-05 5:27 ` Alexey Kardashevskiy
2012-09-10 17:06 ` Alex Williamson
2012-09-10 16:02 ` [PATCH] vfio: enabled and supported on power (v7) Alex Williamson
2012-09-11 8:28 ` Alexey Kardashevskiy
2012-09-13 22:34 ` Alex Williamson
2012-09-13 22:41 ` Scott Wood
2012-09-13 22:55 ` Alex Williamson
2012-09-14 0:51 ` Alexey Kardashevskiy
2012-09-14 4:35 ` Alex Williamson
2012-10-11 8:19 ` Alexey Kardashevskiy
2012-10-11 18:09 ` Alex Williamson
2012-09-05 1:19 [PATCH] powerpc-powernv: added tce_get callback for powernv platform Alexey Kardashevskiy
2012-09-10 2:35 ` David Gibson
2012-09-10 5:19 ` Benjamin Herrenschmidt
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=1346787702.3025.7.camel@pasglop \
--to=benh@kernel.crashing.org \
--cc=aik@ozlabs.ru \
--cc=david@gibson.dropbear.id.au \
--cc=linuxppc-dev@lists.ozlabs.org \
--cc=paulus@samba.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;
as well as URLs for NNTP newsgroup(s).