Re: [Xen-devel] [PATCH v2 00/22] Introduce HVM without dm and new boot ABI

2015-07-03 Thread Roger Pau Monné
El 03/07/15 a les 3.59, Yang Hongyang ha escrit:
> Hi Roger,
> 
>   This seems to be a PVH guest, but IIRC a PVH guest should explicitly
> specify 'pvh' in the config, maybe I'm wrong or did I miss some background?
> Are there any meterial about this?

Not yet. The interface exposed to the guest is very similar to PVH, but
instead of being a PV(H) guest from Xen's point of view, this is a HVM
guest with emulated devices disabled. Note also that the guest kernel
entry point is different from PVH, as is the startup of APs.

Instead of setting pvh=1 in the config file the following options are used:

builder="hvm"
device_model_version="none"

Roger.


___
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel


Re: [Xen-devel] Blktap 3.0.0 improvement

2015-07-03 Thread Akash Talole
I have attached the code of block-vhd.c.

On Wed, Jul 1, 2015 at 11:18 PM, Akash Talole  wrote:

> Hello,
> I want to know about Blktap asynchronous i/o read write operations on VHD.
> I want to know detail flow of program block-VHD.c . How the read write
> operations are performed on VHD .
> And any improvement in code would be done for better read write
> operations. Description about dynamic disk structure.
>
/* 
 * Copyright (C) Citrix Systems Inc.
 *
 * This program is free software; you can redistribute it and/or
 * modify it under the terms of the GNU General Public License
 * as published by the Free Software Foundation; version 2.1 only
 *
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 *
 * You should have received a copy of the GNU General Public License
 * along with this program; if not, write to the Free Software Foundation, Inc.,
 * 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
 */

/*
 * block-vhd.c: asynchronous vhd implementation.
 *
 * A note on write transactions:
 * Writes that require updating the BAT or bitmaps cannot be signaled
 * as complete until all updates have reached disk.  Transactions are
 * used to ensure proper ordering in these cases.  The two types of
 * transactions are as follows:
 *   - Bitmap updates only: data writes that require updates to the same
 * bitmap are grouped in a transaction.  Only after all data writes
 * in a transaction complete does the bitmap write commence.  Only
 * after the bitmap write finishes are the data writes signalled as
 * complete.
 *   - BAT and bitmap updates: data writes are grouped in transactions
 * as above, but a special extra write is included in the transaction,
 * which zeros out the newly allocated bitmap on disk.  When the data
 * writes and the zero-bitmap write complete, the BAT and bitmap writes
 * are started in parallel.  The transaction is completed only after both
 * the BAT and bitmap writes successfully return.
 */

#ifdef HAVE_CONFIG_H
#include "config.h"
#endif

#include 
#include 
#include 
#include 
#include 
#include 
#include 
#include  /* For whatever reason, Linux packages this in */
   /* e2fsprogs-devel.*/
#include /* for memset. */
#include 
#include 
#include 

#include "debug.h"
#include "libvhd.h"
#include "tapdisk.h"
#include "tapdisk-driver.h"
#include "tapdisk-interface.h"
#include "tapdisk-disktype.h"
#include "tapdisk-storage.h"

unsigned int SPB;

#define DEBUGGING   2
#define MICROSOFT_COMPAT

#define VHD_BATMAP_MAX_RETRIES 10

#define __TRACE(s)			\
	do {\
		DBG(TLOG_DBG, "%s: QUEUED: %" PRIu64 ", COMPLETED: %"	\
		PRIu64", RETURNED: %" PRIu64 ", DATA_ALLOCATED: "	\
		"%u, BBLK: 0x%04x\n",\
		s->vhd.file, s->queued, s->completed, s->returned,	\
		VHD_REQS_DATA - s->vreq_free_count,			\
		s->bat.pbw_blk);	\
	} while(0)

#if (DEBUGGING == 1)
  #define DBG(level, _f, _a...)  DPRINTF(_f, ##_a)
  #define ERR(_s, err, _f, _a...)DPRINTF("ERROR: %d: " _f, err, ##_a)
  #define TRACE(s)   ((void)0)
#elif (DEBUGGING == 2)
  #define DBG(level, _f, _a...)  tlog_write(level, _f, ##_a)
  #define ERR(_s, _err, _f, _a...)   tlog_drv_error((_s)->driver, _err, _f, ##_a)
  #define TRACE(s)   __TRACE(s)
#else
  #define DBG(level, _f, _a...)  ((void)0)
  #define ERR(_s, err, _f, _a...)((void)0)
  #define TRACE(s)   ((void)0)
#endif

/**VHD DEFINES**/
#define VHD_CACHE_SIZE   32

#define VHD_REQS_DATATAPDISK_DATA_REQUESTS
#define VHD_REQS_META(VHD_CACHE_SIZE + 2)
#define VHD_REQS_TOTAL   (VHD_REQS_DATA + VHD_REQS_META)

#define VHD_OP_BAT_WRITE 0
#define VHD_OP_DATA_READ 1
#define VHD_OP_DATA_WRITE2
#define VHD_OP_BITMAP_READ   3
#define VHD_OP_BITMAP_WRITE  4
#define VHD_OP_ZERO_BM_WRITE 5
#define VHD_OP_REDUNDANT_BM_WRITE6

#define VHD_BM_BAT_LOCKED0
#define VHD_BM_BAT_CLEAR 1
#define VHD_BM_BIT_CLEAR 2
#define VHD_BM_BIT_SET   3
#define VHD_BM_NOT_CACHED4
#define VHD_BM_READ_PENDING  5

#define VHD_FLAG_OPEN_RDONLY 1
#define VHD_FLAG_OPEN_NO_CACHE   2
#define VHD_FLAG_OPEN_QUIET  4
#define VHD_FLAG_OPEN_STRICT 8
#define VHD_FLAG_OPEN_QUERY  16
#define VHD_FLAG_OPEN_PREALLOCATE32
#define VHD_FLAG_OPEN_NO_O_DIRECT64
#define VHD_FLAG_OPEN_LOCAL_CACHE128

#define VHD_FLAG_BAT_LOCKED  1
#define VHD_FLAG_BAT_WRITE_STARTED   2

#define VHD_FLAG_BM_UPDATE_BAT   1
#define VHD_FLAG_BM_WRITE_PENDING2
#define VHD_FLAG_BM_READ_PENDING  

[Xen-devel] [linux-3.18 test] 59027: regressions - FAIL

2015-07-03 Thread osstest service owner
flight 59027 linux-3.18 real [real]
http://logs.test-lab.xenproject.org/osstest/logs/59027/

Regressions :-(

Tests which did not succeed and are blocking,
including tests which could not be run:
 test-amd64-amd64-xl-pvh-intel 11 guest-start  fail REGR. vs. 58581

Tests which are failing intermittently (not blocking):
 test-amd64-amd64-rumpuserxen-amd64 13 rumpuserxen-demo-xenstorels/xenstorels 
fail in 59015 pass in 59027
 test-armhf-armhf-libvirt  6 xen-bootfail pass in 59001
 test-amd64-i386-xl-qemut-debianhvm-amd64 9 debian-hvm-install fail pass in 
59015
 test-amd64-i386-xl-qemuu-ovmf-amd64 15 guest-localmigrate/x10 fail pass in 
59015

Regressions which are regarded as allowable (not blocking):
 test-amd64-i386-xl-qemut-stubdom-debianhvm-amd64-xsm 9 debian-hvm-install fail 
in 59015 baseline untested
 test-amd64-i386-libvirt-xsm  11 guest-start  fail   like 58558
 test-amd64-i386-libvirt  11 guest-start  fail   like 58581
 test-armhf-armhf-xl-multivcpu  6 xen-boot fail  like 58581
 test-armhf-armhf-xl-credit2   6 xen-boot fail   like 58581
 test-armhf-armhf-xl   6 xen-boot fail   like 58581
 test-armhf-armhf-libvirt-xsm  6 xen-boot fail   like 58581
 test-armhf-armhf-xl-xsm   6 xen-boot fail   like 58581
 test-amd64-i386-xl-qemuu-win7-amd64 16 guest-stop  fail like 58581
 test-amd64-amd64-xl-qemut-win7-amd64 16 guest-stop fail like 58581
 test-amd64-amd64-xl-qemuu-win7-amd64 16 guest-stop fail like 58581

Tests which did not succeed, but are not blocking:
 test-amd64-i386-libvirt-xsm  12 migrate-support-check fail in 59001 never pass
 test-armhf-armhf-libvirt 12 migrate-support-check fail in 59001 never pass
 test-amd64-amd64-xl-pvh-amd  11 guest-start  fail   never pass
 test-amd64-i386-freebsd10-amd64  9 freebsd-install fail never pass
 test-amd64-i386-freebsd10-i386  9 freebsd-install  fail never pass
 test-armhf-armhf-xl-cubietruck  6 xen-boot fail never pass
 test-amd64-amd64-libvirt-xsm 12 migrate-support-checkfail   never pass
 test-armhf-armhf-xl-rtds 11 guest-start  fail   never pass
 test-amd64-amd64-libvirt 12 migrate-support-checkfail   never pass
 test-amd64-i386-xl-qemut-win7-amd64 16 guest-stop  fail never pass
 test-armhf-armhf-xl-arndale  12 migrate-support-checkfail   never pass

version targeted for testing:
 linuxea5dd38e93b3bec3427e5d3eef000bbf5d637e76
baseline version:
 linuxd048c068d00da7d4cfa5ea7651933b99026958cf


People who touched revisions under test:
  "Eric W. Biederman" 
  Aaron Lu 
  Alexander Duyck 
  Alexei Starovoitov 
  Andrew de los Reyes 
  Andrew Morton 
  Andy Lutomirski 
  Anna Schumaker 
  Aravind Gopalakrishnan 
  Ard Biesheuvel 
  Arnd Bergmann 
  Baruch Siach 
  Ben Serebrin 
  Benjamin Tissoires 
  Bjørn Mork 
  Borislav Petkov 
  Chuck Lever 
  Cong Wang 
  Daniel Borkmann 
  Darren Hart 
  Darren Salt 
  David Daney 
  David S. Miller 
  David Woodhouse 
  Devesh Sharma 
  Doug Ledford 
  Eric Dumazet 
  Eric W. Biederman 
  Felipe Balbi 
  Feng Kan 
  Florent Fourcot 
  Florian Fainelli 
  Geert Uytterhoeven 
  Grant Likely 
  Greg Kroah-Hartman 
  Hannes Frederic Sowa 
  Henning Rogge 
  Honggang Li 
  Ian Campbell 
  Ilya Dryomov 
  Ingo Molnar 
  Jakub Sitnicki 
  Jason Gunthorpe 
  Jiada Wang 
  Jiri Kosina 
  Jiri Pirko 
  Joerg Roedel 
  Jovi Zhangwei 
  Ken Xue 
  Kevin Hilman 
  Konstantin Khlebnikov 
  Laura Abbott 
  Laurent Pinchart 
  Linus Lüssing 
  Linus Torvalds 
  Linus Walleij 
  Mark Brown 
  Mark Salyzyn 
  Matt Fleming 
  Matthew Garrett 
  Mauro Carvalho Chehab 
  Max Filippov 
  Meghana Cheripady 
  Mel Gorman 
  Mika Westerberg 
  Milan Plzik 
  Neal Cardwell 
  Neil Horman 
  Nicolas Dichtel 
  Nicolas Iooss 
  Nicolas Pitre 
  Nikolay Aleksandrov 
  Oliver Neukum 
  Oliver Neukum 
  oli...@neukum.org 
  Olof Johansson 
  Pablo Neira Ayuso 
  Paolo Bonzini 
  Pelle Nilsson 
  Peter Zijlstra (Intel) 
  Rafael J. Wysocki 
  Raphael Assenat 
  Richard Cochran 
  Rik Theys 
  Ross Lagerwall 
  Roy Franz 
  Russell King 
  Sasha Levin 
  Sean Young 
  Shawn Bohrer 
  Simon Horman 
  Sowmini Varadhan 
  Sriharsha Basavapatna 
  Steffen Klassert 
  Thadeu Lima de Souza Cascardo 
  Theodore Ts'o 
  Uwe Kleine-König 
  Veaceslav Falico 
  Veeresh U. Kokatnur 
  Vijay Subramanian 
  Vinod Koul 
  Vittorio Gambaletta 
  Vlad Yasevich 
  Vladislav Yasevich 
  WANG Cong 
  Wei Liu 
  Yao Xiwei 
  Yoshihiro Shimoda 
  Yuchung Cheng 


jobs:
 build-amd64-xsm  pass
 build-armhf-xsm  

Re: [Xen-devel] can't create a vNUMA enabled PV guest

2015-07-03 Thread Dario Faggioli
On Thu, 2015-07-02 at 16:25 -0400, Elena Ufimtseva wrote:
> On Wed, Jul 1, 2015 at 10:42 AM, Dario Faggioli

> > If I build a PV guest, it breaks:
> >
> > root@Zhaman:~# xl create -c /etc/xen/test.cfg
> > Parsing config from /etc/xen/test.cfg
> > xc: error: panic: xc_dom_x86.c:940: arch_setup_meminit: failed to allocate 
> > 0x2 pages (v=1, p=1)
> > : Internal error
> > xc: error: panic: xc_dom_boot.c:155: xc_dom_boot_mem_init: can't allocate 
> > low memory for domain: Out of memory
> > libxl: error: libxl_dom.c:731:libxl__build_pv: xc_dom_boot_mem_init failed: 
> > Device or resource busy
> > libxl: error: libxl_create.c:1174:domcreate_rebuild_done: cannot (re-)build 
> > domain: -3
> > libxl: error: libxl.c:1586:libxl__destroy_domid: non-existant domain 15
> > libxl: error: libxl.c:1544:domain_destroy_callback: unable to destroy guest 
> > with domid 15
> > libxl: error: libxl.c:1471:domain_destroy_cb: destruction of domain 15 
> > failed
> >
> > (XEN) d0v1 Over-allocation for domain 15: 262656 > 262400
> > (XEN) memory.c:155:d0v1 Could not allocate order=9 extent: id=15 
> > memflags=210 (0 of 512)
> > (XEN) d0v1 Over-allocation for domain 15: 262401 > 262400
> > (XEN) memory.c:155:d0v1 Could not allocate order=0 extent: id=15 
> > memflags=210 (256 of 131072)
> >
> >
> > As said, I'll be looking into it in the next days. If, in the meanwhile,
> > someone has any ideas, that would be much appreciated. :-)
> 
> Hi Dario!
> 
Hi! :-)

> The kernel you are running maybe missing vNUMA patch.
>
Mmm... Interesting. I was indeed assuming that everything was upstream
already!

That being said, if it were a DomU kernel issue, I expected the kernel
itself to complain, rather than libxl and Xen. In fact, from the logs
above, I think this is all happening during domain creation, when the
kernel does not yet have a say in it.

As I said, I'll try to have a look, but I'm not sure if I'll be able to
by today...

> Konrad asked me if the patch was upstream. well, It is not, I think I
> abandoned it :).
> I will address latest comments and other changes in the v6 review and post it.
> 
Yeah, well, if we really are still missing it, the sooner we get it in,
the better! :-)

Thanks and Regards,
Dario
-- 
<> (Raistlin Majere)
-
Dario Faggioli, Ph.D, http://about.me/dario.faggioli
Senior Software Engineer, Citrix Systems R&D Ltd., Cambridge (UK)


signature.asc
Description: This is a digitally signed message part
___
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel


[Xen-devel] [PATCH] xen-netback: remove duplicated function definition

2015-07-03 Thread Liang Li
There are two duplicated xenvif_zerocopy_callback() definitions.
Remove one of them.

Signed-off-by: Liang Li 
---
 drivers/net/xen-netback/common.h | 3 ---
 1 file changed, 3 deletions(-)

diff --git a/drivers/net/xen-netback/common.h b/drivers/net/xen-netback/common.h
index 8a495b3..c6cb85a 100644
--- a/drivers/net/xen-netback/common.h
+++ b/drivers/net/xen-netback/common.h
@@ -325,9 +325,6 @@ static inline pending_ring_idx_t nr_pending_reqs(struct 
xenvif_queue *queue)
queue->pending_prod + queue->pending_cons;
 }
 
-/* Callback from stack when TX packet can be released */
-void xenvif_zerocopy_callback(struct ubuf_info *ubuf, bool zerocopy_success);
-
 irqreturn_t xenvif_interrupt(int irq, void *dev_id);
 
 extern bool separate_tx_rx_irq;
-- 
1.9.1


___
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel


Re: [Xen-devel] [PATCH 4/4] xen: sched: get rid of cpupool_scheduler_cpumask()

2015-07-03 Thread Dario Faggioli
On Thu, 2015-07-02 at 16:39 +0100, George Dunlap wrote:
> On Thu, Jun 25, 2015 at 1:15 PM, Dario Faggioli

> > diff --git a/xen/common/sched_credit.c b/xen/common/sched_credit.c
> > index a1945ac..8c36635 100644
> > --- a/xen/common/sched_credit.c
> > +++ b/xen/common/sched_credit.c

> > @@ -374,7 +374,7 @@ __runq_tickle(unsigned int cpu, struct csched_vcpu *new)
> >
> >  /* cpu is vc->processor, so it must be in a cpupool. */
> >  ASSERT(per_cpu(cpupool, cpu) != NULL);
> > -online = cpupool_online_cpumask(per_cpu(cpupool, cpu));
> > +online = cpupool_domain_cpumask(new->sdom->dom);
> 
> Two comments in passing here (no action required):
> 
> 1. Looks like passing both cpu and svc to this function is a bit
> redundant, as the function can just look up new->vcpu->processor
> itself
> 
Indeed! It's not only redundant, it's disturbing, IMO. In fact, ever
time I look at it, I wander what cpu is, because, if it just was
->processor, it wouldn't be necessary for it to be a parameter... then I
smack my head and remember that, yes, it's _that_ function!

So, yes, I'm all for killing it!

> 2. After this patch, the ASSERT there will be redundant, as there's
> already an identical assert in cpupool_domain_cpumask()
> 
> Those won't hurt, but if you end up respinning you might think about
> at least taking the ASSERT out.
> 
Right, I'll take it out.

> > diff --git a/xen/common/schedule.c b/xen/common/schedule.c
> > index 4ffcd98..7ad298a 100644
> > --- a/xen/common/schedule.c
> > +++ b/xen/common/schedule.c
> > @@ -80,7 +80,7 @@ static struct scheduler __read_mostly ops;
> >
> >  #define DOM2OP(_d)(((_d)->cpupool == NULL) ? &ops : 
> > ((_d)->cpupool->sched))
> >  #define VCPU2OP(_v)   (DOM2OP((_v)->domain))
> > -#define VCPU2ONLINE(_v) cpupool_online_cpumask((_v)->domain->cpupool)
> > +#define VCPU2ONLINE(_v) cpupool_domain_cpumask((_v)->domain)
> >
> >  static inline void trace_runstate_change(struct vcpu *v, int new_state)
> >  {
> > diff --git a/xen/include/xen/sched-if.h b/xen/include/xen/sched-if.h
> > index 7cc25c6..20af791 100644
> > --- a/xen/include/xen/sched-if.h
> > +++ b/xen/include/xen/sched-if.h
> > @@ -183,9 +183,17 @@ struct cpupool
> >  atomic_t refcnt;
> >  };
> >
> > -#define cpupool_scheduler_cpumask(_pool) \
> > -(((_pool) == NULL) ? &cpupool_free_cpus : (_pool)->cpu_valid)
> >  #define cpupool_online_cpumask(_pool) \
> >  (((_pool) == NULL) ? &cpu_online_map : (_pool)->cpu_valid)
> >
> > +static inline cpumask_t* cpupool_domain_cpumask(struct domain *d)
> > +{
> > +/*
> > + * d->cpupool == NULL only for the idle domain, which should
> > + * have no interest in calling into this.
> > + */
> > +ASSERT(d->cpupool != NULL);
> > +return cpupool_online_cpumask(d->cpupool);
> > +}
> 
> It's a bit strange to assert that d->cpupool != NULL, and then call a
> macro whose return value only depends on whether d->cpupool is NULL or
> not.  Why not just return d->cpupool->cpu_valid?
> 
Yes, you're right. I think this is because my original intent was to
replace cpupool_scheduler_cpumask() with *something* built on top of
cpupool_online_cpumask(), and I retained this design, even when it
became something that could just be 'return d->cpupool->cpu_valid'! :-)

I'll change this.

> Thanks for tracking these down, BTW!
> 
It was a bit of a nightmare, actually, to (1) figure out what was going
on, and (2) come up with a satisfying fix... But, yes, it was well
worth. :-)

Thanks and Regards,
Dario
-- 
<> (Raistlin Majere)
-
Dario Faggioli, Ph.D, http://about.me/dario.faggioli
Senior Software Engineer, Citrix Systems R&D Ltd., Cambridge (UK)


signature.asc
Description: This is a digitally signed message part
___
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel


Re: [Xen-devel] osstest "short fast" tests of xen-unstable proposal

2015-07-03 Thread Dario Faggioli
On Thu, 2015-07-02 at 18:17 +0100, George Dunlap wrote:
> On Tue, Jun 30, 2015 at 6:46 PM, Ian Jackson  
> wrote:

> > Invent a new `xen-unstable-smoke' flight (in osstest terminology, a
> > `branch').
> >
> > This would be a push gate for xen.git.  Its input would be
> > xen.git#staging.  Its output would be a new branch, xen.git#smoked.
> > The existing `xen-unstable' flights would take xen.git#smoked as
> > input.  So there would be a two-stage push gate,
> >
> >  staging -[xen-unstable-smoke test]-> smoked -[xen-unstable test]-> master
> >
> > This would apply to xen-unstable only, not to stable braches, nor to
> > any other codebase (eg, qemu or Linux).  It would aim to run every 2h.
> >
> > Arrangements would be made to reuse the outputs of most recent builds
> > of qemuu and the currently favoured Linux branch.[5]
> >
> > If any test failed, the flight would be automatically aborted and
> > report immediately [6].  Unlike most flights, tests would not be
> > `sticky' to failing hosts, nor (when succeding) prefer hosts which
> > they hadn't run on for a while [6], so they would take the first
> > available machine.
> 
> This sounds good to me.
> 
+1

This would all be really, really useful!

Dario
-- 
<> (Raistlin Majere)
-
Dario Faggioli, Ph.D, http://about.me/dario.faggioli
Senior Software Engineer, Citrix Systems R&D Ltd., Cambridge (UK)


signature.asc
Description: This is a digitally signed message part
___
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel


Re: [Xen-devel] [PATCH 3/6] x86/xsaves: enable xsaves/xrstors for hvm guest

2015-07-03 Thread Chao Peng
On Thu, Jul 02, 2015 at 10:02:28PM +0800, Shuai Ruan wrote:
> This patch enables xsaves for hvm guest, includes:
> 1.handle xsaves vmcs init and vmexit.
> 2.add logic to write/read the XSS msr.
> 
> Signed-off-by: Shuai Ruan 
> ---
>  xen/arch/x86/hvm/hvm.c | 40 
> ++
>  xen/arch/x86/hvm/vmx/vmcs.c|  7 ++-
>  xen/arch/x86/hvm/vmx/vmx.c | 18 +
>  xen/arch/x86/xstate.c  |  4 ++--
>  xen/include/asm-x86/hvm/vmx/vmcs.h |  5 +
>  xen/include/asm-x86/hvm/vmx/vmx.h  |  2 ++
>  xen/include/asm-x86/xstate.h   |  1 +
>  7 files changed, 74 insertions(+), 3 deletions(-)
> 
> diff --git a/xen/arch/x86/hvm/hvm.c b/xen/arch/x86/hvm/hvm.c
> index 535d622..2958e0d 100644
> --- a/xen/arch/x86/hvm/hvm.c
> +++ b/xen/arch/x86/hvm/hvm.c
> @@ -4269,6 +4269,10 @@ void hvm_hypervisor_cpuid_leaf(uint32_t sub_idx,
>  }
>  }
>  
> +#define XSAVEOPT (1 << 0)
> +#define XSAVEC   (1 << 1)
> +#define XGETBV   (1 << 2)
> +#define XSAVES   (1 << 3)

Hard tab is used.

>  void hvm_cpuid(unsigned int input, unsigned int *eax, unsigned int *ebx,
> unsigned int *ecx, unsigned int *edx)
>  {
> @@ -4355,6 +4359,34 @@ void hvm_cpuid(unsigned int input, unsigned int *eax, 
> unsigned int *ebx,
>  *ebx = _eax + _ebx;
>  }
>  }
> +if ( count == 1 )
> +{
> +if ( cpu_has_xsaves )
> +{
> +*ebx = XSTATE_AREA_MIN_SIZE;
> +if ( v->arch.xcr0 | v->arch.msr_ia32_xss )
> +for ( sub_leaf = 2; sub_leaf < 63; sub_leaf++ )
> +{
> +if ( !((v->arch.xcr0 | v->arch.msr_ia32_xss)
> +& (1ULL << sub_leaf)) )

alignment.

> +continue;
> +domain_cpuid(d, input, sub_leaf, &_eax, &_ebx, &_ecx,
> + &_edx);
> +*ebx =  *ebx + _eax;
> +}
> +}
> +else
> +{
> +*eax &= ~XSAVES;
> +if ( !cpu_has_xgetbv1 )
> +*eax &= ~XGETBV;
> +if ( !cpu_has_xsavec )
> +*eax &= ~XSAVEC;
> +if ( !cpu_has_xsaveopt )
> +*eax &= ~XSAVEOPT;

I think these features(XGETBV/XSAVEC/XSAVEOPT) should be independent
of XSAVES, e.g. here they should not be enclosed with 'else' statement.

Chao

___
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel


Re: [Xen-devel] Xen + futexes

2015-07-03 Thread Dario Faggioli
On Thu, 2015-07-02 at 12:48 +0200, Dario Faggioli wrote:

> [0] http://www.akkadia.org/drepper/futex.pdf
>
And, BTW, this is an (old, but) nice reading as well, about futees:

https://www.kernel.org/doc/ols/2002/ols2002-pages-479-495.pdf

Dario
-- 
<> (Raistlin Majere)
-
Dario Faggioli, Ph.D, http://about.me/dario.faggioli
Senior Software Engineer, Citrix Systems R&D Ltd., Cambridge (UK)


signature.asc
Description: This is a digitally signed message part
___
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel


Re: [Xen-devel] Blktap 3.0.0 improvement

2015-07-03 Thread Ian Campbell
I'm afraid that blktap 3 is not part of Xen and therefore you won't find
many people who can answer questions, at least not on this list.

More generally, questions posed in this way, even on maintained areas of
code, do not often result in much attention, take a look at
http://wiki.xen.org/wiki/Asking_Xen_Devel_Questions for some advise in
this area.

Ian.

On Fri, 2015-07-03 at 12:44 +0530, Akash Talole wrote:
> I have attached the code of block-vhd.c.
> 
> On Wed, Jul 1, 2015 at 11:18 PM, Akash Talole 
> wrote:
> Hello,
> I want to know about Blktap asynchronous i/o read write
> operations on VHD. I want to know detail flow of program
> block-VHD.c . How the read write operations are performed on
> VHD .
> And any improvement in code would be done for better read
> write operations. Description about dynamic disk structure.
> 
> 
> 
> ___
> Xen-devel mailing list
> Xen-devel@lists.xen.org
> http://lists.xen.org/xen-devel



___
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel


[Xen-devel] [ovmf test] 59028: regressions - FAIL

2015-07-03 Thread osstest service owner
flight 59028 ovmf real [real]
http://logs.test-lab.xenproject.org/osstest/logs/59028/

Regressions :-(

Tests which did not succeed and are blocking,
including tests which could not be run:
 test-amd64-i386-qemuu-rhel6hvm-amd 14 leak-check/checkfail REGR. vs. 59016
 test-amd64-i386-xl-qemuu-win7-amd64  9 windows-installfail REGR. vs. 59016

Regressions which are regarded as allowable (not blocking):
 test-amd64-amd64-xl-qemuu-win7-amd64 16 guest-stop fail like 59016

version targeted for testing:
 ovmf 371dc63dcffd018d762a8f7794a5652987372f81
baseline version:
 ovmf 3735017c6eb43381f0d9bd572bce141780d33c79


People who touched revisions under test:
  Ard Biesheuvel 
  Hess Chen 
  Jordan Justen 
  Laszlo Ersek 
  Liming Gao 
  Qiu Shumin 
  Star Zeng 
  Yingke Liu 


jobs:
 build-amd64-xsm  pass
 build-i386-xsm   pass
 build-amd64  pass
 build-i386   pass
 build-amd64-libvirt  pass
 build-i386-libvirt   pass
 build-amd64-pvopspass
 build-i386-pvops pass
 test-amd64-amd64-xl-qemuu-debianhvm-amd64-xsmpass
 test-amd64-i386-xl-qemuu-debianhvm-amd64-xsm pass
 test-amd64-i386-qemuu-rhel6hvm-amd   fail
 test-amd64-amd64-xl-qemuu-debianhvm-amd64pass
 test-amd64-i386-xl-qemuu-debianhvm-amd64 pass
 test-amd64-amd64-xl-qemuu-ovmf-amd64 pass
 test-amd64-i386-xl-qemuu-ovmf-amd64  pass
 test-amd64-amd64-xl-qemuu-win7-amd64 fail
 test-amd64-i386-xl-qemuu-win7-amd64  fail
 test-amd64-i386-qemuu-rhel6hvm-intel pass
 test-amd64-i386-xl-qemuu-winxpsp3-vcpus1 pass
 test-amd64-amd64-xl-qemuu-winxpsp3   pass
 test-amd64-i386-xl-qemuu-winxpsp3pass



sg-report-flight on osstest.test-lab.xenproject.org
logs: /home/logs/logs
images: /home/logs/images

Logs, config files, etc. are available at
http://logs.test-lab.xenproject.org/osstest/logs

Test harness code can be found at
http://xenbits.xen.org/gitweb?p=osstest.git;a=summary


Not pushing.

(No revision log; it would be 457 lines long.)

___
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel


Re: [Xen-devel] [RFC PATCH v3 09/18] xen/arm: ITS: Add virtual ITS commands support

2015-07-03 Thread Ian Campbell
On Fri, 2015-07-03 at 12:20 +0530, Vijay Kilari wrote:
> On Mon, Jun 29, 2015 at 5:53 PM, Ian Campbell  wrote:
> > On Mon, 2015-06-22 at 17:31 +0530, vijay.kil...@gmail.com wrote:
> >> +static int vgic_its_process_mapvi(struct vcpu *v, struct vgic_its *vits,
> >> +  its_cmd_block *virt_cmd)
> >> +{
> >> +struct vitt entry;
> >> +struct vits_device *vdev;
> >> +uint8_t vcol_id, cmd;
> >> +uint32_t vid, dev_id, event;
> >> +
> >> +vcol_id = virt_cmd->mapvi.col;
> >> +vid = virt_cmd->mapvi.phy_id;
> >> +dev_id = its_decode_devid(v->domain, virt_cmd);
> >
> > If you used the "union its_cmd" I proposed earlier for the virt_cmd
> > argument then this would just be "virt_command->mapvi.devid".
> 
> its_decode_devid() is used to get physical devid for a given
> virtual device id. I have to use virt_command->mapvi.devid.
> 
> If vitt entries are made base on physical dev id then
> 
>   - This helps where in if interrupt is received we can extract
> physical dev id from
> the its_device structure held by irq_desc. With this physical device id we can
> search vitt entry to get collection/vcpu and vlpi information.

http://xenbits.xen.org/people/ianc/vits/draftG.html#virtual-lpi-injection shows 
that there is no need for the physical device id when handling an pLPI and 
turning it into a vPLI injection.

In the pLPI case the vlpi comes out of the irq_desc and
vgic_vcpu_inject_lpi only requires a vpli, not physical, which it then
uses as indexes into the per-domain irq_pending
(http://xenbits.xen.org/people/ianc/vits/draftG.html#per-domain-struct-pending_irq-for-vlpis)

See also
http://xenbits.xen.org/people/ianc/vits/draftG.html#mapvi-map-an-input-identifier-to-a-physical-interrupt-and-an-interrupt-collection.
which describes how a MAPVI from the guest needs to be handled.

>   However fake devices cannot have physical device id. We cannot search vitt
> entries. Esp INT command has only virtual dev id. So I think this
> approach is not
> viable.

As shown above vgic_vcpu_inject_lpi only takes a vpli param, so the fact
there that there is no physical device id for an INT command on a fake
command doesn't matter.

> I propose:
>  Manage vitt entries based on virtual dev id and manage domain specific
> RB-tree (which holds list of devices assigned to domain) with physical devid.
> 
> Now on receiving interrupt, will search for RB-tree based on physical dev id 
> and
> get virtual dev id. With virtual dev id search vitt entries to get
> vcpu/collection & vlpi
> info.

The design document should shows there is no need for this.

You are very welcome to propose an alternative design, but I'm afraid
that in that case I'm going to have to ask you to produce a
comprehensive document covering all aspects of your proposed design,
either from scratch or by modifying the existing draft to account for
the consequences of your proposed changes across the board, i.e. it
needs remain a coherent design across the board after your changes.

The fact that you are proposing an RB-tree looked during interrupt
however is a problematic aspect of your proposal, in the existing design
has been arranged such that this is not necessary.

> Also for fake devices, we search vitt entries with vdevice id for INT command.
> 
> Any suggestions?
> 
> Regards
> Vijay



___
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel


[Xen-devel] Help

2015-07-03 Thread Akash Talole
Hello,
  I want to know about Blktap asynchronous i/o read write operations on
VHD. I want to know detail flow of program  block-VHD.c . How the read
write operations are performed on VHD . And any improvement in code would
be done for better read   write operations. Description about dynamic disk
structure. I wand modify code of fast clone copy for copy on read.
Currently data is copy into vhd  after write.
So tell me about how step by step which functions are calling from
block-vhd so fast copy is done.

I have attached the code of block-vhd.c.


Thanks,
Akash Talole
/* 
 * Copyright (C) Citrix Systems Inc.
 *
 * This program is free software; you can redistribute it and/or
 * modify it under the terms of the GNU General Public License
 * as published by the Free Software Foundation; version 2.1 only
 *
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 *
 * You should have received a copy of the GNU General Public License
 * along with this program; if not, write to the Free Software Foundation, Inc.,
 * 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
 */

/*
 * block-vhd.c: asynchronous vhd implementation.
 *
 * A note on write transactions:
 * Writes that require updating the BAT or bitmaps cannot be signaled
 * as complete until all updates have reached disk.  Transactions are
 * used to ensure proper ordering in these cases.  The two types of
 * transactions are as follows:
 *   - Bitmap updates only: data writes that require updates to the same
 * bitmap are grouped in a transaction.  Only after all data writes
 * in a transaction complete does the bitmap write commence.  Only
 * after the bitmap write finishes are the data writes signalled as
 * complete.
 *   - BAT and bitmap updates: data writes are grouped in transactions
 * as above, but a special extra write is included in the transaction,
 * which zeros out the newly allocated bitmap on disk.  When the data
 * writes and the zero-bitmap write complete, the BAT and bitmap writes
 * are started in parallel.  The transaction is completed only after both
 * the BAT and bitmap writes successfully return.
 */

#ifdef HAVE_CONFIG_H
#include "config.h"
#endif

#include 
#include 
#include 
#include 
#include 
#include 
#include 
#include  /* For whatever reason, Linux packages this in */
   /* e2fsprogs-devel.*/
#include /* for memset. */
#include 
#include 
#include 

#include "debug.h"
#include "libvhd.h"
#include "tapdisk.h"
#include "tapdisk-driver.h"
#include "tapdisk-interface.h"
#include "tapdisk-disktype.h"
#include "tapdisk-storage.h"

unsigned int SPB;

#define DEBUGGING   2
#define MICROSOFT_COMPAT

#define VHD_BATMAP_MAX_RETRIES 10

#define __TRACE(s)			\
	do {\
		DBG(TLOG_DBG, "%s: QUEUED: %" PRIu64 ", COMPLETED: %"	\
		PRIu64", RETURNED: %" PRIu64 ", DATA_ALLOCATED: "	\
		"%u, BBLK: 0x%04x\n",\
		s->vhd.file, s->queued, s->completed, s->returned,	\
		VHD_REQS_DATA - s->vreq_free_count,			\
		s->bat.pbw_blk);	\
	} while(0)

#if (DEBUGGING == 1)
  #define DBG(level, _f, _a...)  DPRINTF(_f, ##_a)
  #define ERR(_s, err, _f, _a...)DPRINTF("ERROR: %d: " _f, err, ##_a)
  #define TRACE(s)   ((void)0)
#elif (DEBUGGING == 2)
  #define DBG(level, _f, _a...)  tlog_write(level, _f, ##_a)
  #define ERR(_s, _err, _f, _a...)   tlog_drv_error((_s)->driver, _err, _f, ##_a)
  #define TRACE(s)   __TRACE(s)
#else
  #define DBG(level, _f, _a...)  ((void)0)
  #define ERR(_s, err, _f, _a...)((void)0)
  #define TRACE(s)   ((void)0)
#endif

/**VHD DEFINES**/
#define VHD_CACHE_SIZE   32

#define VHD_REQS_DATATAPDISK_DATA_REQUESTS
#define VHD_REQS_META(VHD_CACHE_SIZE + 2)
#define VHD_REQS_TOTAL   (VHD_REQS_DATA + VHD_REQS_META)

#define VHD_OP_BAT_WRITE 0
#define VHD_OP_DATA_READ 1
#define VHD_OP_DATA_WRITE2
#define VHD_OP_BITMAP_READ   3
#define VHD_OP_BITMAP_WRITE  4
#define VHD_OP_ZERO_BM_WRITE 5
#define VHD_OP_REDUNDANT_BM_WRITE6

#define VHD_BM_BAT_LOCKED0
#define VHD_BM_BAT_CLEAR 1
#define VHD_BM_BIT_CLEAR 2
#define VHD_BM_BIT_SET   3
#define VHD_BM_NOT_CACHED4
#define VHD_BM_READ_PENDING  5

#define VHD_FLAG_OPEN_RDONLY 1
#define VHD_FLAG_OPEN_NO_CACHE   2
#define VHD_FLAG_OPEN_QUIET  4
#define VHD_FLAG_OPEN_STRICT 8
#define VHD_FLAG_OPEN_QUERY  16
#define VHD_FLAG_OPEN_PREALLOCATE32
#define VHD_FLAG_OPEN_NO_O_DIRECT64
#define VHD_FLAG_OPEN_LOCAL_CACHE128

#define VHD_FLAG_BAT_LOCKED

Re: [Xen-devel] [rumpuserxen test] People who touched revisions under test: Antti Kantee Ian Jackson Martin Lucina Wei Liu

2015-07-03 Thread Ian Campbell
On Fri, 2015-07-03 at 06:50 +, osstest service owner wrote:
> flight 59037 rumpuserxen real [real]
> http://logs.test-lab.xenproject.org/osstest/logs/59037/

Ian, looks like some body text has ended up in the header section of the
mail. 

Perhaps something like this is needed? (maybe with more "\n" pasting)

diff --git a/sg-report-flight b/sg-report-flight
index 829e0c3..8cd56fb 100755
--- a/sg-report-flight
+++ b/sg-report-flight
@@ -564,10 +564,9 @@ sub printout {
 $header_text .= <{Flight}: $r->{OutcomeSummary}
 END
-foreach my $include (@includebeginfiles) {
-STDOUT->flush();
-system_checked('cat','--',$include);
-}
+bodyprint(get_filecontents_core_quiet($_))
+foreach @includebeginfiles;
+
 bodyprint <{Flight} $branch $r->{FlightInfo}{blessing} 
[$r->{FlightInfo}{intended}]
 $c{ReportHtmlPubBaseUrl}/$r->{Flight}/



___
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel


Re: [Xen-devel] [OSSTEST PATCH 1/4] guest_find_domid: Set Vcpus correctly.

2015-07-03 Thread Ian Campbell
On Thu, 2015-07-02 at 18:11 +0100, Ian Jackson wrote:
> The regexp was wrong, resulting in the last digit of the memory being
> mistaken for the number of vcpus (!)
> 
> The only consumer of this is ts-logs-capture.
> 
> Signed-off-by: Ian Jackson 

Acked-by: Ian Campbell 

Perhaps at some point in the future once xm is off the test radar we
could consider using xl list --format=json (nb, I didn't check the
concrete syntax) and using that.

> ---
>  Osstest/TestSupport.pm |2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/Osstest/TestSupport.pm b/Osstest/TestSupport.pm
> index b5994a4..66dc218 100644
> --- a/Osstest/TestSupport.pm
> +++ b/Osstest/TestSupport.pm
> @@ -1918,7 +1918,7 @@ sub guest_find_domid ($$) {
>  return if defined $gho->{Domid};
>  my $list= target_cmd_output_root($ho,
>  common_toolstack($ho)." list $gho->{Name}");
> -$list =~ m/^(?!Name\s)(\S+)\s+(\d+)\s+(\d+)+(\d+)\s.*$/m
> +$list =~ m/^(?!Name\s)(\S+)\s+(\d+)\s+(\d+)\s+(\d+)\s.*$/m
>  or die "domain list: $list";
>  $1 eq $gho->{Name} or die "domain list name $1 expected $gho->{Name}";
>  $gho->{MemUsed}= $3;



___
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel


Re: [Xen-devel] [OSSTEST PATCH 2/4] ts-logs-capture: Find xenctx in /usr/local as well

2015-07-03 Thread Ian Campbell
On Thu, 2015-07-02 at 18:11 +0100, Ian Jackson wrote:
> xenctx is now in /usr/local/lib/xen/bin/xenctx.
>  ^^
> Find it by setting PATH in the shell command.
> 
> Signed-off-by: Ian Jackson 

Acked-by: Ian Campbell 



___
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel


Re: [Xen-devel] [OSSTEST PATCH 3/4] ts-logs-capture: Break out guest listing and do it earlier

2015-07-03 Thread Ian Campbell
On Thu, 2015-07-02 at 18:11 +0100, Ian Jackson wrote:
> Break out the function find_guests from what was
> fetch_logs_host_guests, and have it save its results in the @guests
> global.
> 
> We do this soon because in the next patch we are going to want to
> do something to each guest before we call serial_fetch_logs.
> 
> The loop containing fetch_logs_guest is now in the main program.
> 
> Signed-off-by: Ian Jackson 

Acked-by: Ian Campbell 



___
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel


Re: [Xen-devel] [OSSTEST PATCH 4/4] ts-logs-capture: Run xenctx earlier

2015-07-03 Thread Ian Campbell
On Thu, 2015-07-02 at 18:11 +0100, Ian Jackson wrote:
> Break fetch_xenctx_guest out into its own function, and run it before
> serial_fetch_logs.
> 
> This is relevant because serial_fetch_logs sends the Xen debug keys,
> which might dislodge a stuck guest - and, if it does, we would like to
> have captured the stuck state with xenctx, rather than the unstuck
> one.
> 
> Signed-off-by: Ian Jackson 

Acked-by: Ian Campbell 

At first I wondered if before and after might be useful, but I don't
think the unstuck state would be useful. However two (or more)
back-to-back ctxt's can often be useful, by giving a snapshot of the
loop the guest is stuck.

Ian.


___
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel


[Xen-devel] [PATCH OSSTEST v1] ap-fetch-version: Arrange for osstest merges from upstream to be stable

2015-07-03 Thread Ian Campbell
If a downstream osstest instance has nothing to test it its local
pretest then it will attempt to merge from the upstream instance. If
this fails then it will try again and again generating a new merge
commit each time, even if upstream has not moved.

It is desirable that these merges instead be stable i.e. the same if
the inputs have not changed. This is good for potential bisection
attempts, history reporting/mining as well as just being sensible.

Here we arrange for this by recording the last merge "epoch" (being
the first merge of the current input branches) in a new branch
"merge-epoch" in the local testing.git and comparing our fresh merge
against it.

If the tree and parents are the same then the merge is effectively
identical (it may/will differ in the date) and we reuse the epoch
merge.

If they new merge does not match then something has changed (i.e.
upstream has moved on) and so we take the new merge and establish a
new epoch.

Signed-off-by: Ian Campbell 
---

I think this change might be best off applied initially to the
Cambridge instance pretest and once it passes testing there to be
folded into upstream via a PR.
---
 ap-fetch-version | 30 ++
 1 file changed, 30 insertions(+)

diff --git a/ap-fetch-version b/ap-fetch-version
index ec52889..d8d4f97 100755
--- a/ap-fetch-version
+++ b/ap-fetch-version
@@ -134,6 +134,36 @@ osstest)
git merge \
-m "Automerge of $TREEBRANCH_OSSTEST_UPSTREAM into 
production" \
ap-merge >&2
+   merge=$(git log -n1 --pretty='%T %P' HEAD)
+
+   if git fetch $HOME/testing.git +merge-epoch:merge-epoch ; 
then
+   # If the new merge matches the current epoch's
+   # tree (%T) and parents (%P) then it is the
+   # same in all the ways which matter. (It
+   # likely only differs in the date). In which
+   # case reuse the epoch merge so that repeated
+   # flights and potential bisections over
+   # osstest see something stable.
+   #
+   # If e.g the parents have changed
+   # (e.g. upstream has progressed) or the trees
+   # differ then use the new merge and establish
+   # a new merge-epoch.
+   epoch=$(git log -n1 --pretty='%T %P' merge-epoch)
+   else
+   echo >&2 "Failed to fetch merge-epoch"
+   epoch="NONE"
+   fi
+   
+   echo >&2 "Merge Epoch: $epoch"
+   echo >&2 "This Merge:  $merge"
+   if [ x"$epoch" = x"$merge" ] ; then
+   echo >&2 "Reusing existing merge-epoch"
+   git reset --hard merge-epoch
+   else
+   echo >&2 "New merge-epoch"
+   git push $HOME/testing.git +production:merge-epoch
+   fi
)
 
# Fetch the result of the above merge into local tree
-- 
2.1.4


___
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel


Re: [Xen-devel] [PATCH mini-os] Correct printf formatting for tpm_tis message.

2015-07-03 Thread Ian Campbell
On Thu, 2015-07-02 at 02:21 +0200, Samuel Thibault wrote:
> Ian Campbell, le Fri 26 Jun 2015 11:58:40 +0100, a écrit :
> > This is under #ifdef HAVE_LIBC so went unnoticed before.
> > 
> > Signed-off-by: Ian Campbell 
> 
> Acked-by: Samuel Thibault 

Applied, thanks.



___
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel


[Xen-devel] [linux-4.1 baseline test] "Old" tested version had not actually been tested; therefore in this

2015-07-03 Thread osstest service owner
flight we test it, rather than a new candidate.  The baseline, if
any, is the most recent actually tested revision.

59031: tolerable trouble: blocked/broken/fail/pass
X-Osstest-Failures:
linux-4.1:test-armhf-armhf-xl-credit2:build-check(1):blocked:nonblocking
linux-4.1:test-armhf-armhf-xl-cubietruck:build-check(1):blocked:nonblocking
linux-4.1:test-armhf-armhf-xl-rtds:build-check(1):blocked:nonblocking
linux-4.1:test-armhf-armhf-xl-multivcpu:build-check(1):blocked:nonblocking
linux-4.1:test-armhf-armhf-libvirt:build-check(1):blocked:nonblocking
linux-4.1:test-armhf-armhf-xl-arndale:build-check(1):blocked:nonblocking
linux-4.1:test-armhf-armhf-libvirt-xsm:build-check(1):blocked:nonblocking
linux-4.1:test-armhf-armhf-xl:build-check(1):blocked:nonblocking
linux-4.1:build-armhf-libvirt:build-check(1):blocked:nonblocking
linux-4.1:test-amd64-i386-freebsd10-amd64:freebsd-install:fail:nonblocking
linux-4.1:test-amd64-i386-freebsd10-i386:freebsd-install:fail:nonblocking
linux-4.1:test-amd64-i386-libvirt-xsm:guest-start:fail:nonblocking
linux-4.1:test-amd64-amd64-xl-pvh-intel:guest-saverestore:fail:nonblocking
linux-4.1:test-amd64-amd64-xl-pvh-amd:guest-start:fail:nonblocking
linux-4.1:build-armhf:host-build-prep:fail:nonblocking
linux-4.1:test-amd64-i386-libvirt:migrate-support-check:fail:nonblocking

linux-4.1:test-amd64-amd64-libvirt-xsm:migrate-support-check:fail:nonblocking
linux-4.1:test-amd64-amd64-libvirt:migrate-support-check:fail:nonblocking

linux-4.1:test-amd64-i386-xl-qemut-debianhvm-amd64-xsm:guest-start/debianhvm.repeat:fail:nonblocking

linux-4.1:test-amd64-i386-xl-qemut-debianhvm-amd64:guest-start/debianhvm.repeat:fail:nonblocking
linux-4.1:test-armhf-armhf-xl-xsm:migrate-support-check:fail:nonblocking
linux-4.1:test-amd64-amd64-xl-qemuu-win7-amd64:guest-stop:fail:nonblocking
linux-4.1:test-amd64-i386-xl-qemuu-win7-amd64:guest-stop:fail:nonblocking
linux-4.1:test-amd64-i386-xl-qemut-win7-amd64:guest-stop:fail:nonblocking

linux-4.1:test-amd64-amd64-xl-qemut-winxpsp3:guest-start/win.repeat:fail:nonblocking
X-Osstest-Versions-This:
linux=b953c0d234bc72e8489d3bf51a276c5c4ec85345
X-Osstest-Versions-That:
linux=b953c0d234bc72e8489d3bf51a276c5c4ec85345

flight 59031 linux-4.1 real [real]
http://logs.test-lab.xenproject.org/osstest/logs/59031/

Failures :-/ but no regressions.

Tests which did not succeed, but are not blocking:
 test-armhf-armhf-xl-credit2   1 build-check(1)   blocked  n/a
 test-armhf-armhf-xl-cubietruck  1 build-check(1)   blocked  n/a
 test-armhf-armhf-xl-rtds  1 build-check(1)   blocked  n/a
 test-armhf-armhf-xl-multivcpu  1 build-check(1)   blocked  n/a
 test-armhf-armhf-libvirt  1 build-check(1)   blocked  n/a
 test-armhf-armhf-xl-arndale   1 build-check(1)   blocked  n/a
 test-armhf-armhf-libvirt-xsm  1 build-check(1)   blocked  n/a
 test-armhf-armhf-xl   1 build-check(1)   blocked  n/a
 build-armhf-libvirt   1 build-check(1)   blocked  n/a
 test-amd64-i386-freebsd10-amd64  9 freebsd-install fail never pass
 test-amd64-i386-freebsd10-i386  9 freebsd-install  fail never pass
 test-amd64-i386-libvirt-xsm  11 guest-start  fail   never pass
 test-amd64-amd64-xl-pvh-intel 13 guest-saverestorefail  never pass
 test-amd64-amd64-xl-pvh-amd  11 guest-start  fail   never pass
 build-armhf   4 host-build-prep  fail   never pass
 test-amd64-i386-libvirt  12 migrate-support-checkfail   never pass
 test-amd64-amd64-libvirt-xsm 12 migrate-support-checkfail   never pass
 test-amd64-amd64-libvirt 12 migrate-support-checkfail   never pass
 test-amd64-i386-xl-qemut-debianhvm-amd64-xsm 18 guest-start/debianhvm.repeat 
fail never pass
 test-amd64-i386-xl-qemut-debianhvm-amd64 18 guest-start/debianhvm.repeat fail 
never pass
 test-armhf-armhf-xl-xsm  12 migrate-support-checkfail   never pass
 test-amd64-amd64-xl-qemuu-win7-amd64 16 guest-stop fail never pass
 test-amd64-i386-xl-qemuu-win7-amd64 16 guest-stop  fail never pass
 test-amd64-i386-xl-qemut-win7-amd64 16 guest-stop  fail never pass
 test-amd64-amd64-xl-qemut-winxpsp3 18 guest-start/win.repeat   fail never pass

version targeted for testing:
 linuxb953c0d234bc72e8489d3bf51a276c5c4ec85345
baseline version:
 linuxb953c0d234bc72e8489d3bf51a276c5c4ec85345

Last test of basis59031  2015-07-02 23:39:59 Z0 days
Testing same since0  1970-01-01 00:00:00 Z 16619 days0 attempts

jobs:
 build-amd64-xsm  pass
 build-armhf-xsm  pass
 build-i386-xsm   pass
 b

[Xen-devel] [OSSTEST PATCH] sg-report-flight: Fix --include (broken by 3d56a191)

2015-07-03 Thread Ian Jackson
In 3d56a191 "sg-report-flight: Make bodyprint[f] defer the output" it
became wrong for anything in the main printout part of
sg-report-flight to write directly to STDOUT.  However, the two (very
similar) bits of code for handling the two kinds of --include still
used cat.

The result is emails looking like this:

  From: osstest service owner 
  To: , 
  CC: 
  Subject: [rumpuserxen test] People who touched revisions under test:
Alice Bob 
Ian Jackson 
Carol David 
  Date: Fri, 3 Jul 2015 06:50:53 +

  flight 59037 rumpuserxen real [real]

Fix this by replacing those two near-identical bits of code with calls
to a single function which slurps the required include file into the
body text accumulation variable.

(There is no need to provide a facility for header includes, since
there is no need for a caller to pass headers through
sg-report-flight: they can simply be written into the output file
before running sg-report-flight, as indeed the string `Subject: ' is.

Despite the fact that --include-begin is used only by cr-daily-branch
which passes it a file `heading', the text is intended for the start
of the body, not the email headers.)

I have run

  ./sg-report-flight --include-begin=header --include=bodyinc 
--this-xen=e13013dbf1d5997915548a3b5f1c39594d8c1d7b 
--that-xen=84066dd4ef4bb5983e246c629a26ef4f3394e5d5 
--html-dir=$HOME/public_html/d --max-flight=37590 37590

with some suitable lorem ipsum in bodyinc and header and observed:

(a) The bug introduced in 3d56a191 is visible in 3c464fbf.

(b) The output after this patch differs from the output produced by
1f0c168d (the previous osstest production commit) only in addition of
the `Last test of basis' and `Testing same since' information, in the
appropriate place.

Deployment note: Because this patch changes only sg-report-flight, it
is safe to deploy under the feet of a running flight.  I intend to do
this for all the production branches in the colo.

Signed-off-by: Ian Jackson 
---
 sg-report-flight |   22 +-
 1 file changed, 13 insertions(+), 9 deletions(-)

diff --git a/sg-report-flight b/sg-report-flight
index 829e0c3..e6ca38c 100755
--- a/sg-report-flight
+++ b/sg-report-flight
@@ -555,6 +555,17 @@ sub print_pushgate_summary () {
 $pinfo->('Testing same since', "FirstTip","CountTip");
 }
 
+sub includes ($) {
+my ($includefiles) = @_;
+local $/ = undef;
+foreach my $include (@$includefiles) {
+   open INCLUDE, $include or die "include $include: $!";
+   $body_text .= ;
+   die $! if INCLUDE->error;
+   close INCLUDE;
+}
+}
+
 sub printout {
 my ($r, @failures) = @_;
 $header_text = '';
@@ -564,10 +575,7 @@ sub printout {
 $header_text .= <{Flight}: $r->{OutcomeSummary}
 END
-foreach my $include (@includebeginfiles) {
-STDOUT->flush();
-system_checked('cat','--',$include);
-}
+includes(\@includebeginfiles);
 bodyprint <{Flight} $branch $r->{FlightInfo}{blessing} 
[$r->{FlightInfo}{intended}]
 $c{ReportHtmlPubBaseUrl}/$r->{Flight}/
@@ -655,11 +663,7 @@ END
 if (@includefiles) {
 bodyprint "\n","-"x60, "\n";
 }
-foreach my $include (@includefiles) {
-STDOUT->flush();
-system_checked('cat','--',$include);
-bodyprint "-"x60, "\n";
-}
+includes(\@includefiles);
 
 bodyprint "\njobs:\n", $r->{JobsSummary}, "\n";
 
-- 
1.7.10.4


___
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel


[Xen-devel] [PATCH v2 0/7] get rid of the SEDF scheduler

2015-07-03 Thread Dario Faggioli
Hey,

Here's v2 of my 'campaign' against SEDF.

Updates are:
 - I've got George's R-b for the whole series,
 - I've applied Andrew's review comment (patch 4)
 - OSSTest has stopped testing SEDF already (no sign of it here
   http://logs.test-lab.xenproject.org/osstest/logs/59025/)

There is a git branch here:
 git://xenbits.xen.org/people/dariof/xen.git  rel/sched/nosedf-v2
 
http://xenbits.xen.org/gitweb/?p=people/dariof/xen.git;a=shortlog;h=refs/heads/rel/sched/nosedf-v2

Thanks and Regards,
Dario
---
Dario Faggioli (7):
  libxl: get rid of the SEDF scheduler
  tools: python: get rid of the SEDF scheduler bindings
  libxc: get rid of the SEDF scheduler
  xen: get rid of the SEDF scheduler
  xen: kill sched_sedf.c
  xl: get rid of the SEDF scheduler
  docs: get rid of the SEDF scheduler

 docs/INDEX  |1 
 docs/man/xl.cfg.pod.5   |   24 
 docs/man/xl.pod.1   |   42 -
 docs/man/xlcpupool.cfg.pod.5|4 
 docs/misc/sedf_scheduler_mini-HOWTO.txt |   44 -
 docs/misc/xen-command-line.markdown |2 
 tools/examples/cpupool  |2 
 tools/libxc/Makefile|1 
 tools/libxc/include/xenctrl.h   |   12 
 tools/libxc/xc_sedf.c   |   78 --
 tools/libxl/libxl.c |   73 -
 tools/libxl/libxl_create.c  |   61 -
 tools/libxl/xl.h|1 
 tools/libxl/xl_cmdimpl.c|  139 ---
 tools/libxl/xl_cmdtable.c   |   16 
 tools/python/xen/lowlevel/xc/xc.c   |   70 -
 xen/common/Makefile |1 
 xen/common/sched_sedf.c | 1556 ---
 xen/common/schedule.c   |1 
 xen/include/public/domctl.h |9 
 xen/include/public/trace.h  |2 
 xen/include/xen/sched-if.h  |1 
 22 files changed, 9 insertions(+), 2131 deletions(-)
 delete mode 100644 docs/misc/sedf_scheduler_mini-HOWTO.txt
 delete mode 100644 tools/libxc/xc_sedf.c
 delete mode 100644 xen/common/sched_sedf.c
--
<> (Raistlin Majere)
-
Dario Faggioli, Ph.D, http://about.me/dario.faggioli
Senior Software Engineer, Citrix Systems R&D Ltd., Cambridge (UK)

___
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel


[Xen-devel] [PATCH v2 3/7] libxc: get rid of the SEDF scheduler

2015-07-03 Thread Dario Faggioli
Signed-off-by: Dario Faggioli 
Reviewed-by: George Dunlap 
---
Cc: Ian Jackson 
Cc: Stefano Stabellini 
Cc: Ian Campbell 
Cc: Wei Liu 
---
 tools/libxc/Makefile  |1 -
 tools/libxc/include/xenctrl.h |   12 --
 tools/libxc/xc_sedf.c |   78 -
 3 files changed, 91 deletions(-)
 delete mode 100644 tools/libxc/xc_sedf.c

diff --git a/tools/libxc/Makefile b/tools/libxc/Makefile
index 153b79e..b659df4 100644
--- a/tools/libxc/Makefile
+++ b/tools/libxc/Makefile
@@ -21,7 +21,6 @@ CTRL_SRCS-y   += xc_misc.c
 CTRL_SRCS-y   += xc_flask.c
 CTRL_SRCS-y   += xc_physdev.c
 CTRL_SRCS-y   += xc_private.c
-CTRL_SRCS-y   += xc_sedf.c
 CTRL_SRCS-y   += xc_csched.c
 CTRL_SRCS-y   += xc_csched2.c
 CTRL_SRCS-y   += xc_arinc653.c
diff --git a/tools/libxc/include/xenctrl.h b/tools/libxc/include/xenctrl.h
index d1d2ab3..31c7cb9 100644
--- a/tools/libxc/include/xenctrl.h
+++ b/tools/libxc/include/xenctrl.h
@@ -875,18 +875,6 @@ int xc_shadow_control(xc_interface *xch,
   uint32_t mode,
   xc_shadow_op_stats_t *stats);
 
-int xc_sedf_domain_set(xc_interface *xch,
-   uint32_t domid,
-   uint64_t period, uint64_t slice,
-   uint64_t latency, uint16_t extratime,
-   uint16_t weight);
-
-int xc_sedf_domain_get(xc_interface *xch,
-   uint32_t domid,
-   uint64_t* period, uint64_t *slice,
-   uint64_t *latency, uint16_t *extratime,
-   uint16_t *weight);
-
 int xc_sched_credit_domain_set(xc_interface *xch,
uint32_t domid,
struct xen_domctl_sched_credit *sdom);
diff --git a/tools/libxc/xc_sedf.c b/tools/libxc/xc_sedf.c
deleted file mode 100644
index db372ca..000
--- a/tools/libxc/xc_sedf.c
+++ /dev/null
@@ -1,78 +0,0 @@
-/**
- * xc_sedf.c
- *
- * API for manipulating parameters of the Simple EDF scheduler.
- *
- * changes by Stephan Diestelhorst
- * based on code
- * by Mark Williamson, Copyright (c) 2004 Intel Research Cambridge.
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation;
- * version 2.1 of the License.
- *
- * This library is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this library; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  
USA
- */
-
-#include "xc_private.h"
-
-int xc_sedf_domain_set(
-xc_interface *xch,
-uint32_t domid,
-uint64_t period,
-uint64_t slice,
-uint64_t latency,
-uint16_t extratime,
-uint16_t weight)
-{
-DECLARE_DOMCTL;
-struct xen_domctl_sched_sedf *p = &domctl.u.scheduler_op.u.sedf;
-
-domctl.cmd = XEN_DOMCTL_scheduler_op;
-domctl.domain  = (domid_t)domid;
-domctl.u.scheduler_op.sched_id = XEN_SCHEDULER_SEDF;
-domctl.u.scheduler_op.cmd = XEN_DOMCTL_SCHEDOP_putinfo;
-
-p->period= period;
-p->slice = slice;
-p->latency   = latency;
-p->extratime = extratime;
-p->weight= weight;
-return do_domctl(xch, &domctl);
-}
-
-int xc_sedf_domain_get(
-xc_interface *xch,
-uint32_t domid,
-uint64_t *period,
-uint64_t *slice,
-uint64_t *latency,
-uint16_t *extratime,
-uint16_t *weight)
-{
-DECLARE_DOMCTL;
-int ret;
-struct xen_domctl_sched_sedf *p = &domctl.u.scheduler_op.u.sedf;
-
-domctl.cmd = XEN_DOMCTL_scheduler_op;
-domctl.domain = (domid_t)domid;
-domctl.u.scheduler_op.sched_id = XEN_SCHEDULER_SEDF;
-domctl.u.scheduler_op.cmd = XEN_DOMCTL_SCHEDOP_getinfo;
-
-ret = do_domctl(xch, &domctl);
-
-*period= p->period;
-*slice = p->slice;
-*latency   = p->latency;
-*extratime = p->extratime;
-*weight= p->weight;
-return ret;
-}


___
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel


[Xen-devel] [PATCH v2 1/7] libxl: get rid of the SEDF scheduler

2015-07-03 Thread Dario Faggioli
only the interface is left in place, for backward
compile-time compatibility, but every attempt to
use it would throw an error.

Signed-off-by: Dario Faggioli 
Reviewed-by: George Dunlap 
---
Cc: Ian Jackson 
Cc: Stefano Stabellini 
Cc: Ian Campbell 
Cc: Wei Liu 
---
 tools/libxl/libxl.c|   73 ++--
 tools/libxl/libxl_create.c |   61 -
 2 files changed, 4 insertions(+), 130 deletions(-)

diff --git a/tools/libxl/libxl.c b/tools/libxl/libxl.c
index e9a2d26..cd55626 100644
--- a/tools/libxl/libxl.c
+++ b/tools/libxl/libxl.c
@@ -5787,73 +5787,6 @@ static int sched_credit2_domain_set(libxl__gc *gc, 
uint32_t domid,
 return 0;
 }
 
-static int sched_sedf_domain_get(libxl__gc *gc, uint32_t domid,
- libxl_domain_sched_params *scinfo)
-{
-uint64_t period;
-uint64_t slice;
-uint64_t latency;
-uint16_t extratime;
-uint16_t weight;
-int rc;
-
-rc = xc_sedf_domain_get(CTX->xch, domid, &period, &slice, &latency,
-&extratime, &weight);
-if (rc != 0) {
-LOGE(ERROR, "getting domain sched sedf");
-return ERROR_FAIL;
-}
-
-libxl_domain_sched_params_init(scinfo);
-scinfo->sched = LIBXL_SCHEDULER_SEDF;
-scinfo->period = period / 100;
-scinfo->slice = slice / 100;
-scinfo->latency = latency / 100;
-scinfo->extratime = extratime;
-scinfo->weight = weight;
-
-return 0;
-}
-
-static int sched_sedf_domain_set(libxl__gc *gc, uint32_t domid,
- const libxl_domain_sched_params *scinfo)
-{
-uint64_t period;
-uint64_t slice;
-uint64_t latency;
-uint16_t extratime;
-uint16_t weight;
-
-int ret;
-
-ret = xc_sedf_domain_get(CTX->xch, domid, &period, &slice, &latency,
-&extratime, &weight);
-if (ret != 0) {
-LOGE(ERROR, "getting domain sched sedf");
-return ERROR_FAIL;
-}
-
-if (scinfo->period != LIBXL_DOMAIN_SCHED_PARAM_PERIOD_DEFAULT)
-period = (uint64_t)scinfo->period * 100;
-if (scinfo->slice != LIBXL_DOMAIN_SCHED_PARAM_SLICE_DEFAULT)
-slice = (uint64_t)scinfo->slice * 100;
-if (scinfo->latency != LIBXL_DOMAIN_SCHED_PARAM_LATENCY_DEFAULT)
-latency = (uint64_t)scinfo->latency * 100;
-if (scinfo->extratime != LIBXL_DOMAIN_SCHED_PARAM_EXTRATIME_DEFAULT)
-extratime = scinfo->extratime;
-if (scinfo->weight != LIBXL_DOMAIN_SCHED_PARAM_WEIGHT_DEFAULT)
-weight = scinfo->weight;
-
-ret = xc_sedf_domain_set(CTX->xch, domid, period, slice, latency,
-extratime, weight);
-if ( ret < 0 ) {
-LOGE(ERROR, "setting domain sched sedf");
-return ERROR_FAIL;
-}
-
-return 0;
-}
-
 static int sched_rtds_domain_get(libxl__gc *gc, uint32_t domid,
libxl_domain_sched_params *scinfo)
 {
@@ -5932,7 +5865,8 @@ int libxl_domain_sched_params_set(libxl_ctx *ctx, 
uint32_t domid,
 
 switch (sched) {
 case LIBXL_SCHEDULER_SEDF:
-ret=sched_sedf_domain_set(gc, domid, scinfo);
+LOG(ERROR, "SEDF scheduler no longer available");
+ret=ERROR_INVAL;
 break;
 case LIBXL_SCHEDULER_CREDIT:
 ret=sched_credit_domain_set(gc, domid, scinfo);
@@ -5968,7 +5902,8 @@ int libxl_domain_sched_params_get(libxl_ctx *ctx, 
uint32_t domid,
 
 switch (scinfo->sched) {
 case LIBXL_SCHEDULER_SEDF:
-ret=sched_sedf_domain_get(gc, domid, scinfo);
+LOG(ERROR, "SEDF scheduler no longer available");
+ret=ERROR_INVAL;
 break;
 case LIBXL_SCHEDULER_CREDIT:
 ret=sched_credit_domain_get(gc, domid, scinfo);
diff --git a/tools/libxl/libxl_create.c b/tools/libxl/libxl_create.c
index f799081..8dbf0d8 100644
--- a/tools/libxl/libxl_create.c
+++ b/tools/libxl/libxl_create.c
@@ -50,61 +50,6 @@ int libxl__domain_create_info_setdefault(libxl__gc *gc,
 return 0;
 }
 
-static int sched_params_valid(libxl__gc *gc,
-  uint32_t domid, libxl_domain_sched_params *scp)
-{
-int has_weight = scp->weight != LIBXL_DOMAIN_SCHED_PARAM_WEIGHT_DEFAULT;
-int has_period = scp->period != LIBXL_DOMAIN_SCHED_PARAM_PERIOD_DEFAULT;
-int has_slice = scp->slice != LIBXL_DOMAIN_SCHED_PARAM_SLICE_DEFAULT;
-int has_extratime =
-scp->extratime != LIBXL_DOMAIN_SCHED_PARAM_EXTRATIME_DEFAULT;
-
-/* The sedf scheduler needs some more consistency checking */
-if (libxl__domain_scheduler(gc, domid) == LIBXL_SCHEDULER_SEDF) {
-if (has_weight && (has_period || has_slice))
-return 0;
-/* If you want a real-time domain, with its own period and
- * slice, please, do provide both! */
-if (has_period != has_slice)
-return 0;
-
-/*
- * Idea is, if we specify a weight, then both period and
- * slice h

[Xen-devel] [PATCH v2 5/7] xen: kill sched_sedf.c

2015-07-03 Thread Dario Faggioli
Signed-off-by: Dario Faggioli 
Reviewed-by: George Dunlap 
---
 xen/common/sched_sedf.c | 1556 ---
 1 file changed, 1556 deletions(-)
 delete mode 100644 xen/common/sched_sedf.c

diff --git a/xen/common/sched_sedf.c b/xen/common/sched_sedf.c
deleted file mode 100644
index a1a4cb7..000
--- a/xen/common/sched_sedf.c
+++ /dev/null
@@ -1,1556 +0,0 @@
-/**
- * Simple EDF scheduler for xen
- *
- * by Stephan Diestelhorst (C)  2004 Cambridge University
- * based on code by Mark Williamson (C) 2004 Intel Research Cambridge
- */
-
-#include 
-#include 
-#include 
-#include 
-#include 
-#include 
-#include 
-
-#ifndef NDEBUG
-#define SEDF_STATS
-#define CHECK(_p)   \
-do {\
-if ( !(_p) )\
-printk("Check '%s' failed, line %d, file %s\n", \
-   #_p , __LINE__, __FILE__);   \
-} while ( 0 )
-#else
-#define CHECK(_p) ((void)0)
-#endif
-
-#define EXTRA_NONE (0)
-#define EXTRA_AWARE (1)
-#define EXTRA_RUN_PEN (2)
-#define EXTRA_RUN_UTIL (4)
-#define EXTRA_WANT_PEN_Q (8)
-#define EXTRA_PEN_Q (0)
-#define EXTRA_UTIL_Q (1)
-#define SEDF_ASLEEP (16)
-
-#define EXTRA_QUANTUM (MICROSECS(500)) 
-#define WEIGHT_PERIOD (MILLISECS(100))
-#define WEIGHT_SAFETY (MILLISECS(5))
-
-#define PERIOD_MAX MILLISECS(1) /* 10s  */
-#define PERIOD_MIN (MICROSECS(10))  /* 10us */
-#define SLICE_MIN (MICROSECS(5))/*  5us */
-
-#define IMPLY(a, b) (!(a) || (b))
-#define EQ(a, b) ((!!(a)) == (!!(b)))
-
-
-struct sedf_dom_info {
-struct domain  *domain;
-};
-
-struct sedf_priv_info {
-/* lock for the whole pluggable scheduler, nests inside cpupool_lock */
-spinlock_t lock;
-};
-
-struct sedf_vcpu_info {
-struct vcpu *vcpu;
-struct list_head list;
-struct list_head extralist[2];
- 
-/* Parameters for EDF */
-s_time_t  period;  /* = relative deadline */
-s_time_t  slice;   /* = worst case execution time */
- 
-/* Advaced Parameters */
-
-/* Latency Scaling */
-s_time_t  period_orig;
-s_time_t  slice_orig;
-s_time_t  latency;
- 
-/* Status of domain */
-int   status;
-/* Weights for "Scheduling for beginners/ lazy/ etc." ;) */
-short weight;
-short extraweight;
-/* Bookkeeping */
-s_time_t  deadl_abs;
-s_time_t  sched_start_abs;
-s_time_t  cputime;
-/* Times the domain un-/blocked */
-s_time_t  block_abs;
-s_time_t  unblock_abs;
- 
-/* Scores for {util, block penalty}-weighted extratime distribution */
-int   score[2];
-s_time_t  short_block_lost_tot;
- 
-/* Statistics */
-s_time_t  extra_time_tot;
-
-#ifdef SEDF_STATS
-s_time_t  block_time_tot;
-s_time_t  penalty_time_tot;
-int   block_tot;
-int   short_block_tot;
-int   long_block_tot;
-int   pen_extra_blocks;
-int   pen_extra_slices;
-#endif
-};
-
-struct sedf_cpu_info {
-struct list_head runnableq;
-struct list_head waitq;
-struct list_head extraq[2];
-s_time_t current_slice_expires;
-};
-
-#define SEDF_PRIV(_ops) \
-((struct sedf_priv_info *)((_ops)->sched_data))
-#define EDOM_INFO(d)   ((struct sedf_vcpu_info *)((d)->sched_priv))
-#define CPU_INFO(cpu)  \
-((struct sedf_cpu_info *)per_cpu(schedule_data, cpu).sched_priv)
-#define LIST(d)(&EDOM_INFO(d)->list)
-#define EXTRALIST(d,i) (&(EDOM_INFO(d)->extralist[i]))
-#define RUNQ(cpu)  (&CPU_INFO(cpu)->runnableq)
-#define WAITQ(cpu) (&CPU_INFO(cpu)->waitq)
-#define EXTRAQ(cpu,i)  (&(CPU_INFO(cpu)->extraq[i]))
-#define IDLETASK(cpu)  (idle_vcpu[cpu])
-
-#define PERIOD_BEGIN(inf) ((inf)->deadl_abs - (inf)->period)
-
-#define DIV_UP(x,y) (((x) + (y) - 1) / y)
-
-#define extra_runs(inf)  ((inf->status) & 6)
-#define extra_get_cur_q(inf) (((inf->status & 6) >> 1)-1)
-#define sedf_runnable(edom)  (!(EDOM_INFO(edom)->status & SEDF_ASLEEP))
-
-
-static void sedf_dump_cpu_state(const struct scheduler *ops, int i);
-
-static inline int extraq_on(struct vcpu *d, int i)
-{
-return ((EXTRALIST(d,i)->next != NULL) &&
-(EXTRALIST(d,i)->next != EXTRALIST(d,i)));
-}
-
-static inline void extraq_del(struct vcpu *d, int i)
-{
-struct list_head *list = EXTRALIST(d,i);
-ASSERT(extraq_on(d,i));
-list_del(list);
-list->next = NULL;
-ASSERT(!extraq_on(d, i));
-}
-
-/*
- * Adds a domain to the queue of processes which are aware of extra time. List
- * is sorted by score, where a lower score means higher priority for an extra
- * slice. It also updates the score, by simply subtracting a fixed value from
- * each entry, in order to avoid overflow. The algorithm works by simply
- * charging each domain that recieved extratime with an inverse of its weight.
- */ 
-static inline void extraq_add_sort_update(struct vcpu 

[Xen-devel] [PATCH v2 2/7] tools: python: get rid of the SEDF scheduler bindings

2015-07-03 Thread Dario Faggioli
as it is going away from libxc, so these won't build any
longer.

Signed-off-by: Dario Faggioli 
Reviewed-by: George Dunlap 
---
Cc: Ian Jackson 
Cc: Stefano Stabellini 
Cc: Ian Campbell 
Cc: Wei Liu 
---
 tools/python/xen/lowlevel/xc/xc.c |   70 -
 1 file changed, 70 deletions(-)

diff --git a/tools/python/xen/lowlevel/xc/xc.c 
b/tools/python/xen/lowlevel/xc/xc.c
index c77e15b..ee3e1d0 100644
--- a/tools/python/xen/lowlevel/xc/xc.c
+++ b/tools/python/xen/lowlevel/xc/xc.c
@@ -1433,51 +1433,6 @@ static PyObject *pyxc_xeninfo(XcObject *self)
  "cc_compile_date", xen_cc.compile_date);
 }
 
-
-static PyObject *pyxc_sedf_domain_set(XcObject *self,
-  PyObject *args,
-  PyObject *kwds)
-{
-uint32_t domid;
-uint64_t period, slice, latency;
-uint16_t extratime, weight;
-static char *kwd_list[] = { "domid", "period", "slice",
-"latency", "extratime", "weight",NULL };
-
-if( !PyArg_ParseTupleAndKeywords(args, kwds, "iLLLhh", kwd_list, 
- &domid, &period, &slice,
- &latency, &extratime, &weight) )
-return NULL;
-   if ( xc_sedf_domain_set(self->xc_handle, domid, period,
-   slice, latency, extratime,weight) != 0 )
-return pyxc_error_to_exception(self->xc_handle);
-
-Py_INCREF(zero);
-return zero;
-}
-
-static PyObject *pyxc_sedf_domain_get(XcObject *self, PyObject *args)
-{
-uint32_t domid;
-uint64_t period, slice,latency;
-uint16_t weight, extratime;
-
-if(!PyArg_ParseTuple(args, "i", &domid))
-return NULL;
-
-if (xc_sedf_domain_get(self->xc_handle, domid, &period,
-   &slice,&latency,&extratime,&weight))
-return pyxc_error_to_exception(self->xc_handle);
-
-return Py_BuildValue("{s:i,s:L,s:L,s:L,s:i,s:i}",
- "domid",domid,
- "period",period,
- "slice", slice,
- "latency",   latency,
- "extratime", extratime,
- "weight",weight);
-}
-
 static PyObject *pyxc_shadow_control(PyObject *self,
  PyObject *args,
  PyObject *kwds)
@@ -2490,30 +2445,6 @@ static PyMethodDef pyxc_methods[] = {
   "Get the current scheduler type in use.\n"
   "Returns: [int] sched_id.\n" },
 
-{ "sedf_domain_set",
-  (PyCFunction)pyxc_sedf_domain_set,
-  METH_KEYWORDS, "\n"
-  "Set the scheduling parameters for a domain when running with Atropos.\n"
-  " dom   [int]:  domain to set\n"
-  " period[long]: domain's scheduling period\n"
-  " slice [long]: domain's slice per period\n"
-  " latency   [long]: domain's wakeup latency hint\n"
-  " extratime [int]:  domain aware of extratime?\n"
-  "Returns: [int] 0 on success; -1 on error.\n" },
-
-{ "sedf_domain_get",
-  (PyCFunction)pyxc_sedf_domain_get,
-  METH_VARARGS, "\n"
-  "Get the current scheduling parameters for a domain when running with\n"
-  "the Atropos scheduler."
-  " dom   [int]: domain to query\n"
-  "Returns:   [dict]\n"
-  " domain[int]: domain ID\n"
-  " period[long]: scheduler period\n"
-  " slice [long]: CPU reservation per period\n"
-  " latency   [long]: domain's wakeup latency hint\n"
-  " extratime [int]:  domain aware of extratime?\n"},
-
 { "sched_credit_domain_set",
   (PyCFunction)pyxc_sched_credit_domain_set,
   METH_KEYWORDS, "\n"
@@ -3033,7 +2964,6 @@ PyMODINIT_FUNC initxc(void)
 PyModule_AddObject(m, "Error", xc_error_obj);
 
 /* Expose some libxc constants to Python */
-PyModule_AddIntConstant(m, "XEN_SCHEDULER_SEDF", XEN_SCHEDULER_SEDF);
 PyModule_AddIntConstant(m, "XEN_SCHEDULER_CREDIT", XEN_SCHEDULER_CREDIT);
 PyModule_AddIntConstant(m, "XEN_SCHEDULER_CREDIT2", XEN_SCHEDULER_CREDIT2);
 


___
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel


[Xen-devel] [PATCH v2 7/7] docs: get rid of the SEDF scheduler

2015-07-03 Thread Dario Faggioli
Signed-off-by: Dario Faggioli 
Reviewed-by: George Dunlap 
---
Cc: Ian Jackson 
Cc: Stefano Stabellini 
Cc: Ian Campbell 
Cc: Wei Liu 
---
 docs/INDEX  |1 -
 docs/man/xlcpupool.cfg.pod.5|4 ---
 docs/misc/sedf_scheduler_mini-HOWTO.txt |   44 ---
 tools/examples/cpupool  |2 +
 4 files changed, 1 insertion(+), 50 deletions(-)
 delete mode 100644 docs/misc/sedf_scheduler_mini-HOWTO.txt

diff --git a/docs/INDEX b/docs/INDEX
index 5ed156f..7d26cf8 100644
--- a/docs/INDEX
+++ b/docs/INDEX
@@ -20,7 +20,6 @@ misc/xl-disk-configurationXL Disk Configuration
 misc/xl-network-configuration  XL Network Configuration
 misc/distro_mappingDistro Directory Layouts
 misc/dump-core-format  Xen Core Dump Format
-misc/sedf_scheduler_mini-HOWTO sEDF Mini HOWTO
 misc/vtd   VT-d HOWTO
 misc/vtpm  Virtual TPM
 misc/xen-error-handlingXen Error Handling
diff --git a/docs/man/xlcpupool.cfg.pod.5 b/docs/man/xlcpupool.cfg.pod.5
index 2ff8ee8..792cf4f 100644
--- a/docs/man/xlcpupool.cfg.pod.5
+++ b/docs/man/xlcpupool.cfg.pod.5
@@ -78,10 +78,6 @@ the credit2 scheduler
 
 the RTDS scheduler
 
-=item B
-
-the SEDF scheduler
-
 =back
 
 The default scheduler is the one used for C specified as
diff --git a/docs/misc/sedf_scheduler_mini-HOWTO.txt 
b/docs/misc/sedf_scheduler_mini-HOWTO.txt
deleted file mode 100644
index 6742867..000
--- a/docs/misc/sedf_scheduler_mini-HOWTO.txt
+++ /dev/null
@@ -1,44 +0,0 @@
-sEDF scheduler
---
-Author:
-   Stephan.Diestelhorst@{cl.cam.ac.uk, inf.tu-dresden.de}
-   
-Overview:
-  This scheduler provides weighted CPU sharing in an intuitive way and
-  uses realtime-algorithms to ensure time guarantees.
-
-Usage:
-   -add "sched=sedf" on Xen's boot command-line
-   -create domains as usual
-   -use "xm sched-sedf  
"
-Where:
-  -period/slice are the normal EDF scheduling parameters in nanosecs
-  -latency-hint is the scaled period in case the domain is doing heavy I/O
- (unused by the currently compiled version)
-  -extra is a flag (0/1), which controls whether the domain can run in
-   extra-time
-  -weight is mutually exclusive with period/slice and specifies another
-   way of setting a domains cpu slice
-
-Examples:
- normal EDF (20ms/5ms):
-  xm sched-sedf  2000 500 0 0 0
-  
- best-effort domains (i.e. non-realtime):
-  xm sched-sedf  2000 0 0 1 0
- 
- normal EDF (20ms/5ms) + share of extra-time:
-  xm sched-sedf  2000 500 0 1 0
-  
- 4 domains with weights 2:3:4:2
-  xm sched-sedf  0 0 0 0 2
-  xm sched-sedf  0 0 0 0 3
-  xm sched-sedf  0 0 0 0 4
-  xm sched-sedf  0 0 0 0 2
-  
- 1 fully-specified (10ms/3ms) domain, 3 other domains share
- available rest in 2:7:3 ratio:
-  xm sched-sedf  1000 300 0 0 0
-  xm sched-sedf  0 0 0 0 2
-  xm sched-sedf  0 0 0 0 7
-  xm sched-sedf  0 0 0 0 3
diff --git a/tools/examples/cpupool b/tools/examples/cpupool
index 73368e6..35e229e 100644
--- a/tools/examples/cpupool
+++ b/tools/examples/cpupool
@@ -9,7 +9,7 @@
 # the name of the new cpupool
 name = "Example-Cpupool"
 
-# the scheduler to use: valid are e.g. credit, credit2, rtds and sedf
+# the scheduler to use: valid are e.g. credit, credit2 and rtds
 sched = "credit"
 
 # list of cpus to use


___
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel


[Xen-devel] [PATCH v2 6/7] xl: get rid of the SEDF scheduler

2015-07-03 Thread Dario Faggioli
Signed-off-by: Dario Faggioli 
Reviewed-by: George Dunlap 
---
Cc: Ian Jackson 
Cc: Stefano Stabellini 
Cc: Ian Campbell 
Cc: Wei Liu 
---
 docs/man/xl.cfg.pod.5 |   24 
 docs/man/xl.pod.1 |   42 --
 tools/libxl/xl.h  |1 
 tools/libxl/xl_cmdimpl.c  |  139 -
 tools/libxl/xl_cmdtable.c |   16 -
 5 files changed, 1 insertion(+), 221 deletions(-)

diff --git a/docs/man/xl.cfg.pod.5 b/docs/man/xl.cfg.pod.5
index a3e0e2e..27e7643 100644
--- a/docs/man/xl.cfg.pod.5
+++ b/docs/man/xl.cfg.pod.5
@@ -198,7 +198,7 @@ For more details, see 
F.
 A domain with a weight of 512 will get twice as much CPU as a domain
 with a weight of 256 on a contended host.
 Legal weights range from 1 to 65535 and the default is 256.
-Honoured by the credit, credit2 and sedf schedulers.
+Honoured by the credit and credit2 schedulers.
 
 =item B
 
@@ -222,28 +222,6 @@ that your VM gets 25% of the available power (50% of 1GHz) 
rather than
 look at performance and cpufreq options in your operating system and
 your BIOS.
 
-=item B
-
-The normal EDF scheduling usage in nanoseconds. This means every period
-the domain gets cpu time defined in slice.
-Honoured by the sedf scheduler.
-
-=item B
-
-The normal EDF scheduling usage in nanoseconds. it defines the time 
-a domain get every period time.
-Honoured by the sedf scheduler.
-
-=item B
-
-Scaled period if domain is doing heavy I/O.
-Honoured by the sedf scheduler.
-
-=item B
-
-Flag for allowing domain to run in extra time.
-Honoured by the sedf scheduler.
-
 =back
 
 =head3 Memory Allocation
diff --git a/docs/man/xl.pod.1 b/docs/man/xl.pod.1
index 4eb929d..7951aff 100644
--- a/docs/man/xl.pod.1
+++ b/docs/man/xl.pod.1
@@ -1031,48 +1031,6 @@ Restrict output to domains in the specified cpupool.
 
 =back
 
-=item B [I]
-
-Set or get Simple EDF (Earliest Deadline First) scheduler parameters. This
-scheduler provides weighted CPU sharing in an intuitive way and uses
-realtime-algorithms to ensure time guarantees.  For more information see
-docs/misc/sedf_scheduler_mini-HOWTO.txt in the Xen distribution.
-
-B
-
-=over 4
-
-=item B<-d DOMAIN>, B<--domain=DOMAIN>
-
-Specify domain for which scheduler parameters are to be modified or retrieved.
-Mandatory for modifying scheduler parameters.
-
-=item B<-p PERIOD>, B<--period=PERIOD>
-
-The normal EDF scheduling usage in milliseconds.
-
-=item B<-s SLICE>, B<--slice=SLICE>
-
-The normal EDF scheduling usage in milliseconds.
-
-=item B<-l LATENCY>, B<--latency=LATENCY>
-
-Scaled period if domain is doing heavy I/O.
-
-=item B<-e EXTRA>, B<--extra=EXTRA>
-
-Flag for allowing domain to run in extra time (0 or 1).
-
-=item B<-w WEIGHT>, B<--weight=WEIGHT>
-
-Another way of setting CPU slice.
-
-=item B<-c CPUPOOL>, B<--cpupool=CPUPOOL>
-
-Restrict output to domains in the specified cpupool.
-
-=back
-
 =item B [I]
 
 Set or get rtds (Real Time Deferrable Server) scheduler parameters.
diff --git a/tools/libxl/xl.h b/tools/libxl/xl.h
index 5bc138c..fe44b86 100644
--- a/tools/libxl/xl.h
+++ b/tools/libxl/xl.h
@@ -66,7 +66,6 @@ int main_memmax(int argc, char **argv);
 int main_memset(int argc, char **argv);
 int main_sched_credit(int argc, char **argv);
 int main_sched_credit2(int argc, char **argv);
-int main_sched_sedf(int argc, char **argv);
 int main_sched_rtds(int argc, char **argv);
 int main_domid(int argc, char **argv);
 int main_domname(int argc, char **argv);
diff --git a/tools/libxl/xl_cmdimpl.c b/tools/libxl/xl_cmdimpl.c
index c858068..de60449 100644
--- a/tools/libxl/xl_cmdimpl.c
+++ b/tools/libxl/xl_cmdimpl.c
@@ -5725,37 +5725,6 @@ static int sched_credit2_domain_output(
 return 0;
 }
 
-static int sched_sedf_domain_output(
-int domid)
-{
-char *domname;
-libxl_domain_sched_params scinfo;
-int rc;
-
-if (domid < 0) {
-printf("%-33s %4s %6s %-6s %7s %5s %6s\n", "Name", "ID", "Period",
-   "Slice", "Latency", "Extra", "Weight");
-return 0;
-}
-
-libxl_domain_sched_params_init(&scinfo);
-rc = sched_domain_get(LIBXL_SCHEDULER_SEDF, domid, &scinfo);
-if (rc)
-return rc;
-domname = libxl_domid_to_name(ctx, domid);
-printf("%-33s %4d %6d %6d %7d %5d %6d\n",
-domname,
-domid,
-scinfo.period,
-scinfo.slice,
-scinfo.latency,
-scinfo.extratime,
-scinfo.weight);
-free(domname);
-libxl_domain_sched_params_dispose(&scinfo);
-return 0;
-}
-
 static int sched_rtds_domain_output(
 int domid)
 {
@@ -6056,114 +6025,6 @@ int main_sched_credit2(int argc, char **argv)
 return 0;
 }
 
-int main_sched_sedf(int argc, char **argv)
-{
-const char *dom = NULL;
-const char *cpupool = NULL;
-int period = 0, opt_p = 0;
-int slice = 0, opt_s = 0;
-int latency = 0, opt_l = 0;
-int extra = 0, opt_e = 0;
-int weight = 0, opt_w = 0;
-int opt, rc;
-static struct option opts[] = {
-{"period

[Xen-devel] [PATCH v2 4/7] xen: get rid of the SEDF scheduler

2015-07-03 Thread Dario Faggioli
more specifically, of all the symbols and references
to it.

Signed-off-by: Dario Faggioli 
Reviewed-by: George Dunlap 
---
Cc: Andrew Cooper 

Changes from v1:
 - added markers for removed #defines, to help keep bits
   of the history, and reduce the likelyhood of accidental
   reuse, as requested during review.
---
 docs/misc/xen-command-line.markdown |2 +-
 xen/common/Makefile |1 -
 xen/common/schedule.c   |1 -
 xen/include/public/domctl.h |9 +
 xen/include/public/trace.h  |2 +-
 xen/include/xen/sched-if.h  |1 -
 6 files changed, 3 insertions(+), 13 deletions(-)

diff --git a/docs/misc/xen-command-line.markdown 
b/docs/misc/xen-command-line.markdown
index aa684c0..d292fae 100644
--- a/docs/misc/xen-command-line.markdown
+++ b/docs/misc/xen-command-line.markdown
@@ -1206,7 +1206,7 @@ Map the HPET page as read only in Dom0. If disabled the 
page will be mapped
 with read and write permissions.
 
 ### sched
-> `= credit | credit2 | sedf | arinc653`
+> `= credit | credit2 | arinc653`
 
 > Default: `sched=credit`
 
diff --git a/xen/common/Makefile b/xen/common/Makefile
index 1cddebc..3fdf931 100644
--- a/xen/common/Makefile
+++ b/xen/common/Makefile
@@ -31,7 +31,6 @@ obj-y += rbtree.o
 obj-y += rcupdate.o
 obj-y += sched_credit.o
 obj-y += sched_credit2.o
-obj-y += sched_sedf.o
 obj-y += sched_arinc653.o
 obj-y += sched_rt.o
 obj-y += schedule.o
diff --git a/xen/common/schedule.c b/xen/common/schedule.c
index ecf1545..0dc2788 100644
--- a/xen/common/schedule.c
+++ b/xen/common/schedule.c
@@ -65,7 +65,6 @@ DEFINE_PER_CPU(struct schedule_data, schedule_data);
 DEFINE_PER_CPU(struct scheduler *, scheduler);
 
 static const struct scheduler *schedulers[] = {
-&sched_sedf_def,
 &sched_credit_def,
 &sched_credit2_def,
 &sched_arinc653_def,
diff --git a/xen/include/public/domctl.h b/xen/include/public/domctl.h
index bc45ea5..6d28489 100644
--- a/xen/include/public/domctl.h
+++ b/xen/include/public/domctl.h
@@ -324,7 +324,7 @@ DEFINE_XEN_GUEST_HANDLE(xen_domctl_max_vcpus_t);
 
 /* XEN_DOMCTL_scheduler_op */
 /* Scheduler types. */
-#define XEN_SCHEDULER_SEDF 4
+/* #define XEN_SCHEDULER_SEDF  4 (Removed) */
 #define XEN_SCHEDULER_CREDIT   5
 #define XEN_SCHEDULER_CREDIT2  6
 #define XEN_SCHEDULER_ARINC653 7
@@ -337,13 +337,6 @@ struct xen_domctl_scheduler_op {
 uint32_t sched_id;  /* XEN_SCHEDULER_* */
 uint32_t cmd;   /* XEN_DOMCTL_SCHEDOP_* */
 union {
-struct xen_domctl_sched_sedf {
-uint64_aligned_t period;
-uint64_aligned_t slice;
-uint64_aligned_t latency;
-uint32_t extratime;
-uint32_t weight;
-} sedf;
 struct xen_domctl_sched_credit {
 uint16_t weight;
 uint16_t cap;
diff --git a/xen/include/public/trace.h b/xen/include/public/trace.h
index 5211ae7..274f8f6 100644
--- a/xen/include/public/trace.h
+++ b/xen/include/public/trace.h
@@ -75,7 +75,7 @@
 /* Per-scheduler IDs, to identify scheduler specific events */
 #define TRC_SCHED_CSCHED   0
 #define TRC_SCHED_CSCHED2  1
-#define TRC_SCHED_SEDF 2
+/* #define XEN_SCHEDULER_SEDF 2 (Removed) */
 #define TRC_SCHED_ARINC653 3
 #define TRC_SCHED_RTDS 4
 
diff --git a/xen/include/xen/sched-if.h b/xen/include/xen/sched-if.h
index 7cc25c6..dbe7cab 100644
--- a/xen/include/xen/sched-if.h
+++ b/xen/include/xen/sched-if.h
@@ -165,7 +165,6 @@ struct scheduler {
 void (*tick_resume) (const struct scheduler *, unsigned int);
 };
 
-extern const struct scheduler sched_sedf_def;
 extern const struct scheduler sched_credit_def;
 extern const struct scheduler sched_credit2_def;
 extern const struct scheduler sched_arinc653_def;


___
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel


Re: [Xen-devel] [OSSTEST PATCH] sg-report-flight: Fix --include (broken by 3d56a191)

2015-07-03 Thread Ian Campbell
On Fri, 2015-07-03 at 11:23 +0100, Ian Jackson wrote:
> In 3d56a191 "sg-report-flight: Make bodyprint[f] defer the output" it
> became wrong for anything in the main printout part of
> sg-report-flight to write directly to STDOUT.  However, the two (very
> similar) bits of code for handling the two kinds of --include still
> used cat.
> 
> The result is emails looking like this:
> 
>   From: osstest service owner 
>   To: , 
>   CC: 
>   Subject: [rumpuserxen test] People who touched revisions under test:
> Alice Bob 
> Ian Jackson 
> Carol David 
>   Date: Fri, 3 Jul 2015 06:50:53 +
> 
>   flight 59037 rumpuserxen real [real]
> 
> Fix this by replacing those two near-identical bits of code with calls
> to a single function which slurps the required include file into the
> body text accumulation variable.
> 
> (There is no need to provide a facility for header includes, since
> there is no need for a caller to pass headers through
> sg-report-flight: they can simply be written into the output file
> before running sg-report-flight, as indeed the string `Subject: ' is.
> 
> Despite the fact that --include-begin is used only by cr-daily-branch
> which passes it a file `heading', the text is intended for the start
> of the body, not the email headers.)
> 
> I have run
> 
>   ./sg-report-flight --include-begin=header --include=bodyinc 
> --this-xen=e13013dbf1d5997915548a3b5f1c39594d8c1d7b 
> --that-xen=84066dd4ef4bb5983e246c629a26ef4f3394e5d5 
> --html-dir=$HOME/public_html/d --max-flight=37590 37590
> 
> with some suitable lorem ipsum in bodyinc and header and observed:
> 
> (a) The bug introduced in 3d56a191 is visible in 3c464fbf.
> 
> (b) The output after this patch differs from the output produced by
> 1f0c168d (the previous osstest production commit) only in addition of
> the `Last test of basis' and `Testing same since' information, in the
> appropriate place.
> 
> Deployment note: Because this patch changes only sg-report-flight, it
> is safe to deploy under the feet of a running flight.  I intend to do
> this for all the production branches in the colo.
> 
> Signed-off-by: Ian Jackson 

Acked-by: Ian Campbell 



___
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel


Re: [Xen-devel] [PATCH v2 4/7] xen: get rid of the SEDF scheduler

2015-07-03 Thread Andrew Cooper
On 03/07/15 11:25, Dario Faggioli wrote:
> more specifically, of all the symbols and references
> to it.
>
> Signed-off-by: Dario Faggioli 
> Reviewed-by: George Dunlap 
> ---
> Cc: Andrew Cooper 
>
> Changes from v1:
>  - added markers for removed #defines, to help keep bits
>of the history, and reduce the likelyhood of accidental
>reuse, as requested during review.
> ---
>  docs/misc/xen-command-line.markdown |2 +-
>  xen/common/Makefile |1 -
>  xen/common/schedule.c   |1 -
>  xen/include/public/domctl.h |9 +
>  xen/include/public/trace.h  |2 +-
>  xen/include/xen/sched-if.h  |1 -
>  6 files changed, 3 insertions(+), 13 deletions(-)

Perhaps you wish to include git rm xen/common/sched_sedf.c ?

Reviewed-by: Andrew Cooper 


___
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel


Re: [Xen-devel] [PATCH v2] xen/arm: Find automatically the gnttab region for DOM0

2015-07-03 Thread Ian Campbell
On Thu, 2015-07-02 at 17:50 +0100, Stefano Stabellini wrote:
> On Thu, 2 Jul 2015, Julien Grall wrote:
> > Hi,
> > 
> > Ping?
> > 
> 
> The patch looks very nice.
> 
> Reviewed-by: Stefano Stabellini 

Acked + applied.

Thanks, sorry for the delay, I thought this was already in.

Ian


___
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel


Re: [Xen-devel] [v3 00/13] xen/arm: Add support for GICv2 on GICv3

2015-07-03 Thread Ian Campbell
On Thu, 2015-07-02 at 11:37 +0100, Julien Grall wrote:
> On 01/07/15 12:00, Julien Grall wrote:
> > Hi all,
> 
> Hi Ian,
> 
> > This patch series adds support for GICv2 on GICv3. This feature is available
> > only when the GICv3 hardware is compatible with GICv2.
> > 
> > When it's the case, the same interface is provided in order to use a
> > virtualize GICv2 (i.e GICC and GICV). This will allow us to re-use the
> > same vGIC driver.
> > 
> > Currently GIC and vGIC drivers are tight because of the domain 
> > initialization
> > splitted between GIC and vGIC. This patch series intends to remove this
> > dependency in order to make the vGIC driver agnostic of the GIC driver.
> > 
> > It has been tested on the ARMv8 Foundation Model with GICv2 and GICv3 as
> > well as changing the vGIC version emulated for the guest (only on GICv3 
> > host).
> > 
> > A branch with all the patches can be found here:
> > git://xenbits.xen.org/people/julieng/xen-unstable.git branch 
> > gicv2-on-gicv3-v3
> > 
> > All the patches as been acked except #11 and #12.
> 
> I was wondering if you can apply patch #1-#10 as they are already acked.
> It would avoid me to resend the whole series.

Done.

There was one wrinkle, which is that the message-id's skipped #2, for
some reason. So I have applied
<1435748473-28812-nn-git-send-email-julien.gr...@citrix.com>
for NN==2 (patch 1, due to 00 being NN=1, which is normal)  and
NN=4..13 inclusive, being patches 2..11, acking patch 11.

I don't know how you convinced git send-email to do this, but I only
mention it in such detail so you can check I've applied the right
things...

> If you ack #11, you could even apply #11 and #13 (#12 is independent).

I did not apply #13 since it seemed to depend on #12:
gic-v3.c: In function 'gicv3_restore_state':
gic-v3.c:385:30: error: 'struct ' has no member named 'version'
 if ( v->domain->arch.vgic.version == GIC_V2 )
  ^
gic-v3.c: In function 'gicv3_update_lr':
gic-v3.c:893:36: error: 'struct ' has no member named 'version'
 if ( current->domain->arch.vgic.version == GIC_V3 )
^
make[4]: *** [gic-v3.o] Error 1




> 
> Regards,
> 



___
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel


Re: [Xen-devel] [PATCH 1/2] libxl: turn NUMA placement misconfigs into warnings

2015-07-03 Thread Ian Campbell
On Wed, 2015-07-01 at 15:38 +0100, Ian Jackson wrote:
> Dario Faggioli writes ("[PATCH 1/2] libxl: turn NUMA placement misconfigs 
> into warnings"):
> > instead than errors. More specifically, in libxl,
> > b_info->numa_autoplacement is meant as a way to
> > disable automatic NUMA placement, if one does not
> > want it to happen. It is, however, useful for
> > consistency checking as well, i.e., to ensure that
> > the user provided configuration (such as, for instance,
> > vcpu hard or soft affinity) and NUMA placement itself
> > will not clash.
> 
> Acked-by: Ian Jackson 

Applied both patches with your ack.

> But, be aware that you are making a semantic change to the API which
> cannot be reverted for backwards-compatibility reasons.

Is any further action required due to this?


___
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel


Re: [Xen-devel] [PATCH v2 12/22] elfnotes: intorduce a new PHYS_ENTRY elfnote

2015-07-03 Thread David Vrabel
On 01/07/15 15:46, Roger Pau Monne wrote:
> This new elfnote contains the 32bit entry point into the kernel. Xen will
> use this entry point in order to launch the guest kernel in 32bit protected
> mode with paging disabled.
[...]
> --- a/tools/xcutils/readnotes.c
> +++ b/tools/xcutils/readnotes.c
> @@ -159,6 +159,9 @@ static unsigned print_notes(struct elf_binary *elf, 
> ELF_HANDLE_DECL(elf_note) st
>   case XEN_ELFNOTE_L1_MFN_VALID:
>   print_l1_mfn_valid_note("L1_MFN_VALID", elf , note);
>   break;
> + case XEN_ELFNOTE_PHYS_ENTRY:
> + print_numeric_note("PHYS_ENTRY", elf , note);
> + break;

I assume this is supposed to be XEN_ELFNOTE_PHYS32_ENTRY?  It doesn't
build otherwise.

David

___
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel


Re: [Xen-devel] [PATCH v9 0/8] Support more than 8 vcpus on arm64 with GICv3

2015-07-03 Thread Ian Campbell
On Tue, 2015-06-30 at 16:14 +0100, Ian Campbell wrote:
> On Tue, 2015-06-30 at 16:00 +0800, Chen Baozi wrote:
> > From: Chen Baozi 
> > 
> > Currently the number of vcpus on arm64 with GICv3 is limited up to 8 due
> > to the fixed size of redistributor mmio region. Increasing the size
> > makes the number expand to 16 because of AFF0 restriction on GICv3.
> > To create a guest up to 128 vCPUs, which is the maxium number that GIC-500
> > can support, this patchset uses the AFF1 information to create a mapping
> > relation between vCPUID and vMPIDR and deals with the related issues.
> > 
> > These patches are written based upon Julien's "GICv2 on GICv3 v2" series
> 
> This series is all acked, but is blocked on this one, but I expect it to
> land pretty soon.

It has and I've therefore applied this too. Thanks!

There was some minor contextual conflict in xen/arch/arm/vgic-v*.c
around the addition of the .max_vcpus field to vgic_ops, which I
resolved, but please check I got it right.

> 
> > and the IROUTER emulation cleanup patch.
> 
> What's this one? Is it already in?
> 
> 
> 
> ___
> Xen-devel mailing list
> Xen-devel@lists.xen.org
> http://lists.xen.org/xen-devel



___
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel


Re: [Xen-devel] [PATCH v9 6/8] xen/arm: Set 'reg' of cpu node for dom0 to match MPIDR's affinity

2015-07-03 Thread Ian Campbell
On Tue, 2015-06-30 at 16:00 +0800, Chen Baozi wrote:
> +mpidr_aff = vcpuid_to_vaffinity(cpu);
> +DPRINT("Create cpu@%"PRIx64" (logical CPUID: %d) node\n", mpidr_aff, 
> cpu);
>  
> -snprintf(buf, sizeof(buf), "cpu@%u", cpu);
> +snprintf(buf, sizeof(buf), "cpu@%lx", mpidr_aff);

While committing I got, on arm32:
domain_build.c: In function ‘make_cpus_node’:
domain_build.c:773:9: error: format ‘%lx’ expects argument of type ‘long 
unsigned int’, but argument 4 has type ‘uint64_t’ [-Werror=format]

So I made %lx into %"PRIx64" as in the DPRINT above.

>  res = fdt_begin_node(fdt, buf);
>  if ( res )
>  return res;
> @@ -776,7 +784,7 @@ static int make_cpus_node(const struct domain *d, void 
> *fdt,
>  if ( res )
>  return res;
>  
> -res = fdt_property_cell(fdt, "reg", cpu);
> +res = fdt_property_cell(fdt, "reg", mpidr_aff);
>  if ( res )
>  return res;
>  



___
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel


Re: [Xen-devel] [PATCH xen] stubdom: vtpmmgr: Correctly format size_t with %z when printing.

2015-07-03 Thread Ian Campbell
On Thu, 2015-07-02 at 02:23 +0200, Samuel Thibault wrote:
> Ian Campbell, le Fri 26 Jun 2015 12:06:09 +0100, a écrit :
> > Also contains a fix from Thomas Leonard (to use %u for "4 + 32", not
> > %lu) previously posted as part of "mini-os: enable compiler check for
> > printk format types" but with mini-os now having been split a separate
> > repo most of that change has been applied there.
> > 
> > This fixes the 32-bit build with updated mini-os which includes format
> > string checking.
> > 
> > Signed-off-by: Thomas Leonard 
> > Signed-off-by: Ian Campbell 
> > Cc: Daniel De Graaf 
> > Cc: Stefano Stabellini 
> 
> Acked-By: Samuel Thibault 
> 
> (after the 'z' modifier support is commited, of course)

That happened, so I updated the Config.mk ref and committed, thanks.

Ian.



___
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel


Re: [Xen-devel] [v3 00/13] xen/arm: Add support for GICv2 on GICv3

2015-07-03 Thread Julien Grall
On 03/07/15 11:33, Ian Campbell wrote:
> On Thu, 2015-07-02 at 11:37 +0100, Julien Grall wrote:
>> On 01/07/15 12:00, Julien Grall wrote:
>>> Hi all,
>>
>> Hi Ian,
>>
>>> This patch series adds support for GICv2 on GICv3. This feature is available
>>> only when the GICv3 hardware is compatible with GICv2.
>>>
>>> When it's the case, the same interface is provided in order to use a
>>> virtualize GICv2 (i.e GICC and GICV). This will allow us to re-use the
>>> same vGIC driver.
>>>
>>> Currently GIC and vGIC drivers are tight because of the domain 
>>> initialization
>>> splitted between GIC and vGIC. This patch series intends to remove this
>>> dependency in order to make the vGIC driver agnostic of the GIC driver.
>>>
>>> It has been tested on the ARMv8 Foundation Model with GICv2 and GICv3 as
>>> well as changing the vGIC version emulated for the guest (only on GICv3 
>>> host).
>>>
>>> A branch with all the patches can be found here:
>>> git://xenbits.xen.org/people/julieng/xen-unstable.git branch 
>>> gicv2-on-gicv3-v3
>>>
>>> All the patches as been acked except #11 and #12.
>>
>> I was wondering if you can apply patch #1-#10 as they are already acked.
>> It would avoid me to resend the whole series.
> 
> Done.
> 
> There was one wrinkle, which is that the message-id's skipped #2, for
> some reason. So I have applied
> <1435748473-28812-nn-git-send-email-julien.gr...@citrix.com>
> for NN==2 (patch 1, due to 00 being NN=1, which is normal)  and
> NN=4..13 inclusive, being patches 2..11, acking patch 11.
> 
> I don't know how you convinced git send-email to do this, but I only
> mention it in such detail so you can check I've applied the right
> things...

I usually use git-sent-email *.patch and let him doing the job. Somehow
I got a spurious patch in the directory.

The patches are correctly applied thanks!

> 
>> If you ack #11, you could even apply #11 and #13 (#12 is independent).
> 
> I did not apply #13 since it seemed to depend on #12:
> gic-v3.c: In function 'gicv3_restore_state':
> gic-v3.c:385:30: error: 'struct ' has no member named 'version'
>  if ( v->domain->arch.vgic.version == GIC_V2 )
>   ^
> gic-v3.c: In function 'gicv3_update_lr':
> gic-v3.c:893:36: error: 'struct ' has no member named 'version'
>  if ( current->domain->arch.vgic.version == GIC_V3 )
> ^
> make[4]: *** [gic-v3.o] Error 1

Hmmm I forgot that I was using GIC_V* in this patch. I will address the
comment on #12 and resent the 2 patches.

Regards,

-- 
Julien Grall

___
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel


Re: [Xen-devel] [PATCH v4 6/6] xen: arm: Import of_bus PCI entry from Linux (as a dt_bus entry)

2015-07-03 Thread Ian Campbell
On Fri, 2015-06-26 at 20:08 +0200, Julien Grall wrote:
> Hi Ian,
> 
> On 08/05/2015 13:27, Ian Campbell wrote:
> > This provides specific handlers for the PCI bus relating to matching
> > and translating. It's mostly similar to the defaults but includes some
> > additional error checks and other PCI specific bits.
> 
> I though the previous patch (#5) was enough to handle PCI. May I ask why 
> we need it?

There are some subtle differences in how the generic code vs. the pci
specific code here will handle buggy DTs (i.e. #*-cells which are not as
required by the pci bindings). This will mean we tolerate such device
trees better.

I say "buggy", but actually it's not clear to me from reading "PCI Bus
Binding to Open Firmware" that when the device_type is "pci" that
#*-cells shouldn't be assumed to have the values given in that text,
e.g. the text says "The value of "#address-cells" for PCI Bus Nodes is
3." and not "A PCI Bus Node must contain a #address-cells property
containing 3". Maybe that interpretation is bogus, but with this patch
we are are able to cope with DTs written by people who do read it like
that.

FWIW it also gets us the ability to parse the flags (cacheability),
although at the moment we only check them for validity rather than use
them.

> > Functions/types renamed and reindented (because apparently we do
> > that for these).
> 
> My mistake, when I first port the functions from Linux I changed the 
> name and the coding style to match the existent functions in 
> xen/common/device_tree.c
> 
> All the functions to work directly on the DT blob have been moved in a 
> separate file (arch/arm/bootfdt.c), so this file is mostly Linux code. 
> I'm thinking to resync it correctly for Xen 4.7.

That sounds good, thanks.

> 
> > Needs a selection of IORESOURCE_* defines, which I've taken from Linux
> > and have included locally for now until we figure out where else they
> > might be needed.
> 
> Regards,
> 



___
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel


Re: [Xen-devel] [PATCH v2 12/22] elfnotes: intorduce a new PHYS_ENTRY elfnote

2015-07-03 Thread Roger Pau Monné
El 03/07/15 a les 12.36, David Vrabel ha escrit:
> On 01/07/15 15:46, Roger Pau Monne wrote:
>> This new elfnote contains the 32bit entry point into the kernel. Xen will
>> use this entry point in order to launch the guest kernel in 32bit protected
>> mode with paging disabled.
> [...]
>> --- a/tools/xcutils/readnotes.c
>> +++ b/tools/xcutils/readnotes.c
>> @@ -159,6 +159,9 @@ static unsigned print_notes(struct elf_binary *elf, 
>> ELF_HANDLE_DECL(elf_note) st
>>  case XEN_ELFNOTE_L1_MFN_VALID:
>>  print_l1_mfn_valid_note("L1_MFN_VALID", elf , note);
>>  break;
>> +case XEN_ELFNOTE_PHYS_ENTRY:
>> +print_numeric_note("PHYS_ENTRY", elf , note);
>> +break;
> 
> I assume this is supposed to be XEN_ELFNOTE_PHYS32_ENTRY?  It doesn't
> build otherwise.

Yes, I've realized about this error yesterday. Not sure why I didn't
catch it my test build, I think NFS was playing dirty tricks behind me...

Anyway, I will send an updated version today with this fixed.

Roger.


___
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel


Re: [Xen-devel] [PATCH v4 6/6] xen: arm: Import of_bus PCI entry from Linux (as a dt_bus entry)

2015-07-03 Thread Ian Campbell
On Fri, 2015-07-03 at 11:47 +0100, Ian Campbell wrote:
> On Fri, 2015-06-26 at 20:08 +0200, Julien Grall wrote:
> > Hi Ian,
> > 
> > On 08/05/2015 13:27, Ian Campbell wrote:
> > > This provides specific handlers for the PCI bus relating to matching
> > > and translating. It's mostly similar to the defaults but includes some
> > > additional error checks and other PCI specific bits.
> > 
> > I though the previous patch (#5) was enough to handle PCI. May I ask why 
> > we need it?
> 
> There are some subtle differences in how the generic code vs. the pci
> specific code here will handle buggy DTs (i.e. #*-cells which are not as
> required by the pci bindings). This will mean we tolerate such device
> trees better.
> 
> I say "buggy", but actually it's not clear to me from reading "PCI Bus
> Binding to Open Firmware" that when the device_type is "pci" that
> #*-cells shouldn't be assumed to have the values given in that text,
> e.g. the text says "The value of "#address-cells" for PCI Bus Nodes is
> 3." and not "A PCI Bus Node must contain a #address-cells property
> containing 3". Maybe that interpretation is bogus, but with this patch
> we are are able to cope with DTs written by people who do read it like
> that.
> 
> FWIW it also gets us the ability to parse the flags (cacheability),
> although at the moment we only check them for validity rather than use
> them.

I've pasted a slightly adjusted version of this into the commit message
for v5.
> 
> > > Functions/types renamed and reindented (because apparently we do
> > > that for these).
> > 
> > My mistake, when I first port the functions from Linux I changed the 
> > name and the coding style to match the existent functions in 
> > xen/common/device_tree.c
> > 
> > All the functions to work directly on the DT blob have been moved in a 
> > separate file (arch/arm/bootfdt.c), so this file is mostly Linux code. 
> > I'm thinking to resync it correctly for Xen 4.7.
> 
> That sounds good, thanks.
> 
> > 
> > > Needs a selection of IORESOURCE_* defines, which I've taken from Linux
> > > and have included locally for now until we figure out where else they
> > > might be needed.
> > 
> > Regards,
> > 
> 
> 
> 
> ___
> Xen-devel mailing list
> Xen-devel@lists.xen.org
> http://lists.xen.org/xen-devel



___
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel


Re: [Xen-devel] [PATCH v4 5/6] xen: arm: map child MMIO and IRQs to dom0 for PCI bus DT nodes.

2015-07-03 Thread Ian Campbell
On Fri, 2015-06-26 at 19:56 +0200, Julien Grall wrote:
> Hi Ian,
> 
> NIT in the title: The final point is not necessary
> 
> On 08/05/2015 13:26, Ian Campbell wrote:
> > +static int map_device_children(struct domain *d,
> > +   const struct dt_device_node *dev)
> > +{
> > +bool_t need_mapping = !dt_device_for_passthrough(dev);
> > +int ret;
> > +
> > +if ( dt_device_type_is_equal(dev, "pci") )
> > +{
> > +DPRINT("Mapping children of %s to guest\n", 
> > dt_node_full_name(dev));
> > +
> > +/*
> > + * We need to handle IRQs even if !need_mapping in order to
> > + * setup the domain's permissions on the device's IRQs, such
> > + * that it can pass them through to other domains.
> > + */
> > + ret = dt_for_each_irq_map(dev, &map_interrupt_to_domain, d);
> > + if ( ret < 0 )
> > + return ret;
> > +
> > + if ( need_mapping )
> > + {
> 
> I forgot to mention in the previous version that we need to give iomem 
> permission to the guest. Otherwise DOM0 won't be able to map the BAR 
> into the guest.

This boils down to a call to iomem_permit_access in the
map_range_to_domain callback and moving the need_mapping check down into
the cb surrouding only the map_mmio_region call but not the
permis_access one, right?



___
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel


[Xen-devel] [OSSTEST PATCH] mg-update-live: New script

2015-07-03 Thread Ian Jackson
This is for deploying an emergency update under the feet of all
running tests.

Signed-off-by: Ian Jackson 
---
 mg-update-live |   46 ++
 1 file changed, 46 insertions(+)
 create mode 100755 mg-update-live

diff --git a/mg-update-live b/mg-update-live
new file mode 100755
index 000..f1d24cd
--- /dev/null
+++ b/mg-update-live
@@ -0,0 +1,46 @@
+#!/bin/bash
+#
+# for updating live trees from a bad commit
+
+# This is part of "osstest", an automated testing framework for Xen.
+# Copyright (C) 2009-2013 Citrix Inc.
+# 
+# This program is free software: you can redistribute it and/or modify
+# it under the terms of the GNU Affero General Public License as published by
+# the Free Software Foundation, either version 3 of the License, or
+# (at your option) any later version.
+# 
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+# GNU Affero General Public License for more details.
+# 
+# You should have received a copy of the GNU Affero General Public License
+# along with this program.  If not, see .
+
+# usage is something like:
+#  cd ~osstest
+#  for f in branches/*.git; do ./update-live 
3c464fbf8a05b24f4afb7e58bcf4ae77fbb7ad0c $f; done
+
+set -e
+bad="$1"
+dir="$2"
+
+case "$dir" in
+branches/for-*.git) ;;
+bisects/for-*.git) ;;
+*) echo >&2 'bad dir'; exit 1;;
+esac
+
+cd $dir
+
+head="`git rev-parse HEAD~0`"
+
+if [ "x$head" != "x$bad" ]; then
+   echo ok
+   exit 0
+fi
+
+git fetch /home/osstest/testing.git production
+
+git merge --ff-only FETCH_HEAD
-- 
1.7.10.4


___
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel


Re: [Xen-devel] [OSSTEST PATCH] mg-update-live: New script

2015-07-03 Thread Ian Jackson
Ian Jackson writes ("[OSSTEST PATCH] mg-update-live: New script"):
> This is for deploying an emergency update under the feet of all
> running tests.

FYI, I actually ran a slightly earlier version of this script so I
think we shouldn't see any more broken emails.  About a dozen trees
were updated.

Ian.

___
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel


Re: [Xen-devel] [PATCH 1/2] libxl: turn NUMA placement misconfigs into warnings

2015-07-03 Thread Ian Jackson
Ian Campbell writes ("Re: [PATCH 1/2] libxl: turn NUMA placement misconfigs 
into warnings"):
> On Wed, 2015-07-01 at 15:38 +0100, Ian Jackson wrote:
> > Acked-by: Ian Jackson 
> 
> Applied both patches with your ack.

Right.

> > But, be aware that you are making a semantic change to the API which
> > cannot be reverted for backwards-compatibility reasons.
> 
> Is any further action required due to this?

Not if it doesn't cause you or Dario to change your mind about the
patch :-).

Thanks,
Ian.

___
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel


Re: [Xen-devel] [PATCH] xl: Change output from xl -N create to be more useful

2015-07-03 Thread Ian Jackson
Ian Jackson writes ("[PATCH] xl: Change output from xl -N create to be more 
useful"):
> Note that this change is NOT BACKWARDS COMPATIBLE.  But it would only
> adversely affects anyone who uses `xl -N create' and then saves and
> processes the JSON.  (The output from xl list et al is not changed; it
> normally needs the domid.)  Such a user should probably have already
> have complained about the infelicitous output.  If they haven't it
> would be simple enough for them to bookend the output so as to provide
> compatible output.

This was discussed and everyone was content with this implication of
the patch as-is.

Would anyone care to give it a formal ack ?

Thanks,
Ian.

___
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel


Re: [Xen-devel] [PATCH OSSTEST v3] mg-all-branch-statuses: Show how up to date each branch is

2015-07-03 Thread Ian Campbell
On Thu, 2015-07-02 at 17:30 +0100, Ian Jackson wrote:

> > +printf "%-28s %-8s %-8s %-9s %-10s %-10s\n" \
> > +   "Branch" "Basis" "Tip" "#Tip #Tot" "1stTip" "1stNew"
> > +
> > +for branch in $@; do
> > +basis=`./ap-fetch-version-old $branch 2>/dev/null || true`
> > +tip=`./ap-fetch-version $branch 2>/dev/null || true`
> 
> This is quite fault-oblivious, isn't it.  Oh well.

Yes, the problem is that for branches with no baseline:
$ ./ap-fetch-version-old linux-next ; echo $?
HEAD is now at 705bb44... fix
fatal: Couldn't find remote ref tested/linux-next
128
$

And for osstest (where the tip may not be available unless you are
osstest@osstest);
./ap-fetch-version osstest ; echo $?
HEAD is now at 705bb44... fix
fatal: Couldn't find remote ref pretest
fatal: The remote end hung up unexpectedly
128
$

In the latter case I print "Error!" (I could do it here instead of
later, I just noticed).

Not sure what to do about the former. In both cases this obviously
conflates actual failures with expected failures. I'm not sure how to
distinguish. Perhaps I could special case baselineless trees
(linux-next) in ap-fetch-version-old/ap-common and special case osstest
here as the only tree which might plausibly have an unavailable tip?

Ian.


___
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel


Re: [Xen-devel] [PATCH] libxl: Increase device model startup timeout to 1min.

2015-07-03 Thread Anthony PERARD
On Thu, Jul 02, 2015 at 01:38:37PM +0100, Ian Jackson wrote:
> Anthony PERARD writes ("Re: [PATCH] libxl: Increase device model startup 
> timeout to 1min."):
> > I have tested an increase timeout this night. And here are the result.
> > 
> > The machine is a AMD Opteron(tm) Processor 4284, with 8G of RAM and 8 pCPU.
> > It's running Ubuntu 14.04, with Xen 4.4. On top of that, OpenStack have
> > been deployed via devstack on a single.
> > 
> > The test is to run Tempest with --concurrency=4. There are 4 tests runned
> > in parallel, but they don't necessarly start a VM. When they do, it's a PV
> > with 64MB and 1 vCPU and sometime with double amount of RAM.
> > 
> > The stats:
> >   Tempest run: 22
> >   Tempest run time for each run: ~3000s
> >   Tempest number of test: 1143
> > after 22 run of tempest:
> >   QEMU start: 3352
> >   number of run that took more than 2s: 20
> >   number of run that took more than 9s: 6
> >   maximum start time: 10.973713s
> > 
> > I have gathered the QEMU start time by having strace running for each of
> > them. I have then look at the time it took from the first syscall
> > execve('qemu') until the syscall where QEMU respond on its QMP socket
> > (libxl have acknoledge that QEMU is running at that time).
> 
> Thanks for this information.
> 
> So from what you say it appears that we are running at most 4 copies
> of libxl and qemu in parallel, along with at most 4 VMs ?

Some test do run 3 VM, so at most it would be 12 VM. I think that still
only one copy of libxl since everythings goes through libvirt, right?

> And out of 3352 qemu starts, we have
>   <= 2s   3332
>   >2s <= 9s 14
>   > 9s   6
> ?
> 
> Do you have any information about the maximum system load in general ?
> dom0 load, vcpu overcommit, etc. ?  Do you know what the guests are
> doing ?

I've got some stat collected via `dstat`.
During the tests, the load average can go from 5 to 8 in dom0.
The CPUs in dom0 can spend quite a lot of time waiting, it's not rare to
see beetween 35 and 60% of time waiting (total of all 8 cpu). As for the
disk, dstat reveal that there is often between 50M and 120M per second of
total disk write.

The guests usully does not do much, beside booting. It run a small system
call CirrOS.

> I'm starting to think that this might be a real bug but that the bug
> might be "Linux's I/O subsystem sometimes produces appalling latency
> under load" (which is hardly news).

I guess the straces support this, here are few quote from different strace:
04:11:50.602067 access("/etc/ld.so.nohwcap", F_OK) = -1 ENOENT (No such file or 
directory) <0.36>
04:11:50.602166 open("/usr/lib/x86_64-linux-gnu/libidn.so.11", 
O_RDONLY|O_CLOEXEC) = 3 <0.39>
04:11:50.602263 read(3, 
"\177ELF\2\1\1\0\0\0\0\0\0\0\0\0\3\0>\0\1\0\0\0\300+\0\0\0\0\0\0"..., 832) = 
832 <0.35>
04:11:50.602359 fstat(3, {st_mode=S_IFREG|0644, st_size=207128, ...}) = 0 
<0.33>
04:11:50.602453 mmap(NULL, 2302208, PROT_READ|PROT_EXEC, 
MAP_PRIVATE|MAP_DENYWRITE, 3, 0) = 0x7f845b9f8000 <0.36>
04:11:50.602546 mprotect(0x7f845ba29000, 2097152, PROT_NONE) = 0 <0.37>
04:11:50.602639 mmap(0x7f845bc29000, 8192, PROT_READ|PROT_WRITE, 
MAP_PRIVATE|MAP_FIXED|MAP_DENYWRITE, 3, 0x31000) = 0x7f845bc29000 <0.38>
04:11:51.257654 close(3)= 0 <0.42>
04:11:51.257859 access("/etc/ld.so.nohwcap", F_OK) = -1 ENOENT (No such file or 
directory) <0.78>

18:08:37.635570 open("/usr/lib/x86_64-linux-gnu/sasl2/libcrammd5.so", 
O_RDONLY|O_CLOEXEC) = 28 <0.50>
18:08:37.635681 read(28, 
"\177ELF\2\1\1\0\0\0\0\0\0\0\0\0\3\0>\0\1\0\0\0\260\20\0\0\0\0\0\0"..., 832) = 
832 <1.011536>
18:08:38.647329 fstat(28, {st_mode=S_IFREG|0644, st_size=22592, ...}) = 0 
<0.42>
18:08:38.647499 mmap(NULL, 2117872, PROT_READ|PROT_EXEC, 
MAP_PRIVATE|MAP_DENYWRITE, 28, 0) = 0x7f6c29128000 <0.48>
18:08:38.647613 mprotect(0x7f6c2912c000, 2097152, PROT_NONE) = 0 <0.49>
18:08:38.647721 mmap(0x7f6c2932c000, 8192, PROT_READ|PROT_WRITE, 
MAP_PRIVATE|MAP_FIXED|MAP_DENYWRITE, 28, 0x4000) = 0x7f6c2932c000 <0.43>
18:08:38.647862 close(28)   = 0 <0.35>

The first quote is a pattern I'm seeing very often on slow dm start, where
it take a long time between the mmap and the next syscall. On the second
quote, read() is to blame, it took 1s.

I guess even the first quote imply there is going to be I/O after the mmap
call, isn't it?

-- 
Anthony PERARD

___
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel


Re: [Xen-devel] [OSSTEST PATCH 4/4] ts-logs-capture: Run xenctx earlier

2015-07-03 Thread Ian Jackson
Ian Campbell writes ("Re: [OSSTEST PATCH 4/4] ts-logs-capture: Run xenctx 
earlier"):
> At first I wondered if before and after might be useful, but I don't
> think the unstuck state would be useful. However two (or more)
> back-to-back ctxt's can often be useful, by giving a snapshot of the
> loop the guest is stuck.

Good idea.  I will respin.

Ian.

___
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel


Re: [Xen-devel] [PATCH v4 6/6] xen: arm: Import of_bus PCI entry from Linux (as a dt_bus entry)

2015-07-03 Thread Julien Grall
On 03/07/15 11:56, Ian Campbell wrote:
> On Fri, 2015-07-03 at 11:47 +0100, Ian Campbell wrote:
>> On Fri, 2015-06-26 at 20:08 +0200, Julien Grall wrote:
>>> Hi Ian,
>>>
>>> On 08/05/2015 13:27, Ian Campbell wrote:
 This provides specific handlers for the PCI bus relating to matching
 and translating. It's mostly similar to the defaults but includes some
 additional error checks and other PCI specific bits.
>>>
>>> I though the previous patch (#5) was enough to handle PCI. May I ask why 
>>> we need it?
>>
>> There are some subtle differences in how the generic code vs. the pci
>> specific code here will handle buggy DTs (i.e. #*-cells which are not as
>> required by the pci bindings). This will mean we tolerate such device
>> trees better.
>>
>> I say "buggy", but actually it's not clear to me from reading "PCI Bus
>> Binding to Open Firmware" that when the device_type is "pci" that
>> #*-cells shouldn't be assumed to have the values given in that text,
>> e.g. the text says "The value of "#address-cells" for PCI Bus Nodes is
>> 3." and not "A PCI Bus Node must contain a #address-cells property
>> containing 3". Maybe that interpretation is bogus, but with this patch
>> we are are able to cope with DTs written by people who do read it like
>> that.

If the #address-cells and #size-cells are not correct that will likely
means that the property "reg" in the PCI node would be misinterpreted by
Xen.

I think it's here to cope with DT when #*-cells are not specified. The
spec doesn't say if the properties should be present or not.

>> FWIW it also gets us the ability to parse the flags (cacheability),
>> although at the moment we only check them for validity rather than use
>> them.

Good point.

> I've pasted a slightly adjusted version of this into the commit message
> for v5.

Thank you!

Regards,

-- 
Julien Grall

___
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel


Re: [Xen-devel] [PATCH] xl: Change output from xl -N create to be more useful

2015-07-03 Thread Ian Campbell
On Fri, 2015-06-26 at 15:29 +0100, Ian Jackson wrote:
> Currently, xl -N create produces:
> 
> {
> "domid": null,
> "config": {
> "c_info": {
> "type": "pv",
>  [etc]
> }
> 
> The domid is always NULL (as the domain has not been created at this
> stage).
> 
> This is annoying if you want to take this output and use it for some
> actually useful purpose like domain creation: either it needs to be
> massaged, or the the consuming tool needs to be taught to look inside
> the json object for the `config' element (which IMO makes no sense as
> an interface).
> 
> We would like to be able to pass libxl json configs around sensibly.
> In the future maybe xl will grow an option to create a domain from a
> json config, and this is currently something I want to be able to have
> a test tool do.
> 
> Note that this change is NOT BACKWARDS COMPATIBLE.  But it would only
> adversely affects anyone who uses `xl -N create' and then saves and
> processes the JSON.  (The output from xl list et al is not changed; it
> normally needs the domid.)  Such a user should probably have already
> have complained about the infelicitous output.  If they haven't it
> would be simple enough for them to bookend the output so as to provide
> compatible output.
> 
> If this backward compatibility problem is considered a blocker for
> this patch, then I will respin, with one of the following two
> workarounds:
>   - A new option to force sane output
>   - Generate output which contains the domain config twice,
> once directly in the main struct, and a copy in "config"
> 
> Signed-off-by: Ian Jackson 
> CC: Ian Campbell 
> CC: Wei Liu 
> CC: Euan Harris 
> ---
>  tools/libxl/xl_cmdimpl.c |   17 ++---
>  1 file changed, 14 insertions(+), 3 deletions(-)
> 
> diff --git a/tools/libxl/xl_cmdimpl.c b/tools/libxl/xl_cmdimpl.c
> index c858068..9e9ee5e 100644
> --- a/tools/libxl/xl_cmdimpl.c
> +++ b/tools/libxl/xl_cmdimpl.c
> @@ -2687,9 +2687,20 @@ static uint32_t create_domain(struct domain_create 
> *dom_info)
>  }
>  }
>  
> -if (debug || dom_info->dryrun)
> -printf_info(default_output_format, -1, &d_config,
> -debug ? stderr : stdout);
> +if (debug || dom_info->dryrun) {
> +FILE *cfg_print_fh = debug ? stderr : stdout;

Did you mean to use this instead of the hardcoded stdout below?

Otherwise the debug output's location differs depending on the format,
which seems unexpected.

> +if (default_output_format == OUTPUT_FORMAT_SXP) {
> +printf_info_sexp(-1, &d_config, cfg_print_fh);
> +} else {
> +char *json = libxl_domain_config_to_json(ctx, &d_config);
> +fputs(json, stdout);
> +free(json);
> +if (ferror(stdout) || fflush(stdout)) {
> +perror("stdout"); exit(-1);
> +}
> +}
> +}
> +
>  
>  ret = 0;
>  if (dom_info->dryrun)



___
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel


Re: [Xen-devel] [PATCH OSSTEST v3] mg-all-branch-statuses: Show how up to date each branch is

2015-07-03 Thread Ian Jackson
Ian Campbell writes ("Re: [PATCH OSSTEST v3] mg-all-branch-statuses: Show how 
up to date each branch is"):
> On Thu, 2015-07-02 at 17:30 +0100, Ian Jackson wrote:
> > This is quite fault-oblivious, isn't it.  Oh well.
> 
> Yes, the problem is that for branches with no baseline:
> $ ./ap-fetch-version-old linux-next ; echo $?
> HEAD is now at 705bb44... fix
> fatal: Couldn't find remote ref tested/linux-next
> 128
> $
> 
> And for osstest (where the tip may not be available unless you are
> osstest@osstest);
> ./ap-fetch-version osstest ; echo $?
> HEAD is now at 705bb44... fix
> fatal: Couldn't find remote ref pretest
> fatal: The remote end hung up unexpectedly
> 128
> $

Right.  There's not really anything at that layer that knows to say
"no" rather than "aargh".

> In the latter case I print "Error!" (I could do it here instead of
> later, I just noticed).
> 
> Not sure what to do about the former. In both cases this obviously
> conflates actual failures with expected failures. I'm not sure how to
> distinguish. Perhaps I could special case baselineless trees
> (linux-next) in ap-fetch-version-old/ap-common and special case osstest
> here as the only tree which might plausibly have an unavailable tip?

I think that is too big a yak.

Ian.

___
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel


Re: [Xen-devel] [PATCH v4 5/6] xen: arm: map child MMIO and IRQs to dom0 for PCI bus DT nodes.

2015-07-03 Thread Julien Grall
Hi Ian,

On 03/07/15 11:59, Ian Campbell wrote:
> On Fri, 2015-06-26 at 19:56 +0200, Julien Grall wrote:
>> I forgot to mention in the previous version that we need to give iomem 
>> permission to the guest. Otherwise DOM0 won't be able to map the BAR 
>> into the guest.
> 
> This boils down to a call to iomem_permit_access in the
> map_range_to_domain callback and moving the need_mapping check down into
> the cb surrouding only the map_mmio_region call but not the
> permis_access one, right?

Correct.

Regards,

-- 
Julien Grall

___
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel


Re: [Xen-devel] [PATCH] libxl: Increase device model startup timeout to 1min.

2015-07-03 Thread Ian Jackson
Anthony PERARD writes ("Re: [PATCH] libxl: Increase device model startup 
timeout to 1min."):
> On Thu, Jul 02, 2015 at 01:38:37PM +0100, Ian Jackson wrote:
> > I'm starting to think that this might be a real bug but that the bug
> > might be "Linux's I/O subsystem sometimes produces appalling latency
> > under load" (which is hardly news).
> 
> I guess the straces support this, here are few quote from different strace:
...
> 04:11:50.602639 mmap(0x7f845bc29000, 8192, PROT_READ|PROT_WRITE, 
> MAP_PRIVATE|MAP_FIXED|MAP_DENYWRITE, 3, 0x31000) = 0x7f845bc29000 <0.38>
> 04:11:51.257654 close(3)= 0 <0.42>
...
> The first quote is a pattern I'm seeing very often on slow dm start, where
> it take a long time between the mmap and the next syscall. On the second
> quote, read() is to blame, it took 1s.
> 
> I guess even the first quote imply there is going to be I/O after the mmap
> call, isn't it?

It's very likely, yes.  The code after mmap will probably start
reading the pages just mapped.


Thanks for this investigation.

I am now convinced that this is indeed the bug "Linux's I/O subsystem
sometimes produces appalling latency under load".  That bug has
existed for at least a decade and seems unlikely to be fixed any time
soon.  Certainly, fixing it is beyond our scope.

So papering over this with an increase in the timeout is probably
proper.  I'm tempted to suggest increasing the timeout only on Linux.

Ian.

___
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel


Re: [Xen-devel] [PATCH] xl: Change output from xl -N create to be more useful

2015-07-03 Thread Ian Jackson
Ian Campbell writes ("Re: [PATCH] xl: Change output from xl -N create to be 
more useful"):
> On Fri, 2015-06-26 at 15:29 +0100, Ian Jackson wrote:
...
> > -if (debug || dom_info->dryrun)
> > -printf_info(default_output_format, -1, &d_config,
> > -debug ? stderr : stdout);
> > +if (debug || dom_info->dryrun) {
> > +FILE *cfg_print_fh = debug ? stderr : stdout;
> 
> Did you mean to use this instead of the hardcoded stdout below?
> 
> Otherwise the debug output's location differs depending on the format,
> which seems unexpected.

This is indeed wrong.  Well spotted.

Ian.

___
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel


Re: [Xen-devel] [PATCH v4 6/6] xen: arm: Import of_bus PCI entry from Linux (as a dt_bus entry)

2015-07-03 Thread Ian Campbell
On Fri, 2015-07-03 at 12:24 +0100, Julien Grall wrote:
> On 03/07/15 11:56, Ian Campbell wrote:
> > On Fri, 2015-07-03 at 11:47 +0100, Ian Campbell wrote:
> >> On Fri, 2015-06-26 at 20:08 +0200, Julien Grall wrote:
> >>> Hi Ian,
> >>>
> >>> On 08/05/2015 13:27, Ian Campbell wrote:
>  This provides specific handlers for the PCI bus relating to matching
>  and translating. It's mostly similar to the defaults but includes some
>  additional error checks and other PCI specific bits.
> >>>
> >>> I though the previous patch (#5) was enough to handle PCI. May I ask why 
> >>> we need it?
> >>
> >> There are some subtle differences in how the generic code vs. the pci
> >> specific code here will handle buggy DTs (i.e. #*-cells which are not as
> >> required by the pci bindings). This will mean we tolerate such device
> >> trees better.
> >>
> >> I say "buggy", but actually it's not clear to me from reading "PCI Bus
> >> Binding to Open Firmware" that when the device_type is "pci" that
> >> #*-cells shouldn't be assumed to have the values given in that text,
> >> e.g. the text says "The value of "#address-cells" for PCI Bus Nodes is
> >> 3." and not "A PCI Bus Node must contain a #address-cells property
> >> containing 3". Maybe that interpretation is bogus, but with this patch
> >> we are are able to cope with DTs written by people who do read it like
> >> that.
> 
> If the #address-cells and #size-cells are not correct that will likely
> means that the property "reg" in the PCI node would be misinterpreted by
> Xen.

Right, everything falls apart in that case anyway, unless the #*-cells
properties are inconsistent with a regs which correctly follows the
spec, but that's the most unlikely case I think.

> I think it's here to cope with DT when #*-cells are not specified. The
> spec doesn't say if the properties should be present or not.

Right.



___
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel


[Xen-devel] [PATCH v3 07/32] xen/x86: fix arch_set_info_guest for HVM guests

2015-07-03 Thread Roger Pau Monne
Add checks for ignored vcpu fields in HVM mode. HVM vCPUs (BSP and APs) are
always started in 32bit protected mode with paging disabled.

Signed-off-by: Roger Pau Monné 
Cc: Jan Beulich 
Cc: Andrew Cooper 
---
 xen/arch/x86/domain.c | 14 +++---
 1 file changed, 11 insertions(+), 3 deletions(-)

diff --git a/xen/arch/x86/domain.c b/xen/arch/x86/domain.c
index a8fe046..a112953 100644
--- a/xen/arch/x86/domain.c
+++ b/xen/arch/x86/domain.c
@@ -795,6 +795,15 @@ int arch_set_info_guest(
   c.nat->fs_base || c.nat->gs_base_user)) )
 return -EINVAL;
 }
+else if ( is_hvm_domain(d) )
+{
+if ( c(ctrlreg[0]) || c(ctrlreg[1]) || c(ctrlreg[2]) ||
+ c(ctrlreg[3]) || c(ctrlreg[4]) || c(ctrlreg[5]) ||
+ c(ctrlreg[6]) || c(ctrlreg[7]) || c(ldt_base) ||
+ c(ldt_ents) || c(kernel_ss) || c(kernel_sp) ||
+ c(gdt_ents) )
+return -EINVAL;
+}
 
 v->fpu_initialised = !!(flags & VGCF_I387_VALID);
 
@@ -1064,15 +1073,14 @@ int arch_set_info_guest(
 if ( v->vcpu_id == 0 )
 update_domain_wallclock_time(d);
 
-/* Don't redo final setup */
-v->is_initialised = 1;
-
 if ( paging_mode_enabled(d) )
 paging_update_paging_modes(v);
 
 update_cr3(v);
 
  out:
+/* Don't redo final setup */
+v->is_initialised = 1;
 if ( flags & VGCF_online )
 clear_bit(_VPF_down, &v->pause_flags);
 else
-- 
1.9.5 (Apple Git-50.3)


___
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel


[Xen-devel] [PATCH v3 01/32] libxc: split x86 HVM setup_guest into smaller logical functions

2015-07-03 Thread Roger Pau Monne
This is just a preparatory change to clean up the code in setup_guest.
Should not introduce any functional changes.

Signed-off-by: Roger Pau Monné 
Cc: Ian Jackson 
Cc: Stefano Stabellini 
Cc: Ian Campbell 
Cc: Wei Liu 
---
 tools/libxc/xc_hvm_build_x86.c | 198 -
 1 file changed, 117 insertions(+), 81 deletions(-)

diff --git a/tools/libxc/xc_hvm_build_x86.c b/tools/libxc/xc_hvm_build_x86.c
index 003ea06..f7616a8 100644
--- a/tools/libxc/xc_hvm_build_x86.c
+++ b/tools/libxc/xc_hvm_build_x86.c
@@ -232,28 +232,20 @@ static int check_mmio_hole(uint64_t start, uint64_t 
memsize,
 return 1;
 }
 
-static int setup_guest(xc_interface *xch,
-   uint32_t dom, struct xc_hvm_build_args *args,
-   char *image, unsigned long image_size)
+static int xc_hvm_populate_memory(xc_interface *xch, uint32_t dom,
+  struct xc_hvm_build_args *args,
+  xen_pfn_t *page_array)
 {
-xen_pfn_t *page_array = NULL;
 unsigned long i, vmemid, nr_pages = args->mem_size >> PAGE_SHIFT;
 unsigned long p2m_size;
 unsigned long target_pages = args->mem_target >> PAGE_SHIFT;
-unsigned long entry_eip, cur_pages, cur_pfn;
-void *hvm_info_page;
-uint32_t *ident_pt;
-struct elf_binary elf;
-uint64_t v_start, v_end;
-uint64_t m_start = 0, m_end = 0;
+unsigned long cur_pages, cur_pfn;
 int rc;
 xen_capabilities_info_t caps;
 unsigned long stat_normal_pages = 0, stat_2mb_pages = 0, 
 stat_1gb_pages = 0;
 unsigned int memflags = 0;
 int claim_enabled = args->claim_enabled;
-xen_pfn_t special_array[NR_SPECIAL_PAGES];
-xen_pfn_t ioreq_server_array[NR_IOREQ_SERVER_PAGES];
 uint64_t total_pages;
 xen_vmemrange_t dummy_vmemrange[2];
 unsigned int dummy_vnode_to_pnode[1];
@@ -261,19 +253,6 @@ static int setup_guest(xc_interface *xch,
 unsigned int *vnode_to_pnode;
 unsigned int nr_vmemranges, nr_vnodes;
 
-memset(&elf, 0, sizeof(elf));
-if ( elf_init(&elf, image, image_size) != 0 )
-{
-PERROR("Could not initialise ELF image");
-goto error_out;
-}
-
-xc_elf_set_logfile(xch, &elf, 1);
-
-elf_parse_binary(&elf);
-v_start = 0;
-v_end = args->mem_size;
-
 if ( nr_pages > target_pages )
 memflags |= XENMEMF_populate_on_demand;
 
@@ -346,24 +325,6 @@ static int setup_guest(xc_interface *xch,
 goto error_out;
 }
 
-if ( modules_init(args, v_end, &elf, &m_start, &m_end) != 0 )
-{
-ERROR("Insufficient space to load modules.");
-goto error_out;
-}
-
-DPRINTF("VIRTUAL MEMORY ARRANGEMENT:\n");
-DPRINTF("  Loader:   %016"PRIx64"->%016"PRIx64"\n", elf.pstart, elf.pend);
-DPRINTF("  Modules:  %016"PRIx64"->%016"PRIx64"\n", m_start, m_end);
-DPRINTF("  TOTAL:%016"PRIx64"->%016"PRIx64"\n", v_start, v_end);
-DPRINTF("  ENTRY:%016"PRIx64"\n", elf_uval(&elf, elf.ehdr, e_entry));
-
-if ( (page_array = malloc(p2m_size * sizeof(xen_pfn_t))) == NULL )
-{
-PERROR("Could not allocate memory.");
-goto error_out;
-}
-
 for ( i = 0; i < p2m_size; i++ )
 page_array[i] = ((xen_pfn_t)-1);
 for ( vmemid = 0; vmemid < nr_vmemranges; vmemid++ )
@@ -563,7 +524,54 @@ static int setup_guest(xc_interface *xch,
 DPRINTF("  4KB PAGES: 0x%016lx\n", stat_normal_pages);
 DPRINTF("  2MB PAGES: 0x%016lx\n", stat_2mb_pages);
 DPRINTF("  1GB PAGES: 0x%016lx\n", stat_1gb_pages);
-
+
+rc = 0;
+goto out;
+ error_out:
+rc = -1;
+ out:
+
+/* ensure no unclaimed pages are left unused */
+xc_domain_claim_pages(xch, dom, 0 /* cancels the claim */);
+
+return rc;
+}
+
+static int xc_hvm_load_image(xc_interface *xch,
+   uint32_t dom, struct xc_hvm_build_args *args,
+   xen_pfn_t *page_array)
+{
+unsigned long entry_eip, image_size;
+struct elf_binary elf;
+uint64_t v_start, v_end;
+uint64_t m_start = 0, m_end = 0;
+char *image;
+int rc;
+
+image = xc_read_image(xch, args->image_file_name, &image_size);
+if ( image == NULL )
+return -1;
+
+memset(&elf, 0, sizeof(elf));
+if ( elf_init(&elf, image, image_size) != 0 )
+goto error_out;
+
+xc_elf_set_logfile(xch, &elf, 1);
+
+elf_parse_binary(&elf);
+v_start = 0;
+v_end = args->mem_size;
+
+if ( modules_init(args, v_end, &elf, &m_start, &m_end) != 0 )
+{
+ERROR("Insufficient space to load modules.");
+goto error_out;
+}
+
+DPRINTF("VIRTUAL MEMORY ARRANGEMENT:\n");
+DPRINTF("  Loader:   %016"PRIx64"->%016"PRIx64"\n", elf.pstart, elf.pend);
+DPRINTF("  Modules:  %016"PRIx64"->%016"PRIx64"\n", m_start, m_end);
+
 if ( loadelfimage(xch, &elf, dom, page_array) != 0 )
 {
 PERROR("Could not load ELF image");
@@ -576,6 +584,44 @@ static int setup_guest(xc_inte

[Xen-devel] [PATCH v3 02/32] libxc: unify xc_dom_p2m_{host/guest}

2015-07-03 Thread Roger Pau Monne
Unify both functions into xc_dom_p2m. Should not introduce any functional
change.

Signed-off-by: Roger Pau Monné 
Cc: Ian Jackson 
Cc: Stefano Stabellini 
Cc: Ian Campbell 
Cc: Wei Liu 
Cc: Samuel Thibault 
---
 stubdom/grub/kexec.c  |  4 ++--
 tools/libxc/include/xc_dom.h  | 14 ++
 tools/libxc/xc_dom_boot.c | 10 +-
 tools/libxc/xc_dom_compat_linux.c |  4 ++--
 tools/libxc/xc_dom_x86.c  | 32 
 tools/libxl/libxl_dom.c   |  4 ++--
 6 files changed, 29 insertions(+), 39 deletions(-)

diff --git a/stubdom/grub/kexec.c b/stubdom/grub/kexec.c
index 4c33b25..0b2f4f3 100644
--- a/stubdom/grub/kexec.c
+++ b/stubdom/grub/kexec.c
@@ -358,9 +358,9 @@ void kexec(void *kernel, long kernel_size, void *module, 
long module_size, char
 #ifdef __x86_64__
 MMUEXT_PIN_L4_TABLE,
 #endif
-xc_dom_p2m_host(dom, dom->pgtables_seg.pfn),
+xc_dom_p2m(dom, dom->pgtables_seg.pfn),
 dom->guest_domid)) != 0 ) {
-grub_printf("pin_table(%lx) returned %d\n", xc_dom_p2m_host(dom,
+grub_printf("pin_table(%lx) returned %d\n", xc_dom_p2m(dom,
 dom->pgtables_seg.pfn), rc);
 errnum = ERR_BOOT_FAILURE;
 goto out_remap;
diff --git a/tools/libxc/include/xc_dom.h b/tools/libxc/include/xc_dom.h
index a7d059a..ec9e293 100644
--- a/tools/libxc/include/xc_dom.h
+++ b/tools/libxc/include/xc_dom.h
@@ -376,19 +376,9 @@ static inline void *xc_dom_vaddr_to_ptr(struct 
xc_dom_image *dom,
 return ptr + offset;
 }
 
-static inline xen_pfn_t xc_dom_p2m_host(struct xc_dom_image *dom, xen_pfn_t 
pfn)
+static inline xen_pfn_t xc_dom_p2m(struct xc_dom_image *dom, xen_pfn_t pfn)
 {
-if (dom->shadow_enabled)
-return pfn;
-if (pfn < dom->rambase_pfn || pfn >= dom->rambase_pfn + dom->total_pages)
-return INVALID_MFN;
-return dom->p2m_host[pfn - dom->rambase_pfn];
-}
-
-static inline xen_pfn_t xc_dom_p2m_guest(struct xc_dom_image *dom,
- xen_pfn_t pfn)
-{
-if (xc_dom_feature_translated(dom))
+if ( dom->shadow_enabled || xc_dom_feature_translated(dom) )
 return pfn;
 if (pfn < dom->rambase_pfn || pfn >= dom->rambase_pfn + dom->total_pages)
 return INVALID_MFN;
diff --git a/tools/libxc/xc_dom_boot.c b/tools/libxc/xc_dom_boot.c
index f82db2d..fda9e52 100644
--- a/tools/libxc/xc_dom_boot.c
+++ b/tools/libxc/xc_dom_boot.c
@@ -54,7 +54,7 @@ static int setup_hypercall_page(struct xc_dom_image *dom)
   dom->parms.virt_hypercall, pfn);
 domctl.cmd = XEN_DOMCTL_hypercall_init;
 domctl.domain = dom->guest_domid;
-domctl.u.hypercall_init.gmfn = xc_dom_p2m_guest(dom, pfn);
+domctl.u.hypercall_init.gmfn = xc_dom_p2m(dom, pfn);
 rc = do_domctl(dom->xch, &domctl);
 if ( rc != 0 )
 xc_dom_panic(dom->xch, XC_INTERNAL_ERROR,
@@ -84,7 +84,7 @@ static int clear_page(struct xc_dom_image *dom, xen_pfn_t pfn)
 if ( pfn == 0 )
 return 0;
 
-dst = xc_dom_p2m_host(dom, pfn);
+dst = xc_dom_p2m(dom, pfn);
 DOMPRINTF("%s: pfn 0x%" PRIpfn ", mfn 0x%" PRIpfn "",
   __FUNCTION__, pfn, dst);
 rc = xc_clear_domain_page(dom->xch, dom->guest_domid, dst);
@@ -178,7 +178,7 @@ void *xc_dom_boot_domU_map(struct xc_dom_image *dom, 
xen_pfn_t pfn,
 }
 
 for ( i = 0; i < count; i++ )
-entries[i].mfn = xc_dom_p2m_host(dom, pfn + i);
+entries[i].mfn = xc_dom_p2m(dom, pfn + i);
 
 ptr = xc_map_foreign_ranges(dom->xch, dom->guest_domid,
 count << page_shift, PROT_READ | PROT_WRITE, 1 << page_shift,
@@ -435,8 +435,8 @@ int xc_dom_gnttab_init(struct xc_dom_image *dom)
   dom->console_domid, dom->xenstore_domid);
 } else {
 return xc_dom_gnttab_seed(dom->xch, dom->guest_domid,
-  xc_dom_p2m_host(dom, dom->console_pfn),
-  xc_dom_p2m_host(dom, dom->xenstore_pfn),
+  xc_dom_p2m(dom, dom->console_pfn),
+  xc_dom_p2m(dom, dom->xenstore_pfn),
   dom->console_domid, dom->xenstore_domid);
 }
 }
diff --git a/tools/libxc/xc_dom_compat_linux.c 
b/tools/libxc/xc_dom_compat_linux.c
index 2c14a0f..acccde9 100644
--- a/tools/libxc/xc_dom_compat_linux.c
+++ b/tools/libxc/xc_dom_compat_linux.c
@@ -65,8 +65,8 @@ static int xc_linux_build_internal(struct xc_dom_image *dom,
 if ( (rc = xc_dom_gnttab_init(dom)) != 0)
 goto out;
 
-*console_mfn = xc_dom_p2m_host(dom, dom->console_pfn);
-*store_mfn = xc_dom_p2m_host(dom, dom->xenstore_pfn);
+*console_mfn = xc_dom_p2m(dom, dom->console_pfn);
+*store_mfn = xc_dom_p2m(dom, dom->xenstore_pfn);
 
  out:
 return rc;
diff --git a/tools/libxc/xc_dom_x86.c b/tools/libxc/xc_dom_x86.c
index 920fe42..0d80c18 100644
--- a/tools/libxc/

[Xen-devel] [PATCH v3 00/32] Introduce HVM without dm and new boot ABI

2015-07-03 Thread Roger Pau Monne
This series are now rebased on top of Paul Durrant "x86/hvm: I/O emulation 
cleanup and fix" v5.

This series is split in the following order:

 - Patches from 1 to 10 switch HVM domain contruction to use the xc_dom_* 
   family of functions, like they are used to build PV domains. 
 - Patches from 11 to 21 allow disabling the devices emulated inside of Xen.
 - Patches from 22 to 32 introduce the creation of HVM guests without a 
   device model and without the devices emulated inside of Xen.

THe main difference with v2 is that instead of using a 
single XEN_DOMCTL_CDF_noemu flag in order to disable all devices emulated in 
Xen a bitmap is used, which should allow enabling or disabling specific 
emulated devices in the future.

This series has been successfully tested on the following hardware:

 - Intel Xeon W3550.
 - AMD Opteron 4184.

With both hap=0 and hap=1 in the configuration file. I've been able to boot 
a SMP guest in this mode with a virtual hard drive and a virtual network 
card, all working fine AFAICT.

For this round only maintainers of the specific code being modified have 
been Cced on the patches.

The series can also be found in the following git repo:

git://xenbits.xen.org/people/royger/xen.git branch hvm_without_dm_v3

And for the FreeBSD part:

git://xenbits.xen.org/people/royger/freebsd.git branch new_entry_point_v2

In case someone wants to give it a try, I've uploaded a FreeBSD kernel that 
should work when booted into this mode:

https://people.freebsd.org/~royger/kernel_no_dm

The config file that I've used is:


kernel="/path/to/kernel_no_dm"

builder="hvm"
device_model_version="none"

memory=128
vcpus=2
name = "freebsd"


Of course if you have a FreeBSD disk already setup it can also be added to 
the configuration file, and the following line can be used to point FreeBSD 
to the disk:

extra="vfs.root.mountfrom=ufs:/dev/ufsid/"

Thanks, Roger.

___
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel


[Xen-devel] [PATCH v3 08/32] libxc: introduce a xc_dom_arch for hvm-3.0-x86_32 guests

2015-07-03 Thread Roger Pau Monne
This xc_dom_arch will be used in order to build HVM domains. The code is
based on the existing xc_hvm_populate_memory and xc_hvm_populate_params
functions.

Signed-off-by: Roger Pau Monné 
Cc: Ian Jackson 
Cc: Stefano Stabellini 
Cc: Ian Campbell 
Cc: Wei Liu 
---
 tools/libxc/include/xc_dom.h |   6 +
 tools/libxc/xc_dom_x86.c | 541 ++-
 2 files changed, 536 insertions(+), 11 deletions(-)

diff --git a/tools/libxc/include/xc_dom.h b/tools/libxc/include/xc_dom.h
index 42533a5..68b052c 100644
--- a/tools/libxc/include/xc_dom.h
+++ b/tools/libxc/include/xc_dom.h
@@ -189,6 +189,12 @@ struct xc_dom_image {
 } container_type;
 
 /* HVM specific fields. */
+xen_pfn_t target_pages;
+xen_pfn_t mmio_start;
+xen_pfn_t mmio_size;
+xen_pfn_t lowmem_end;
+xen_pfn_t highmem_end;
+
 /* Extra ACPI tables passed to HVMLOADER */
 struct xc_hvm_firmware_module acpi_module;
 
diff --git a/tools/libxc/xc_dom_x86.c b/tools/libxc/xc_dom_x86.c
index 993954e..6573b94 100644
--- a/tools/libxc/xc_dom_x86.c
+++ b/tools/libxc/xc_dom_x86.c
@@ -40,10 +40,29 @@
 
 /*  */
 
-#define SUPERPAGE_PFN_SHIFT  9
-#define SUPERPAGE_NR_PFNS(1UL << SUPERPAGE_PFN_SHIFT)
 #define SUPERPAGE_BATCH_SIZE 512
 
+#define SUPERPAGE_2MB_SHIFT   9
+#define SUPERPAGE_2MB_NR_PFNS (1UL << SUPERPAGE_2MB_SHIFT)
+#define SUPERPAGE_1GB_SHIFT   18
+#define SUPERPAGE_1GB_NR_PFNS (1UL << SUPERPAGE_1GB_SHIFT)
+
+#define VGA_HOLE_SIZE (0x20)
+
+#define SPECIALPAGE_PAGING   0
+#define SPECIALPAGE_ACCESS   1
+#define SPECIALPAGE_SHARING  2
+#define SPECIALPAGE_BUFIOREQ 3
+#define SPECIALPAGE_XENSTORE 4
+#define SPECIALPAGE_IOREQ5
+#define SPECIALPAGE_IDENT_PT 6
+#define SPECIALPAGE_CONSOLE  7
+#define NR_SPECIAL_PAGES 8
+#define special_pfn(x) (0xff000u - NR_SPECIAL_PAGES + (x))
+
+#define NR_IOREQ_SERVER_PAGES 8
+#define ioreq_server_pfn(x) (special_pfn(0) - NR_IOREQ_SERVER_PAGES + (x))
+
 #define bits_to_mask(bits)   (((xen_vaddr_t)1 << (bits))-1)
 #define round_down(addr, mask)   ((addr) & ~(mask))
 #define round_up(addr, mask) ((addr) | (mask))
@@ -462,6 +481,135 @@ static int alloc_magic_pages(struct xc_dom_image *dom)
 return 0;
 }
 
+static void build_hvm_info(void *hvm_info_page, struct xc_dom_image *dom)
+{
+struct hvm_info_table *hvm_info = (struct hvm_info_table *)
+(((unsigned char *)hvm_info_page) + HVM_INFO_OFFSET);
+uint8_t sum;
+int i;
+
+memset(hvm_info_page, 0, PAGE_SIZE);
+
+/* Fill in the header. */
+strncpy(hvm_info->signature, "HVM INFO", 8);
+hvm_info->length = sizeof(struct hvm_info_table);
+
+/* Sensible defaults: these can be overridden by the caller. */
+hvm_info->apic_mode = 1;
+hvm_info->nr_vcpus = 1;
+memset(hvm_info->vcpu_online, 0xff, sizeof(hvm_info->vcpu_online));
+
+/* Memory parameters. */
+hvm_info->low_mem_pgend = dom->lowmem_end >> PAGE_SHIFT;
+hvm_info->high_mem_pgend = dom->highmem_end >> PAGE_SHIFT;
+hvm_info->reserved_mem_pgstart = ioreq_server_pfn(0);
+
+/* Finish with the checksum. */
+for ( i = 0, sum = 0; i < hvm_info->length; i++ )
+sum += ((uint8_t *)hvm_info)[i];
+hvm_info->checksum = -sum;
+}
+
+static int alloc_magic_pages_hvm(struct xc_dom_image *dom)
+{
+unsigned long i;
+void *hvm_info_page;
+uint32_t *ident_pt, domid = dom->guest_domid;
+int rc;
+xen_pfn_t special_array[NR_SPECIAL_PAGES];
+xen_pfn_t ioreq_server_array[NR_IOREQ_SERVER_PAGES];
+xc_interface *xch = dom->xch;
+
+if ( (hvm_info_page = xc_map_foreign_range(
+  xch, domid, PAGE_SIZE, PROT_READ | PROT_WRITE,
+  HVM_INFO_PFN)) == NULL )
+goto error_out;
+build_hvm_info(hvm_info_page, dom);
+munmap(hvm_info_page, PAGE_SIZE);
+
+/* Allocate and clear special pages. */
+for ( i = 0; i < NR_SPECIAL_PAGES; i++ )
+special_array[i] = special_pfn(i);
+
+rc = xc_domain_populate_physmap_exact(xch, domid, NR_SPECIAL_PAGES, 0, 0,
+  special_array);
+if ( rc != 0 )
+{
+DOMPRINTF("Could not allocate special pages.");
+goto error_out;
+}
+
+if ( xc_clear_domain_pages(xch, domid, special_pfn(0), NR_SPECIAL_PAGES) )
+goto error_out;
+
+xc_hvm_param_set(xch, domid, HVM_PARAM_STORE_PFN,
+ special_pfn(SPECIALPAGE_XENSTORE));
+xc_hvm_param_set(xch, domid, HVM_PARAM_BUFIOREQ_PFN,
+ special_pfn(SPECIALPAGE_BUFIOREQ));
+xc_hvm_param_set(xch, domid, HVM_PARAM_IOREQ_PFN,
+ special_pfn(SPECIALPAGE_IOREQ));
+xc_hvm_param_set(xch, domid, HVM_PARAM_CONSOLE_PFN,
+ special_pfn(SPECIALPAGE_CONSOLE));
+xc_hvm_param_set(xch, domid, HVM_PARAM_PAGING_RING_PFN,
+ special_pfn(SPECIALPAGE_PAGING));
+xc_hvm_param_set(xch, domid, HVM_PARAM_MONITOR_R

[Xen-devel] [PATCH v3 06/32] libxc: make arch_setup_boot{init/late} xc_dom_arch hooks

2015-07-03 Thread Roger Pau Monne
This should not introduce any functional change.

Signed-off-by: Roger Pau Monné 
Cc: Ian Jackson 
Cc: Stefano Stabellini 
Cc: Ian Campbell 
Cc: Wei Liu 
---
 tools/libxc/include/xc_dom.h |  7 ++--
 tools/libxc/xc_dom_arm.c | 38 -
 tools/libxc/xc_dom_boot.c|  4 +--
 tools/libxc/xc_dom_x86.c | 78 
 4 files changed, 68 insertions(+), 59 deletions(-)

diff --git a/tools/libxc/include/xc_dom.h b/tools/libxc/include/xc_dom.h
index b461f19..42533a5 100644
--- a/tools/libxc/include/xc_dom.h
+++ b/tools/libxc/include/xc_dom.h
@@ -223,6 +223,8 @@ struct xc_dom_arch {
 int (*start_info) (struct xc_dom_image * dom);
 int (*shared_info) (struct xc_dom_image * dom, void *shared_info);
 int (*vcpu) (struct xc_dom_image * dom, void *vcpu_ctxt);
+int (*bootearly) (struct xc_dom_image * dom);
+int (*bootlate) (struct xc_dom_image * dom);
 
 /* arch-specific memory initialization. */
 int (*meminit) (struct xc_dom_image * dom);
@@ -402,11 +404,6 @@ static inline xen_pfn_t xc_dom_p2m(struct xc_dom_image 
*dom, xen_pfn_t pfn)
 return dom->p2m_host[pfn - dom->rambase_pfn];
 }
 
-/* --- arch bits --- */
-
-int arch_setup_bootearly(struct xc_dom_image *dom);
-int arch_setup_bootlate(struct xc_dom_image *dom);
-
 /*
  * Local variables:
  * mode: C
diff --git a/tools/libxc/xc_dom_arm.c b/tools/libxc/xc_dom_arm.c
index 1f00d05..b0d964c 100644
--- a/tools/libxc/xc_dom_arm.c
+++ b/tools/libxc/xc_dom_arm.c
@@ -492,6 +492,24 @@ static int meminit(struct xc_dom_image *dom)
 
 /*  */
 
+static int bootearly(struct xc_dom_image *dom)
+{
+DOMPRINTF("%s: doing nothing", __FUNCTION__);
+return 0;
+}
+
+static int bootlate(struct xc_dom_image *dom)
+{
+/* XXX
+ *   map shared info
+ *   map grant tables
+ *   setup shared info
+ */
+return 0;
+}
+
+/*  */
+
 static struct xc_dom_arch xc_dom_32 = {
 .guest_type = "xen-3.0-armv7l",
 .native_protocol = XEN_IO_PROTO_ABI_ARM,
@@ -504,6 +522,8 @@ static struct xc_dom_arch xc_dom_32 = {
 .shared_info = shared_info_arm,
 .vcpu = vcpu_arm32,
 .meminit = meminit,
+.bootearly = bootearly,
+.bootlate = bootlate,
 };
 
 static struct xc_dom_arch xc_dom_64 = {
@@ -518,6 +538,8 @@ static struct xc_dom_arch xc_dom_64 = {
 .shared_info = shared_info_arm,
 .vcpu = vcpu_arm64,
 .meminit = meminit,
+.bootearly = bootearly,
+.bootlate = bootlate,
 };
 
 static void __init register_arch_hooks(void)
@@ -526,22 +548,6 @@ static void __init register_arch_hooks(void)
 xc_dom_register_arch_hooks(&xc_dom_64);
 }
 
-int arch_setup_bootearly(struct xc_dom_image *dom)
-{
-DOMPRINTF("%s: doing nothing", __FUNCTION__);
-return 0;
-}
-
-int arch_setup_bootlate(struct xc_dom_image *dom)
-{
-/* XXX
- *   map shared info
- *   map grant tables
- *   setup shared info
- */
-return 0;
-}
-
 int xc_dom_feature_translated(struct xc_dom_image *dom)
 {
 return 1;
diff --git a/tools/libxc/xc_dom_boot.c b/tools/libxc/xc_dom_boot.c
index 3ef7e6c..2f7488d 100644
--- a/tools/libxc/xc_dom_boot.c
+++ b/tools/libxc/xc_dom_boot.c
@@ -209,7 +209,7 @@ int xc_dom_boot_image(struct xc_dom_image *dom)
 DOMPRINTF_CALLED(dom->xch);
 
 /* misc stuff*/
-if ( (rc = arch_setup_bootearly(dom)) != 0 )
+if ( (rc = dom->arch_hooks->bootearly(dom)) != 0 )
 return rc;
 
 /* collect some info */
@@ -256,7 +256,7 @@ int xc_dom_boot_image(struct xc_dom_image *dom)
 xc_dom_log_memory_footprint(dom);
 
 /* misc x86 stuff */
-if ( (rc = arch_setup_bootlate(dom)) != 0 )
+if ( (rc = dom->arch_hooks->bootlate(dom)) != 0 )
 return rc;
 
 /* let the vm run */
diff --git a/tools/libxc/xc_dom_x86.c b/tools/libxc/xc_dom_x86.c
index 6fb4aee..993954e 100644
--- a/tools/libxc/xc_dom_x86.c
+++ b/tools/libxc/xc_dom_x86.c
@@ -926,41 +926,7 @@ static int meminit_pv(struct xc_dom_image *dom)
 
 /*  */
 
-static struct xc_dom_arch xc_dom_32_pae = {
-.guest_type = "xen-3.0-x86_32p",
-.native_protocol = XEN_IO_PROTO_ABI_X86_32,
-.page_shift = PAGE_SHIFT_X86,
-.sizeof_pfn = 4,
-.alloc_magic_pages = alloc_magic_pages,
-.count_pgtables = count_pgtables_x86_32_pae,
-.setup_pgtables = setup_pgtables_x86_32_pae,
-.start_info = start_info_x86_32,
-.shared_info = shared_info_x86_32,
-.vcpu = vcpu_x86_32,
-.meminit = meminit_pv,
-};
-
-static struct xc_dom_arch xc_dom_64 = {
-.guest_type = "xen-3.0-x86_64",
-.native_protocol = XEN_IO_PROTO_ABI_X86_64,
-.page_shift = PAGE_SHIFT_X86,
-.sizeof_pfn = 8,
-.alloc_magic_pages = alloc_magic_pages,
-.count_pgtables = count_pgtables_x86_64,
-.s

[Xen-devel] [PATCH v3 04/32] libxc: introduce a domain loader for HVM guest firmware

2015-07-03 Thread Roger Pau Monne
Introduce a very simple (and dummy) domain loader to be used to load the
firmware (hvmloader) into HVM guests. Since hmvloader is just a 32bit elf
executable the loader is fairly simple.

Signed-off-by: Roger Pau Monné 
Cc: Ian Jackson 
Cc: Stefano Stabellini 
Cc: Ian Campbell 
Cc: Wei Liu 
---
 tools/libxc/Makefile   |   1 +
 tools/libxc/include/xc_dom.h   |   8 ++
 tools/libxc/xc_dom_hvmloader.c | 316 +
 xen/include/xen/libelf.h   |   1 +
 4 files changed, 326 insertions(+)
 create mode 100644 tools/libxc/xc_dom_hvmloader.c

diff --git a/tools/libxc/Makefile b/tools/libxc/Makefile
index 153b79e..48fc473 100644
--- a/tools/libxc/Makefile
+++ b/tools/libxc/Makefile
@@ -87,6 +87,7 @@ GUEST_SRCS-y += xc_dom_core.c xc_dom_boot.c
 GUEST_SRCS-y += xc_dom_elfloader.c
 GUEST_SRCS-$(CONFIG_X86) += xc_dom_bzimageloader.c
 GUEST_SRCS-$(CONFIG_X86) += xc_dom_decompress_lz4.c
+GUEST_SRCS-$(CONFIG_X86) += xc_dom_hvmloader.c
 GUEST_SRCS-$(CONFIG_ARM) += xc_dom_armzimageloader.c
 GUEST_SRCS-y += xc_dom_binloader.c
 GUEST_SRCS-y += xc_dom_compat_linux.c
diff --git a/tools/libxc/include/xc_dom.h b/tools/libxc/include/xc_dom.h
index f7b5f0f..d61482c 100644
--- a/tools/libxc/include/xc_dom.h
+++ b/tools/libxc/include/xc_dom.h
@@ -15,6 +15,7 @@
  */
 
 #include 
+#include 
 
 #define INVALID_P2M_ENTRY   ((xen_pfn_t)-1)
 
@@ -186,6 +187,13 @@ struct xc_dom_image {
 XC_DOM_PV_CONTAINER,
 XC_DOM_HVM_CONTAINER,
 } container_type;
+
+/* HVM specific fields. */
+/* Extra ACPI tables passed to HVMLOADER */
+struct xc_hvm_firmware_module acpi_module;
+
+/* Extra SMBIOS structures passed to HVMLOADER */
+struct xc_hvm_firmware_module smbios_module;
 };
 
 /* --- pluggable kernel loader - */
diff --git a/tools/libxc/xc_dom_hvmloader.c b/tools/libxc/xc_dom_hvmloader.c
new file mode 100644
index 000..b6270c9
--- /dev/null
+++ b/tools/libxc/xc_dom_hvmloader.c
@@ -0,0 +1,316 @@
+/*
+ * Xen domain builder -- HVM specific bits.
+ *
+ * Parse and load ELF firmware images for HVM domains.
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation;
+ * version 2.1 of the License.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  
USA
+ *
+ */
+
+#include 
+#include 
+#include 
+#include 
+#include 
+
+#include "xg_private.h"
+#include "xc_dom.h"
+#include "xc_bitops.h"
+
+/*  */
+/* parse elf binary */
+
+static elf_negerrnoval check_elf_kernel(struct xc_dom_image *dom, bool verbose)
+{
+if ( dom->kernel_blob == NULL )
+{
+if ( verbose )
+xc_dom_panic(dom->xch,
+ XC_INTERNAL_ERROR, "%s: no kernel image loaded",
+ __FUNCTION__);
+return -EINVAL;
+}
+
+if ( !elf_is_elfbinary(dom->kernel_blob, dom->kernel_size) )
+{
+if ( verbose )
+xc_dom_panic(dom->xch,
+ XC_INVALID_KERNEL, "%s: kernel is not an ELF image",
+ __FUNCTION__);
+return -EINVAL;
+}
+return 0;
+}
+
+static elf_negerrnoval xc_dom_probe_hvm_kernel(struct xc_dom_image *dom)
+{
+struct elf_binary elf;
+int rc;
+
+/* This loader is designed for HVM guest firmware. */
+if ( dom->container_type != XC_DOM_HVM_CONTAINER )
+return -EINVAL;
+
+rc = check_elf_kernel(dom, 0);
+if ( rc != 0 )
+return rc;
+
+rc = elf_init(&elf, dom->kernel_blob, dom->kernel_size);
+if ( rc != 0 )
+return rc;
+
+/*
+ * We need to check that there are no Xen ELFNOTES, or
+ * else we might be trying to load a PV kernel.
+ */
+elf_parse_binary(&elf);
+rc = elf_xen_parse(&elf, &dom->parms);
+if ( rc == 0 )
+return -EINVAL;
+
+return 0;
+}
+
+static elf_errorstatus xc_dom_parse_hvm_kernel(struct xc_dom_image *dom)
+/*
+ * This function sometimes returns -1 for error and sometimes
+ * an errno value.  ?!?!
+ */
+{
+struct elf_binary *elf;
+elf_errorstatus rc;
+
+rc = check_elf_kernel(dom, 1);
+if ( rc != 0 )
+return rc;
+
+elf = xc_dom_malloc(dom, sizeof(*elf));
+if ( elf == NULL )
+return -1;
+dom->priva

[Xen-devel] [PATCH v3 03/32] libxc: introduce the notion of a container type

2015-07-03 Thread Roger Pau Monne
Introduce the notion of a container type into xc_dom_image. This will be
needed by later changes that will also use xc_dom_image in order to build
HVM guests.

Signed-off-by: Roger Pau Monné 
Cc: Ian Jackson 
Cc: Stefano Stabellini 
Cc: Ian Campbell 
Cc: Wei Liu 
---
 tools/libxc/include/xc_dom.h | 6 ++
 tools/libxc/xc_dom_x86.c | 4 
 tools/libxl/libxl_dom.c  | 1 +
 3 files changed, 11 insertions(+)

diff --git a/tools/libxc/include/xc_dom.h b/tools/libxc/include/xc_dom.h
index ec9e293..f7b5f0f 100644
--- a/tools/libxc/include/xc_dom.h
+++ b/tools/libxc/include/xc_dom.h
@@ -180,6 +180,12 @@ struct xc_dom_image {
 struct xc_dom_arch *arch_hooks;
 /* allocate up to virt_alloc_end */
 int (*allocate) (struct xc_dom_image * dom, xen_vaddr_t up_to);
+
+/* Container type (HVM or PV). */
+enum {
+XC_DOM_PV_CONTAINER,
+XC_DOM_HVM_CONTAINER,
+} container_type;
 };
 
 /* --- pluggable kernel loader - */
diff --git a/tools/libxc/xc_dom_x86.c b/tools/libxc/xc_dom_x86.c
index 0d80c18..b89f5c2 100644
--- a/tools/libxc/xc_dom_x86.c
+++ b/tools/libxc/xc_dom_x86.c
@@ -1071,6 +1071,10 @@ int arch_setup_bootlate(struct xc_dom_image *dom)
 
 int xc_dom_feature_translated(struct xc_dom_image *dom)
 {
+/* Guests running inside HVM containers are always auto-translated. */
+if ( dom->container_type == XC_DOM_HVM_CONTAINER )
+return 1;
+
 return elf_xen_feature_get(XENFEAT_auto_translated_physmap, dom->f_active);
 }
 
diff --git a/tools/libxl/libxl_dom.c b/tools/libxl/libxl_dom.c
index fb2f916..2bae277 100644
--- a/tools/libxl/libxl_dom.c
+++ b/tools/libxl/libxl_dom.c
@@ -626,6 +626,7 @@ int libxl__build_pv(libxl__gc *gc, uint32_t domid,
 }
 
 dom->pvh_enabled = state->pvh_enabled;
+dom->container_type = XC_DOM_PV_CONTAINER;
 
 LOG(DEBUG, "pv kernel mapped %d path %s", state->pv_kernel.mapped, 
state->pv_kernel.path);
 
-- 
1.9.5 (Apple Git-50.3)


___
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel


[Xen-devel] [PATCH v3 05/32] libxc: make arch_setup_meminit a xc_dom_arch hook

2015-07-03 Thread Roger Pau Monne
This allows having different arch_setup_meminit implementations based on the
guest type. It should not introduce any functional changes.

Signed-off-by: Roger Pau Monné 
Cc: Ian Jackson 
Cc: Stefano Stabellini 
Cc: Ian Campbell 
Cc: Wei Liu 
---
 tools/libxc/include/xc_dom.h |  4 ++-
 tools/libxc/xc_dom_arm.c | 70 +++
 tools/libxc/xc_dom_boot.c|  2 +-
 tools/libxc/xc_dom_x86.c | 71 +++-
 4 files changed, 78 insertions(+), 69 deletions(-)

diff --git a/tools/libxc/include/xc_dom.h b/tools/libxc/include/xc_dom.h
index d61482c..b461f19 100644
--- a/tools/libxc/include/xc_dom.h
+++ b/tools/libxc/include/xc_dom.h
@@ -224,6 +224,9 @@ struct xc_dom_arch {
 int (*shared_info) (struct xc_dom_image * dom, void *shared_info);
 int (*vcpu) (struct xc_dom_image * dom, void *vcpu_ctxt);
 
+/* arch-specific memory initialization. */
+int (*meminit) (struct xc_dom_image * dom);
+
 char *guest_type;
 char *native_protocol;
 int page_shift;
@@ -401,7 +404,6 @@ static inline xen_pfn_t xc_dom_p2m(struct xc_dom_image 
*dom, xen_pfn_t pfn)
 
 /* --- arch bits --- */
 
-int arch_setup_meminit(struct xc_dom_image *dom);
 int arch_setup_bootearly(struct xc_dom_image *dom);
 int arch_setup_bootlate(struct xc_dom_image *dom);
 
diff --git a/tools/libxc/xc_dom_arm.c b/tools/libxc/xc_dom_arm.c
index 065debb..1f00d05 100644
--- a/tools/libxc/xc_dom_arm.c
+++ b/tools/libxc/xc_dom_arm.c
@@ -195,38 +195,6 @@ static int vcpu_arm64(struct xc_dom_image *dom, void *ptr)
 
 /*  */
 
-static struct xc_dom_arch xc_dom_32 = {
-.guest_type = "xen-3.0-armv7l",
-.native_protocol = XEN_IO_PROTO_ABI_ARM,
-.page_shift = PAGE_SHIFT_ARM,
-.sizeof_pfn = 8,
-.alloc_magic_pages = alloc_magic_pages,
-.count_pgtables = count_pgtables_arm,
-.setup_pgtables = setup_pgtables_arm,
-.start_info = start_info_arm,
-.shared_info = shared_info_arm,
-.vcpu = vcpu_arm32,
-};
-
-static struct xc_dom_arch xc_dom_64 = {
-.guest_type = "xen-3.0-aarch64",
-.native_protocol = XEN_IO_PROTO_ABI_ARM,
-.page_shift = PAGE_SHIFT_ARM,
-.sizeof_pfn = 8,
-.alloc_magic_pages = alloc_magic_pages,
-.count_pgtables = count_pgtables_arm,
-.setup_pgtables = setup_pgtables_arm,
-.start_info = start_info_arm,
-.shared_info = shared_info_arm,
-.vcpu = vcpu_arm64,
-};
-
-static void __init register_arch_hooks(void)
-{
-xc_dom_register_arch_hooks(&xc_dom_32);
-xc_dom_register_arch_hooks(&xc_dom_64);
-}
-
 static int set_mode(xc_interface *xch, domid_t domid, char *guest_type)
 {
 static const struct {
@@ -385,7 +353,7 @@ out:
 return rc < 0 ? rc : 0;
 }
 
-int arch_setup_meminit(struct xc_dom_image *dom)
+static int meminit(struct xc_dom_image *dom)
 {
 int i, rc;
 xen_pfn_t pfn;
@@ -522,6 +490,42 @@ int arch_setup_meminit(struct xc_dom_image *dom)
 return 0;
 }
 
+/*  */
+
+static struct xc_dom_arch xc_dom_32 = {
+.guest_type = "xen-3.0-armv7l",
+.native_protocol = XEN_IO_PROTO_ABI_ARM,
+.page_shift = PAGE_SHIFT_ARM,
+.sizeof_pfn = 8,
+.alloc_magic_pages = alloc_magic_pages,
+.count_pgtables = count_pgtables_arm,
+.setup_pgtables = setup_pgtables_arm,
+.start_info = start_info_arm,
+.shared_info = shared_info_arm,
+.vcpu = vcpu_arm32,
+.meminit = meminit,
+};
+
+static struct xc_dom_arch xc_dom_64 = {
+.guest_type = "xen-3.0-aarch64",
+.native_protocol = XEN_IO_PROTO_ABI_ARM,
+.page_shift = PAGE_SHIFT_ARM,
+.sizeof_pfn = 8,
+.alloc_magic_pages = alloc_magic_pages,
+.count_pgtables = count_pgtables_arm,
+.setup_pgtables = setup_pgtables_arm,
+.start_info = start_info_arm,
+.shared_info = shared_info_arm,
+.vcpu = vcpu_arm64,
+.meminit = meminit,
+};
+
+static void __init register_arch_hooks(void)
+{
+xc_dom_register_arch_hooks(&xc_dom_32);
+xc_dom_register_arch_hooks(&xc_dom_64);
+}
+
 int arch_setup_bootearly(struct xc_dom_image *dom)
 {
 DOMPRINTF("%s: doing nothing", __FUNCTION__);
diff --git a/tools/libxc/xc_dom_boot.c b/tools/libxc/xc_dom_boot.c
index fda9e52..3ef7e6c 100644
--- a/tools/libxc/xc_dom_boot.c
+++ b/tools/libxc/xc_dom_boot.c
@@ -147,7 +147,7 @@ int xc_dom_boot_mem_init(struct xc_dom_image *dom)
 
 DOMPRINTF_CALLED(dom->xch);
 
-rc = arch_setup_meminit(dom);
+rc = dom->arch_hooks->meminit(dom);
 if ( rc != 0 )
 {
 xc_dom_panic(dom->xch, XC_OUT_OF_MEMORY,
diff --git a/tools/libxc/xc_dom_x86.c b/tools/libxc/xc_dom_x86.c
index b89f5c2..6fb4aee 100644
--- a/tools/libxc/xc_dom_x86.c
+++ b/tools/libxc/xc_dom_x86.c
@@ -671,38 +671,6 @@ static int vcpu_x86_64(struct xc_dom_image *dom, void *ptr)
 
 /* 

[Xen-devel] [PATCH v3 09/32] libxl: switch HVM domain building to use xc_dom_* helpers

2015-07-03 Thread Roger Pau Monne
Now that we have all the code in place HVM domain building in libxl can be
switched to use the xc_dom_* family of functions, just like they are used in
order to build PV guests.

Signed-off-by: Roger Pau Monné 
Cc: Ian Jackson 
Cc: Stefano Stabellini 
Cc: Ian Campbell 
Cc: Wei Liu 
---
 tools/libxl/libxl_dom.c  | 224 +--
 tools/libxl/libxl_internal.h |   2 +-
 tools/libxl/libxl_vnuma.c|  12 ++-
 3 files changed, 139 insertions(+), 99 deletions(-)

diff --git a/tools/libxl/libxl_dom.c b/tools/libxl/libxl_dom.c
index 2bae277..480b7e7 100644
--- a/tools/libxl/libxl_dom.c
+++ b/tools/libxl/libxl_dom.c
@@ -609,6 +609,64 @@ static int set_vnuma_info(libxl__gc *gc, uint32_t domid,
 return rc;
 }
 
+static int libxl__build_dom(libxl__gc *gc, uint32_t domid,
+ libxl_domain_build_info *info, libxl__domain_build_state *state,
+ struct xc_dom_image *dom)
+{
+libxl_ctx *ctx = libxl__gc_owner(gc);
+uint64_t mem_kb;
+int ret;
+
+if ( (ret = xc_dom_boot_xen_init(dom, ctx->xch, domid)) != 0 ) {
+LOGE(ERROR, "xc_dom_boot_xen_init failed");
+goto out;
+}
+#ifdef GUEST_RAM_BASE
+if ( (ret = xc_dom_rambase_init(dom, GUEST_RAM_BASE)) != 0 ) {
+LOGE(ERROR, "xc_dom_rambase failed");
+goto out;
+}
+#endif
+if ( (ret = xc_dom_parse_image(dom)) != 0 ) {
+LOGE(ERROR, "xc_dom_parse_image failed");
+goto out;
+}
+if ( (ret = libxl__arch_domain_init_hw_description(gc, info, state, dom)) 
!= 0 ) {
+LOGE(ERROR, "libxl__arch_domain_init_hw_description failed");
+goto out;
+}
+
+mem_kb = dom->container_type == XC_DOM_HVM_CONTAINER ?
+ (info->max_memkb - info->video_memkb) : info->target_memkb;
+if ( (ret = xc_dom_mem_init(dom, mem_kb / 1024)) != 0 ) {
+LOGE(ERROR, "xc_dom_mem_init failed");
+goto out;
+}
+if ( (ret = xc_dom_boot_mem_init(dom)) != 0 ) {
+LOGE(ERROR, "xc_dom_boot_mem_init failed");
+goto out;
+}
+if ( (ret = libxl__arch_domain_finalise_hw_description(gc, info, dom)) != 
0 ) {
+LOGE(ERROR, "libxl__arch_domain_finalise_hw_description failed");
+goto out;
+}
+if ( (ret = xc_dom_build_image(dom)) != 0 ) {
+LOGE(ERROR, "xc_dom_build_image failed");
+goto out;
+}
+if ( (ret = xc_dom_boot_image(dom)) != 0 ) {
+LOGE(ERROR, "xc_dom_boot_image failed");
+goto out;
+}
+if ( (ret = xc_dom_gnttab_init(dom)) != 0 ) {
+LOGE(ERROR, "xc_dom_gnttab_init failed");
+goto out;
+}
+
+out:
+return ret;
+}
+
 int libxl__build_pv(libxl__gc *gc, uint32_t domid,
  libxl_domain_build_info *info, libxl__domain_build_state *state)
 {
@@ -699,48 +757,9 @@ int libxl__build_pv(libxl__gc *gc, uint32_t domid,
 dom->vnode_to_pnode[i] = info->vnuma_nodes[i].pnode;
 }
 
-if ( (ret = xc_dom_boot_xen_init(dom, ctx->xch, domid)) != 0 ) {
-LOGE(ERROR, "xc_dom_boot_xen_init failed");
-goto out;
-}
-#ifdef GUEST_RAM_BASE
-if ( (ret = xc_dom_rambase_init(dom, GUEST_RAM_BASE)) != 0 ) {
-LOGE(ERROR, "xc_dom_rambase failed");
-goto out;
-}
-#endif
-if ( (ret = xc_dom_parse_image(dom)) != 0 ) {
-LOGE(ERROR, "xc_dom_parse_image failed");
-goto out;
-}
-if ( (ret = libxl__arch_domain_init_hw_description(gc, info, state, dom)) 
!= 0 ) {
-LOGE(ERROR, "libxl__arch_domain_init_hw_description failed");
-goto out;
-}
-if ( (ret = xc_dom_mem_init(dom, info->target_memkb / 1024)) != 0 ) {
-LOGE(ERROR, "xc_dom_mem_init failed");
-goto out;
-}
-if ( (ret = xc_dom_boot_mem_init(dom)) != 0 ) {
-LOGE(ERROR, "xc_dom_boot_mem_init failed");
+ret = libxl__build_dom(gc, domid, info, state, dom);
+if (ret != 0)
 goto out;
-}
-if ( (ret = libxl__arch_domain_finalise_hw_description(gc, info, dom)) != 
0 ) {
-LOGE(ERROR, "libxl__arch_domain_finalise_hw_description failed");
-goto out;
-}
-if ( (ret = xc_dom_build_image(dom)) != 0 ) {
-LOGE(ERROR, "xc_dom_build_image failed");
-goto out;
-}
-if ( (ret = xc_dom_boot_image(dom)) != 0 ) {
-LOGE(ERROR, "xc_dom_boot_image failed");
-goto out;
-}
-if ( (ret = xc_dom_gnttab_init(dom)) != 0 ) {
-LOGE(ERROR, "xc_dom_gnttab_init failed");
-goto out;
-}
 
 if (xc_dom_feature_translated(dom)) {
 state->console_mfn = dom->console_pfn;
@@ -800,39 +819,39 @@ static int hvm_build_set_params(xc_interface *handle, 
uint32_t domid,
 
 static int hvm_build_set_xs_values(libxl__gc *gc,
uint32_t domid,
-   struct xc_hvm_build_args *args)
+   struct xc_dom_image *dom)
 {
 char *path = NULL;
 int ret = 0;
 
-if (args->smbios_module.guest

[Xen-devel] [PATCH v3 20/32] xen/x86: allow disabling the emulated IOMMU

2015-07-03 Thread Roger Pau Monne
Signed-off-by: Roger Pau Monné 
Cc: Suravee Suthikulpanit 
Cc: Aravind Gopalakrishnan 
---
 xen/drivers/passthrough/amd/iommu_guest.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/xen/drivers/passthrough/amd/iommu_guest.c 
b/xen/drivers/passthrough/amd/iommu_guest.c
index 5908bf3..0831908 100644
--- a/xen/drivers/passthrough/amd/iommu_guest.c
+++ b/xen/drivers/passthrough/amd/iommu_guest.c
@@ -888,7 +888,8 @@ int guest_iommu_init(struct domain* d)
 struct guest_iommu *iommu;
 struct hvm_iommu *hd  = domain_hvm_iommu(d);
 
-if ( !is_hvm_domain(d) || !iommu_enabled || !iommuv2_enabled )
+if ( !is_hvm_domain(d) || !iommu_enabled || !iommuv2_enabled ||
+ !has_viommu(d) )
 return 0;
 
 iommu = xzalloc(struct guest_iommu);
-- 
1.9.5 (Apple Git-50.3)


___
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel


[Xen-devel] [PATCH v3 11/32] xen/x86: add bitmap of enabled emulated devices

2015-07-03 Thread Roger Pau Monne
Introduce a bitmap in x86 xen_arch_domainconfig that allows enabling or
disabling specific devices emulated inside of Xen for HVM guests.

Signed-off-by: Roger Pau Monné 
Cc: Ian Jackson 
Cc: Stefano Stabellini 
Cc: Ian Campbell 
Cc: Wei Liu 
Cc: Jan Beulich 
Cc: Andrew Cooper 
---
 tools/libxl/libxl_x86.c   |  6 --
 xen/arch/x86/domain.c | 15 +++
 xen/include/asm-x86/domain.h  | 13 +
 xen/include/public/arch-x86/xen.h | 20 +++-
 4 files changed, 51 insertions(+), 3 deletions(-)

diff --git a/tools/libxl/libxl_x86.c b/tools/libxl/libxl_x86.c
index ed2bd38..f04433a 100644
--- a/tools/libxl/libxl_x86.c
+++ b/tools/libxl/libxl_x86.c
@@ -5,8 +5,10 @@ int libxl__arch_domain_prepare_config(libxl__gc *gc,
   libxl_domain_config *d_config,
   xc_domain_configuration_t *xc_config)
 {
-/* No specific configuration right now */
-
+if (d_config->c_info.type == LIBXL_DOMAIN_TYPE_HVM)
+xc_config->emulation_flags = (EMU_LAPIC | EMU_HPET | EMU_PMTIMER |
+  EMU_RTC | EMU_IOAPIC | EMU_PIC |
+  EMU_PMU | EMU_VGA | EMU_IOMMU);
 return 0;
 }
 
diff --git a/xen/arch/x86/domain.c b/xen/arch/x86/domain.c
index a112953..d684f49 100644
--- a/xen/arch/x86/domain.c
+++ b/xen/arch/x86/domain.c
@@ -528,6 +528,7 @@ int arch_domain_create(struct domain *d, unsigned int 
domcr_flags,
 {
 int i, paging_initialised = 0;
 int rc = -ENOMEM;
+uint32_t emulation_mask;
 
 d->arch.s3_integrity = !!(domcr_flags & DOMCRF_s3_integrity);
 
@@ -550,6 +551,20 @@ int arch_domain_create(struct domain *d, unsigned int 
domcr_flags,
d->domain_id);
 }
 
+if ( is_hvm_domain(d) )
+{
+emulation_mask = (EMU_LAPIC | EMU_HPET | EMU_PMTIMER | EMU_RTC |
+  EMU_IOAPIC | EMU_PIC | EMU_PMU | EMU_VGA | 
EMU_IOMMU);
+if ( (config->emulation_flags & emulation_mask) != emulation_mask )
+{
+printk(XENLOG_G_ERR "Xen does not allow HVM creation with the "
+   "current selection of emulators: 0x%x.\n",
+   config->emulation_flags);
+return -EPERM;
+}
+d->arch.emulation_flags = config->emulation_flags;
+}
+
 if ( has_hvm_container_domain(d) )
 {
 d->arch.hvm_domain.hap_enabled =
diff --git a/xen/include/asm-x86/domain.h b/xen/include/asm-x86/domain.h
index 96bde65..502379e 100644
--- a/xen/include/asm-x86/domain.h
+++ b/xen/include/asm-x86/domain.h
@@ -356,8 +356,21 @@ struct arch_domain
 
 /* Mem_access emulation control */
 bool_t mem_access_emulate_enabled;
+
+/* Emulated devices enabled bitmap. */
+uint32_t emulation_flags;
 } __cacheline_aligned;
 
+#define has_vlapic(d)   (d->arch.emulation_flags & EMU_LAPIC)
+#define has_vhpet(d)(d->arch.emulation_flags & EMU_HPET)
+#define has_vpmtimer(d) (d->arch.emulation_flags & EMU_PMTIMER)
+#define has_vrtc(d) (d->arch.emulation_flags & EMU_RTC)
+#define has_vioapic(d)  (d->arch.emulation_flags & EMU_IOAPIC)
+#define has_vpic(d) (d->arch.emulation_flags & EMU_PIC)
+#define has_vpmu(d) (d->arch.emulation_flags & EMU_PMU)
+#define has_vvga(d) (d->arch.emulation_flags & EMU_VGA)
+#define has_viommu(d)   (d->arch.emulation_flags & EMU_IOMMU)
+
 #define has_arch_pdevs(d)(!list_empty(&(d)->arch.pdev_list))
 
 #define gdt_ldt_pt_idx(v) \
diff --git a/xen/include/public/arch-x86/xen.h 
b/xen/include/public/arch-x86/xen.h
index 2ecc9c9..6b387a3 100644
--- a/xen/include/public/arch-x86/xen.h
+++ b/xen/include/public/arch-x86/xen.h
@@ -268,7 +268,25 @@ typedef struct arch_shared_info arch_shared_info_t;
  * XEN_DOMCTL_INTERFACE_VERSION.
  */
 struct xen_arch_domainconfig {
-char dummy;
+#define _EMU_LAPIC  0
+#define EMU_LAPIC   (1U<<_EMU_LAPIC)
+#define _EMU_HPET   1
+#define EMU_HPET(1U<<_EMU_HPET)
+#define _EMU_PMTIMER2
+#define EMU_PMTIMER (1U<<_EMU_PMTIMER)
+#define _EMU_RTC3
+#define EMU_RTC (1U<<_EMU_RTC)
+#define _EMU_IOAPIC 4
+#define EMU_IOAPIC  (1U<<_EMU_IOAPIC)
+#define _EMU_PIC5
+#define EMU_PIC (1U<<_EMU_PIC)
+#define _EMU_PMU6
+#define EMU_PMU (1U<<_EMU_PMU)
+#define _EMU_VGA7
+#define EMU_VGA (1U<<_EMU_VGA)
+#define _EMU_IOMMU  8
+#define EMU_IOMMU   (1U<<_EMU_IOMMU)
+uint32_t emulation_flags;
 };
 #endif
 
-- 
1.9.5 (Apple Git-50.3)


___
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel


[Xen-devel] [PATCH v3 27/32] libxc: change the position of the special pages

2015-07-03 Thread Roger Pau Monne
Change the physical memory address of the special pages when there are no
emulated devices. On HVM guests the special pages have always been reserved
so that they end at the 0xff000 pfn, but there are some problems with this
approach when used without emulated devices:

 - If we want to allow HVMlite to be used for Dom0 those special pages
   cannot be placed inside of the MMIO hole or else they may clash with MMIO
   regions of physical devices passed-through to Dom0.
 - If there's no emulated devices the guests needs to access the console
   page and the command line very early during boot. This is a problem for
   FreeBSD at least, since the early page tables only map memory up to 1GiB.

So instead append the special pages after the kernel and ramdisk. The guest
must make sure it figures out the position of those pages very early during
boot, since the region is not marked as reserved in the memory map.

Signed-off-by: Roger Pau Monné 
Cc: Ian Jackson 
Cc: Stefano Stabellini 
Cc: Ian Campbell 
Cc: Wei Liu 
---
 tools/libxc/xc_dom_x86.c | 50 ++--
 1 file changed, 31 insertions(+), 19 deletions(-)

diff --git a/tools/libxc/xc_dom_x86.c b/tools/libxc/xc_dom_x86.c
index 45b1f03..1195400 100644
--- a/tools/libxc/xc_dom_x86.c
+++ b/tools/libxc/xc_dom_x86.c
@@ -58,15 +58,27 @@
 #define SPECIALPAGE_IDENT_PT 6
 #define SPECIALPAGE_CONSOLE  7
 #define NR_SPECIAL_PAGES 8
-#define special_pfn(x) (0xff000u - NR_SPECIAL_PAGES + (x))
+#define LAST_SPECIAL_PFN 0xff000u
 
 #define NR_IOREQ_SERVER_PAGES 8
-#define ioreq_server_pfn(x) (special_pfn(0) - NR_IOREQ_SERVER_PAGES + (x))
+#define ioreq_server_pfn(x, dom) (special_pfn(0, dom) - NR_IOREQ_SERVER_PAGES 
+ (x))
 
 #define bits_to_mask(bits)   (((xen_vaddr_t)1 << (bits))-1)
 #define round_down(addr, mask)   ((addr) & ~(mask))
 #define round_up(addr, mask) ((addr) | (mask))
 
+static unsigned long special_pfn(int index, struct xc_dom_image *dom)
+{
+unsigned long start_pfn;
+
+if ( dom->emulation )
+return (LAST_SPECIAL_PFN - NR_SPECIAL_PAGES + index);
+
+start_pfn = (dom->virt_alloc_end - dom->parms.virt_base) >>
+XC_DOM_PAGE_SHIFT(dom);
+return (start_pfn + index);
+}
+
 /* get guest IO ABI protocol */
 const char *xc_domain_get_native_protocol(xc_interface *xch,
   uint32_t domid)
@@ -502,7 +514,7 @@ static void build_hvm_info(void *hvm_info_page, struct 
xc_dom_image *dom)
 /* Memory parameters. */
 hvm_info->low_mem_pgend = dom->lowmem_end >> PAGE_SHIFT;
 hvm_info->high_mem_pgend = dom->highmem_end >> PAGE_SHIFT;
-hvm_info->reserved_mem_pgstart = ioreq_server_pfn(0);
+hvm_info->reserved_mem_pgstart = ioreq_server_pfn(0, dom);
 
 /* Finish with the checksum. */
 for ( i = 0, sum = 0; i < hvm_info->length; i++ )
@@ -532,7 +544,7 @@ static int alloc_magic_pages_hvm(struct xc_dom_image *dom)
 
 /* Allocate and clear special pages. */
 for ( i = 0; i < NR_SPECIAL_PAGES; i++ )
-special_array[i] = special_pfn(i);
+special_array[i] = special_pfn(i, dom);
 
 rc = xc_domain_populate_physmap_exact(xch, domid, NR_SPECIAL_PAGES, 0, 0,
   special_array);
@@ -542,23 +554,23 @@ static int alloc_magic_pages_hvm(struct xc_dom_image *dom)
 goto error_out;
 }
 
-if ( xc_clear_domain_pages(xch, domid, special_pfn(0), NR_SPECIAL_PAGES) )
+if ( xc_clear_domain_pages(xch, domid, special_pfn(0, dom), 
NR_SPECIAL_PAGES) )
 goto error_out;
 
 xc_hvm_param_set(xch, domid, HVM_PARAM_STORE_PFN,
- special_pfn(SPECIALPAGE_XENSTORE));
+ special_pfn(SPECIALPAGE_XENSTORE, dom));
 xc_hvm_param_set(xch, domid, HVM_PARAM_BUFIOREQ_PFN,
- special_pfn(SPECIALPAGE_BUFIOREQ));
+ special_pfn(SPECIALPAGE_BUFIOREQ, dom));
 xc_hvm_param_set(xch, domid, HVM_PARAM_IOREQ_PFN,
- special_pfn(SPECIALPAGE_IOREQ));
+ special_pfn(SPECIALPAGE_IOREQ, dom));
 xc_hvm_param_set(xch, domid, HVM_PARAM_CONSOLE_PFN,
- special_pfn(SPECIALPAGE_CONSOLE));
+ special_pfn(SPECIALPAGE_CONSOLE, dom));
 xc_hvm_param_set(xch, domid, HVM_PARAM_PAGING_RING_PFN,
- special_pfn(SPECIALPAGE_PAGING));
+ special_pfn(SPECIALPAGE_PAGING, dom));
 xc_hvm_param_set(xch, domid, HVM_PARAM_MONITOR_RING_PFN,
- special_pfn(SPECIALPAGE_ACCESS));
+ special_pfn(SPECIALPAGE_ACCESS, dom));
 xc_hvm_param_set(xch, domid, HVM_PARAM_SHARING_RING_PFN,
- special_pfn(SPECIALPAGE_SHARING));
+ special_pfn(SPECIALPAGE_SHARING, dom));
 
 if ( dom->emulation )
 {
@@ -567,7 +579,7 @@ static int alloc_magic_pages_hvm(struct xc_dom_image *dom)
  * server will use the IOREQ and BUFIOREQ special 

[Xen-devel] [PATCH v3 21/32] xen/x86: allow disabling all emulated devices inside of Xen

2015-07-03 Thread Roger Pau Monne
Only allow enabling or disabling all the emulated devices inside of Xen,
right now Xen doesn't support enabling specific emulated devices only.

Signed-off-by: Roger Pau Monné 
Cc: Jan Beulich 
Cc: Andrew Cooper 
---
 xen/arch/x86/domain.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/xen/arch/x86/domain.c b/xen/arch/x86/domain.c
index d684f49..bdaf646 100644
--- a/xen/arch/x86/domain.c
+++ b/xen/arch/x86/domain.c
@@ -555,7 +555,8 @@ int arch_domain_create(struct domain *d, unsigned int 
domcr_flags,
 {
 emulation_mask = (EMU_LAPIC | EMU_HPET | EMU_PMTIMER | EMU_RTC |
   EMU_IOAPIC | EMU_PIC | EMU_PMU | EMU_VGA | 
EMU_IOMMU);
-if ( (config->emulation_flags & emulation_mask) != emulation_mask )
+if ( (config->emulation_flags & emulation_mask) != emulation_mask &&
+ (config->emulation_flags & emulation_mask) != 0 )
 {
 printk(XENLOG_G_ERR "Xen does not allow HVM creation with the "
"current selection of emulators: 0x%x.\n",
-- 
1.9.5 (Apple Git-50.3)


___
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel


[Xen-devel] [PATCH v3 14/32] xen/x86: allow disabling the pmtimer

2015-07-03 Thread Roger Pau Monne
Signed-off-by: Roger Pau Monné 
Cc: Jan Beulich 
Cc: Andrew Cooper 
---
 xen/arch/x86/hvm/pmtimer.c | 13 +
 1 file changed, 13 insertions(+)

diff --git a/xen/arch/x86/hvm/pmtimer.c b/xen/arch/x86/hvm/pmtimer.c
index 8b531d9..335a296 100644
--- a/xen/arch/x86/hvm/pmtimer.c
+++ b/xen/arch/x86/hvm/pmtimer.c
@@ -248,6 +248,9 @@ static int pmtimer_save(struct domain *d, 
hvm_domain_context_t *h)
 uint32_t x, msb = s->pm.tmr_val & TMR_VAL_MSB;
 int rc;
 
+if ( !has_vpmtimer(d) )
+return 0;
+
 spin_lock(&s->lock);
 
 /* Update the counter to the guest's current time.  We always save
@@ -272,6 +275,9 @@ static int pmtimer_load(struct domain *d, 
hvm_domain_context_t *h)
 {
 PMTState *s = &d->arch.hvm_domain.pl_time.vpmt;
 
+if ( !has_vpmtimer(d) )
+return 0;
+
 spin_lock(&s->lock);
 
 /* Reload the registers */
@@ -329,6 +335,9 @@ void pmtimer_init(struct vcpu *v)
 {
 PMTState *s = &v->domain->arch.hvm_domain.pl_time.vpmt;
 
+if ( !has_vpmtimer(v->domain) )
+return;
+
 spin_lock_init(&s->lock);
 
 s->scale = ((uint64_t)FREQUENCE_PMTIMER << 32) / SYSTEM_TIME_HZ;
@@ -349,6 +358,10 @@ void pmtimer_init(struct vcpu *v)
 void pmtimer_deinit(struct domain *d)
 {
 PMTState *s = &d->arch.hvm_domain.pl_time.vpmt;
+
+if ( !has_vpmtimer(d) )
+return;
+
 kill_timer(&s->timer);
 }
 
-- 
1.9.5 (Apple Git-50.3)


___
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel


[Xen-devel] [PATCH v3 23/32] libxc: allow creating domains without emulated devices.

2015-07-03 Thread Roger Pau Monne
Introduce a new flag in xc_dom_image that turns on and off the emulated
devices. This prevents creating the VGA hole, the hvm_info page and the
ioreq server pages. libxl unconditionally sets it to true for all HVM
domains at the moment.

Signed-off-by: Roger Pau Monné 
Cc: Ian Jackson 
Cc: Stefano Stabellini 
Cc: Ian Campbell 
Cc: Wei Liu 
---
 tools/libxc/include/xc_dom.h |  1 +
 tools/libxc/xc_dom_x86.c | 71 +---
 tools/libxl/libxl_dom.c  |  1 +
 3 files changed, 42 insertions(+), 31 deletions(-)

diff --git a/tools/libxc/include/xc_dom.h b/tools/libxc/include/xc_dom.h
index 68b052c..7086f6e 100644
--- a/tools/libxc/include/xc_dom.h
+++ b/tools/libxc/include/xc_dom.h
@@ -194,6 +194,7 @@ struct xc_dom_image {
 xen_pfn_t mmio_size;
 xen_pfn_t lowmem_end;
 xen_pfn_t highmem_end;
+bool emulation;
 
 /* Extra ACPI tables passed to HVMLOADER */
 struct xc_hvm_firmware_module acpi_module;
diff --git a/tools/libxc/xc_dom_x86.c b/tools/libxc/xc_dom_x86.c
index 6573b94..336eab4 100644
--- a/tools/libxc/xc_dom_x86.c
+++ b/tools/libxc/xc_dom_x86.c
@@ -520,12 +520,15 @@ static int alloc_magic_pages_hvm(struct xc_dom_image *dom)
 xen_pfn_t ioreq_server_array[NR_IOREQ_SERVER_PAGES];
 xc_interface *xch = dom->xch;
 
-if ( (hvm_info_page = xc_map_foreign_range(
-  xch, domid, PAGE_SIZE, PROT_READ | PROT_WRITE,
-  HVM_INFO_PFN)) == NULL )
-goto error_out;
-build_hvm_info(hvm_info_page, dom);
-munmap(hvm_info_page, PAGE_SIZE);
+if ( dom->emulation )
+{
+if ( (hvm_info_page = xc_map_foreign_range(
+  xch, domid, PAGE_SIZE, PROT_READ | PROT_WRITE,
+  HVM_INFO_PFN)) == NULL )
+goto error_out;
+build_hvm_info(hvm_info_page, dom);
+munmap(hvm_info_page, PAGE_SIZE);
+}
 
 /* Allocate and clear special pages. */
 for ( i = 0; i < NR_SPECIAL_PAGES; i++ )
@@ -557,30 +560,33 @@ static int alloc_magic_pages_hvm(struct xc_dom_image *dom)
 xc_hvm_param_set(xch, domid, HVM_PARAM_SHARING_RING_PFN,
  special_pfn(SPECIALPAGE_SHARING));
 
-/*
- * Allocate and clear additional ioreq server pages. The default
- * server will use the IOREQ and BUFIOREQ special pages above.
- */
-for ( i = 0; i < NR_IOREQ_SERVER_PAGES; i++ )
-ioreq_server_array[i] = ioreq_server_pfn(i);
-
-rc = xc_domain_populate_physmap_exact(xch, domid, NR_IOREQ_SERVER_PAGES, 0,
-  0, ioreq_server_array);
-if ( rc != 0 )
+if ( dom->emulation )
 {
-DOMPRINTF("Could not allocate ioreq server pages.");
-goto error_out;
-}
+/*
+ * Allocate and clear additional ioreq server pages. The default
+ * server will use the IOREQ and BUFIOREQ special pages above.
+ */
+for ( i = 0; i < NR_IOREQ_SERVER_PAGES; i++ )
+ioreq_server_array[i] = ioreq_server_pfn(i);
 
-if ( xc_clear_domain_pages(xch, domid, ioreq_server_pfn(0),
-   NR_IOREQ_SERVER_PAGES) )
+rc = xc_domain_populate_physmap_exact(xch, domid, 
NR_IOREQ_SERVER_PAGES, 0,
+  0, ioreq_server_array);
+if ( rc != 0 )
+{
+DOMPRINTF("Could not allocate ioreq server pages.");
 goto error_out;
+}
 
-/* Tell the domain where the pages are and how many there are */
-xc_hvm_param_set(xch, domid, HVM_PARAM_IOREQ_SERVER_PFN,
- ioreq_server_pfn(0));
-xc_hvm_param_set(xch, domid, HVM_PARAM_NR_IOREQ_SERVER_PAGES,
- NR_IOREQ_SERVER_PAGES);
+if ( xc_clear_domain_pages(xch, domid, ioreq_server_pfn(0),
+   NR_IOREQ_SERVER_PAGES) )
+goto error_out;
+
+/* Tell the domain where the pages are and how many there are */
+xc_hvm_param_set(xch, domid, HVM_PARAM_IOREQ_SERVER_PFN,
+ ioreq_server_pfn(0));
+xc_hvm_param_set(xch, domid, HVM_PARAM_NR_IOREQ_SERVER_PAGES,
+ NR_IOREQ_SERVER_PAGES);
+}
 
 /*
  * Identity-map page table is required for running with CR0.PG=0 when
@@ -1228,7 +1234,8 @@ static int meminit_hvm(struct xc_dom_image *dom)
  * allocated is pointless.
  */
 if ( claim_enabled ) {
-rc = xc_domain_claim_pages(xch, domid, target_pages - VGA_HOLE_SIZE);
+rc = xc_domain_claim_pages(xch, domid, target_pages -
+   dom->emulation ? VGA_HOLE_SIZE : 0);
 if ( rc != 0 )
 {
 DOMPRINTF("Could not allocate memory for HVM guest as we cannot 
claim memory!");
@@ -1244,7 +1251,8 @@ static int meminit_hvm(struct xc_dom_image *dom)
  * tot_pages will be target_pages - VGA_HOLE_SIZE after
  * this call.
  */
-rc = xc_domain_set_pod_target(xch, dom

[Xen-devel] [PATCH v3 10/32] libxc: remove dead HVM building code

2015-07-03 Thread Roger Pau Monne
Remove xc_hvm_build_x86.c and xc_hvm_build_arm.c since xc_hvm_build is not
longer used in order to create HVM guests.

Signed-off-by: Roger Pau Monné 
Cc: Ian Jackson 
Cc: Stefano Stabellini 
Cc: Ian Campbell 
Cc: Wei Liu 
---
 tools/libxc/Makefile  |   2 -
 tools/libxc/include/xenguest.h|  44 ---
 tools/libxc/xc_hvm_build_arm.c|  49 ---
 tools/libxc/xc_hvm_build_x86.c| 805 --
 tools/libxc/xg_private.c  |   9 -
 tools/python/xen/lowlevel/xc/xc.c |  81 
 6 files changed, 990 deletions(-)
 delete mode 100644 tools/libxc/xc_hvm_build_arm.c
 delete mode 100644 tools/libxc/xc_hvm_build_x86.c

diff --git a/tools/libxc/Makefile b/tools/libxc/Makefile
index 48fc473..a143c0f 100644
--- a/tools/libxc/Makefile
+++ b/tools/libxc/Makefile
@@ -94,9 +94,7 @@ GUEST_SRCS-y += xc_dom_compat_linux.c
 
 GUEST_SRCS-$(CONFIG_X86) += xc_dom_x86.c
 GUEST_SRCS-$(CONFIG_X86) += xc_cpuid_x86.c
-GUEST_SRCS-$(CONFIG_X86) += xc_hvm_build_x86.c
 GUEST_SRCS-$(CONFIG_ARM) += xc_dom_arm.c
-GUEST_SRCS-$(CONFIG_ARM) += xc_hvm_build_arm.c
 
 ifeq ($(CONFIG_LIBXC_MINIOS),y)
 GUEST_SRCS-y += xc_dom_decompress_unsafe.c
diff --git a/tools/libxc/include/xenguest.h b/tools/libxc/include/xenguest.h
index 7581263..d96bf7d 100644
--- a/tools/libxc/include/xenguest.h
+++ b/tools/libxc/include/xenguest.h
@@ -233,50 +233,6 @@ struct xc_hvm_firmware_module {
 uint64_t  guest_addr_out;
 };
 
-struct xc_hvm_build_args {
-uint64_t mem_size;   /* Memory size in bytes. */
-uint64_t mem_target; /* Memory target in bytes. */
-uint64_t mmio_size;  /* Size of the MMIO hole in bytes. */
-const char *image_file_name; /* File name of the image to load. */
-
-/* Extra ACPI tables passed to HVMLOADER */
-struct xc_hvm_firmware_module acpi_module;
-
-/* Extra SMBIOS structures passed to HVMLOADER */
-struct xc_hvm_firmware_module smbios_module;
-/* Whether to use claim hypercall (1 - enable, 0 - disable). */
-int claim_enabled;
-
-/* vNUMA information*/
-xen_vmemrange_t *vmemranges;
-unsigned int nr_vmemranges;
-unsigned int *vnode_to_pnode;
-unsigned int nr_vnodes;
-
-/* Out parameters  */
-uint64_t lowmem_end;
-uint64_t highmem_end;
-uint64_t mmio_start;
-};
-
-/**
- * Build a HVM domain.
- * @parm xch  libxc context handle.
- * @parm domiddomain ID for the new domain.
- * @parm hvm_args parameters for the new domain.
- *
- * The memory size and image file parameters are required, the rest
- * are optional.
- */
-int xc_hvm_build(xc_interface *xch, uint32_t domid,
- struct xc_hvm_build_args *hvm_args);
-
-int xc_hvm_build_target_mem(xc_interface *xch,
-uint32_t domid,
-int memsize,
-int target,
-const char *image_name);
-
 /*
  * Sets *lockfd to -1.
  * Has deallocated everything even on error.
diff --git a/tools/libxc/xc_hvm_build_arm.c b/tools/libxc/xc_hvm_build_arm.c
deleted file mode 100644
index ff66689..000
--- a/tools/libxc/xc_hvm_build_arm.c
+++ /dev/null
@@ -1,49 +0,0 @@
-/**
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation;
- * version 2.1 of the License.
- *
- * This library is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this library; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  
USA
- *
- * Copyright (c) 2011, Citrix Systems
- */
-
-#include 
-#include 
-#include 
-#include 
-
-int xc_hvm_build(xc_interface *xch, uint32_t domid,
- struct xc_hvm_build_args *hvm_args)
-{
-errno = ENOSYS;
-return -1;
-}
-
-int xc_hvm_build_target_mem(xc_interface *xch,
-   uint32_t domid,
-   int memsize,
-   int target,
-   const char *image_name)
-{
-errno = ENOSYS;
-return -1;
-}
-
-/*
- * Local variables:
- * mode: C
- * c-file-style: "BSD"
- * c-basic-offset: 4
- * tab-width: 4
- * indent-tabs-mode: nil
- * End:
- */
diff --git a/tools/libxc/xc_hvm_build_x86.c b/tools/libxc/xc_hvm_build_x86.c
deleted file mode 100644
index f7616a8..000
--- a/tools/libxc/xc_hvm_build_x86.c
+++ /dev/null
@@ -1,805 +0,0 @@
-/**
- * xc_hvm_build.c
- *
- * This librar

[Xen-devel] [PATCH v3 13/32] xen/x86: allow disabling the emulated HPET

2015-07-03 Thread Roger Pau Monne
Signed-off-by: Roger Pau Monné 
Cc: Jan Beulich 
Cc: Andrew Cooper 
---
 xen/arch/x86/hvm/hpet.c | 13 +
 xen/arch/x86/hvm/hvm.c  |  1 -
 2 files changed, 13 insertions(+), 1 deletion(-)

diff --git a/xen/arch/x86/hvm/hpet.c b/xen/arch/x86/hvm/hpet.c
index 732504a..9773034 100644
--- a/xen/arch/x86/hvm/hpet.c
+++ b/xen/arch/x86/hvm/hpet.c
@@ -517,6 +517,9 @@ static int hpet_save(struct domain *d, hvm_domain_context_t 
*h)
 int rc;
 uint64_t guest_time;
 
+if ( !has_vhpet(d) )
+return 0;
+
 write_lock(&hp->lock);
 guest_time = guest_time_hpet(hp);
 
@@ -576,6 +579,9 @@ static int hpet_load(struct domain *d, hvm_domain_context_t 
*h)
 uint64_t guest_time;
 int i;
 
+if ( !has_vhpet(d) )
+return 0;
+
 write_lock(&hp->lock);
 
 /* Reload the HPET registers */
@@ -634,6 +640,9 @@ void hpet_init(struct domain *d)
 HPETState *h = domain_vhpet(d);
 int i;
 
+if ( !has_vhpet(d) )
+return;
+
 memset(h, 0, sizeof(HPETState));
 
 rwlock_init(&h->lock);
@@ -661,6 +670,7 @@ void hpet_init(struct domain *d)
 }
 
 register_mmio_handler(d, &hpet_mmio_ops);
+d->arch.hvm_domain.params[HVM_PARAM_HPET_ENABLED] = 1;
 }
 
 void hpet_deinit(struct domain *d)
@@ -668,6 +678,9 @@ void hpet_deinit(struct domain *d)
 int i;
 HPETState *h = domain_vhpet(d);
 
+if ( !has_vhpet(d) )
+return;
+
 write_lock(&h->lock);
 
 if ( hpet_enabled(h) )
diff --git a/xen/arch/x86/hvm/hvm.c b/xen/arch/x86/hvm/hvm.c
index 901f9a8..9c6e7fd 100644
--- a/xen/arch/x86/hvm/hvm.c
+++ b/xen/arch/x86/hvm/hvm.c
@@ -1547,7 +1547,6 @@ int hvm_domain_initialise(struct domain *d)
 
 hvm_init_guest_time(d);
 
-d->arch.hvm_domain.params[HVM_PARAM_HPET_ENABLED] = 1;
 d->arch.hvm_domain.params[HVM_PARAM_TRIPLE_FAULT_REASON] = SHUTDOWN_reboot;
 
 vpic_init(d);
-- 
1.9.5 (Apple Git-50.3)


___
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel


[Xen-devel] [PATCH v3 15/32] xen/x86: allow disabling the emulated RTC

2015-07-03 Thread Roger Pau Monne
Signed-off-by: Roger Pau Monné 
Cc: Jan Beulich 
Cc: Andrew Cooper 
---
 xen/arch/x86/hvm/rtc.c | 16 
 1 file changed, 16 insertions(+)

diff --git a/xen/arch/x86/hvm/rtc.c b/xen/arch/x86/hvm/rtc.c
index fde120b..d6d24c8 100644
--- a/xen/arch/x86/hvm/rtc.c
+++ b/xen/arch/x86/hvm/rtc.c
@@ -726,6 +726,9 @@ void rtc_migrate_timers(struct vcpu *v)
 {
 RTCState *s = vcpu_vrtc(v);
 
+if ( !has_vrtc(v->domain) )
+return;
+
 if ( v->vcpu_id == 0 )
 {
 migrate_timer(&s->update_timer, v->processor);;
@@ -739,6 +742,10 @@ static int rtc_save(struct domain *d, hvm_domain_context_t 
*h)
 {
 RTCState *s = domain_vrtc(d);
 int rc;
+
+if ( !has_vrtc(d) )
+return 0;
+
 spin_lock(&s->lock);
 rc = hvm_save_entry(RTC, 0, h, &s->hw);
 spin_unlock(&s->lock);
@@ -750,6 +757,9 @@ static int rtc_load(struct domain *d, hvm_domain_context_t 
*h)
 {
 RTCState *s = domain_vrtc(d);
 
+if ( !has_vrtc(d) )
+return 0;
+
 spin_lock(&s->lock);
 
 /* Restore the registers */
@@ -790,6 +800,9 @@ void rtc_init(struct domain *d)
 {
 RTCState *s = domain_vrtc(d);
 
+if ( !has_vrtc(d) )
+return;
+
 spin_lock_init(&s->lock);
 
 init_timer(&s->update_timer, rtc_update_timer, s, smp_processor_id());
@@ -820,6 +833,9 @@ void rtc_deinit(struct domain *d)
 {
 RTCState *s = domain_vrtc(d);
 
+if ( !has_vrtc(d) )
+return;
+
 spin_barrier(&s->lock);
 
 TRACE_0D(TRC_HVM_EMUL_RTC_STOP_TIMER);
-- 
1.9.5 (Apple Git-50.3)


___
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel


[Xen-devel] [PATCH v3 25/32] xen/x86: allow HVM guests to use hypercalls to bring up vCPUs

2015-07-03 Thread Roger Pau Monne
Allow the usage of the VCPUOP_initialise, VCPUOP_up, VCPUOP_down and
VCPUOP_is_up hypercalls from HVM guests.

Signed-off-by: Roger Pau Monné 
Cc: Jan Beulich 
Cc: Andrew Cooper 
---
 xen/arch/x86/hvm/hvm.c | 8 
 1 file changed, 8 insertions(+)

diff --git a/xen/arch/x86/hvm/hvm.c b/xen/arch/x86/hvm/hvm.c
index 75a5566..350e409 100644
--- a/xen/arch/x86/hvm/hvm.c
+++ b/xen/arch/x86/hvm/hvm.c
@@ -4808,6 +4808,10 @@ static long hvm_vcpu_op(
 case VCPUOP_stop_singleshot_timer:
 case VCPUOP_register_vcpu_info:
 case VCPUOP_register_vcpu_time_memory_area:
+case VCPUOP_initialise:
+case VCPUOP_up:
+case VCPUOP_down:
+case VCPUOP_is_up:
 rc = do_vcpu_op(cmd, vcpuid, arg);
 break;
 default:
@@ -4866,6 +4870,10 @@ static long hvm_vcpu_op_compat32(
 case VCPUOP_stop_singleshot_timer:
 case VCPUOP_register_vcpu_info:
 case VCPUOP_register_vcpu_time_memory_area:
+case VCPUOP_initialise:
+case VCPUOP_up:
+case VCPUOP_down:
+case VCPUOP_is_up:
 rc = compat_vcpu_op(cmd, vcpuid, arg);
 break;
 default:
-- 
1.9.5 (Apple Git-50.3)


___
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel


[Xen-devel] [PATCH v3 30/32] libxc/xen: introduce HVM_PARAM_MODLIST_PFN

2015-07-03 Thread Roger Pau Monne
This HVM parameter is used to pass a list of loaded modules to the guest.
Right now the number of loaded modules is limited to 1 by the current
implementation, but this interface allows passing more than one module.

Signed-off-by: Roger Pau Monné 
Cc: Ian Jackson 
Cc: Stefano Stabellini 
Cc: Ian Campbell 
Cc: Wei Liu 
Cc: Keir Fraser 
Cc: Jan Beulich 
Cc: Andrew Cooper 
---
 tools/libxc/xc_dom_x86.c| 24 +++-
 xen/arch/x86/hvm/hvm.c  |  1 +
 xen/include/public/hvm/params.h | 23 ++-
 3 files changed, 46 insertions(+), 2 deletions(-)

diff --git a/tools/libxc/xc_dom_x86.c b/tools/libxc/xc_dom_x86.c
index 74c3819..71b353e 100644
--- a/tools/libxc/xc_dom_x86.c
+++ b/tools/libxc/xc_dom_x86.c
@@ -58,7 +58,8 @@
 #define SPECIALPAGE_IDENT_PT 6
 #define SPECIALPAGE_CONSOLE  7
 #define SPECIALPAGE_CMDLINE  8
-#define NR_SPECIAL_PAGES 9
+#define SPECIALPAGE_MODLIST  9
+#define NR_SPECIAL_PAGES 10
 #define LAST_SPECIAL_PFN 0xff000u
 
 #define NR_IOREQ_SERVER_PAGES 8
@@ -533,6 +534,7 @@ static int alloc_magic_pages_hvm(struct xc_dom_image *dom)
 xen_pfn_t ioreq_server_array[NR_IOREQ_SERVER_PAGES];
 xc_interface *xch = dom->xch;
 char *cmdline;
+uint64_t *modlist;
 
 if ( dom->emulation )
 {
@@ -621,6 +623,26 @@ static int alloc_magic_pages_hvm(struct xc_dom_image *dom)
  NR_IOREQ_SERVER_PAGES);
 }
 
+if ( dom->ramdisk_blob )
+{
+modlist = xc_map_foreign_range(
+  xch, domid, PAGE_SIZE, PROT_READ | PROT_WRITE,
+  special_pfn(SPECIALPAGE_MODLIST, dom));
+if ( modlist == NULL ) {
+DOMPRINTF("Unable to map module list page");
+goto error_out;
+}
+
+/* This is currently limited to only one module. */
+modlist[0] = dom->ramdisk_seg.vstart - dom->parms.virt_base;
+modlist[1] = dom->ramdisk_seg.vend - dom->ramdisk_seg.vstart;
+modlist[2] = 0;
+modlist[3] = 0;
+munmap(modlist, PAGE_SIZE);
+xc_hvm_param_set(xch, domid, HVM_PARAM_MODLIST_PFN,
+ special_pfn(SPECIALPAGE_MODLIST, dom));
+}
+
 /*
  * Identity-map page table is required for running with CR0.PG=0 when
  * using Intel EPT. Create a 32-bit non-PAE page directory of superpages.
diff --git a/xen/arch/x86/hvm/hvm.c b/xen/arch/x86/hvm/hvm.c
index 2b190e9..95f12c0 100644
--- a/xen/arch/x86/hvm/hvm.c
+++ b/xen/arch/x86/hvm/hvm.c
@@ -5919,6 +5919,7 @@ static int hvm_allow_get_param(struct domain *d,
 case HVM_PARAM_CONSOLE_EVTCHN:
 case HVM_PARAM_CMDLINE_PFN:
 case HVM_PARAM_FIRST_FREE_PFN:
+case HVM_PARAM_MODLIST_PFN:
 break;
 /*
  * The following parameters must not be read by the guest
diff --git a/xen/include/public/hvm/params.h b/xen/include/public/hvm/params.h
index 47e38a8..86cc15b 100644
--- a/xen/include/public/hvm/params.h
+++ b/xen/include/public/hvm/params.h
@@ -193,6 +193,27 @@
 /* First free PFN after the special pages. */
 #define HVM_PARAM_FIRST_FREE_PFN 36
 
-#define HVM_NR_PARAMS  37
+/*
+ * List of modules passed to the kernel.
+ *
+ * The PFN returned by this HVM_PARAM points to a page that contains an
+ * array of unsigned 64bit integers encoded in little endian.
+ *
+ * The first integer contains the address where the module has been loaded,
+ * while the second contains the size of the module in bytes. The last element
+ * in the array is a module with address 0 and length 0:
+ *
+ * module[0] = 
+ * module[1] = 
+ * [...]
+ * module[N/2] = 
+ * module[N/2+1] = 
+ * [...]
+ * module[M] = 0
+ * module[M+1] = 0
+ */
+#define HVM_PARAM_MODLIST_PFN 37
+
+#define HVM_NR_PARAMS  38
 
 #endif /* __XEN_PUBLIC_HVM_PARAMS_H__ */
-- 
1.9.5 (Apple Git-50.3)


___
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel


[Xen-devel] [PATCH v3 17/32] xen/x86: allow disabling the emulated PIC

2015-07-03 Thread Roger Pau Monne
Signed-off-by: Roger Pau Monné 
Cc: Jan Beulich 
Cc: Andrew Cooper 
---
 xen/arch/x86/hvm/vpic.c | 11 ++-
 1 file changed, 10 insertions(+), 1 deletion(-)

diff --git a/xen/arch/x86/hvm/vpic.c b/xen/arch/x86/hvm/vpic.c
index 909b9d0..2eb162a 100644
--- a/xen/arch/x86/hvm/vpic.c
+++ b/xen/arch/x86/hvm/vpic.c
@@ -377,6 +377,9 @@ static int vpic_save(struct domain *d, hvm_domain_context_t 
*h)
 struct hvm_hw_vpic *s;
 int i;
 
+if ( !has_vpic(d) )
+return 0;
+
 /* Save the state of both PICs */
 for ( i = 0; i < 2 ; i++ )
 {
@@ -392,7 +395,10 @@ static int vpic_load(struct domain *d, 
hvm_domain_context_t *h)
 {
 struct hvm_hw_vpic *s;
 uint16_t inst;
-
+
+if ( !has_vpic(d) )
+return 0;
+
 /* Which PIC is this? */
 inst = hvm_load_instance(h);
 if ( inst > 1 )
@@ -425,6 +431,9 @@ void vpic_reset(struct domain *d)
 
 void vpic_init(struct domain *d)
 {
+if ( !has_vpic(d) )
+return;
+
 vpic_reset(d);
 
 register_portio_handler(d, 0x20, 2, vpic_intercept_pic_io);
-- 
1.9.5 (Apple Git-50.3)


___
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel


[Xen-devel] [PATCH v3 28/32] libxc/xen: introduce HVM_PARAM_CMDLINE_PFN

2015-07-03 Thread Roger Pau Monne
This HVM parameter returns a PFN that contains the address of the memory
page where the guest command line has been placed.

Signed-off-by: Roger Pau Monné 
Cc: Ian Jackson 
Cc: Stefano Stabellini 
Cc: Ian Campbell 
Cc: Wei Liu 
Cc: Jan Beulich 
Cc: Andrew Cooper 
---
 tools/libxc/xc_dom_x86.c| 21 -
 xen/arch/x86/hvm/hvm.c  |  1 +
 xen/include/public/hvm/params.h |  5 -
 3 files changed, 25 insertions(+), 2 deletions(-)

diff --git a/tools/libxc/xc_dom_x86.c b/tools/libxc/xc_dom_x86.c
index 1195400..41ff7a4 100644
--- a/tools/libxc/xc_dom_x86.c
+++ b/tools/libxc/xc_dom_x86.c
@@ -57,7 +57,8 @@
 #define SPECIALPAGE_IOREQ5
 #define SPECIALPAGE_IDENT_PT 6
 #define SPECIALPAGE_CONSOLE  7
-#define NR_SPECIAL_PAGES 8
+#define SPECIALPAGE_CMDLINE  8
+#define NR_SPECIAL_PAGES 9
 #define LAST_SPECIAL_PFN 0xff000u
 
 #define NR_IOREQ_SERVER_PAGES 8
@@ -531,6 +532,7 @@ static int alloc_magic_pages_hvm(struct xc_dom_image *dom)
 xen_pfn_t special_array[NR_SPECIAL_PAGES];
 xen_pfn_t ioreq_server_array[NR_IOREQ_SERVER_PAGES];
 xc_interface *xch = dom->xch;
+char *cmdline;
 
 if ( dom->emulation )
 {
@@ -572,6 +574,23 @@ static int alloc_magic_pages_hvm(struct xc_dom_image *dom)
 xc_hvm_param_set(xch, domid, HVM_PARAM_SHARING_RING_PFN,
  special_pfn(SPECIALPAGE_SHARING, dom));
 
+if ( dom->cmdline )
+{
+cmdline = xc_map_foreign_range(
+  xch, domid, PAGE_SIZE, PROT_READ | PROT_WRITE,
+  special_pfn(SPECIALPAGE_CMDLINE, dom));
+if ( cmdline == NULL ) {
+DOMPRINTF("Unable to map command line page");
+goto error_out;
+}
+
+strncpy(cmdline, dom->cmdline, MAX_GUEST_CMDLINE);
+cmdline[MAX_GUEST_CMDLINE - 1] = '\0';
+munmap(cmdline, PAGE_SIZE);
+xc_hvm_param_set(xch, domid, HVM_PARAM_CMDLINE_PFN,
+ special_pfn(SPECIALPAGE_CMDLINE, dom));
+}
+
 if ( dom->emulation )
 {
 /*
diff --git a/xen/arch/x86/hvm/hvm.c b/xen/arch/x86/hvm/hvm.c
index 350e409..efe7232 100644
--- a/xen/arch/x86/hvm/hvm.c
+++ b/xen/arch/x86/hvm/hvm.c
@@ -5917,6 +5917,7 @@ static int hvm_allow_get_param(struct domain *d,
 case HVM_PARAM_STORE_EVTCHN:
 case HVM_PARAM_CONSOLE_PFN:
 case HVM_PARAM_CONSOLE_EVTCHN:
+case HVM_PARAM_CMDLINE_PFN:
 break;
 /*
  * The following parameters must not be read by the guest
diff --git a/xen/include/public/hvm/params.h b/xen/include/public/hvm/params.h
index 7c73089..b7f8839 100644
--- a/xen/include/public/hvm/params.h
+++ b/xen/include/public/hvm/params.h
@@ -187,6 +187,9 @@
 /* Location of the VM Generation ID in guest physical address space. */
 #define HVM_PARAM_VM_GENERATION_ID_ADDR 34
 
-#define HVM_NR_PARAMS  35
+/* PFN of the command line. */
+#define HVM_PARAM_CMDLINE_PFN 35
+
+#define HVM_NR_PARAMS  36
 
 #endif /* __XEN_PUBLIC_HVM_PARAMS_H__ */
-- 
1.9.5 (Apple Git-50.3)


___
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel


[Xen-devel] [PATCH v3 32/32] libxl: allow the creation of HVM domains without a device model.

2015-07-03 Thread Roger Pau Monne
Replace the firmware loaded into HVM guests with an OS kernel. Since the HVM
builder now uses the PV xc_dom_* set of functions this kernel will be parsed
and loaded inside the guest like on PV, but the container is a pure HVM
guest.

Also, if device_model_version is set to none unconditinally set the nic type
to LIBXL_NIC_TYPE_VIF.

Signed-off-by: Roger Pau Monné 
Cc: Ian Jackson 
Cc: Stefano Stabellini 
Cc: Ian Campbell 
Cc: Wei Liu 
---
 docs/man/xl.cfg.pod.5   |  5 
 tools/libxl/libxl.c |  7 +++---
 tools/libxl/libxl_create.c  | 18 ++
 tools/libxl/libxl_dom.c | 60 ++---
 tools/libxl/libxl_types.idl |  1 +
 tools/libxl/libxl_x86.c |  4 ++-
 tools/libxl/xl_cmdimpl.c|  2 ++
 7 files changed, 72 insertions(+), 25 deletions(-)

diff --git a/docs/man/xl.cfg.pod.5 b/docs/man/xl.cfg.pod.5
index a3e0e2e..1270605 100644
--- a/docs/man/xl.cfg.pod.5
+++ b/docs/man/xl.cfg.pod.5
@@ -1631,6 +1631,11 @@ This device-model is the default for Linux dom0.
 Use the device-model based upon the historical Xen fork of Qemu.
 This device-model is still the default for NetBSD dom0.
 
+=item B
+
+Don't use any device model. This requires a kernel capable of booting
+in this mode.
+
 =back
 
 It is recommended to accept the default value for new guests.  If
diff --git a/tools/libxl/libxl.c b/tools/libxl/libxl.c
index e9a2d26..a6690cf 100644
--- a/tools/libxl/libxl.c
+++ b/tools/libxl/libxl.c
@@ -1590,11 +1590,10 @@ void libxl__destroy_domid(libxl__egc *egc, 
libxl__destroy_domid_state *dis)
 
 switch (libxl__domain_type(gc, domid)) {
 case LIBXL_DOMAIN_TYPE_HVM:
-if (!libxl_get_stubdom_id(CTX, domid))
-dm_present = 1;
-else
+if (libxl_get_stubdom_id(CTX, domid)) {
 dm_present = 0;
-break;
+break;
+}
 case LIBXL_DOMAIN_TYPE_PV:
 pid = libxl__xs_read(gc, XBT_NULL, libxl__sprintf(gc, 
"/local/domain/%d/image/device-model-pid", domid));
 dm_present = (pid != NULL);
diff --git a/tools/libxl/libxl_create.c b/tools/libxl/libxl_create.c
index f366a09..1444e40 100644
--- a/tools/libxl/libxl_create.c
+++ b/tools/libxl/libxl_create.c
@@ -164,6 +164,8 @@ int libxl__domain_build_info_setdefault(libxl__gc *gc,
 b_info->u.hvm.bios = LIBXL_BIOS_TYPE_ROMBIOS; break;
 case LIBXL_DEVICE_MODEL_VERSION_QEMU_XEN:
 b_info->u.hvm.bios = LIBXL_BIOS_TYPE_SEABIOS; break;
+case LIBXL_DEVICE_MODEL_VERSION_NONE:
+break;
 default:return ERROR_INVAL;
 }
 
@@ -177,6 +179,8 @@ int libxl__domain_build_info_setdefault(libxl__gc *gc,
 if (b_info->u.hvm.bios == LIBXL_BIOS_TYPE_ROMBIOS)
 return ERROR_INVAL;
 break;
+case LIBXL_DEVICE_MODEL_VERSION_NONE:
+break;
 default:abort();
 }
 
@@ -278,6 +282,9 @@ int libxl__domain_build_info_setdefault(libxl__gc *gc,
 break;
 }
 break;
+case LIBXL_DEVICE_MODEL_VERSION_NONE:
+b_info->video_memkb = 0;
+break;
 case LIBXL_DEVICE_MODEL_VERSION_QEMU_XEN:
 default:
 switch (b_info->u.hvm.vga.kind) {
@@ -945,6 +952,11 @@ static void initiate_domain_create(libxl__egc *egc,
 ret = libxl__device_nic_setdefault(gc, &d_config->nics[i], domid);
 if (ret) goto error_out;
 
+/* HVM guests without a device model only have PV nics. */
+if (d_config->b_info.device_model_version ==
+LIBXL_DEVICE_MODEL_VERSION_NONE)
+d_config->nics[i].nictype = LIBXL_NIC_TYPE_VIF;
+
 if (d_config->nics[i].devid > last_devid)
 last_devid = d_config->nics[i].devid;
 }
@@ -1293,6 +1305,12 @@ static void domcreate_launch_dm(libxl__egc *egc, 
libxl__multidev *multidev,
 libxl__device_console_add(gc, domid, &console, state, &device);
 libxl__device_console_dispose(&console);
 
+if (d_config->b_info.device_model_version ==
+LIBXL_DEVICE_MODEL_VERSION_NONE) {
+domcreate_devmodel_started(egc, &dcs->dmss.dm, 0);
+return;
+}
+
 libxl_device_vkb_init(&vkb);
 libxl__device_vkb_add(gc, domid, &vkb);
 libxl_device_vkb_dispose(&vkb);
diff --git a/tools/libxl/libxl_dom.c b/tools/libxl/libxl_dom.c
index 6ce4115..59854a1 100644
--- a/tools/libxl/libxl_dom.c
+++ b/tools/libxl/libxl_dom.c
@@ -789,21 +789,23 @@ static int hvm_build_set_params(xc_interface *handle, 
uint32_t domid,
 uint64_t str_mfn, cons_mfn;
 int i;
 
-va_map = xc_map_foreign_range(handle, domid,
-  XC_PAGE_SIZE, PROT_READ | PROT_WRITE,
-  HVM_INFO_PFN);
-if (va_map == NULL)
-return -1;
-
-va_hvm = (struct hvm_info_table *)(va_map + HVM_INFO_OFFSET);
-va_hvm->apic_mode = libxl_defbool_val(info->u.hvm.apic);
-

[Xen-devel] [PATCH v3 16/32] xen/x86: allow disabling the emulated IO APIC

2015-07-03 Thread Roger Pau Monne
Signed-off-by: Roger Pau Monné 
Cc: Jan Beulich 
Cc: Andrew Cooper 
---
 xen/arch/x86/hvm/vioapic.c | 14 ++
 1 file changed, 14 insertions(+)

diff --git a/xen/arch/x86/hvm/vioapic.c b/xen/arch/x86/hvm/vioapic.c
index 9de2ff3..4cfc704 100644
--- a/xen/arch/x86/hvm/vioapic.c
+++ b/xen/arch/x86/hvm/vioapic.c
@@ -425,12 +425,20 @@ void vioapic_update_EOI(struct domain *d, u8 vector)
 static int ioapic_save(struct domain *d, hvm_domain_context_t *h)
 {
 struct hvm_hw_vioapic *s = domain_vioapic(d);
+
+if ( !has_vioapic(d) )
+return 0;
+
 return hvm_save_entry(IOAPIC, 0, h, s);
 }
 
 static int ioapic_load(struct domain *d, hvm_domain_context_t *h)
 {
 struct hvm_hw_vioapic *s = domain_vioapic(d);
+
+if ( !has_vioapic(d) )
+return 0;
+
 return hvm_load_entry(IOAPIC, h, s);
 }
 
@@ -449,6 +457,9 @@ void vioapic_reset(struct domain *d)
 
 int vioapic_init(struct domain *d)
 {
+if ( !has_vioapic(d) )
+return 0;
+
 if ( (d->arch.hvm_domain.vioapic == NULL) &&
  ((d->arch.hvm_domain.vioapic = xmalloc(struct hvm_vioapic)) == NULL) )
 return -ENOMEM;
@@ -463,6 +474,9 @@ int vioapic_init(struct domain *d)
 
 void vioapic_deinit(struct domain *d)
 {
+if ( !has_vioapic(d) )
+return;
+
 xfree(d->arch.hvm_domain.vioapic);
 d->arch.hvm_domain.vioapic = NULL;
 }
-- 
1.9.5 (Apple Git-50.3)


___
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel


[Xen-devel] [PATCH v3 31/32] libxc: switch xc_dom_elfloader to be used with HVMlite domains

2015-07-03 Thread Roger Pau Monne
Allow xc_dom_elfloader to report a guest type as hvm-3.0-x86_32 if it's
running inside of a HVM container and has the PHYS32_ENTRY elfnote set.

Signed-off-by: Roger Pau Monné 
Cc: Ian Jackson 
Cc: Stefano Stabellini 
Cc: Ian Campbell 
Cc: Wei Liu 
---
Only xc_dom_elfloader has been switched to support HVMlite, other loaders
should also be switched once we have a HVMlite compatible kernel that uses
them.
---
 tools/libxc/xc_dom_elfloader.c | 4 
 1 file changed, 4 insertions(+)

diff --git a/tools/libxc/xc_dom_elfloader.c b/tools/libxc/xc_dom_elfloader.c
index 6ce1062..2f05015 100644
--- a/tools/libxc/xc_dom_elfloader.c
+++ b/tools/libxc/xc_dom_elfloader.c
@@ -57,6 +57,10 @@ static char *xc_dom_guest_type(struct xc_dom_image *dom,
 {
 uint64_t machine = elf_uval(elf, elf->ehdr, e_machine);
 
+if ( dom->container_type == XC_DOM_HVM_CONTAINER &&
+ dom->parms.phys_entry != UNSET_ADDR )
+return "hvm-3.0-x86_32";
+
 switch ( machine )
 {
 case EM_386:
-- 
1.9.5 (Apple Git-50.3)


___
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel


[Xen-devel] [PATCH v3 19/32] xen/x86: allow disabling the emulated VGA

2015-07-03 Thread Roger Pau Monne
Signed-off-by: Roger Pau Monné 
Cc: Jan Beulich 
Cc: Andrew Cooper 
---
 xen/arch/x86/hvm/stdvga.c | 6 ++
 1 file changed, 6 insertions(+)

diff --git a/xen/arch/x86/hvm/stdvga.c b/xen/arch/x86/hvm/stdvga.c
index f13983e..87d0725 100644
--- a/xen/arch/x86/hvm/stdvga.c
+++ b/xen/arch/x86/hvm/stdvga.c
@@ -546,6 +546,9 @@ void stdvga_init(struct domain *d)
 void *p;
 int i;
 
+if ( !has_vvga(d) )
+return;
+
 memset(s, 0, sizeof(*s));
 spin_lock_init(&s->lock);
 
@@ -581,6 +584,9 @@ void stdvga_deinit(struct domain *d)
 struct hvm_hw_stdvga *s = &d->arch.hvm_domain.stdvga;
 int i;
 
+if ( !has_vvga(d) )
+return;
+
 for ( i = 0; i != ARRAY_SIZE(s->vram_page); i++ )
 {
 if ( s->vram_page[i] == NULL )
-- 
1.9.5 (Apple Git-50.3)


___
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel


[Xen-devel] [PATCH v3 24/32] xen: allow HVM guests to use XENMEM_memory_map

2015-07-03 Thread Roger Pau Monne
Enable this hypercall for HVM guests in order to fetch the e820 memory
map in the absence of an emulated BIOS. The memory map is populated and
notified to Xen in arch_setup_meminit_hvm.

Signed-off-by: Roger Pau Monné 
Cc: Ian Jackson 
Cc: Stefano Stabellini 
Cc: Ian Campbell 
Cc: Wei Liu 
Cc: Jan Beulich 
Cc: Andrew Cooper 
---
 tools/libxc/xc_dom_x86.c | 29 -
 xen/arch/x86/hvm/hvm.c   |  2 --
 xen/arch/x86/mm.c|  6 --
 3 files changed, 28 insertions(+), 9 deletions(-)

diff --git a/tools/libxc/xc_dom_x86.c b/tools/libxc/xc_dom_x86.c
index 336eab4..45b1f03 100644
--- a/tools/libxc/xc_dom_x86.c
+++ b/tools/libxc/xc_dom_x86.c
@@ -1113,6 +1113,7 @@ static int check_mmio_hole(uint64_t start, uint64_t 
memsize,
 return 1;
 }
 
+#define MAX_E820_ENTRIES128
 static int meminit_hvm(struct xc_dom_image *dom)
 {
 unsigned long i, vmemid, nr_pages = dom->total_pages;
@@ -1133,6 +1134,8 @@ static int meminit_hvm(struct xc_dom_image *dom)
 unsigned int nr_vmemranges, nr_vnodes;
 xc_interface *xch = dom->xch;
 uint32_t domid = dom->guest_domid;
+struct e820entry entries[MAX_E820_ENTRIES];
+int e820_index = 0;
 
 if ( nr_pages > target_pages )
 memflags |= XENMEMF_populate_on_demand;
@@ -1183,6 +1186,13 @@ static int meminit_hvm(struct xc_dom_image *dom)
 vnode_to_pnode = dom->vnode_to_pnode;
 }
 
+/* Add one additional memory range to account for the VGA hole */
+if ( (nr_vmemranges + (dom->emulation ? 1 : 0)) > MAX_E820_ENTRIES )
+{
+DOMPRINTF("Too many memory ranges");
+goto error_out;
+}
+
 total_pages = 0;
 p2m_size = 0;
 for ( i = 0; i < nr_vmemranges; i++ )
@@ -1271,9 +1281,13 @@ static int meminit_hvm(struct xc_dom_image *dom)
  * Under 2MB mode, we allocate pages in batches of no more than 8MB to 
  * ensure that we can be preempted and hence dom0 remains responsive.
  */
-if ( dom->emulation )
+if ( dom->emulation ) {
 rc = xc_domain_populate_physmap_exact(
 xch, domid, 0xa0, 0, memflags, &dom->p2m_host[0x00]);
+entries[e820_index].addr = 0;
+entries[e820_index].size = 0xa0 << PAGE_SHIFT;
+entries[e820_index++].type = E820_RAM;
+}
 
 stat_normal_pages = 0;
 for ( vmemid = 0; vmemid < nr_vmemranges; vmemid++ )
@@ -1300,6 +1314,12 @@ static int meminit_hvm(struct xc_dom_image *dom)
 else
 cur_pages = vmemranges[vmemid].start >> PAGE_SHIFT;
 
+/* Build an e820 map. */
+entries[e820_index].addr = cur_pages << PAGE_SHIFT;
+entries[e820_index].size = vmemranges[vmemid].end -
+   entries[e820_index].addr;
+entries[e820_index++].type = E820_RAM;
+
 while ( (rc == 0) && (end_pages > cur_pages) )
 {
 /* Clip count to maximum 1GB extent. */
@@ -1417,6 +1437,13 @@ static int meminit_hvm(struct xc_dom_image *dom)
 DPRINTF("  2MB PAGES: 0x%016lx\n", stat_2mb_pages);
 DPRINTF("  1GB PAGES: 0x%016lx\n", stat_1gb_pages);
 
+rc = xc_domain_set_memory_map(xch, domid, entries, e820_index);
+if ( rc != 0 )
+{
+DOMPRINTF("unable to set memory map.");
+goto error_out;
+}
+
 rc = 0;
 goto out;
  error_out:
diff --git a/xen/arch/x86/hvm/hvm.c b/xen/arch/x86/hvm/hvm.c
index 9c6e7fd..75a5566 100644
--- a/xen/arch/x86/hvm/hvm.c
+++ b/xen/arch/x86/hvm/hvm.c
@@ -4765,7 +4765,6 @@ static long hvm_memory_op(int cmd, 
XEN_GUEST_HANDLE_PARAM(void) arg)
 
 switch ( cmd & MEMOP_CMD_MASK )
 {
-case XENMEM_memory_map:
 case XENMEM_machine_memory_map:
 case XENMEM_machphys_mapping:
 return -ENOSYS;
@@ -4841,7 +4840,6 @@ static long hvm_memory_op_compat32(int cmd, 
XEN_GUEST_HANDLE_PARAM(void) arg)
 
 switch ( cmd & MEMOP_CMD_MASK )
 {
-case XENMEM_memory_map:
 case XENMEM_machine_memory_map:
 case XENMEM_machphys_mapping:
 return -ENOSYS;
diff --git a/xen/arch/x86/mm.c b/xen/arch/x86/mm.c
index fd151c6..92eccd0 100644
--- a/xen/arch/x86/mm.c
+++ b/xen/arch/x86/mm.c
@@ -4717,12 +4717,6 @@ long arch_memory_op(unsigned long cmd, 
XEN_GUEST_HANDLE_PARAM(void) arg)
 return rc;
 }
 
-if ( is_hvm_domain(d) )
-{
-rcu_unlock_domain(d);
-return -EPERM;
-}
-
 e820 = xmalloc_array(e820entry_t, fmap.map.nr_entries);
 if ( e820 == NULL )
 {
-- 
1.9.5 (Apple Git-50.3)


___
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel


[Xen-devel] [PATCH v3 18/32] xen/x86: allow disabling the emulated pmu

2015-07-03 Thread Roger Pau Monne
Signed-off-by: Roger Pau Monné 
Cc: Jan Beulich 
Cc: Andrew Cooper 
---
 xen/arch/x86/hvm/vpmu.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/xen/arch/x86/hvm/vpmu.c b/xen/arch/x86/hvm/vpmu.c
index c3273ee..776661d 100644
--- a/xen/arch/x86/hvm/vpmu.c
+++ b/xen/arch/x86/hvm/vpmu.c
@@ -233,7 +233,7 @@ void vpmu_initialise(struct vcpu *v)
 uint8_t vendor = current_cpu_data.x86_vendor;
 int ret;
 
-if ( is_pvh_vcpu(v) )
+if ( is_pvh_vcpu(v) || !has_vpmu(v->domain) )
 return;
 
 ASSERT(!vpmu->flags && !vpmu->context);
-- 
1.9.5 (Apple Git-50.3)


___
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel


[Xen-devel] [PATCH v3 22/32] elfnotes: intorduce a new PHYS_ENTRY elfnote

2015-07-03 Thread Roger Pau Monne
This new elfnote contains the 32bit entry point into the kernel. Xen will
use this entry point in order to launch the guest kernel in 32bit protected
mode with paging disabled.

Signed-off-by: Roger Pau Monné 
Cc: Ian Jackson 
Cc: Stefano Stabellini 
Cc: Ian Campbell 
Cc: Wei Liu 
---
 tools/xcutils/readnotes.c  |  3 +++
 xen/common/libelf/libelf-dominfo.c |  4 
 xen/include/public/elfnote.h   | 11 ++-
 3 files changed, 17 insertions(+), 1 deletion(-)

diff --git a/tools/xcutils/readnotes.c b/tools/xcutils/readnotes.c
index 5fa445e..e682dd1 100644
--- a/tools/xcutils/readnotes.c
+++ b/tools/xcutils/readnotes.c
@@ -159,6 +159,9 @@ static unsigned print_notes(struct elf_binary *elf, 
ELF_HANDLE_DECL(elf_note) st
case XEN_ELFNOTE_L1_MFN_VALID:
print_l1_mfn_valid_note("L1_MFN_VALID", elf , note);
break;
+   case XEN_ELFNOTE_PHYS32_ENTRY:
+   print_numeric_note("PHYS32_ENTRY", elf , note);
+   break;
default:
printf("unknown note type %#x\n",
   (unsigned)elf_uval(elf, note, type));
diff --git a/xen/common/libelf/libelf-dominfo.c 
b/xen/common/libelf/libelf-dominfo.c
index 0771323..78d75ad 100644
--- a/xen/common/libelf/libelf-dominfo.c
+++ b/xen/common/libelf/libelf-dominfo.c
@@ -120,6 +120,7 @@ elf_errorstatus elf_xen_parse_note(struct elf_binary *elf,
 [XEN_ELFNOTE_BSD_SYMTAB] = { "BSD_SYMTAB", 1},
 [XEN_ELFNOTE_SUSPEND_CANCEL] = { "SUSPEND_CANCEL", 0 },
 [XEN_ELFNOTE_MOD_START_PFN] = { "MOD_START_PFN", 0 },
+[XEN_ELFNOTE_PHYS32_ENTRY] = { "PHYS32_ENTRY", 0 },
 };
 /* *INDENT-ON* */
 
@@ -213,6 +214,9 @@ elf_errorstatus elf_xen_parse_note(struct elf_binary *elf,
 elf, note, sizeof(*parms->f_supported), i);
 break;
 
+case XEN_ELFNOTE_PHYS32_ENTRY:
+parms->phys_entry = val;
+break;
 }
 return 0;
 }
diff --git a/xen/include/public/elfnote.h b/xen/include/public/elfnote.h
index 3824a94..e6fc596 100644
--- a/xen/include/public/elfnote.h
+++ b/xen/include/public/elfnote.h
@@ -200,9 +200,18 @@
 #define XEN_ELFNOTE_SUPPORTED_FEATURES 17
 
 /*
+ * Physical entry point into the kernel.
+ *
+ * 32bit entry point into the kernel. Xen will use this entry point
+ * in order to launch the guest kernel in 32bit protected mode
+ * with paging disabled.
+ */
+#define XEN_ELFNOTE_PHYS32_ENTRY 18
+
+/*
  * The number of the highest elfnote defined.
  */
-#define XEN_ELFNOTE_MAX XEN_ELFNOTE_SUPPORTED_FEATURES
+#define XEN_ELFNOTE_MAX XEN_ELFNOTE_PHYS32_ENTRY
 
 /*
  * System information exported through crash notes.
-- 
1.9.5 (Apple Git-50.3)


___
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel


[Xen-devel] [PATCH v3 12/32] xen/x86: allow disabling the emulated local apic

2015-07-03 Thread Roger Pau Monne
Signed-off-by: Roger Pau Monné 
Cc: Boris Ostrovsky 
Cc: Suravee Suthikulpanit 
Cc: Aravind Gopalakrishnan 
Cc: Jan Beulich 
Cc: Andrew Cooper 
Cc: Jun Nakajima 
Cc: Eddie Dong 
Cc: Kevin Tian 
---
 xen/arch/x86/hvm/svm/svm.c  | 16 +---
 xen/arch/x86/hvm/vlapic.c   | 30 +-
 xen/arch/x86/hvm/vmsi.c |  6 ++
 xen/arch/x86/hvm/vmx/vmcs.c | 14 ++
 xen/arch/x86/hvm/vmx/vmx.c  |  9 -
 5 files changed, 62 insertions(+), 13 deletions(-)

diff --git a/xen/arch/x86/hvm/svm/svm.c b/xen/arch/x86/hvm/svm/svm.c
index a02f983..46062dd 100644
--- a/xen/arch/x86/hvm/svm/svm.c
+++ b/xen/arch/x86/hvm/svm/svm.c
@@ -1036,6 +1036,7 @@ static void noreturn svm_do_resume(struct vcpu *v)
 struct vmcb_struct *vmcb = v->arch.hvm_svm.vmcb;
 bool_t debug_state = v->domain->debugger_attached;
 bool_t vcpu_guestmode = 0;
+struct vlapic *vlapic = vcpu_vlapic(v);
 
 if ( nestedhvm_enabled(v->domain) && nestedhvm_vcpu_in_guestmode(v) )
 vcpu_guestmode = 1;
@@ -1059,14 +1060,14 @@ static void noreturn svm_do_resume(struct vcpu *v)
 hvm_asid_flush_vcpu(v);
 }
 
-if ( !vcpu_guestmode )
+if ( !vcpu_guestmode && !vlapic_hw_disabled(vlapic) )
 {
 vintr_t intr;
 
 /* Reflect the vlapic's TPR in the hardware vtpr */
 intr = vmcb_get_vintr(vmcb);
 intr.fields.tpr =
-(vlapic_get_reg(vcpu_vlapic(v), APIC_TASKPRI) & 0xFF) >> 4;
+(vlapic_get_reg(vlapic, APIC_TASKPRI) & 0xFF) >> 4;
 vmcb_set_vintr(vmcb, intr);
 }
 
@@ -2295,6 +2296,7 @@ void svm_vmexit_handler(struct cpu_user_regs *regs)
 int inst_len, rc;
 vintr_t intr;
 bool_t vcpu_guestmode = 0;
+struct vlapic *vlapic = vcpu_vlapic(v);
 
 hvm_invalidate_regs_fields(regs);
 
@@ -2312,11 +2314,11 @@ void svm_vmexit_handler(struct cpu_user_regs *regs)
  * NB. We need to preserve the low bits of the TPR to make checked builds
  * of Windows work, even though they don't actually do anything.
  */
-if ( !vcpu_guestmode ) {
+if ( !vcpu_guestmode && !vlapic_hw_disabled(vlapic) ) {
 intr = vmcb_get_vintr(vmcb);
-vlapic_set_reg(vcpu_vlapic(v), APIC_TASKPRI,
+vlapic_set_reg(vlapic, APIC_TASKPRI,
((intr.fields.tpr & 0x0F) << 4) |
-   (vlapic_get_reg(vcpu_vlapic(v), APIC_TASKPRI) & 0x0F));
+   (vlapic_get_reg(vlapic, APIC_TASKPRI) & 0x0F));
 }
 
 exit_reason = vmcb->exitcode;
@@ -2698,14 +2700,14 @@ void svm_vmexit_handler(struct cpu_user_regs *regs)
 }
 
   out:
-if ( vcpu_guestmode )
+if ( vcpu_guestmode || vlapic_hw_disabled(vlapic) )
 /* Don't clobber TPR of the nested guest. */
 return;
 
 /* The exit may have updated the TPR: reflect this in the hardware vtpr */
 intr = vmcb_get_vintr(vmcb);
 intr.fields.tpr =
-(vlapic_get_reg(vcpu_vlapic(v), APIC_TASKPRI) & 0xFF) >> 4;
+(vlapic_get_reg(vlapic, APIC_TASKPRI) & 0xFF) >> 4;
 vmcb_set_vintr(vmcb, intr);
 }
 
diff --git a/xen/arch/x86/hvm/vlapic.c b/xen/arch/x86/hvm/vlapic.c
index 5472f79..ff648b9 100644
--- a/xen/arch/x86/hvm/vlapic.c
+++ b/xen/arch/x86/hvm/vlapic.c
@@ -994,6 +994,9 @@ static void set_x2apic_id(struct vlapic *vlapic)
 
 bool_t vlapic_msr_set(struct vlapic *vlapic, uint64_t value)
 {
+if ( !has_vlapic(vlapic_domain(vlapic)) )
+return 0;
+
 if ( (vlapic->hw.apic_base_msr ^ value) & MSR_IA32_APICBASE_ENABLE )
 {
 if ( unlikely(value & MSR_IA32_APICBASE_EXTD) )
@@ -1043,8 +1046,7 @@ void vlapic_tdt_msr_set(struct vlapic *vlapic, uint64_t 
value)
 uint64_t guest_tsc;
 struct vcpu *v = vlapic_vcpu(vlapic);
 
-/* may need to exclude some other conditions like vlapic->hw.disabled */
-if ( !vlapic_lvtt_tdt(vlapic) )
+if ( !vlapic_lvtt_tdt(vlapic) || vlapic_hw_disabled(vlapic) )
 {
 HVM_DBG_LOG(DBG_LEVEL_VLAPIC_TIMER, "ignore tsc deadline msr write");
 return;
@@ -1119,6 +1121,9 @@ static int __vlapic_accept_pic_intr(struct vcpu *v)
 
 int vlapic_accept_pic_intr(struct vcpu *v)
 {
+if ( vlapic_hw_disabled(vcpu_vlapic(v)) )
+return 0;
+
 TRACE_2D(TRC_HVM_EMUL_LAPIC_PIC_INTR,
  (v == v->domain->arch.hvm_domain.i8259_target),
  v ? __vlapic_accept_pic_intr(v) : -1);
@@ -1266,6 +1271,9 @@ static int lapic_save_hidden(struct domain *d, 
hvm_domain_context_t *h)
 struct vlapic *s;
 int rc = 0;
 
+if ( !has_vlapic(d) )
+return 0;
+
 for_each_vcpu ( d, v )
 {
 s = vcpu_vlapic(v);
@@ -1282,6 +1290,9 @@ static int lapic_save_regs(struct domain *d, 
hvm_domain_context_t *h)
 struct vlapic *s;
 int rc = 0;
 
+if ( !has_vlapic(d) )
+return 0;
+
 for_each_vcpu ( d, v )
 {
 if ( hvm_funcs.sync_pir_to_irr )
@@ -1329,7 +1340,10 @@ static int lapic_load_hidden(struct domain *d, 
hvm_domain_context_t *h)
 uint16_t vcpuid;
 

[Xen-devel] [PATCH v3 26/32] xenconsole: try to attach to PV console if HVM fails

2015-07-03 Thread Roger Pau Monne
HVM guests have always used the emulated serial console by default, but if
the emulated serial pty cannot be fetched from xenstore try to use the PV
console instead.

Signed-off-by: Roger Pau Monné 
Cc: Ian Jackson 
Cc: Stefano Stabellini 
Cc: Ian Campbell 
Cc: Wei Liu 
---
 tools/console/client/main.c | 11 ---
 1 file changed, 8 insertions(+), 3 deletions(-)

diff --git a/tools/console/client/main.c b/tools/console/client/main.c
index f4c783b..c92553e 100644
--- a/tools/console/client/main.c
+++ b/tools/console/client/main.c
@@ -279,7 +279,7 @@ int main(int argc, char **argv)
{ 0 },
 
};
-   char *dom_path = NULL, *path = NULL;
+   char *dom_path = NULL, *path = NULL, *test = NULL;
int spty, xsfd;
struct xs_handle *xs;
char *end;
@@ -357,9 +357,14 @@ int main(int argc, char **argv)
path = malloc(strlen(dom_path) + strlen("/device/console/0/tty") + 5);
if (path == NULL)
err(ENOMEM, "malloc");
-   if (type == CONSOLE_SERIAL)
+   if (type == CONSOLE_SERIAL) {
snprintf(path, strlen(dom_path) + strlen("/serial/0/tty") + 5, 
"%s/serial/%d/tty", dom_path, num);
-   else {
+   test = xs_read(xs, XBT_NULL, path, NULL);
+   free(test);
+   if (test == NULL)
+   goto pv_console;
+   } else {
+pv_console:
if (num == 0)
snprintf(path, strlen(dom_path) + 
strlen("/console/tty") + 1, "%s/console/tty", dom_path);
else
-- 
1.9.5 (Apple Git-50.3)


___
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel


[Xen-devel] [PATCH v3 29/32] libxc/xen: introduce HVM_PARAM_FIRST_FREE_PFN

2015-07-03 Thread Roger Pau Monne
This HVM parameter returns the first free pfn after all the special pages.
It can be used by guests to figure out the first free memory address after
the kernel, ramdisk and special pages. This is interesting for compatibility
reasons in case more special pages are later added, older guests can still
use this parameter to figure out the first free address, ignoring newly
added special pages.

Signed-off-by: Roger Pau Monné 
Cc: Ian Jackson 
Cc: Stefano Stabellini 
Cc: Ian Campbell 
Cc: Wei Liu 
Cc: Jan Beulich 
Cc: Andrew Cooper 
---
 tools/libxc/xc_dom_x86.c| 2 ++
 xen/arch/x86/hvm/hvm.c  | 1 +
 xen/include/public/hvm/params.h | 5 -
 3 files changed, 7 insertions(+), 1 deletion(-)

diff --git a/tools/libxc/xc_dom_x86.c b/tools/libxc/xc_dom_x86.c
index 41ff7a4..74c3819 100644
--- a/tools/libxc/xc_dom_x86.c
+++ b/tools/libxc/xc_dom_x86.c
@@ -573,6 +573,8 @@ static int alloc_magic_pages_hvm(struct xc_dom_image *dom)
  special_pfn(SPECIALPAGE_ACCESS, dom));
 xc_hvm_param_set(xch, domid, HVM_PARAM_SHARING_RING_PFN,
  special_pfn(SPECIALPAGE_SHARING, dom));
+xc_hvm_param_set(xch, domid, HVM_PARAM_FIRST_FREE_PFN,
+ special_pfn(NR_SPECIAL_PAGES, dom));
 
 if ( dom->cmdline )
 {
diff --git a/xen/arch/x86/hvm/hvm.c b/xen/arch/x86/hvm/hvm.c
index efe7232..2b190e9 100644
--- a/xen/arch/x86/hvm/hvm.c
+++ b/xen/arch/x86/hvm/hvm.c
@@ -5918,6 +5918,7 @@ static int hvm_allow_get_param(struct domain *d,
 case HVM_PARAM_CONSOLE_PFN:
 case HVM_PARAM_CONSOLE_EVTCHN:
 case HVM_PARAM_CMDLINE_PFN:
+case HVM_PARAM_FIRST_FREE_PFN:
 break;
 /*
  * The following parameters must not be read by the guest
diff --git a/xen/include/public/hvm/params.h b/xen/include/public/hvm/params.h
index b7f8839..47e38a8 100644
--- a/xen/include/public/hvm/params.h
+++ b/xen/include/public/hvm/params.h
@@ -190,6 +190,9 @@
 /* PFN of the command line. */
 #define HVM_PARAM_CMDLINE_PFN 35
 
-#define HVM_NR_PARAMS  36
+/* First free PFN after the special pages. */
+#define HVM_PARAM_FIRST_FREE_PFN 36
+
+#define HVM_NR_PARAMS  37
 
 #endif /* __XEN_PUBLIC_HVM_PARAMS_H__ */
-- 
1.9.5 (Apple Git-50.3)


___
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel


Re: [Xen-devel] [PATCH OSSTEST v3] mg-all-branch-statuses: Show how up to date each branch is

2015-07-03 Thread Ian Campbell
On Fri, 2015-07-03 at 12:26 +0100, Ian Jackson wrote:
> Ian Campbell writes ("Re: [PATCH OSSTEST v3] mg-all-branch-statuses: Show how 
> up to date each branch is"):
> > On Thu, 2015-07-02 at 17:30 +0100, Ian Jackson wrote:
> > > This is quite fault-oblivious, isn't it.  Oh well.
> > 
> > Yes, the problem is that for branches with no baseline:
> > $ ./ap-fetch-version-old linux-next ; echo $?
> > HEAD is now at 705bb44... fix
> > fatal: Couldn't find remote ref tested/linux-next
> > 128
> > $
> > 
> > And for osstest (where the tip may not be available unless you are
> > osstest@osstest);
> > ./ap-fetch-version osstest ; echo $?
> > HEAD is now at 705bb44... fix
> > fatal: Couldn't find remote ref pretest
> > fatal: The remote end hung up unexpectedly
> > 128
> > $
> 
> Right.  There's not really anything at that layer that knows to say
> "no" rather than "aargh".
> 
> > In the latter case I print "Error!" (I could do it here instead of
> > later, I just noticed).
> > 
> > Not sure what to do about the former. In both cases this obviously
> > conflates actual failures with expected failures. I'm not sure how to
> > distinguish. Perhaps I could special case baselineless trees
> > (linux-next) in ap-fetch-version-old/ap-common and special case osstest
> > here as the only tree which might plausibly have an unavailable tip?
> 
> I think that is too big a yak.

Phew!



___
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel


[Xen-devel] [OSSTEST PATCH 4/6] ts-logs-capture: Run xenctx earlier

2015-07-03 Thread Ian Jackson
Break fetch_xenctx_guest out into its own function, and run it before
serial_fetch_logs.

This is relevant because serial_fetch_logs sends the Xen debug keys,
which might dislodge a stuck guest - and, if it does, we would like to
have captured the stuck state with xenctx, rather than the unstuck
one.

Signed-off-by: Ian Jackson 
Acked-by: Ian Campbell 
---
 ts-logs-capture |   20 +---
 1 file changed, 13 insertions(+), 7 deletions(-)

diff --git a/ts-logs-capture b/ts-logs-capture
index 7127675..04cb2fd 100755
--- a/ts-logs-capture
+++ b/ts-logs-capture
@@ -203,14 +203,9 @@ sub fetch_logs_host () {
 }
 }
 
-sub fetch_logs_guest ($) {
+sub fetch_xenctx_guest ($) {
 my ($gho) = @_;
-my $gn = $gho->{Name};
-logm("saving logs for $gn");
-
-my $consolecmd= toolstack($ho)->consolecmd($gho);
-try_cmd_output_save("sleep 1 | $consolecmd | cat",
-"guest-$gho->{Name}-console");
+logm("collecting xenctx for $gho->{Name}");
 
 if (defined $gho->{Vcpus}) {
 foreach (my $vcpu=0; $vcpu < $gho->{Vcpus}; $vcpu++) {
@@ -224,6 +219,16 @@ sub fetch_logs_guest ($) {
);
 }
 }
+}
+
+sub fetch_logs_guest ($) {
+my ($gho) = @_;
+my $gn = $gho->{Name};
+logm("saving logs for $gn");
+
+my $consolecmd= toolstack($ho)->consolecmd($gho);
+try_cmd_output_save("sleep 1 | $consolecmd | cat",
+"guest-$gho->{Name}-console");
 
 if (!eval {
 my $vnc= guest_vncsnapshot_begin($ho,$gho);
@@ -235,6 +240,7 @@ sub fetch_logs_guest ($) {
 }
 
 find_guests();
+fetch_xenctx_guest($_) foreach @guests;
 serial_fetch_logs($ho);
 fetch_logs_host();
 fetch_logs_guest($_) foreach @guests;
-- 
1.7.10.4


___
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel


[Xen-devel] [OSSTEST PATCH 5/6] ts-logs-capture: Run xenctx twice for each guest vcpu

2015-07-03 Thread Ian Jackson
Two (or more) back-to-back ctxt's can often be useful, by giving a
snapshot of a loop the guest is stuck in.

Signed-off-by: Ian Jackson 
---
v2: New patch in this series.
---
 ts-logs-capture |   10 ++
 1 file changed, 6 insertions(+), 4 deletions(-)

diff --git a/ts-logs-capture b/ts-logs-capture
index 04cb2fd..b2caa77 100755
--- a/ts-logs-capture
+++ b/ts-logs-capture
@@ -213,10 +213,12 @@ sub fetch_xenctx_guest ($) {
my $sysmaparg = !defined $kernpath ? '' :
$kernpath !~ m,/vmlinuz-, ? die "$kernpath ?" :
"-s $`/System.map-$'";
-   try_cmd_output_save(
-   'PATH=/usr/local/lib/xen/bin:/usr/lib/xen/bin:$PATH; '.
-   "xenctx $sysmaparg $gho->{Domid} $vcpu"
-   );
+   foreach my $iter (0..1) {
+   try_cmd_output_save(
+   'PATH=/usr/local/lib/xen/bin:/usr/lib/xen/bin:$PATH; '.
+   "xenctx $sysmaparg $gho->{Domid} $vcpu"
+   );
+   }
 }
 }
 }
-- 
1.7.10.4


___
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel


[Xen-devel] [PATCH 1/3] xl: Break out flush_stream

2015-07-03 Thread Ian Jackson
We are going to want to reuse this.  Adjust the code slightly to
detect right away call sites that pass something other than stdout or
stderr.

No resulting functional change.

Signed-off-by: Ian Jackson 
---
v2: New patch in this version of the mini-series
---
 tools/libxl/xl_cmdimpl.c |   22 +++---
 1 file changed, 15 insertions(+), 7 deletions(-)

diff --git a/tools/libxl/xl_cmdimpl.c b/tools/libxl/xl_cmdimpl.c
index c858068..ee55786 100644
--- a/tools/libxl/xl_cmdimpl.c
+++ b/tools/libxl/xl_cmdimpl.c
@@ -389,6 +389,20 @@ static yajl_gen_status printf_info_one_json(yajl_gen hand, 
int domid,
 out:
 return s;
 }
+
+static void flush_stream(FILE *fh)
+{
+const char *fh_name =
+fh == stdout ? "stdout" :
+fh == stderr ? "stderr" :
+(abort(), (const char*)0);
+
+if (ferror(fh) || fflush(fh)) {
+perror(fh_name);
+exit(-1);
+}
+}
+
 static void printf_info(enum output_format output_format,
 int domid,
 libxl_domain_config *d_config, FILE *fh)
@@ -424,13 +438,7 @@ out:
 fprintf(stderr,
 "unable to format domain config as JSON (YAJL:%d)\n", s);
 
-if (ferror(fh) || fflush(fh)) {
-if (fh == stdout)
-perror("stdout");
-else
-perror("stderr");
-exit(-1);
-}
+flush_stream(fh);
 }
 
 static int do_daemonize(char *name)
-- 
1.7.10.4


___
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel


[Xen-devel] [OSSTEST PATCH 2/6] ts-logs-capture: Find xenctx in /usr/local as well

2015-07-03 Thread Ian Jackson
xenctx is now in /usr/local/lib/xen/bin/xenctx.
 ^^
Find it by setting PATH in the shell command.

Signed-off-by: Ian Jackson 
Acked-by: Ian Campbell 
---
 ts-logs-capture |6 --
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/ts-logs-capture b/ts-logs-capture
index 2498416..13795e8 100755
--- a/ts-logs-capture
+++ b/ts-logs-capture
@@ -210,8 +210,10 @@ sub fetch_logs_guest ($) {
my $sysmaparg = !defined $kernpath ? '' :
$kernpath !~ m,/vmlinuz-, ? die "$kernpath ?" :
"-s $`/System.map-$'";
-   try_cmd_output_save("/usr/lib/xen/bin/xenctx ".$sysmaparg.
-   " $gho->{Domid} $vcpu");
+   try_cmd_output_save(
+   'PATH=/usr/local/lib/xen/bin:/usr/lib/xen/bin:$PATH; '.
+   "xenctx $sysmaparg $gho->{Domid} $vcpu"
+   );
 }
 }
 
-- 
1.7.10.4


___
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel


[Xen-devel] [OSSTEST PATCH 3/6] ts-logs-capture: Break out guest listing and do it earlier

2015-07-03 Thread Ian Jackson
Break out the function find_guests from what was
fetch_logs_host_guests, and have it save its results in the @guests
global.

We do this soon because in the next patch we are going to want to
do something to each guest before we call serial_fetch_logs.

The loop containing fetch_logs_guest is now in the main program.

Signed-off-by: Ian Jackson 
Acked-by: Ian Campbell 
---
 ts-logs-capture |   60 ---
 1 file changed, 35 insertions(+), 25 deletions(-)

diff --git a/ts-logs-capture b/ts-logs-capture
index 13795e8..7127675 100755
--- a/ts-logs-capture
+++ b/ts-logs-capture
@@ -33,6 +33,34 @@ our ($whhost) = @ARGV;
 $whhost ||= 'host';
 our $ho= selecthost($whhost);
 
+our @guests;
+
+sub find_guests () {
+my $sth= $dbh_tests->prepare(fetchrow_hashref) {
+my $gn= $row->{name};
+$gn =~ s/_domname$//;
+
+   my $gho= selectguest($gn,$ho);
+   if (!eval {
+   guest_find_domid($ho,$gho);
+   1;
+   }) {
+   logm("cannot find domid: $@");;
+   next;
+   }
+
+   push @guests, $gho;
+}
+$sth->finish();
+}
+
 sub try_fetch_logs ($$) {
 my ($lho, $logfilepats) = @_;
 my $ok= 0;
@@ -97,7 +125,7 @@ sub try_cmd_output_save ($;$) {
 close $fh or die $!;
 }
 
-sub fetch_logs_host_guests () {
+sub fetch_logs_host () {
 my $logs= [qw(
   /var/log/kern.log*
   /var/log/syslog*
@@ -173,33 +201,13 @@ sub fetch_logs_host_guests () {
  ) {
 try_cmd_output_save($cmd);
 }
-
-my $sth= $dbh_tests->prepare(fetchrow_hashref) {
-my $gn= $row->{name};
-$gn =~ s/_domname$//;
-fetch_logs_guest($gn);
-}
-$sth->finish();
 }
 
 sub fetch_logs_guest ($) {
-my ($gn) = @_;
+my ($gho) = @_;
+my $gn = $gho->{Name};
 logm("saving logs for $gn");
-my $gho= selectguest($gn,$ho);
-if (!eval {
-guest_find_domid($ho,$gho);
-1;
-}) {
-logm("cannot find domid: $@");
-return;
-}
+
 my $consolecmd= toolstack($ho)->consolecmd($gho);
 try_cmd_output_save("sleep 1 | $consolecmd | cat",
 "guest-$gho->{Name}-console");
@@ -226,6 +234,8 @@ sub fetch_logs_guest ($) {
 }
 }
 
+find_guests();
 serial_fetch_logs($ho);
-fetch_logs_host_guests();
+fetch_logs_host();
+fetch_logs_guest($_) foreach @guests;
 logm("logs captured to $stash");
-- 
1.7.10.4


___
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel


[Xen-devel] [OSSTEST PATCH 1/6] guest_find_domid: Set Vcpus correctly.

2015-07-03 Thread Ian Jackson
The regexp was wrong, resulting in the last digit of the memory being
mistaken for the number of vcpus (!)

The only consumer of this is ts-logs-capture.

Signed-off-by: Ian Jackson 
Acked-by: Ian Campbell 
---
 Osstest/TestSupport.pm |2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/Osstest/TestSupport.pm b/Osstest/TestSupport.pm
index b5994a4..66dc218 100644
--- a/Osstest/TestSupport.pm
+++ b/Osstest/TestSupport.pm
@@ -1918,7 +1918,7 @@ sub guest_find_domid ($$) {
 return if defined $gho->{Domid};
 my $list= target_cmd_output_root($ho,
 common_toolstack($ho)." list $gho->{Name}");
-$list =~ m/^(?!Name\s)(\S+)\s+(\d+)\s+(\d+)+(\d+)\s.*$/m
+$list =~ m/^(?!Name\s)(\S+)\s+(\d+)\s+(\d+)\s+(\d+)\s.*$/m
 or die "domain list: $list";
 $1 eq $gho->{Name} or die "domain list name $1 expected $gho->{Name}";
 $gho->{MemUsed}= $3;
-- 
1.7.10.4


___
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel


[Xen-devel] [OSSTEST PATCH 6/6] ts-logs-capture: Explicitly set xenctx capture filename

2015-07-03 Thread Ian Jackson
Now that the command contains PATH, the autogenerated filename is very
ugly.

Signed-off-by: Ian Jackson 
---
v2: New patch in this version of the series.
---
 ts-logs-capture |5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/ts-logs-capture b/ts-logs-capture
index b2caa77..0081372 100755
--- a/ts-logs-capture
+++ b/ts-logs-capture
@@ -214,10 +214,11 @@ sub fetch_xenctx_guest ($) {
$kernpath !~ m,/vmlinuz-, ? die "$kernpath ?" :
"-s $`/System.map-$'";
foreach my $iter (0..1) {
+   my $dfn = "$ho->{Name}-xenctx-$gho->{Name},vcpu$vcpu,i$iter";
try_cmd_output_save(
'PATH=/usr/local/lib/xen/bin:/usr/lib/xen/bin:$PATH; '.
-   "xenctx $sysmaparg $gho->{Domid} $vcpu"
-   );
+   "xenctx $sysmaparg $gho->{Domid} $vcpu",
+   $dfn);
}
 }
 }
-- 
1.7.10.4


___
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel


[Xen-devel] [PATCH 2/3] xl: Change output from xl -N create to be more useful

2015-07-03 Thread Ian Jackson
Currently, xl -N create produces:

{
"domid": null,
"config": {
"c_info": {
"type": "pv",
 [etc]
}

The domid is always NULL (as the domain has not been created at this
stage).

This is annoying if you want to take this output and use it for some
actually useful purpose like domain creation: either it needs to be
massaged, or the the consuming tool needs to be taught to look inside
the json object for the `config' element (which IMO makes no sense as
an interface).

We would like to be able to pass libxl json configs around sensibly.
In the future maybe xl will grow an option to create a domain from a
json config, and this is currently something I want to be able to have
a test tool do.

Note that this change is NOT BACKWARDS COMPATIBLE.  But it would only
adversely affects anyone who uses `xl -N create' and then saves and
processes the JSON.  (The output from xl list et al is not changed; it
normally needs the domid.)  Such a user should probably have already
have complained about the infelicitous output.  If they haven't it
would be simple enough for them to bookend the output so as to provide
compatible output.

Signed-off-by: Ian Jackson 
CC: Ian Campbell 
CC: Wei Liu 
CC: Euan Harris 
---
v2: Print json output to correct filehandle
(Using newly introduced flush_stream.)
---
 tools/libxl/xl_cmdimpl.c |   15 ---
 1 file changed, 12 insertions(+), 3 deletions(-)

diff --git a/tools/libxl/xl_cmdimpl.c b/tools/libxl/xl_cmdimpl.c
index ee55786..50247de 100644
--- a/tools/libxl/xl_cmdimpl.c
+++ b/tools/libxl/xl_cmdimpl.c
@@ -2695,9 +2695,18 @@ static uint32_t create_domain(struct domain_create 
*dom_info)
 }
 }
 
-if (debug || dom_info->dryrun)
-printf_info(default_output_format, -1, &d_config,
-debug ? stderr : stdout);
+if (debug || dom_info->dryrun) {
+FILE *cfg_print_fh = debug ? stderr : stdout;
+if (default_output_format == OUTPUT_FORMAT_SXP) {
+printf_info_sexp(-1, &d_config, cfg_print_fh);
+} else {
+char *json = libxl_domain_config_to_json(ctx, &d_config);
+fputs(json, cfg_print_fh);
+free(json);
+flush_stream(cfg_print_fh);
+}
+}
+
 
 ret = 0;
 if (dom_info->dryrun)
-- 
1.7.10.4


___
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel


  1   2   3   >