All of lore.kernel.org
 help / color / mirror / Atom feed
From: Claudio Imbrenda <imbrenda@linux.ibm.com>
To: Thomas Huth <thuth@redhat.com>
Cc: kvm@vger.kernel.org, linux-s390@vger.kernel.org,
	david@redhat.com, frankja@linux.ibm.com, cohuck@redhat.com,
	pmorel@linux.ibm.com
Subject: Re: [kvm-unit-tests PATCH v1 3/4] s390x: mmu: add support for large pages
Date: Thu, 11 Feb 2021 11:30:42 +0100	[thread overview]
Message-ID: <20210211113042.73553215@ibm-vm> (raw)
In-Reply-To: <9d99a22d-5bcd-5544-a78e-4fe0e025f961@redhat.com>

On Thu, 11 Feb 2021 11:06:06 +0100
Thomas Huth <thuth@redhat.com> wrote:

> On 09/02/2021 15.38, Claudio Imbrenda wrote:
> > Add support for 1M and 2G pages.
> > 
> > Signed-off-by: Claudio Imbrenda <imbrenda@linux.ibm.com>
> > ---
> >   lib/s390x/mmu.h |  73 +++++++++++++-
> >   lib/s390x/mmu.c | 246
> > +++++++++++++++++++++++++++++++++++++++++++----- 2 files changed,
> > 294 insertions(+), 25 deletions(-)  
> [...]
> > +/*
> > + * Get the pte (page) DAT table entry for the given address and
> > pmd,
> > + * allocating it if necessary.
> > + * The pmd must not be large.
> > + */
> > +static inline pte_t *get_pte(pmd_t *pmd, uintptr_t vaddr)
> > +{
> >   	pte_t *pte = pte_alloc(pmd, vaddr);
> >   
> > -	return &pte_val(*pte);
> > +	assert(!pmd_large(*pmd));
> > +	pte = pte_alloc(pmd, vaddr);  
> 
> Why is this function doing "pte = pte_alloc(pmd, vaddr)" twice now?

ooops! the first pte_alloc is not supposed to be there!
good catch - will fix

> > +	return pte;
> > +}  
> [...]
> > +	if ((level == 1) && !pgd_none(*(pgd_t *)ptr))
> > +		idte_pgdp(va, ptr);
> > +	else if ((level == 2) && !p4d_none(*(p4d_t *)ptr))
> > +		idte_p4dp(va, ptr);
> > +	else if ((level == 3) && !pud_none(*(pud_t *)ptr))
> > +		idte_pudp(va, ptr);
> > +	else if ((level == 4) && !pmd_none(*(pmd_t *)ptr))
> > +		idte_pmdp(va, ptr);
> > +	else if (!pte_none(*(pte_t *)ptr))
> > +		ipte(va, ptr);  
> 
> Meta-comment: Being someone who worked quite a bit with the page
> tables on s390x, but never really got in touch with the way it is
> handled in the Linux kernel, I'm always having a hard time to match
> all these TLAs to the PoP: pmd, pud, p4d ...
> Can we please have a proper place in the kvm-unit-tests sources
> somewhere (maybe at the beginning of mmu.c), where the TLAs are
> explained and how they map to the region and segment tables of the Z
> architecture? (I personally would prefer to completely switch to the
> Z arch naming instead, but I guess that's too much of a change right
> now)

makes sense, I can add that

>   Thomas
> 


  reply	other threads:[~2021-02-11 10:35 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-02-09 14:38 [kvm-unit-tests PATCH v1 0/4] s390: Add support for large pages Claudio Imbrenda
2021-02-09 14:38 ` [kvm-unit-tests PATCH v1 1/4] libcflat: add SZ_1M and SZ_2G Claudio Imbrenda
2021-02-09 15:21   ` Thomas Huth
2021-02-09 14:38 ` [kvm-unit-tests PATCH v1 2/4] s390x: lib: fix and improve pgtable.h Claudio Imbrenda
2021-02-11  9:09   ` Thomas Huth
2021-02-09 14:38 ` [kvm-unit-tests PATCH v1 3/4] s390x: mmu: add support for large pages Claudio Imbrenda
2021-02-11 10:06   ` Thomas Huth
2021-02-11 10:30     ` Claudio Imbrenda [this message]
2021-02-09 14:38 ` [kvm-unit-tests PATCH v1 4/4] s390x: edat test Claudio Imbrenda
2021-02-11 11:35   ` Thomas Huth
2021-02-11 12:18     ` Claudio Imbrenda

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=20210211113042.73553215@ibm-vm \
    --to=imbrenda@linux.ibm.com \
    --cc=cohuck@redhat.com \
    --cc=david@redhat.com \
    --cc=frankja@linux.ibm.com \
    --cc=kvm@vger.kernel.org \
    --cc=linux-s390@vger.kernel.org \
    --cc=pmorel@linux.ibm.com \
    --cc=thuth@redhat.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: link
Be 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.