From: Alexander Graf <agraf@suse.de>
To: Alexey Kardashevskiy <aik@ozlabs.ru>, qemu-devel@nongnu.org
Cc: qemu-ppc@nongnu.org
Subject: Re: [Qemu-devel] [PATCH 2/9] spapr_iommu: Enable multiple TCE requests
Date: Wed, 21 May 2014 16:37:30 +0200 [thread overview]
Message-ID: <537CBA2A.80204@suse.de> (raw)
In-Reply-To: <1400682080-30724-3-git-send-email-aik@ozlabs.ru>
On 21.05.14 16:21, Alexey Kardashevskiy wrote:
> Currently only single TCE entry per request is supported (H_PUT_TCE).
> However PAPR+ specification allows multiple entry requests such as
> H_PUT_TCE_INDIRECT and H_STUFF_TCE. Having less transitions to the host
> kernel via ioctls, support of these calls can accelerate IOMMU operations.
>
> This implements H_STUFF_TCE and H_PUT_TCE_INDIRECT.
>
> This advertises "multi-tce" capability to the guest if the host kernel
> supports it (KVM_CAP_SPAPR_MULTITCE) or guest is running in TCG mode.
>
> Signed-off-by: Alexey Kardashevskiy <aik@ozlabs.ru>
> ---
> Changes:
> v1:
> * removed checks for liobn as the check is performed already in
> spapr_tce_find_by_liobn
> * added hcall-multi-tce if the host kernel supports the capability
> ---
> hw/ppc/spapr.c | 3 ++
> hw/ppc/spapr_iommu.c | 78 ++++++++++++++++++++++++++++++++++++++++++++++++++++
> target-ppc/kvm.c | 7 +++++
> target-ppc/kvm_ppc.h | 7 +++++
> trace-events | 2 ++
> 5 files changed, 97 insertions(+)
>
> diff --git a/hw/ppc/spapr.c b/hw/ppc/spapr.c
> index e174e04..66929cb 100644
> --- a/hw/ppc/spapr.c
> +++ b/hw/ppc/spapr.c
> @@ -500,6 +500,9 @@ static void *spapr_create_fdt_skel(hwaddr initrd_base,
> /* RTAS */
> _FDT((fdt_begin_node(fdt, "rtas")));
>
> + if (kvmppc_spapr_use_multitce()) {
Sorry I didn't realize this earlier. I think it's more obvious to the
reader if the "enabled for TCG" logic is not hidden in some other function:
if (!kvm_enabled() || kvmppc_supports_multitce()) {
> + SPAPR_HYPERRTAS_ADD("hcall-multi-tce");
> + }
> _FDT((fdt_property(fdt, "ibm,hypertas-functions", hypertas_prop,
> hypertas_prop_len)));
> _FDT((fdt_property(fdt, "qemu,hypertas-functions", qemu_hypertas_prop,
> diff --git a/hw/ppc/spapr_iommu.c b/hw/ppc/spapr_iommu.c
> index 72493d8..ab5037c 100644
> --- a/hw/ppc/spapr_iommu.c
> +++ b/hw/ppc/spapr_iommu.c
> @@ -224,6 +224,82 @@ static target_ulong put_tce_emu(sPAPRTCETable *tcet, target_ulong ioba,
> return H_SUCCESS;
> }
>
> +static target_ulong h_put_tce_indirect(PowerPCCPU *cpu,
> + sPAPREnvironment *spapr,
> + target_ulong opcode, target_ulong *args)
> +{
> + int i;
> + target_ulong liobn = args[0];
> + target_ulong ioba = args[1];
> + target_ulong ioba1 = ioba;
> + target_ulong tce_list = args[2];
> + target_ulong npages = args[3];
> + target_ulong ret = H_PARAMETER;
> + sPAPRTCETable *tcet = spapr_tce_find_by_liobn(liobn);
> + CPUState *cs = CPU(cpu);
> +
> + if (!tcet) {
> + return H_PARAMETER;
> + }
> +
> + if (npages > 512) {
> + return H_PARAMETER;
> + }
> +
> + ioba &= ~SPAPR_TCE_PAGE_MASK;
> + tce_list &= ~SPAPR_TCE_PAGE_MASK;
> +
> + for (i = 0; i < npages; ++i, ioba += SPAPR_TCE_PAGE_SIZE) {
> + target_ulong tce = ldq_phys(cs->as, tce_list +
Is this one of those cases where the guest may expect us to mask the
upper bits again? It's not an rtas call after all. What does sPAPR say?
Alex
next prev parent reply other threads:[~2014-05-21 14:37 UTC|newest]
Thread overview: 30+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-05-21 14:21 [Qemu-devel] [PATCH 0/9] spapr_pci: Prepare for VFIO Alexey Kardashevskiy
2014-05-21 14:21 ` [Qemu-devel] [PATCH 1/9] spapr: Enable dynamic change of the supported hypercalls list Alexey Kardashevskiy
2014-05-21 14:26 ` Alexander Graf
2014-05-21 15:21 ` [Qemu-devel] [PATCH v2] " Alexey Kardashevskiy
2014-05-22 10:47 ` Alexander Graf
2014-05-22 11:01 ` Alexey Kardashevskiy
2014-05-22 11:02 ` Alexander Graf
2014-05-21 14:21 ` [Qemu-devel] [PATCH 2/9] spapr_iommu: Enable multiple TCE requests Alexey Kardashevskiy
2014-05-21 14:37 ` Alexander Graf [this message]
2014-05-21 15:23 ` [Qemu-devel] [PATCH v2] " Alexey Kardashevskiy
2014-05-21 16:03 ` Alexey Kardashevskiy
2014-05-21 21:54 ` Alexander Graf
2014-05-21 14:21 ` [Qemu-devel] [PATCH 3/9] spapr_pci: Introduce a finish_realize() callback Alexey Kardashevskiy
2014-05-21 14:21 ` [Qemu-devel] [PATCH 4/9] spapr_pci: spapr_iommu: Make DMA window a subregion Alexey Kardashevskiy
2014-05-21 14:21 ` [Qemu-devel] [PATCH 5/9] spapr_pci: Allow multiple TCE tables per PHB Alexey Kardashevskiy
2014-05-21 14:21 ` [Qemu-devel] [PATCH 6/9] spapr_iommu: Convert old qdev_init_nofail() to object_property_set_bool Alexey Kardashevskiy
2014-05-21 14:21 ` [Qemu-devel] [PATCH 7/9] spapr_iommu: Get rid of window_size in sPAPRTCETable Alexey Kardashevskiy
2014-05-21 22:05 ` Alexander Graf
2014-05-21 14:21 ` [Qemu-devel] [PATCH 8/9] spapr_iommu: Introduce page_shift " Alexey Kardashevskiy
2014-05-21 22:11 ` Alexander Graf
2014-05-21 23:45 ` Alexey Kardashevskiy
2014-05-22 10:09 ` Alexander Graf
2014-05-22 10:24 ` Alexey Kardashevskiy
2014-05-22 10:45 ` Alexander Graf
2014-05-22 10:46 ` Alexey Kardashevskiy
2014-05-22 10:48 ` Alexander Graf
2014-05-22 10:55 ` Alexey Kardashevskiy
2014-05-22 4:25 ` Alexey Kardashevskiy
2014-05-22 7:11 ` Alexander Graf
2014-05-21 14:21 ` [Qemu-devel] [PATCH 9/9] spapr_iommu: Introduce bus_offset " Alexey Kardashevskiy
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=537CBA2A.80204@suse.de \
--to=agraf@suse.de \
--cc=aik@ozlabs.ru \
--cc=qemu-devel@nongnu.org \
--cc=qemu-ppc@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 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).