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]
Message-ID: <AM6PR08MB4376BC9B6EF50A1B17A4E106F7CF9@AM6PR08MB4376.eurprd08.prod.outlook.com>
Date:   Fri, 3 Sep 2021 09:18:55 +0000
From:   Justin He <Justin.He@....com>
To:     Marc Zyngier <maz@...nel.org>
CC:     James Morse <James.Morse@....com>,
        Alexandru Elisei <Alexandru.Elisei@....com>,
        Suzuki Poulose <Suzuki.Poulose@....com>,
        Catalin Marinas <Catalin.Marinas@....com>,
        Will Deacon <will@...nel.org>,
        Liu Shixin <liushixin2@...wei.com>,
        Eric Auger <eric.auger@...hat.com>,
        Kees Cook <keescook@...omium.org>,
        Nick Desaulniers <ndesaulniers@...gle.com>,
        Shenming Lu <lushenming@...wei.com>,
        Sami Tolvanen <samitolvanen@...gle.com>,
        Lorenzo Pieralisi <Lorenzo.Pieralisi@....com>,
        Xiaoming Ni <nixiaoming@...wei.com>,
        Zenghui Yu <yuzenghui@...wei.com>,
        "linux-arm-kernel@...ts.infradead.org" 
        <linux-arm-kernel@...ts.infradead.org>,
        "kvmarm@...ts.cs.columbia.edu" <kvmarm@...ts.cs.columbia.edu>,
        "linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>
Subject: RE: [PATCH 1/2] KVM: arm64: vgic: Add memcg accounting to vgic
 allocations

Hi Marc

> -----Original Message-----
> From: Marc Zyngier <maz@...nel.org>
> Sent: Friday, September 3, 2021 2:04 AM
> To: Justin He <Justin.He@....com>
> Cc: James Morse <James.Morse@....com>; Alexandru Elisei
> <Alexandru.Elisei@....com>; Suzuki Poulose <Suzuki.Poulose@....com>;
> Catalin Marinas <Catalin.Marinas@....com>; Will Deacon <will@...nel.org>;
> Liu Shixin <liushixin2@...wei.com>; Eric Auger <eric.auger@...hat.com>;
> Kees Cook <keescook@...omium.org>; Nick Desaulniers
> <ndesaulniers@...gle.com>; Shenming Lu <lushenming@...wei.com>; Sami
> Tolvanen <samitolvanen@...gle.com>; Lorenzo Pieralisi
> <Lorenzo.Pieralisi@....com>; Xiaoming Ni <nixiaoming@...wei.com>; Zenghui
> Yu <yuzenghui@...wei.com>; linux-arm-kernel@...ts.infradead.org;
> kvmarm@...ts.cs.columbia.edu; linux-kernel@...r.kernel.org
> Subject: Re: [PATCH 1/2] KVM: arm64: vgic: Add memcg accounting to vgic
> allocations
> 
> Jia,
> 
> Once again: please add a cover letter when you have a patch
> series. It isn't rocket science, and Git will do it for you.
> 

Okay
> On Thu, 02 Sep 2021 01:28:00 +0100,
> Jia He <justin.he@....com> wrote:
> >
> > Inspired by commit 254272ce6505 ("kvm: x86: Add memcg accounting to KVM
> > allocations"), it would be better to make arm64 vgic consistent with
> > common kvm codes.
> >
> > The memory allocations of VM scope should be charged into VM process
> > cgroup, hence change GFP_KERNEL to GFP_KERNEL_ACCOUNT.
> >
> > There remained a case in vgic_set_kvm_info() since this allocation is
> > global, not in VM scope.
> >
> > Signed-off-by: Jia He <justin.he@....com>
> > ---
> >  arch/arm64/kvm/vgic/vgic-debug.c   |  2 +-
> >  arch/arm64/kvm/vgic/vgic-init.c    |  2 +-
> >  arch/arm64/kvm/vgic/vgic-irqfd.c   |  2 +-
> >  arch/arm64/kvm/vgic/vgic-its.c     | 14 +++++++-------
> >  arch/arm64/kvm/vgic/vgic-mmio-v3.c |  2 +-
> >  arch/arm64/kvm/vgic/vgic-v4.c      |  2 +-
> >  6 files changed, 12 insertions(+), 12 deletions(-)
> >
> > diff --git a/arch/arm64/kvm/vgic/vgic-debug.c b/arch/arm64/kvm/vgic/vgic-
> debug.c
> > index f38c40a76251..e6a01f210df9 100644
> > --- a/arch/arm64/kvm/vgic/vgic-debug.c
> > +++ b/arch/arm64/kvm/vgic/vgic-debug.c
> > @@ -92,7 +92,7 @@ static void *vgic_debug_start(struct seq_file *s,
> loff_t *pos)
> >  		goto out;
> >  	}
> >
> > -	iter = kmalloc(sizeof(*iter), GFP_KERNEL);
> > +	iter = kmalloc(sizeof(*iter), GFP_KERNEL_ACCOUNT);
> 
> This really isn't an allocation made in the context of a VM. I don't
> think this hunk belongs here.

Yes, indeed


--
Cheers,
Justin (Jia He)


Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ