From mboxrd@z Thu Jan 1 00:00:00 1970 From: Bharata B Rao Date: Tue, 24 Nov 2020 09:56:11 +0000 Subject: Re: [PATCH v1 0/2] Use H_RPT_INVALIDATE for nested guest Message-Id: <20201124094411.GA72234@in.ibm.com> List-Id: References: <20201019112642.53016-1-bharata@linux.ibm.com> In-Reply-To: <20201019112642.53016-1-bharata@linux.ibm.com> MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable To: kvm-ppc@vger.kernel.org, linuxppc-dev@lists.ozlabs.org Cc: aneesh.kumar@linux.ibm.com, npiggin@gmail.com Hi, Any comments on this patchset? Anything specific to be addressed before it could be considered for inclusion? Regards, Bharata. On Mon, Oct 19, 2020 at 04:56:40PM +0530, Bharata B Rao wrote: > This patchset adds support for the new hcall H_RPT_INVALIDATE > (currently handles nested case only) and replaces the nested tlb flush > calls with this new hcall if the support for the same exists. >=20 > Changes in v1: > ------------- > - Removed the bits that added the FW_FEATURE_RPT_INVALIDATE feature > as they are already upstream. >=20 > v0: https://lore.kernel.org/linuxppc-dev/20200703104420.21349-1-bharata@l= inux.ibm.com/T/#m1800c5f5b3d4f6a154ae58fc1c617c06f286358f >=20 > H_RPT_INVALIDATE > =3D=3D=3D=3D=3D=3D=3D=3D > Syntax: > int64=A0=A0 /* H_Success: Return code on successful completion */ > =A0=A0=A0=A0=A0=A0=A0 /* H_Busy - repeat the call with the same */ > =A0=A0=A0=A0=A0=A0=A0 /* H_Parameter, H_P2, H_P3, H_P4, H_P5 : Invalid pa= rameters */ > =A0=A0=A0=A0=A0=A0=A0 hcall(const uint64 H_RPT_INVALIDATE, /* Invalidate = RPT translation lookaside information */ > =A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0 uint64 pid,=A0=A0=A0=A0=A0=A0 /* = PID/LPID to invalidate */ > =A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0 uint64 target,=A0=A0=A0 /* Invali= dation target */ > =A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0 uint64 type,=A0=A0=A0=A0=A0 /* Ty= pe of lookaside information */ > =A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0 uint64 pageSizes,=A0=A0=A0=A0 /* = Page sizes */ > =A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0 uint64 start,=A0=A0=A0=A0 /* Star= t of Effective Address (EA) range (inclusive) */ > =A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0 uint64 end)=A0=A0=A0=A0=A0=A0 /* = End of EA range (exclusive) */ >=20 > Invalidation targets (target) > ----------------------------- > Core MMU=A0=A0=A0=A0=A0=A0=A0 0x01 /* All virtual processors in the parti= tion */ > Core local MMU=A0 0x02 /* Current virtual processor */ > Nest MMU=A0=A0=A0=A0=A0=A0=A0 0x04 /* All nest/accelerator agents in use = by the partition */ >=20 > A combination of the above can be specified, except core and core local. >=20 > Type of translation to invalidate (type) > --------------------------------------- > NESTED=A0=A0=A0=A0=A0=A0 0x0001=A0 /* Invalidate nested guest partition-s= cope */ > TLB=A0=A0=A0=A0=A0=A0=A0=A0=A0=A00x0002=A0 /* Invalidate TLB */ > PWC=A0=A0=A0=A0=A0=A0=A0=A0=A0=A00x0004=A0 /* Invalidate Page Walk Cache = */ > PRT=A0=A0=A0=A0=A0=A0=A0=A0=A0=A00x0008=A0 /* Invalidate Process Table En= tries if NESTED is clear */ > PAT=A0=A0=A0=A0=A0=A0=A0=A0=A0=A00x0008=A0 /* Invalidate Partition Table = Entries=A0if NESTED is set */ >=20 > A combination of the above can be specified. >=20 > Page size mask (pageSizes) > -------------------------- > 4K=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0 0x01 > 64K=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0 0x02 > 2M=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0 0x04 > 1G=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0 0x08 > All sizes=A0=A0=A0=A0=A0=A0 (-1UL) >=20 > A combination of the above can be specified. > All page sizes can be selected with -1. >=20 > Semantics: Invalidate radix tree lookaside information > =A0=A0=A0=A0=A0=A0=A0=A0=A0=A0 matching the parameters given. > * Return H_P2, H_P3 or H_P4 if target, type, or pageSizes parameters are > =A0 different from the defined values. > * Return H_PARAMETER if NESTED is set and pid is not a valid nested > LPID allocated to this partition > * Return H_P5 if (start, end) doesn't form a valid range. Start and end > should be a valid Quadrant address and=A0 end > start. > * Return H_NotSupported if the partition is not in running in radix > translation mode. > * May invalidate more translation information than requested. > * If start =3D 0 and end =3D -1, set the range to cover all valid address= es. > =A0 Else start and end should be aligned to 4kB (lower 11 bits clear). > * If NESTED is clear, then invalidate process scoped lookaside informatio= n. > =A0 Else pid specifies a nested LPID, and the invalidation is performed > =A0 on nested guest partition table and nested guest partition scope real > addresses. > * If pid =3D 0 and NESTED is clear, then valid addresses are quadrant 3 a= nd > =A0 quadrant 0 spaces, Else valid addresses are quadrant 0. > * Pages which are fully covered by the range are to be invalidated. > =A0 Those which are partially covered are considered outside invalidation > =A0 range, which allows a caller to optimally invalidate ranges that may > =A0 contain mixed page sizes. > * Return H_SUCCESS on success. >=20 > Bharata B Rao (2): > KVM: PPC: Book3S HV: Add support for H_RPT_INVALIDATE (nested case > only) > KVM: PPC: Book3S HV: Use H_RPT_INVALIDATE in nested KVM >=20 > Documentation/virt/kvm/api.rst | 17 +++ > .../include/asm/book3s/64/tlbflush-radix.h | 18 +++ > arch/powerpc/include/asm/kvm_book3s.h | 3 + > arch/powerpc/kvm/book3s_64_mmu_radix.c | 26 ++++- > arch/powerpc/kvm/book3s_hv.c | 32 ++++++ > arch/powerpc/kvm/book3s_hv_nested.c | 107 +++++++++++++++++- > arch/powerpc/kvm/powerpc.c | 3 + > arch/powerpc/mm/book3s64/radix_tlb.c | 4 - > include/uapi/linux/kvm.h | 1 + > 9 files changed, 200 insertions(+), 11 deletions(-) >=20 > --=20 > 2.26.2