lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date:   Thu, 17 Jun 2021 09:03:04 +0100
From:   Marc Zyngier <maz@...nel.org>
To:     "wangyanan (Y)" <wangyanan55@...wei.com>
Cc:     Will Deacon <will@...nel.org>, Quentin Perret <qperret@...gle.com>,
        Alexandru Elisei <alexandru.elisei@....com>,
        <kvmarm@...ts.cs.columbia.edu>,
        <linux-arm-kernel@...ts.infradead.org>, <kvm@...r.kernel.org>,
        <linux-kernel@...r.kernel.org>,
        Catalin Marinas <catalin.marinas@....com>,
        James Morse <james.morse@....com>,
        Julien Thierry <julien.thierry.kdev@...il.com>,
        Suzuki K Poulose <suzuki.poulose@....com>,
        Gavin Shan <gshan@...hat.com>, <wanghaibin.wang@...wei.com>,
        <zhukeqian1@...wei.com>, <yuzenghui@...wei.com>
Subject: Re: [PATCH v6 1/4] KVM: arm64: Introduce cache maintenance callbacks for guest stage-2

On Thu, 17 Jun 2021 07:48:29 +0100,
"wangyanan (Y)" <wangyanan55@...wei.com> wrote:
> 
> Hi Marc,
> 
> On 2021/6/16 21:21, Marc Zyngier wrote:
> > Hi Yanan,
> > 
> > On Wed, 16 Jun 2021 10:51:57 +0100,
> > Yanan Wang <wangyanan55@...wei.com> wrote:
> >> To prepare for performing guest CMOs in the fault handlers in pgtable.c,
> >> introduce two cache maintenance callbacks in struct kvm_pgtable_mm_ops.
> >> 
> >> The new callbacks are specific for guest stage-2, so they will only be
> >> initialized in 'struct kvm_pgtable_mm_ops kvm_s2_mm_ops'.
> >> 
> >> Signed-off-by: Yanan Wang <wangyanan55@...wei.com>
> >> ---
> >>   arch/arm64/include/asm/kvm_pgtable.h | 7 +++++++
> >>   1 file changed, 7 insertions(+)
> >> 
> >> diff --git a/arch/arm64/include/asm/kvm_pgtable.h b/arch/arm64/include/asm/kvm_pgtable.h
> >> index c3674c47d48c..302eca32e0af 100644
> >> --- a/arch/arm64/include/asm/kvm_pgtable.h
> >> +++ b/arch/arm64/include/asm/kvm_pgtable.h
> >> @@ -44,6 +44,11 @@ typedef u64 kvm_pte_t;
> >>    *			in the current context.
> >>    * @virt_to_phys:	Convert a virtual address mapped in the current context
> >>    *			into a physical address.
> >> + * @flush_dcache:	Clean data cache for a guest page address range before
> >> + *			creating the corresponding stage-2 mapping.
> > Please don't reintroduce the word 'flush'. We are really trying to
> > move away from it as it doesn't describe what we want to do.
> I agree with this. I intended to make the names short and laconic, but this
> missed the information about the callback's actual behaviors.
> > Here this
> > should be 'clean_invalidate_dcache' which, despite being a mouthful,
> > describe accurately what we expect it to do.
> Sure, I will change the name as you suggested.
> > The comment is also missing the invalidate part, and we shouldn't
> > assume that this is only used for S2 mapping.
> Ok, will refine the comment. I think something like"Clean and invalidate the
> date cache for the specified memory address range" may be generic enough.
> >> + * @flush_icache:	Invalidate instruction cache for a guest page address
> >> + *			range before creating or updating the corresponding
> >> + *			stage-2 mapping.
> > Same thing here; this should be 'invalidate_icache', and the comment
> > cleaned up.
> Thanks, I will also correct this part.
> 
> Besides the callback names and comments, is there anything else that still
> needs some adjustment in the other three patches? :)

It looks pretty good so far, much nicer than the previous versions.

I have a small nit on the last patch, which should be dead easy to
address. I'm currently running a bunch of tests, hopefully nothing bad
will come out of it.

If you respin it shortly, that nothing fails, and unless someone
shouts, I'll queue it for -next.

Thanks,

	M.

-- 
Without deviation from the norm, progress is not possible.

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ