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: <200810231243.42181.major@openvz.org>
Date:	Thu, 23 Oct 2008 12:43:41 +0400
From:	Andrey Mirkin <major@...nvz.org>
To:	devel@...nvz.org
Cc:	Dave Hansen <dave@...ux.vnet.ibm.com>,
	containers@...ts.linux-foundation.org, linux-kernel@...r.kernel.org
Subject: Re: [Devel] Re: [PATCH 06/10] Introduce functions to dump mm

On Monday 20 October 2008 21:21 Dave Hansen wrote:
> On Sat, 2008-10-18 at 03:11 +0400, Andrey Mirkin wrote:
> > +static void page_get_desc(struct vm_area_struct *vma, unsigned long
> > addr, +                         struct page_desc *pdesc, cpt_context_t *
> > ctx) +{
> > +       struct mm_struct *mm = vma->vm_mm;
> > +       pgd_t *pgd;
> > +       pud_t *pud;
> > +       pmd_t *pmd;
> > +       pte_t *ptep, pte;
> > +       spinlock_t *ptl;
> > +       struct page *pg = NULL;
> > +       pgoff_t linear_index = (addr - vma->vm_start)/PAGE_SIZE +
> > vma->vm_pgoff; +
> > +       pdesc->index = linear_index;
> > +       pdesc->shared = 0;
> > +       pdesc->mm = CPT_NULL;
> > +
> > +       if (vma->vm_flags & VM_IO) {
> > +               pdesc->type = PD_ABSENT;
> > +               return;
> > +       }
> > +
> > +       pgd = pgd_offset(mm, addr);
> > +       if (pgd_none(*pgd) || unlikely(pgd_bad(*pgd)))
> > +               goto out_absent;
> > +       pud = pud_offset(pgd, addr);
> > +       if (pud_none(*pud) || unlikely(pud_bad(*pud)))
> > +               goto out_absent;
> > +       pmd = pmd_offset(pud, addr);
> > +       if (pmd_none(*pmd) || unlikely(pmd_bad(*pmd)))
> > +               goto out_absent;
> > +#ifdef CONFIG_X86
> > +       if (pmd_huge(*pmd)) {
> > +               eprintk("page_huge\n");
> > +               goto out_unsupported;
> > +       }
> > +#endif
>
> I take it you know that this breaks with the 1GB (x86_64) and 16GB (ppc)
> large pages.
>
> Since you have the VMA, why not use is_vm_hugetlb_page()?
Right now I'm checking VM_HUGETLB flag on VMAs in dump_one_vma().
This checks were added for sanity purpose just to throw out all unsupported 
right now cases.

Andrey
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ