All of lore.kernel.org
 help / color / mirror / Atom feed
From: Stefano Stabellini <sstabellini@kernel.org>
To: jgross@suse.com
Cc: xen-devel@lists.xenproject.org, boris.ostrovsky@oracle.com,
	sstabellini@kernel.org, 206497@studenti.unimore.it,
	marco.solieri@unimore.it
Subject: [Xen-devel] [BUG?] limit too low in privcmd-buf.c
Date: Mon, 22 Jul 2019 14:21:46 -0700 (PDT)	[thread overview]
Message-ID: <alpine.DEB.2.21.1907221341080.31177@sstabellini-ThinkPad-T480s> (raw)

Hi Juergen,

We are working on a technology to limit cache interference between
guests running on the same SoC. It works well, but as a consequence, all
memory allocations are 4K only: higher granularities (2M, 1G) do not
work at all.

One of the issues I am seeing after upgrading dom0 kernel is that the
limit in privcmd-buf.c, which is 64, is too low.  (Previously I was
using an old kernel without privcmd-buf.c.) The issue is that I cannot
start a guest of 128MB because mmap returns an error, specifically the
following check in privcmd_buf_mmap:privcmd_buf_mmap fails:

        if (!(vma->vm_flags & VM_SHARED) || count > limit ||
            file_priv->allocated + count > limit)
            return -EINVAL;

The check to fail is "file_priv->allocated + count > limit".

In my tests, limit needs to be roughly similar to the amount of MB of
guest RAM given to the guest. For example, we want a limit of 512 to be
able to start a guest with 512MB of RAM.

For the moment, I solved the problem simply by increasing the limit.
However, I don't know for sure what the right limit would be and whether
it is the right way to solve the problem.

Do you have any suggestions?

Cheers,

Stefano

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xenproject.org
https://lists.xenproject.org/mailman/listinfo/xen-devel

             reply	other threads:[~2019-07-22 21:22 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-07-22 21:21 Stefano Stabellini [this message]
2019-07-22 21:37 ` [Xen-devel] [BUG?] limit too low in privcmd-buf.c Andrew Cooper
2019-07-23  3:57   ` Juergen Gross

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=alpine.DEB.2.21.1907221341080.31177@sstabellini-ThinkPad-T480s \
    --to=sstabellini@kernel.org \
    --cc=206497@studenti.unimore.it \
    --cc=boris.ostrovsky@oracle.com \
    --cc=jgross@suse.com \
    --cc=marco.solieri@unimore.it \
    --cc=xen-devel@lists.xenproject.org \
    /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.