All of lore.kernel.org
 help / color / mirror / Atom feed
From: Cornelia Huck <cohuck@redhat.com>
To: Marcel Apfelbaum <marcel@redhat.com>, borntraeger@de.ibm.com
Cc: qemu-devel@nongnu.org, ehabkost@redhat.com, imammedo@redhat.com,
	yuval.shaia@oracle.com, pbonzini@redhat.com, mst@redhat.com
Subject: [Qemu-devel] Getting rid of phys_mem_set_alloc (was: Re: [PATCH V6 2/5] mem: add share parameter to memory-backend-ram)
Date: Mon, 8 Jan 2018 17:05:53 +0100	[thread overview]
Message-ID: <20180108170553.6312b178.cohuck@redhat.com> (raw)
In-Reply-To: <20180107123224.100877-3-marcel@redhat.com>

On Sun,  7 Jan 2018 14:32:21 +0200
Marcel Apfelbaum <marcel@redhat.com> wrote:

Looking at the churn below...

> diff --git a/exec.c b/exec.c
> index 4722e521d4..247f8bd0c0 100644
> --- a/exec.c
> +++ b/exec.c
> @@ -1278,7 +1278,7 @@ static int subpage_register (subpage_t *mmio, uint32_t start, uint32_t end,
>                               uint16_t section);
>  static subpage_t *subpage_init(FlatView *fv, hwaddr base);
>  
> -static void *(*phys_mem_alloc)(size_t size, uint64_t *align) =
> +static void *(*phys_mem_alloc)(size_t size, uint64_t *align, bool shared) =
>                                 qemu_anon_ram_alloc;
>  
>  /*
> @@ -1286,7 +1286,7 @@ static void *(*phys_mem_alloc)(size_t size, uint64_t *align) =
>   * Accelerators with unusual needs may need this.  Hopefully, we can
>   * get rid of it eventually.
>   */
> -void phys_mem_set_alloc(void *(*alloc)(size_t, uint64_t *align))
> +void phys_mem_set_alloc(void *(*alloc)(size_t, uint64_t *align, bool shared))
>  {
>      phys_mem_alloc = alloc;
>  }

> diff --git a/include/sysemu/kvm.h b/include/sysemu/kvm.h
> index bbf12a1723..85002ac49a 100644
> --- a/include/sysemu/kvm.h
> +++ b/include/sysemu/kvm.h
> @@ -248,7 +248,7 @@ int kvm_on_sigbus(int code, void *addr);
>  
>  /* interface with exec.c */
>  
> -void phys_mem_set_alloc(void *(*alloc)(size_t, uint64_t *align));
> +void phys_mem_set_alloc(void *(*alloc)(size_t, uint64_t *align, bool shared));
>  
>  /* internal API */
>  

> diff --git a/target/s390x/kvm.c b/target/s390x/kvm.c
> index 9b8b59f2a2..6c0fc2f89c 100644
> --- a/target/s390x/kvm.c
> +++ b/target/s390x/kvm.c
> @@ -144,7 +144,7 @@ static int cap_gs;
>  
>  static int active_cmma;
>  
> -static void *legacy_s390_alloc(size_t size, uint64_t *align);
> +static void *legacy_s390_alloc(size_t size, uint64_t *align, bool shared);
>  
>  static int kvm_s390_query_mem_limit(uint64_t *memory_limit)
>  {
> @@ -743,7 +743,7 @@ int kvm_s390_mem_op(S390CPU *cpu, vaddr addr, uint8_t ar, void *hostbuf,
>   * to grow. We also have to use MAP parameters that avoid
>   * read-only mapping of guest pages.
>   */
> -static void *legacy_s390_alloc(size_t size, uint64_t *align)
> +static void *legacy_s390_alloc(size_t size, uint64_t *align, bool shared)
>  {
>      void *mem;
>  

...I'm wondering whether we have any chance to get rid of this in the
future?

s390x/kvm is the only user:

    if (!kvm_check_extension(s, KVM_CAP_S390_GMAP)
        || !kvm_check_extension(s, KVM_CAP_S390_COW)) {
        phys_mem_set_alloc(legacy_s390_alloc);
    }

In practice, this means depending on ESOP in the host. Are there still
any machines/hypervisors without ESOP that we can reasonably expect
people to run kvm on?

  reply	other threads:[~2018-01-08 16:06 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-01-07 12:32 [Qemu-devel] [PATCH V6 0/5] hw/pvrdma: PVRDMA device implementation Marcel Apfelbaum
2018-01-07 12:32 ` [Qemu-devel] [PATCH V6 1/5] pci/shpc: Move function to generic header file Marcel Apfelbaum
2018-01-07 13:47   ` Philippe Mathieu-Daudé
2018-01-07 14:35     ` Marcel Apfelbaum
2018-01-07 12:32 ` [Qemu-devel] [PATCH V6 2/5] mem: add share parameter to memory-backend-ram Marcel Apfelbaum
2018-01-08 16:05   ` Cornelia Huck [this message]
2018-01-08 18:53     ` [Qemu-devel] Getting rid of phys_mem_set_alloc Marcel Apfelbaum
2018-01-07 12:32 ` [Qemu-devel] [PATCH V6 3/5] docs: add pvrdma device documentation Marcel Apfelbaum
2018-01-09  9:17   ` Cornelia Huck
2018-01-09 10:09     ` Marcel Apfelbaum
2018-01-07 12:32 ` [Qemu-devel] [PATCH V6 4/5] pvrdma: initial implementation Marcel Apfelbaum
2018-01-09 10:39   ` Cornelia Huck
2018-01-09 11:08     ` Yuval Shaia
2018-01-09 12:51       ` Cornelia Huck
2018-01-10  9:28         ` Marcel Apfelbaum
2018-01-10  9:37           ` Cornelia Huck
2018-01-10  9:06     ` Marcel Apfelbaum
2018-01-07 12:32 ` [Qemu-devel] [PATCH V6 5/5] MAINTAINERS: add entry for hw/rdma Marcel Apfelbaum

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=20180108170553.6312b178.cohuck@redhat.com \
    --to=cohuck@redhat.com \
    --cc=borntraeger@de.ibm.com \
    --cc=ehabkost@redhat.com \
    --cc=imammedo@redhat.com \
    --cc=marcel@redhat.com \
    --cc=mst@redhat.com \
    --cc=pbonzini@redhat.com \
    --cc=qemu-devel@nongnu.org \
    --cc=yuval.shaia@oracle.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.