public inbox for linux-s390@vger.kernel.org
 help / color / mirror / Atom feed
From: Janosch Frank <frankja@linux.ibm.com>
To: Cornelia Huck <cohuck@redhat.com>, Pierre Morel <pmorel@linux.ibm.com>
Cc: kvm@vger.kernel.org, linux-s390@vger.kernel.org,
	david@redhat.com, thuth@redhat.com, imbrenda@linux.ibm.com
Subject: Re: [kvm-unit-tests PATCH v2 1/4] memory: allocation in low memory
Date: Tue, 29 Sep 2020 09:19:53 +0200	[thread overview]
Message-ID: <136e1860-ddbc-edc0-7e67-fdbd8112a01e@linux.ibm.com> (raw)
In-Reply-To: <20200928173147.750e7358.cohuck@redhat.com>


[-- Attachment #1.1: Type: text/plain, Size: 2145 bytes --]

On 9/28/20 5:31 PM, Cornelia Huck wrote:
> On Mon, 28 Sep 2020 16:23:34 +0200
> Pierre Morel <pmorel@linux.ibm.com> wrote:
> 
>> Some architectures need allocations to be done under a
>> specific address limit to allow DMA from I/O.
>>
>> We propose here a very simple page allocator to get
>> pages allocated under this specific limit.
>>
>> The DMA page allocator will only use part of the available memory
>> under the DMA address limit to let room for the standard allocator.
>>
>> Signed-off-by: Pierre Morel <pmorel@linux.ibm.com>
>> ---
>>  lib/alloc_dma_page.c | 57 ++++++++++++++++++++++++++++++++++++++++++++
>>  lib/alloc_dma_page.h | 24 +++++++++++++++++++
>>  lib/s390x/sclp.c     |  2 ++
>>  s390x/Makefile       |  1 +
>>  4 files changed, 84 insertions(+)
>>  create mode 100644 lib/alloc_dma_page.c
>>  create mode 100644 lib/alloc_dma_page.h
> 
> (...)
> 
>> diff --git a/lib/alloc_dma_page.h b/lib/alloc_dma_page.h
>> new file mode 100644
>> index 0000000..85e1d2f
>> --- /dev/null
>> +++ b/lib/alloc_dma_page.h
>> @@ -0,0 +1,24 @@
>> +/*
>> + * Page allocator for DMA definitions
>> + *
>> + * Copyright (c) IBM, Corp. 2020
>> + *
>> + * Authors:
>> + *  Pierre Morel <pmorel@linux.ibm.com>
>> + *
>> + * This code is free software; you can redistribute it and/or modify it
>> + * under the terms of the GNU Library General Public License version 2.
>> + */
>> +#ifndef _ALLOC_DMA_PAGE_H_
>> +#define _ALLOC_DMA_PAGE_H_
>> +
>> +#include <asm/page.h>
>> +
>> +void put_dma_page(void *dma_page);
>> +void *get_dma_page(void);
>> +phys_addr_t dma_page_alloc_init(phys_addr_t start_pfn, phys_addr_t nb_pages);
>> +
>> +#define DMA_MAX_PFN	(0x80000000 >> PAGE_SHIFT)
>> +#define DMA_ALLOC_RATIO	8
> 
> Hm, shouldn't the architecture be able to decide where a dma page can
> be located? Or am I misunderstanding?

Before we start any other discussion on this patch we should clear up if
this is still necessary after Claudio's alloc revamp.

I think he added options to request special types of memory.

> 
>> +
>> +#endif /* _ALLOC_DMA_PAGE_H_ */
> (...)
> 



[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 833 bytes --]

  reply	other threads:[~2020-09-29  7:20 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-09-28 14:23 [kvm-unit-tests PATCH v2 0/4] s390x: css: pv: css test adaptation for PV Pierre Morel
2020-09-28 14:23 ` [kvm-unit-tests PATCH v2 1/4] memory: allocation in low memory Pierre Morel
2020-09-28 15:31   ` Cornelia Huck
2020-09-29  7:19     ` Janosch Frank [this message]
2020-11-05 12:16       ` Pierre Morel
2020-11-05 14:15         ` Janosch Frank
2020-11-06  9:46           ` Andrew Jones
2020-11-06 13:25           ` Paolo Bonzini
2020-11-09  9:13             ` Pierre Morel
2020-09-28 14:23 ` [kvm-unit-tests PATCH v2 2/4] s390x: pv: implement routine to share/unshare memory Pierre Morel
2020-09-29 10:51   ` Cornelia Huck
2020-09-28 14:23 ` [kvm-unit-tests PATCH v2 3/4] s390x: define UV compatible I/O allocation Pierre Morel
2020-09-28 14:23 ` [kvm-unit-tests PATCH v2 4/4] s390x: css: pv: css test adaptation for PV Pierre Morel

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=136e1860-ddbc-edc0-7e67-fdbd8112a01e@linux.ibm.com \
    --to=frankja@linux.ibm.com \
    --cc=cohuck@redhat.com \
    --cc=david@redhat.com \
    --cc=imbrenda@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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox