From: David Gibson <david@gibson.dropbear.id.au> To: Bharata B Rao <bharata@linux.ibm.com> Cc: farosas@linux.ibm.com, aneesh.kumar@linux.ibm.com, npiggin@gmail.com, kvm-ppc@vger.kernel.org, linuxppc-dev@lists.ozlabs.org Subject: Re: [PATCH v8 3/6] KVM: PPC: Book3S HV: Add support for H_RPT_INVALIDATE Date: Mon, 12 Jul 2021 12:28:43 +1000 [thread overview] Message-ID: <YOuo2y4Wu5keCx5p@yekko> (raw) In-Reply-To: <YOZ/FNW1K/nzaaEe@in.ibm.com> [-- Attachment #1: Type: text/plain, Size: 3031 bytes --] On Thu, Jul 08, 2021 at 09:59:08AM +0530, Bharata B Rao wrote: > On Thu, Jul 08, 2021 at 01:58:04PM +1000, David Gibson wrote: > > On Tue, Jul 06, 2021 at 10:56:32AM +0530, Bharata B Rao wrote: > > > On Mon, Jul 05, 2021 at 02:42:33PM +1000, David Gibson wrote: > > > > On Mon, Jun 21, 2021 at 02:20:00PM +0530, Bharata B Rao wrote: > > > > > diff --git a/arch/powerpc/include/asm/mmu_context.h b/arch/powerpc/include/asm/mmu_context.h > > > > > index 4bc45d3ed8b0..b44f291fc909 100644 > > > > > --- a/arch/powerpc/include/asm/mmu_context.h > > > > > +++ b/arch/powerpc/include/asm/mmu_context.h > > > > > @@ -124,8 +124,17 @@ static inline bool need_extra_context(struct mm_struct *mm, unsigned long ea) > > > > > > > > > > #if defined(CONFIG_KVM_BOOK3S_HV_POSSIBLE) && defined(CONFIG_PPC_RADIX_MMU) > > > > > extern void radix_kvm_prefetch_workaround(struct mm_struct *mm); > > > > > +void do_h_rpt_invalidate_prt(unsigned long pid, unsigned long lpid, > > > > > + unsigned long type, unsigned long pg_sizes, > > > > > + unsigned long start, unsigned long end); > > > > > #else > > > > > static inline void radix_kvm_prefetch_workaround(struct mm_struct *mm) { } > > > > > +static inline void do_h_rpt_invalidate_prt(unsigned long pid, > > > > > + unsigned long lpid, > > > > > + unsigned long type, > > > > > + unsigned long pg_sizes, > > > > > + unsigned long start, > > > > > + unsigned long end) { } > > > > > > > > Since the only plausible caller is in KVM HV code, why do you need the > > > > #else clause. > > > > > > The call to the above routine is prevented for non-radix guests > > > in KVM HV code at runtime using kvm_is_radix() check and not by > > > CONFIG_PPC_RADIX_MMU. Hence the #else version would be needed. > > > > kvm_is_radix() should evaluate to false at compile time if > > !defined(CONFIG_PPC_RADIX_MMU), in which case, no you shouldn't need > > the else version. > > At least in the latest mainline, I don't see the definition of > kvm_is_radix() being conditional to CONFIG_PPC_RADIX_MMU. That's probably worth fixing, then. > Anyway this is what I see in practice if the #else version is > removed and CONFIG_PPC_RADIX_MMU is turned off: > > arch/powerpc/kvm/book3s_hv.c: In function ‘kvmppc_h_rpt_invalidate’: > arch/powerpc/kvm/book3s_hv.c:983:2: error: implicit declaration of function ‘do_h_rpt_invalidate_prt’; did you mean ‘do_h_rpt_invalidate_pat’? [-Werror=implicit-function-declaration] > 983 | do_h_rpt_invalidate_prt(id, vcpu->kvm->arch.lpid, > | ^~~~~~~~~~~~~~~~~~~~~~~ > | do_h_rpt_invalidate_pat If you really do need the stub, it should probably be a BUG() rather than a no-op, since this really never should get called if we don't have radix. -- David Gibson | I'll have my music baroque, and my code david AT gibson.dropbear.id.au | minimalist, thank you. NOT _the_ _other_ | _way_ _around_! http://www.ozlabs.org/~dgibson [-- Attachment #2: signature.asc --] [-- Type: application/pgp-signature, Size: 833 bytes --]
WARNING: multiple messages have this Message-ID (diff)
From: David Gibson <david@gibson.dropbear.id.au> To: Bharata B Rao <bharata@linux.ibm.com> Cc: farosas@linux.ibm.com, aneesh.kumar@linux.ibm.com, npiggin@gmail.com, kvm-ppc@vger.kernel.org, linuxppc-dev@lists.ozlabs.org Subject: Re: [PATCH v8 3/6] KVM: PPC: Book3S HV: Add support for H_RPT_INVALIDATE Date: Mon, 12 Jul 2021 02:28:43 +0000 [thread overview] Message-ID: <YOuo2y4Wu5keCx5p@yekko> (raw) In-Reply-To: <YOZ/FNW1K/nzaaEe@in.ibm.com> [-- Attachment #1: Type: text/plain, Size: 3031 bytes --] On Thu, Jul 08, 2021 at 09:59:08AM +0530, Bharata B Rao wrote: > On Thu, Jul 08, 2021 at 01:58:04PM +1000, David Gibson wrote: > > On Tue, Jul 06, 2021 at 10:56:32AM +0530, Bharata B Rao wrote: > > > On Mon, Jul 05, 2021 at 02:42:33PM +1000, David Gibson wrote: > > > > On Mon, Jun 21, 2021 at 02:20:00PM +0530, Bharata B Rao wrote: > > > > > diff --git a/arch/powerpc/include/asm/mmu_context.h b/arch/powerpc/include/asm/mmu_context.h > > > > > index 4bc45d3ed8b0..b44f291fc909 100644 > > > > > --- a/arch/powerpc/include/asm/mmu_context.h > > > > > +++ b/arch/powerpc/include/asm/mmu_context.h > > > > > @@ -124,8 +124,17 @@ static inline bool need_extra_context(struct mm_struct *mm, unsigned long ea) > > > > > > > > > > #if defined(CONFIG_KVM_BOOK3S_HV_POSSIBLE) && defined(CONFIG_PPC_RADIX_MMU) > > > > > extern void radix_kvm_prefetch_workaround(struct mm_struct *mm); > > > > > +void do_h_rpt_invalidate_prt(unsigned long pid, unsigned long lpid, > > > > > + unsigned long type, unsigned long pg_sizes, > > > > > + unsigned long start, unsigned long end); > > > > > #else > > > > > static inline void radix_kvm_prefetch_workaround(struct mm_struct *mm) { } > > > > > +static inline void do_h_rpt_invalidate_prt(unsigned long pid, > > > > > + unsigned long lpid, > > > > > + unsigned long type, > > > > > + unsigned long pg_sizes, > > > > > + unsigned long start, > > > > > + unsigned long end) { } > > > > > > > > Since the only plausible caller is in KVM HV code, why do you need the > > > > #else clause. > > > > > > The call to the above routine is prevented for non-radix guests > > > in KVM HV code at runtime using kvm_is_radix() check and not by > > > CONFIG_PPC_RADIX_MMU. Hence the #else version would be needed. > > > > kvm_is_radix() should evaluate to false at compile time if > > !defined(CONFIG_PPC_RADIX_MMU), in which case, no you shouldn't need > > the else version. > > At least in the latest mainline, I don't see the definition of > kvm_is_radix() being conditional to CONFIG_PPC_RADIX_MMU. That's probably worth fixing, then. > Anyway this is what I see in practice if the #else version is > removed and CONFIG_PPC_RADIX_MMU is turned off: > > arch/powerpc/kvm/book3s_hv.c: In function ‘kvmppc_h_rpt_invalidate’: > arch/powerpc/kvm/book3s_hv.c:983:2: error: implicit declaration of function ‘do_h_rpt_invalidate_prt’; did you mean ‘do_h_rpt_invalidate_pat’? [-Werror=implicit-function-declaration] > 983 | do_h_rpt_invalidate_prt(id, vcpu->kvm->arch.lpid, > | ^~~~~~~~~~~~~~~~~~~~~~~ > | do_h_rpt_invalidate_pat If you really do need the stub, it should probably be a BUG() rather than a no-op, since this really never should get called if we don't have radix. -- David Gibson | I'll have my music baroque, and my code david AT gibson.dropbear.id.au | minimalist, thank you. NOT _the_ _other_ | _way_ _around_! http://www.ozlabs.org/~dgibson [-- Attachment #2: signature.asc --] [-- Type: application/pgp-signature, Size: 833 bytes --]
next prev parent reply other threads:[~2021-07-12 2:29 UTC|newest] Thread overview: 36+ messages / expand[flat|nested] mbox.gz Atom feed top 2021-06-21 8:49 [PATCH v8 0/6] Support for H_RPT_INVALIDATE in PowerPC KVM Bharata B Rao 2021-06-21 8:50 ` Bharata B Rao 2021-06-21 8:49 ` [PATCH v8 1/6] KVM: PPC: Book3S HV: Fix comments of H_RPT_INVALIDATE arguments Bharata B Rao 2021-06-21 8:50 ` Bharata B Rao 2021-06-21 8:49 ` [PATCH v8 2/6] powerpc/book3s64/radix: Add H_RPT_INVALIDATE pgsize encodings to mmu_psize_def Bharata B Rao 2021-06-21 8:50 ` Bharata B Rao 2021-06-21 8:50 ` [PATCH v8 3/6] KVM: PPC: Book3S HV: Add support for H_RPT_INVALIDATE Bharata B Rao 2021-06-21 8:50 ` Bharata B Rao 2021-07-05 4:42 ` David Gibson 2021-07-05 4:42 ` David Gibson 2021-07-06 5:26 ` Bharata B Rao 2021-07-06 5:38 ` Bharata B Rao 2021-07-08 3:58 ` David Gibson 2021-07-08 3:58 ` David Gibson 2021-07-08 4:29 ` Bharata B Rao 2021-07-08 4:41 ` Bharata B Rao 2021-07-12 2:28 ` David Gibson [this message] 2021-07-12 2:28 ` David Gibson 2021-06-21 8:50 ` [PATCH v8 4/6] KVM: PPC: Book3S HV: Nested support in H_RPT_INVALIDATE Bharata B Rao 2021-06-21 8:50 ` Bharata B Rao 2021-06-21 17:12 ` Nathan Chancellor 2021-06-21 17:12 ` Nathan Chancellor 2021-06-22 4:35 ` Bharata B Rao 2021-06-22 4:47 ` Bharata B Rao 2021-06-22 7:12 ` Bharata B Rao 2021-06-22 7:24 ` Bharata B Rao 2021-06-23 6:47 ` Michael Ellerman 2021-06-23 6:47 ` Michael Ellerman 2021-06-21 8:50 ` [PATCH v8 5/6] KVM: PPC: Book3S HV: Add KVM_CAP_PPC_RPT_INVALIDATE capability Bharata B Rao 2021-06-21 8:50 ` Bharata B Rao 2021-06-21 8:50 ` [PATCH v8 6/6] KVM: PPC: Book3S HV: Use H_RPT_INVALIDATE in nested KVM Bharata B Rao 2021-06-21 8:50 ` Bharata B Rao 2021-06-21 15:07 ` kernel test robot 2021-06-21 15:21 ` Philip Li 2021-06-24 13:59 ` [PATCH v8 0/6] Support for H_RPT_INVALIDATE in PowerPC KVM Michael Ellerman 2021-06-24 13:59 ` Michael Ellerman
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=YOuo2y4Wu5keCx5p@yekko \ --to=david@gibson.dropbear.id.au \ --cc=aneesh.kumar@linux.ibm.com \ --cc=bharata@linux.ibm.com \ --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: linkBe 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.