From: Bharata B Rao <bharata@linux.ibm.com>
To: Fabiano Rosas <farosas@linux.ibm.com>
Cc: aneesh.kumar@linux.ibm.com, npiggin@gmail.com,
kvm-ppc@vger.kernel.org, linuxppc-dev@lists.ozlabs.org,
david@gibson.dropbear.id.au
Subject: Re: [PATCH v2 1/2] KVM: PPC: Book3S HV: Add support for H_RPT_INVALIDATE
Date: Thu, 17 Dec 2020 08:53:19 +0000 [thread overview]
Message-ID: <20201217084119.GC775394@in.ibm.com> (raw)
In-Reply-To: <87v9d174hq.fsf@linux.ibm.com>
On Wed, Dec 16, 2020 at 07:47:29PM -0300, Fabiano Rosas wrote:
> > +static void do_tlb_invalidate(unsigned long rs, unsigned long target,
> > + unsigned long type, unsigned long page_size,
> > + unsigned long ap, unsigned long start,
> > + unsigned long end)
> > +{
> > + unsigned long rb;
> > + unsigned long addr = start;
> > +
> > + if ((type & H_RPTI_TYPE_ALL) = H_RPTI_TYPE_ALL) {
> > + rb = PPC_BIT(53); /* IS = 1 */
> > + do_tlb_invalidate_all(rb, rs);
> > + return;
> > + }
> > +
> > + if (type & H_RPTI_TYPE_PWC) {
> > + rb = PPC_BIT(53); /* IS = 1 */
> > + do_tlb_invalidate_pwc(rb, rs);
> > + }
> > +
> > + if (!addr && end = -1) { /* PID */
> > + rb = PPC_BIT(53); /* IS = 1 */
> > + do_tlb_invalidate_tlb(rb, rs);
> > + } else { /* EA */
> > + do {
> > + rb = addr & ~(PPC_BITMASK(52, 63));
> > + rb |= ap << PPC_BITLSHIFT(58);
> > + do_tlb_invalidate_tlb(rb, rs);
> > + addr += page_size;
> > + } while (addr < end);
> > + }
> > +}
>
> This is all quite similar to _tlbie_pid in mm/book3s64/radix_tlb.c so:
>
> 1) Shouldn't do_tlb_invalidate be in that file so we could reuse
> __tlbie_pid and __tlbie_va? There are also the tracepoints in that file
> that we might want to reuse.
Will see how much reuse is possible.
>
> 2) For my own understanding, don't the "fixups" in _tlbie_pid apply to
> this scenario as well?
Yes, I think, will add fixups.
> > +long kvmhv_h_rpti_nested(struct kvm_vcpu *vcpu, unsigned long lpid,
> > + unsigned long type, unsigned long pg_sizes,
> > + unsigned long start, unsigned long end)
> > +{
> > + struct kvm_nested_guest *gp;
> > + long ret;
> > + unsigned long psize, ap;
> > +
> > + /*
> > + * If L2 lpid isn't valid, we need to return H_PARAMETER.
> > + * Nested KVM issues a L2 lpid flush call when creating
> > + * partition table entries for L2. This happens even before
> > + * the corresponding shadow lpid is created in HV. Until
> > + * this is fixed, ignore such flush requests.
>
> >From the text, it seems that you are talking about kvmhv_set_ptbl_entry
> in L1 calling kvmhv_flush_lpid, but I'm not sure. Could you clarify that
> scenario a bit?
Yes this is the scenario which I am talking about here.
>
> Maybe it would be good to have a more concrete hint of the issue here or
> in the commit message, since you mentioned this is something that needs
> fixing.
Hmm let me see if I can make the comment more verbose/concrete in the
next version.
Thanks for your review.
Regards,
Bharata.
WARNING: multiple messages have this Message-ID (diff)
From: Bharata B Rao <bharata@linux.ibm.com>
To: Fabiano Rosas <farosas@linux.ibm.com>
Cc: aneesh.kumar@linux.ibm.com, npiggin@gmail.com,
kvm-ppc@vger.kernel.org, linuxppc-dev@lists.ozlabs.org,
david@gibson.dropbear.id.au
Subject: Re: [PATCH v2 1/2] KVM: PPC: Book3S HV: Add support for H_RPT_INVALIDATE
Date: Thu, 17 Dec 2020 14:11:19 +0530 [thread overview]
Message-ID: <20201217084119.GC775394@in.ibm.com> (raw)
In-Reply-To: <87v9d174hq.fsf@linux.ibm.com>
On Wed, Dec 16, 2020 at 07:47:29PM -0300, Fabiano Rosas wrote:
> > +static void do_tlb_invalidate(unsigned long rs, unsigned long target,
> > + unsigned long type, unsigned long page_size,
> > + unsigned long ap, unsigned long start,
> > + unsigned long end)
> > +{
> > + unsigned long rb;
> > + unsigned long addr = start;
> > +
> > + if ((type & H_RPTI_TYPE_ALL) == H_RPTI_TYPE_ALL) {
> > + rb = PPC_BIT(53); /* IS = 1 */
> > + do_tlb_invalidate_all(rb, rs);
> > + return;
> > + }
> > +
> > + if (type & H_RPTI_TYPE_PWC) {
> > + rb = PPC_BIT(53); /* IS = 1 */
> > + do_tlb_invalidate_pwc(rb, rs);
> > + }
> > +
> > + if (!addr && end == -1) { /* PID */
> > + rb = PPC_BIT(53); /* IS = 1 */
> > + do_tlb_invalidate_tlb(rb, rs);
> > + } else { /* EA */
> > + do {
> > + rb = addr & ~(PPC_BITMASK(52, 63));
> > + rb |= ap << PPC_BITLSHIFT(58);
> > + do_tlb_invalidate_tlb(rb, rs);
> > + addr += page_size;
> > + } while (addr < end);
> > + }
> > +}
>
> This is all quite similar to _tlbie_pid in mm/book3s64/radix_tlb.c so:
>
> 1) Shouldn't do_tlb_invalidate be in that file so we could reuse
> __tlbie_pid and __tlbie_va? There are also the tracepoints in that file
> that we might want to reuse.
Will see how much reuse is possible.
>
> 2) For my own understanding, don't the "fixups" in _tlbie_pid apply to
> this scenario as well?
Yes, I think, will add fixups.
> > +long kvmhv_h_rpti_nested(struct kvm_vcpu *vcpu, unsigned long lpid,
> > + unsigned long type, unsigned long pg_sizes,
> > + unsigned long start, unsigned long end)
> > +{
> > + struct kvm_nested_guest *gp;
> > + long ret;
> > + unsigned long psize, ap;
> > +
> > + /*
> > + * If L2 lpid isn't valid, we need to return H_PARAMETER.
> > + * Nested KVM issues a L2 lpid flush call when creating
> > + * partition table entries for L2. This happens even before
> > + * the corresponding shadow lpid is created in HV. Until
> > + * this is fixed, ignore such flush requests.
>
> >From the text, it seems that you are talking about kvmhv_set_ptbl_entry
> in L1 calling kvmhv_flush_lpid, but I'm not sure. Could you clarify that
> scenario a bit?
Yes this is the scenario which I am talking about here.
>
> Maybe it would be good to have a more concrete hint of the issue here or
> in the commit message, since you mentioned this is something that needs
> fixing.
Hmm let me see if I can make the comment more verbose/concrete in the
next version.
Thanks for your review.
Regards,
Bharata.
next prev parent reply other threads:[~2020-12-17 8:53 UTC|newest]
Thread overview: 14+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-12-16 8:54 [PATCH v2 0/2] Support for H_RPT_INVALIDATE in PowerPC KVM Bharata B Rao
2020-12-16 8:58 ` Bharata B Rao
2020-12-16 8:54 ` [PATCH v2 1/2] KVM: PPC: Book3S HV: Add support for H_RPT_INVALIDATE Bharata B Rao
2020-12-16 8:58 ` Bharata B Rao
2020-12-17 3:42 ` David Gibson
2020-12-17 3:42 ` David Gibson
2020-12-17 8:48 ` Bharata B Rao
2020-12-17 8:50 ` Bharata B Rao
[not found] ` <87v9d174hq.fsf@linux.ibm.com>
2020-12-17 8:41 ` Bharata B Rao [this message]
2020-12-17 8:53 ` Bharata B Rao
2020-12-16 8:54 ` [PATCH v2 2/2] KVM: PPC: Book3S HV: Use H_RPT_INVALIDATE in nested KVM Bharata B Rao
2020-12-16 8:58 ` Bharata B Rao
2020-12-17 3:33 ` [PATCH v2 0/2] Support for H_RPT_INVALIDATE in PowerPC KVM David Gibson
2020-12-17 3:33 ` David Gibson
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=20201217084119.GC775394@in.ibm.com \
--to=bharata@linux.ibm.com \
--cc=aneesh.kumar@linux.ibm.com \
--cc=david@gibson.dropbear.id.au \
--cc=farosas@linux.ibm.com \
--cc=kvm-ppc@vger.kernel.org \
--cc=linuxppc-dev@lists.ozlabs.org \
--cc=npiggin@gmail.com \
/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.