From: Samuel Thibault <samuel.thibault@eu.citrix.com>
To: Keir Fraser <keir.fraser@eu.citrix.com>
Cc: xen-devel@lists.xensource.com
Subject: Re: Re: [Xen-changelog] [xen-unstable] Clean up handling of IS_PRIV_FOR() and rcu_[un]lock_domain().
Date: Sat, 5 Apr 2008 18:25:39 +0200 [thread overview]
Message-ID: <20080405162538.GM4005@implementation> (raw)
In-Reply-To: <C413DCED.1587C%keir.fraser@eu.citrix.com>
Keir Fraser, le Sat 29 Mar 2008 11:47:57 +0000, a écrit :
> > DOMCTL_getdomaininfo is needed.
> > DOMCTL_max_mem is needed.
>
> These ones are a sticking point I'm afraid. DOMCTL_max_mem is a globally
> privileged operation because it can give increased access to the global
> memory resource. We can't let stub domains have at it. We'll have to keep
> max_mem permanently increased, and set that up in xend. With that done you
> probably don't really need getdomaininfo either.
Hum, actually that was already done, see python/xen/xend/Image.py:682
and that can indeed be seen in xm top...
The patch below drops the qemu reservation code, and things still work
as expected.
Samuel
ioemu: drop duplicate memory reservation
Signed-off-by: Samuel Thibault <samuel.thibault@eu.citrix.com>
diff -r 30c502e58777 tools/ioemu/vl.c
--- a/tools/ioemu/vl.c Sat Apr 05 15:01:14 2008 +0100
+++ b/tools/ioemu/vl.c Sat Apr 05 17:18:56 2008 +0100
@@ -7018,26 +7018,12 @@ int unset_mm_mapping(int xc_handle, uint
xen_pfn_t *extent_start)
{
int err = 0;
- xc_dominfo_t info;
-
- xc_domain_getinfo(xc_handle, domid, 1, &info);
- if ((info.nr_pages - nr_pages) <= 0) {
- fprintf(stderr, "unset_mm_mapping: error nr_pages\n");
- err = -1;
- }
err = xc_domain_memory_decrease_reservation(xc_handle, domid,
nr_pages, 0, extent_start);
if (err)
fprintf(stderr, "Failed to decrease physmap\n");
-
- if (xc_domain_setmaxmem(xc_handle, domid, (info.nr_pages - nr_pages) *
- PAGE_SIZE/1024) != 0) {
- fprintf(logfile, "set maxmem returned error %d\n", errno);
- err = -1;
- }
-
return err;
}
@@ -7045,16 +7031,7 @@ int set_mm_mapping(int xc_handle, uint32
unsigned long nr_pages, unsigned int address_bits,
xen_pfn_t *extent_start)
{
- xc_dominfo_t info;
int err = 0;
-
- xc_domain_getinfo(xc_handle, domid, 1, &info);
-
- if (xc_domain_setmaxmem(xc_handle, domid, info.max_memkb +
- nr_pages * PAGE_SIZE/1024) != 0) {
- fprintf(logfile, "set maxmem returned error %d\n", errno);
- return -1;
- }
err = xc_domain_memory_populate_physmap(xc_handle, domid, nr_pages, 0,
address_bits, extent_start);
next prev parent reply other threads:[~2008-04-05 16:25 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <200803290750.m2T7o8pP027589@xenbits.xensource.com>
2008-03-29 11:23 ` [Xen-changelog] [xen-unstable] Clean up handling of IS_PRIV_FOR() and rcu_[un]lock_domain() Samuel Thibault
2008-03-29 11:47 ` Keir Fraser
2008-03-29 11:58 ` Samuel Thibault
2008-04-05 14:28 ` Samuel Thibault
2008-04-05 16:31 ` Keir Fraser
2008-04-11 14:27 ` Samuel Thibault
2008-04-05 16:25 ` Samuel Thibault [this message]
2008-04-10 15:43 ` ioemu & settimeoffset [Was: Clean up handling of IS_PRIV_FOR() and rcu_[un]lock_domain()] Samuel Thibault
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=20080405162538.GM4005@implementation \
--to=samuel.thibault@eu.citrix.com \
--cc=keir.fraser@eu.citrix.com \
--cc=xen-devel@lists.xensource.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.