All of lore.kernel.org
 help / color / mirror / Atom feed
From: David Hildenbrand <david@redhat.com>
To: Andrew Jones <drjones@redhat.com>
Cc: kvm@vger.kernel.org, "Paolo Bonzini" <pbonzini@redhat.com>,
	"Radim Krčmář" <rkrcmar@redhat.com>,
	"Thomas Huth" <thuth@redhat.com>,
	"Christian Borntraeger" <borntraeger@de.ibm.com>,
	"Cornelia Huck" <cohuck@redhat.com>
Subject: Re: [PATCH kvm-unit-tests v2 07/11] s390x: initialize the physical allocator
Date: Mon, 15 Jan 2018 11:21:59 +0100	[thread overview]
Message-ID: <9e24c7c0-4dfb-d8e3-0d38-f6e98e28f35d@redhat.com> (raw)
In-Reply-To: <20180115101614.7zazuegmbmu3p6ku@kamzik.brq.redhat.com>

On 15.01.2018 11:16, Andrew Jones wrote:
> On Fri, Jan 12, 2018 at 03:34:13PM +0100, David Hildenbrand wrote:
>> We now have the range of free memory, let's initialize the physical
>> allocator. It is now possible to use alloc_page()/alloc_pages().
> 
> Commit message isn't quite right. After this patch it's possible to
> use malloc and memalign, based on the early-ops, but alloc_pages()
> requires the freelist to be initialized first by free_pages(), done
> by setup_vm().

That's interesting, as I am using alloc_pages() during setup_vm() I
haven't noticed it.

> 
> Actually, since we have four states of memory management setup,
> then I think we either need three setup calls:
> 
> state 1: no setup done, no call
> state 2: phys-alloc is set up by the phys_alloc_init() call
> state 3: alloc_page() is set up, need call that allocates chunk with the
>                                  phys-allocator for free_pages()
> 
> (Instead of a chunk, all memory could be given, but then either a
>  new set of early-ops should be provided that are based on
>  alloc_page(), or all early memory allocations must use alloc_page())
> 
> state 4: virtual memory is set up by the setup_vm() call
> 
> Or, simply remove state 2 and its code and alloc-ops, changing all early
> allocations to use alloc_page(). If each arch provides an mmu_enabled()
> call, then the alloc_ops->memalign call in memalign could be replaced
> with

I think I'd prefer that. Unless somebody needs the flexibility of this
extra state.

But let's hear what the others say.

> 
>  if (mmu_enabled())
>     vm_memalign(...)
>  else
>     /* fallback to alloc_pages() */
> 
> I probably should have written all this in a separate thread, because
> I wouldn't want to hold this series up on a rework of the general
> memory management framework. But, anyway, thoughts on that? Paolo?>
> Thanks,
> drew
>

-- 

Thanks,

David / dhildenb

  reply	other threads:[~2018-01-15 10:22 UTC|newest]

Thread overview: 23+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-01-12 14:34 [PATCH kvm-unit-tests v2 00/11] s390x: vmalloc support David Hildenbrand
2018-01-12 14:34 ` [PATCH kvm-unit-tests v2 01/11] s390x: fix TEST BLOCK tests David Hildenbrand
2018-01-12 14:34 ` [PATCH kvm-unit-tests v2 02/11] s390x: use highest addresses for PGM_ADDRESSING errors David Hildenbrand
2018-01-12 14:34 ` [PATCH kvm-unit-tests v2 03/11] s390x: set initital stack pointer to stackptr, not stacktop David Hildenbrand
2018-01-12 16:04   ` Thomas Huth
2018-01-12 14:34 ` [PATCH kvm-unit-tests v2 04/11] s390x: add missing sclp definitions from QEMU David Hildenbrand
2018-01-15 10:46   ` Thomas Huth
2018-01-12 14:34 ` [PATCH kvm-unit-tests v2 05/11] s390x: rename sclp_setup() to sclp_ascii_setup() David Hildenbrand
2018-01-12 14:34 ` [PATCH kvm-unit-tests v2 06/11] s390x: detect installed memory David Hildenbrand
2018-01-15 10:56   ` Thomas Huth
2018-01-12 14:34 ` [PATCH kvm-unit-tests v2 07/11] s390x: initialize the physical allocator David Hildenbrand
2018-01-15 10:16   ` Andrew Jones
2018-01-15 10:21     ` David Hildenbrand [this message]
2018-01-15 10:31       ` Paolo Bonzini
2018-01-15 10:35         ` David Hildenbrand
2018-01-15 10:38     ` Paolo Bonzini
2018-01-15 10:50       ` Andrew Jones
2018-01-15 10:42     ` David Hildenbrand
2018-01-12 14:34 ` [PATCH kvm-unit-tests v2 08/11] s390x: add vmalloc support David Hildenbrand
2018-01-12 14:34 ` [PATCH kvm-unit-tests v2 09/11] s390x: enable DAT in PGM interrupt handler David Hildenbrand
2018-01-12 14:34 ` [PATCH kvm-unit-tests v2 10/11] s390x: add test for (v)malloc David Hildenbrand
2018-01-15 10:58   ` Thomas Huth
2018-01-12 14:34 ` [PATCH kvm-unit-tests v2 11/11] s390x: add sieve test David Hildenbrand

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=9e24c7c0-4dfb-d8e3-0d38-f6e98e28f35d@redhat.com \
    --to=david@redhat.com \
    --cc=borntraeger@de.ibm.com \
    --cc=cohuck@redhat.com \
    --cc=drjones@redhat.com \
    --cc=kvm@vger.kernel.org \
    --cc=pbonzini@redhat.com \
    --cc=rkrcmar@redhat.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.