[Xen-devel] [PATCH v3 3/3] VT-d PI: restrict the vcpu number on a given pcpu

2017-05-23 Thread Chao Gao
Currently, a blocked vCPU is put in its pCPU's pi blocking list. If
too many vCPUs are blocked on a given pCPU, it will incur that the list
grows too long. After a simple analysis, there are 32k domains and
128 vcpu per domain, thus about 4M vCPUs may be blocked in one pCPU's
PI blocking list. When a wakeup interrupt arrives, the list is
traversed to find some specific vCPUs to wake them up. This traversal in
that case would consume much time.

To mitigate this issue, this patch limits the vcpu number on a given
pCPU, taking factors such as perfomance of common case, current hvm vcpu
count and current pcpu count into consideration. With this method, for
the common case, it works fast and for some extreme cases, the list
length is under control.

The change in vmx_pi_unblock_vcpu() is for the following case:
vcpu is running -> try to block (this patch may change NSDT to
another pCPU) but notification comes in time, thus the vcpu
goes back to running station -> VM-entry (we should set NSDT again,
reverting the change we make to NSDT in vmx_vcpu_block())

Signed-off-by: Chao Gao 
---
 xen/arch/x86/hvm/vmx/vmx.c | 70 +-
 1 file changed, 63 insertions(+), 7 deletions(-)

diff --git a/xen/arch/x86/hvm/vmx/vmx.c b/xen/arch/x86/hvm/vmx/vmx.c
index abbf16b..91ee65b 100644
--- a/xen/arch/x86/hvm/vmx/vmx.c
+++ b/xen/arch/x86/hvm/vmx/vmx.c
@@ -100,16 +100,62 @@ void vmx_pi_per_cpu_init(unsigned int cpu)
 spin_lock_init(&per_cpu(vmx_pi_blocking, cpu).lock);
 }
 
+/*
+ * By default, the local pcpu (means the one the vcpu is currently running on)
+ * is chosen as the destination of wakeup interrupt. But if the vcpu number of
+ * the pcpu exceeds a limit, another pcpu is chosen until we find a suitable
+ * one.
+ *
+ * Currently, choose (v_tot/p_tot) + K as the limit of vcpu count, where
+ * v_tot is the total number of hvm vcpus on the system, p_tot is the total
+ * number of pcpus in the system, and K is a fixed number. Experments shows
+ * the maximum time to wakeup a vcpu from a 128-entry blocking list is about
+ * 22us, which is tolerable. So choose 128 as the fixed number K.
+ *
+ * This policy makes sure:
+ * 1) for common cases, the limit won't be reached and the local pcpu is used
+ * which is beneficial to performance (at least, avoid an IPI when unblocking
+ * vcpu).
+ * 2) for the worst case, the blocking list length scales with the vcpu count
+ * divided by the pcpu count.
+ */
+#define PI_LIST_FIXED_NUM 128
+#define PI_LIST_LIMIT (atomic_read(&num_hvm_vcpus) / num_online_cpus() + \
+   PI_LIST_FIXED_NUM)
+
+static bool pi_over_limit(int count)
+{
+/* Compare w/ constant first to save an atomic read in the common case */
+return ((count > PI_LIST_FIXED_NUM) &&
+(count > (atomic_read(&num_hvm_vcpus) / num_online_cpus()) +
+PI_LIST_FIXED_NUM));
+}
+
 static void vmx_vcpu_block(struct vcpu *v)
 {
 unsigned long flags;
-unsigned int dest;
+unsigned int dest, pi_cpu;
 spinlock_t *old_lock;
-spinlock_t *pi_blocking_list_lock =
-   &per_cpu(vmx_pi_blocking, v->processor).lock;
 struct pi_desc *pi_desc = &v->arch.hvm_vmx.pi_desc;
+spinlock_t *pi_blocking_list_lock;
+
+pi_cpu = v->processor;
+ retry:
+pi_blocking_list_lock = &per_cpu(vmx_pi_blocking, pi_cpu).lock;
 
 spin_lock_irqsave(pi_blocking_list_lock, flags);
+/*
+ * Since pi_cpu may now be one other than the one v is currently
+ * running on, check to make sure that it's still up.
+ */
+if ( unlikely((!cpu_online(pi_cpu)) ||
+ pi_over_limit(per_cpu(vmx_pi_blocking, pi_cpu).counter)) )
+{
+pi_cpu = cpumask_cycle(pi_cpu, &cpu_online_map);
+spin_unlock_irqrestore(pi_blocking_list_lock, flags);
+goto retry;
+}
+
 old_lock = cmpxchg(&v->arch.hvm_vmx.pi_blocking.lock, NULL,
pi_blocking_list_lock);
 
@@ -120,11 +166,11 @@ static void vmx_vcpu_block(struct vcpu *v)
  */
 ASSERT(old_lock == NULL);
 
-per_cpu(vmx_pi_blocking, v->processor).counter++;
-TRACE_4D(TRC_HVM_PI_LIST_ADD, v->domain->domain_id, v->vcpu_id,
- v->processor, per_cpu(vmx_pi_blocking, v->processor).counter);
+per_cpu(vmx_pi_blocking, pi_cpu).counter++;
+TRACE_4D(TRC_HVM_PI_LIST_ADD, v->domain->domain_id, v->vcpu_id, pi_cpu,
+ per_cpu(vmx_pi_blocking, pi_cpu).counter);
 list_add_tail(&v->arch.hvm_vmx.pi_blocking.list,
-  &per_cpu(vmx_pi_blocking, v->processor).list);
+  &per_cpu(vmx_pi_blocking, pi_cpu).list);
 spin_unlock_irqrestore(pi_blocking_list_lock, flags);
 
 ASSERT(!pi_test_sn(pi_desc));
@@ -134,6 +180,13 @@ static void vmx_vcpu_block(struct vcpu *v)
 ASSERT(pi_desc->ndst ==
(x2apic_enabled ? dest : MASK_INSR(dest, PI_xAPIC_NDST_MASK)));
 
+if ( unlikely(pi_cpu != v->processor) )
+{
+dest = cpu_physical_id(pi_cpu);
+

[Xen-devel] [PATCH v3] VT-d PI: track the vcpu number in pi blocking list

2017-05-23 Thread Chao Gao
This patch adds a field, counter, in struct vmx_pi_blocking_vcpu to track
how many entries are on the pi blocking list. In order to analyze list
operation frequence and obtain the list length, add some relevant events
to xentrace and some associated code in xenalyze. As to xenalyze, for
removing from pi list can happen in various contexts (interrupt context,
and non-interrupt context) and be done by the vcpu itself or others, some of
the contexts would incur that toplevel_assert_check() fails. To bypass this
check, this patch adds a new type TRC_HVM_ASYNC and for this new type event,
the context would not be checked.

Signed-off-by: Chao Gao 
---
 tools/xentrace/formats  |   3 +
 tools/xentrace/xenalyze.c   | 154 +---
 xen/arch/x86/hvm/vmx/vmx.c  |  33 +++--
 xen/include/asm-x86/hvm/trace.h |   1 +
 xen/include/public/trace.h  |   5 ++
 5 files changed, 182 insertions(+), 14 deletions(-)

diff --git a/tools/xentrace/formats b/tools/xentrace/formats
index 8b31780..54e0b11 100644
--- a/tools/xentrace/formats
+++ b/tools/xentrace/formats
@@ -125,6 +125,9 @@
 0x00082020  CPU%(cpu)d  %(tsc)d (+%(reltsc)8d)  INTR_WINDOW [ value = 
0x%(1)08x ]
 0x00082021  CPU%(cpu)d  %(tsc)d (+%(reltsc)8d)  NPF [ gpa = 
0x%(2)08x%(1)08x mfn = 0x%(4)08x%(3)08x qual = 0x%(5)04x p2mt = 0x%(6)04x ]
 0x00082023  CPU%(cpu)d  %(tsc)d (+%(reltsc)8d)  TRAP[ vector = 
0x%(1)02x ]
+0x00082026  CPU%(cpu)d  %(tsc)d (+%(reltsc)8d)  PI_LIST_ADD [ domid = 
0x%(1)04x vcpu = 0x%(2)04x, pcpu = 0x%(3)04x, #entry = 0x%(4)04x ]
+
+0x00088001  CPU%(cpu)d  %(tsc)d (+%(reltsc)8d)  ASYNC_PI_LIST_DEL [ domid = 
0x%(1)04x vcpu = 0x%(2)04x ]
 
 0x0010f001  CPU%(cpu)d  %(tsc)d (+%(reltsc)8d)  page_grant_map  [ domid = 
%(1)d ]
 0x0010f002  CPU%(cpu)d  %(tsc)d (+%(reltsc)8d)  page_grant_unmap[ domid = 
%(1)d ]
diff --git a/tools/xentrace/xenalyze.c b/tools/xentrace/xenalyze.c
index fa608ad..fbc2429 100644
--- a/tools/xentrace/xenalyze.c
+++ b/tools/xentrace/xenalyze.c
@@ -296,6 +296,7 @@ struct symbol_struct {
 };
 
 void error(enum error_level l, struct record_info *ri);
+struct vcpu_data * vcpu_find(int did, int vid);
 
 void parse_symbol_file(char *fn) {
 unsigned long long last_addr = 0;
@@ -944,6 +945,7 @@ enum {
 HVM_EVENT_TRAP,
 HVM_EVENT_TRAP_DEBUG,
 HVM_EVENT_VLAPIC,
+HVM_EVENT_PI_LIST_ADD,
 HVM_EVENT_HANDLER_MAX
 };
 char * hvm_event_handler_name[HVM_EVENT_HANDLER_MAX] = {
@@ -979,13 +981,15 @@ char * hvm_event_handler_name[HVM_EVENT_HANDLER_MAX] = {
 "realmode_emulate",
 "trap",
 "trap_debug",
-"vlapic"
+"vlapic",
+"pi_list_add",
 };
 
 enum {
 HVM_VOL_VMENTRY,
 HVM_VOL_VMEXIT,
 HVM_VOL_HANDLER,
+HVM_VOL_ASYNC,
 HVM_VOL_MAX
 };
 
@@ -1012,6 +1016,7 @@ char *hvm_vol_name[HVM_VOL_MAX] = {
 [HVM_VOL_VMENTRY]="vmentry",
 [HVM_VOL_VMEXIT] ="vmexit",
 [HVM_VOL_HANDLER]="handler",
+[HVM_VOL_ASYNC]="async",
 };
 
 enum {
@@ -1337,6 +1342,9 @@ struct hvm_data {
 struct {
 struct io_address *mmio, *pio;
 } io;
+struct {
+int pi_list_add, pi_list_del;
+} pi;
 } summary;
 
 /* In-flight accumulation information */
@@ -1391,6 +1399,9 @@ struct hvm_data {
 
 /* Historical info */
 tsc_t last_rdtsc;
+
+/* Destination pcpu of posted interrupt's wakeup interrupt */
+int pi_cpu;
 };
 
 enum {
@@ -1457,6 +1468,8 @@ void init_hvm_data(struct hvm_data *h, struct vcpu_data 
*v) {
 }
 for(i=0; isummary.guest_interrupt[i].count=0;
+
+h->pi_cpu = -1;
 }
 
 /* PV data */
@@ -1766,6 +1779,14 @@ char * toplevel_name[TOPLEVEL_MAX] = {
 [TOPLEVEL_HW]="hw",
 };
 
+enum {
+SUBLEVEL_HVM_ENTRYEXIT=1,
+SUBLEVEL_HVM_HANDLER,
+SUBLEVEL_HVM_EMUL,
+SUBLEVEL_HVM_ASYNC,
+SUBLEVEL_HVM_MAX=SUBLEVEL_HVM_ASYNC+1,
+};
+
 struct trace_volume {
 unsigned long long toplevel[TOPLEVEL_MAX];
 unsigned long long sched_verbose;
@@ -1852,6 +1873,9 @@ struct pcpu_info {
 tsc_t tsc;
 struct cycle_summary idle, running, lost;
 } time;
+
+/* Posted Interrupt List Length */
+int pi_list_length;
 };
 
 void __fill_in_record_info(struct pcpu_info *p);
@@ -4726,6 +4750,71 @@ void hvm_generic_dump(struct record_info *ri, char * 
prefix)
 printf(" ]\n");
 }
 
+void hvm_pi_list_add_process(struct record_info *ri, struct hvm_data *h)
+{
+struct {
+int did;
+int vid;
+int pcpu;
+int len;
+} *data;
+struct vcpu_data *v;
+
+data = (typeof(data))ri->rec.u.tsc.data;
+v = vcpu_find(data->did, data->vid);
+if ( !v->hvm.init )
+init_hvm_data(&v->hvm, v);
+
+if ( opt.dump_all )
+printf("d%uv%u is added to pi blocking list of pcpu%u. "
+   "The list length is now %d\n",
+   data->did, data->vid, data->pcpu, data->len);
+
+v->hvm.pi_cpu = data->pcpu;
+v->hvm.summary.pi.pi_list_add++;
+if ( data->p

[Xen-devel] [PATCH v3 2/3] vcpu: track hvm vcpu number on the system

2017-05-23 Thread Chao Gao
This number is used to calculate how many hvm vcpu on a pcpu on average.
This counting is x86 specific.

Signed-off-by: Chao Gao 
---
 xen/arch/x86/domain.c| 10 ++
 xen/include/asm-x86/domain.h |  2 ++
 2 files changed, 12 insertions(+)

diff --git a/xen/arch/x86/domain.c b/xen/arch/x86/domain.c
index 13cdc50..050fe0e 100644
--- a/xen/arch/x86/domain.c
+++ b/xen/arch/x86/domain.c
@@ -66,6 +66,9 @@
 
 DEFINE_PER_CPU(struct vcpu *, curr_vcpu);
 
+/* how many hvm vcpu on this system? */
+atomic_t num_hvm_vcpus;
+
 static void default_idle(void);
 void (*pm_idle) (void) __read_mostly = default_idle;
 void (*dead_idle) (void) __read_mostly = default_dead_idle;
@@ -467,7 +470,11 @@ int vcpu_initialise(struct vcpu *v)
 xfree(v->arch.pv_vcpu.trap_ctxt);
 }
 else if ( !is_idle_domain(v->domain) )
+{
 vpmu_initialise(v);
+if ( is_hvm_domain(v->domain) )
+atomic_inc(&num_hvm_vcpus);
+}
 
 return rc;
 }
@@ -489,7 +496,10 @@ void vcpu_destroy(struct vcpu *v)
 vpmu_destroy(v);
 
 if ( is_hvm_vcpu(v) )
+{
 hvm_vcpu_destroy(v);
+atomic_dec(&num_hvm_vcpus);
+}
 else
 xfree(v->arch.pv_vcpu.trap_ctxt);
 }
diff --git a/xen/include/asm-x86/domain.h b/xen/include/asm-x86/domain.h
index 924caac..769cde2 100644
--- a/xen/include/asm-x86/domain.h
+++ b/xen/include/asm-x86/domain.h
@@ -31,6 +31,8 @@
 #define nmi_pendingnmi_state.pending
 #define mce_pendingmce_state.pending
 
+extern atomic_t num_hvm_vcpus;
+
 struct trap_bounce {
 uint32_t  error_code;
 uint8_t   flags; /* TBF_ */
-- 
1.8.3.1


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


[Xen-devel] [PATCH v3 0/3] mitigate the per-pCPU blocking list may be too long

2017-05-23 Thread Chao Gao
VT-d PI introduces a per-pCPU blocking list to track the blocked vCPU
on a given pCPU. Theoretically, there are 32K domain on single host,
128 vCPUs per domain. If all vCPUs are blocked on the same pCPU,
4M vCPUs are in the same list. Traversing this list consumes too
much time. More discussion can be found in [1,2,3].

To mitigate this issue, this series put vcpus to another pcpu's list
when the local pcpu's list length reachs an upper bound. The upper
bound is determined by total vcpu count and total pcpu count in the
system.

PATCH 1/3 adds a counter to track the per-pCPU blocking list's length
and to aid analysis and obtain the list length, add some relevant
events to xentrace. With this patch, some data can be acquired to help
to validate patch 3/3. 

PATCH 2/3 uses a global variable to track how many hvm vcpus on this
system. It is used to calculate the number limit of blocked vcpu on a
given pcpu.

In patch 3/3, a policy is used to restrict the vcpu count on a given
pcpu's pi blocking list in case the list grows too long.

In this new version, the method only putting vcpus which are referred
by at least one IRTE to the list is removed for
1. The implementation is intrusive.
2. Now, no evidence shows its necessity.

[1] 
https://lists.gt.net/xen/devel/422661?search_string=VT-d%20posted-interrupt%20core%20logic%20handling;#422661
[2] 
https://lists.gt.net/xen/devel/422567?search_string=%20The%20length%20of%20the%20list%20depends;#422567
[3] 
https://lists.gt.net/xen/devel/472749?search_string=enable%20vt-d%20pi%20by%20default;#472749

Chao Gao (3):
  VT-d PI: track the vcpu number in pi blocking list
  vcpu: track hvm vcpu number on the system
  VT-d PI: restrict the vcpu number on a given pcpu

 tools/xentrace/formats  |   3 +
 tools/xentrace/xenalyze.c   | 159 +---
 xen/arch/x86/domain.c   |  10 +++
 xen/arch/x86/hvm/vmx/vmx.c  |  97 +---
 xen/include/asm-x86/domain.h|   2 +
 xen/include/asm-x86/hvm/trace.h |   2 +
 xen/include/public/trace.h  |   6 ++
 7 files changed, 261 insertions(+), 18 deletions(-)

-- 
1.8.3.1


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


Re: [Xen-devel] [PATCH v2 for-4.9] x86/mm: Fix incorrect unmapping of 2MB and 1GB pages

2017-05-23 Thread Andrew Cooper
On 24/05/2017 07:20, Jan Beulich wrote:
> I'm kind of disappointed that there was no visible attempt
> from Igor so far to help the situation.

Igor is out of the office at the moment, and besides, this thread of
problem is only 36h old at this point, which is a single working day in
this timezone.

~Andrew

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


Re: [Xen-devel] [PATCH] xen/x86: Add Xenoprofile support for AMD Family 17h

2017-05-23 Thread Jan Beulich
>>> On 23.05.17 at 23:51,  wrote:
> On 5/23/2017 4:46 PM, Boris Ostrovsky wrote:
>> On 05/23/2017 05:28 PM, Gary R Hook wrote:
>>> Signed-off-by: Gary R Hook 
>>> ---
>>>   xen/arch/x86/oprofile/nmi_int.c |4 
>>>   1 file changed, 4 insertions(+)
>>>
>>> diff --git a/xen/arch/x86/oprofile/nmi_int.c 
> b/xen/arch/x86/oprofile/nmi_int.c
>>> index 13534d491405..5ad48c12e515 100644
>>> --- a/xen/arch/x86/oprofile/nmi_int.c
>>> +++ b/xen/arch/x86/oprofile/nmi_int.c
>>> @@ -419,6 +419,10 @@ static int __init nmi_init(void)
>>> model = &op_athlon_spec;
>>> cpu_type = "x86-64/family16h";
>>> break;
>>> +   case 0x17:
>>> +model = &op_amd_fam15h_spec;
>>> +   cpu_type = "x86-64/family17h";
>>> +   break;
>>> }
>>> break;
>> 
>> 
>> Have you actually tried this? I don't know whether oprofile still works
>> since corresponding kernel patches that I am aware of are at least 5
>> years old.
> 
> Yes, I was getting a complaint during boot. That's why I did it. Works a 
> treat on my family 17 system :-)

I think Boris meant more than just boot a system, i.e. whether you've
actually used oprofile successfully with the change. Dealing with the
"Initialization failed" message would not necessarily require properly
installing handlers - we could also declare newer families unsupported
and simply suppress the message in such cases. Note how on most
Intel family 6 models code behaves in this very way.

Btw, please also note the indentation issue your patch has (spaces
vs tabs).

Jan


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


Re: [Xen-devel] [PATCH 31/31] xen/scsifront: Remove code that zeroes driver-private command data

2017-05-23 Thread Hannes Reinecke
On 05/24/2017 02:34 AM, Bart Van Assche wrote:
> Since the SCSI core zeroes driver-private command data, remove
> that code from the xen-scsifront driver.
> 
> Signed-off-by: Bart Van Assche 
> Cc: Juergen Gross 
> Cc: xen-de...@lists.xenproject.org
> ---
>  drivers/scsi/xen-scsifront.c | 1 -
>  1 file changed, 1 deletion(-)
> 
> diff --git a/drivers/scsi/xen-scsifront.c b/drivers/scsi/xen-scsifront.c
> index a6a8b60d4902..36f59a1be7e9 100644
> --- a/drivers/scsi/xen-scsifront.c
> +++ b/drivers/scsi/xen-scsifront.c
> @@ -534,7 +534,6 @@ static int scsifront_queuecommand(struct Scsi_Host *shost,
>   int err;
>  
>   sc->result = 0;
> - memset(shadow, 0, sizeof(*shadow));
>  
>   shadow->sc  = sc;
>   shadow->act = VSCSIIF_ACT_SCSI_CDB;
> 
Reviewed-by: Hannes Reinecke 

Cheers,

Hannes
-- 
Dr. Hannes ReineckeTeamlead Storage & Networking
h...@suse.de   +49 911 74053 688
SUSE LINUX GmbH, Maxfeldstr. 5, 90409 Nürnberg
GF: F. Imendörffer, J. Smithard, J. Guild, D. Upmanyu, G. Norton
HRB 21284 (AG Nürnberg)

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


Re: [Xen-devel] [BUG] xen-mceinj tool testing cause dom0 crash

2017-05-23 Thread Jan Beulich
>>> On 24.05.17 at 07:32,  wrote:
>>  -Original Message-
>> From: Xen-devel [mailto:xen-devel-boun...@lists.xen.org] On Behalf Of Hao,
>> Xudong
>> Sent: Tuesday, May 23, 2017 5:34 PM
>> To: Jan Beulich 
>> Cc: Lars Kurth ; Julien Grall ;
>> George Dunlap ; Zhang, Haozhong
>> ; xen-devel@lists.xen.org 
>> Subject: Re: [Xen-devel] [BUG] xen-mceinj tool testing cause dom0 crash
>> 
>> > -Original Message-
>> > From: Xen-devel [mailto:xen-devel-boun...@lists.xen.org] On Behalf Of
>> > Jan Beulich
>> > Sent: Tuesday, May 23, 2017 12:06 AM
>> > To: Hao, Xudong 
>> > Cc: Lars Kurth ; Julien Grall
>> > ; xen-devel@lists.xen.org; George Dunlap
>> > ; Zhang, Haozhong 
>> > Subject: Re: [Xen-devel] [BUG] xen-mceinj tool testing cause dom0
>> > crash
>> >
>> > >>> On 22.05.17 at 10:39,  wrote:
>> > > (XEN) Hardware Dom0 crashed: rebooting machine in 5 seconds.
>> >
>> > Not this - Xen is unavoidably going to go down in such a case, yet
>> > your log has no hint at all what kind of problem Dom0 experienced
>> > (e.g. whether one of the injected #MC-s caused this).
>> >
>> 
>> Jan,
>> The first mail attached the complete log from Xen booting, hope there is 
> some
>> hint from the full log.
>> 
>> > > (XEN) [ Xen-4.9-rc  x86_64  debug=y   Tainted: MCE  ]
>> > > (XEN) CPU:0
>> > > (XEN) RIP:e008:[<65eb1e13>] 65eb1e13
>> > > ...
>> > > (XEN) Pagetable walk from 682ab009:
>> > > (XEN)  L4[0x000] = 00102c961063 
>> > > (XEN)  L3[0x001] = 5f812063 
>> > > (XEN)  L2[0x141] =  
>> >
>> > Here you're apparently hitting a firmware bug: While RIP points into
>> > runtime services memory, CR2 doesn't:
>> >
>> > (XEN)  065eb8000-0682acfff type=0 attr=000f
>> >
>> > You may try working around this via one of "reboot=acpi" or
>> > "efi=no-rs" on the hypervisor command line.
>> >
>> 
>> Will try them.
>> 
> 
> Neither "reboot=acpi" nor "efi=no-rs" can work around this issue.

Apparently I didn't express myself clearly enough: These
workarounds were supposed to help with the Xen crash, not
the Dom0 one. And as your logs prove they did fulfill that
purpose. Yet still there are no Dom0 log messages at all near
the crash, which leaves open whether there is a completely
silent path in its MCE handling, or whether some messages
simply don't make it through. Right now I can't see any Xen
side of the issue here though, so from a 4.9 perspective I
think we're fine.

Jan


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


Re: [Xen-devel] [PATCH v2 for-4.9] x86/mm: Fix incorrect unmapping of 2MB and 1GB pages

2017-05-23 Thread Jan Beulich
>>> On 24.05.17 at 00:25,  wrote:
> On 05/23/2017 10:32 AM, Boris Ostrovsky wrote:
>> On 05/23/2017 10:05 AM, Jan Beulich wrote:
>>> Further changes may then
>>> be needed to the splitting of large pages (in p2m_next_level())
>>> depending on whether INVALID_MFN entries can make it there.
>> Let me see what I can do here.
> 
> TBH, I don't see what needs to be done in p2m_next_level(). mfn doesn't
> enter the calculation there.

The relevant variables are named "pfn" there, and so far I'm only
guessing there might be an issue (or actually I meanwhile thing it
should only be a cosmetic one): What's being read out of the old
PTE is being taken and incremented for each split PTE. That'll (in
the 2Mb page case) result in 4k PTEs referencing MFNs 0xff
and 0 ... 0x1fe. But generally this should be harmless, as these
are non-present PTEs, and the frame numbers read back out of
non-present PTEs should be of no interest to anyone.

I'm pondering to convert the code to use mfn_add() (perhaps we
should also have mfn_inc()), making the helper saturate.

In any event I hope to find time later today to look into the issue
myself. I'm kind of disappointed that there was no visible attempt
from Igor so far to help the situation.

Jan


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


[Xen-devel] [qemu-mainline test] 109701: regressions - FAIL

2017-05-23 Thread osstest service owner
flight 109701 qemu-mainline real [real]
http://logs.test-lab.xenproject.org/osstest/logs/109701/

Regressions :-(

Tests which did not succeed and are blocking,
including tests which could not be run:
 test-armhf-armhf-xl-credit2 15 guest-start/debian.repeat fail REGR. vs. 109664

Tests which did not succeed, but are not blocking:
 test-amd64-i386-xl-qemuu-win7-amd64 16 guest-stop fail like 109613
 test-amd64-amd64-xl-qemuu-win7-amd64 15 guest-localmigrate/x10 fail like 109653
 test-armhf-armhf-libvirt-xsm 13 saverestore-support-checkfail  like 109664
 test-armhf-armhf-libvirt-raw 12 saverestore-support-checkfail  like 109664
 test-armhf-armhf-libvirt 13 saverestore-support-checkfail  like 109664
 test-amd64-amd64-libvirt-xsm 12 migrate-support-checkfail   never pass
 test-amd64-amd64-xl-qemuu-ws16-amd64  9 windows-installfail never pass
 test-amd64-i386-libvirt  12 migrate-support-checkfail   never pass
 test-amd64-i386-libvirt-xsm  12 migrate-support-checkfail   never pass
 test-amd64-amd64-libvirt 12 migrate-support-checkfail   never pass
 test-amd64-amd64-libvirt-qemuu-debianhvm-amd64-xsm 10 migrate-support-check 
fail never pass
 test-arm64-arm64-xl-credit2  12 migrate-support-checkfail   never pass
 test-arm64-arm64-xl-credit2  13 saverestore-support-checkfail   never pass
 test-arm64-arm64-libvirt 12 migrate-support-checkfail   never pass
 test-arm64-arm64-libvirt 13 saverestore-support-checkfail   never pass
 test-arm64-arm64-xl-xsm  12 migrate-support-checkfail   never pass
 test-arm64-arm64-xl-xsm  13 saverestore-support-checkfail   never pass
 test-amd64-i386-libvirt-qemuu-debianhvm-amd64-xsm 10 migrate-support-check 
fail never pass
 test-arm64-arm64-xl-multivcpu 12 migrate-support-checkfail  never pass
 test-arm64-arm64-xl-multivcpu 13 saverestore-support-checkfail  never pass
 test-arm64-arm64-libvirt-xsm 12 migrate-support-checkfail   never pass
 test-arm64-arm64-libvirt-xsm 13 saverestore-support-checkfail   never pass
 test-amd64-amd64-libvirt-vhd 11 migrate-support-checkfail   never pass
 test-arm64-arm64-libvirt-qcow2 11 migrate-support-checkfail never pass
 test-arm64-arm64-libvirt-qcow2 12 saverestore-support-checkfail never pass
 test-amd64-amd64-qemuu-nested-amd 16 debian-hvm-install/l1/l2  fail never pass
 test-armhf-armhf-xl-rtds 12 migrate-support-checkfail   never pass
 test-armhf-armhf-xl-rtds 13 saverestore-support-checkfail   never pass
 test-armhf-armhf-libvirt-xsm 12 migrate-support-checkfail   never pass
 test-armhf-armhf-xl-credit2  12 migrate-support-checkfail   never pass
 test-armhf-armhf-xl-credit2  13 saverestore-support-checkfail   never pass
 test-armhf-armhf-xl-multivcpu 12 migrate-support-checkfail  never pass
 test-armhf-armhf-xl-multivcpu 13 saverestore-support-checkfail  never pass
 test-armhf-armhf-xl-xsm  12 migrate-support-checkfail   never pass
 test-armhf-armhf-xl-xsm  13 saverestore-support-checkfail   never pass
 test-armhf-armhf-libvirt-raw 11 migrate-support-checkfail   never pass
 test-armhf-armhf-xl-vhd  11 migrate-support-checkfail   never pass
 test-armhf-armhf-xl-vhd  12 saverestore-support-checkfail   never pass
 test-armhf-armhf-xl-cubietruck 12 migrate-support-checkfail never pass
 test-armhf-armhf-xl-cubietruck 13 saverestore-support-checkfail never pass
 test-armhf-armhf-xl  12 migrate-support-checkfail   never pass
 test-armhf-armhf-xl  13 saverestore-support-checkfail   never pass
 test-arm64-arm64-xl  12 migrate-support-checkfail   never pass
 test-arm64-arm64-xl  13 saverestore-support-checkfail   never pass
 test-armhf-armhf-xl-arndale  12 migrate-support-checkfail   never pass
 test-armhf-armhf-xl-arndale  13 saverestore-support-checkfail   never pass
 test-arm64-arm64-xl-rtds 12 migrate-support-checkfail   never pass
 test-arm64-arm64-xl-rtds 13 saverestore-support-checkfail   never pass
 test-armhf-armhf-libvirt 12 migrate-support-checkfail   never pass
 test-amd64-i386-xl-qemuu-win10-i386  9 windows-install fail never pass
 test-amd64-amd64-xl-qemuu-win10-i386  9 windows-installfail never pass
 test-amd64-i386-xl-qemuu-ws16-amd64  9 windows-install fail never pass

version targeted for testing:
 qemuu9964e96dccf7f7c936ee854a795415d19b60
baseline version:
 qemuu56821559f0ba682fe6b367815572e6f974d329ab

Last test of basis   109664  2017-05-21 14:59:24 Z2 days
Testing same since   109701  2017-05-23 17:13:05 Z0 days1 attempts


People who touched revisions under test:
  Dr. David Alan Gilbert 
  Eduardo Habkost 
  Gerd Hoffmann 
 

[Xen-devel] [linux-linus test] 109697: regressions - trouble: broken/fail/pass

2017-05-23 Thread osstest service owner
flight 109697 linux-linus real [real]
http://logs.test-lab.xenproject.org/osstest/logs/109697/

Regressions :-(

Tests which did not succeed and are blocking,
including tests which could not be run:
 test-amd64-i386-libvirt   7 host-ping-check-xen  fail REGR. vs. 109656
 test-amd64-i386-libvirt-qemuu-debianhvm-amd64-xsm 7 host-ping-check-xen fail 
REGR. vs. 109656
 test-armhf-armhf-libvirt-raw  8 leak-check/basis(8)  fail REGR. vs. 109656
 test-armhf-armhf-libvirt-xsm  7 host-ping-check-xen  fail REGR. vs. 109656
 test-amd64-i386-xl-qemut-win7-amd64 15 guest-localmigrate/x10 fail REGR. vs. 
109656
 test-amd64-amd64-amd64-pvgrub 10 guest-start fail REGR. vs. 109656

Tests which did not succeed, but are not blocking:
 test-amd64-amd64-xl-qemuu-win7-amd64 16 guest-stop  fail blocked in 109656
 test-amd64-amd64-xl-qemut-win7-amd64 16 guest-stop  fail blocked in 109656
 test-armhf-armhf-xl-rtds   15 guest-start/debian.repeat fail blocked in 109656
 test-armhf-armhf-libvirt 13 saverestore-support-checkfail  like 109656
 test-amd64-i386-xl-qemuu-win7-amd64 16 guest-stop fail like 109656
 test-amd64-amd64-xl-rtds  9 debian-install   fail  like 109656
 test-amd64-amd64-xl-qemut-ws16-amd64  9 windows-installfail never pass
 test-amd64-i386-libvirt-xsm  12 migrate-support-checkfail   never pass
 test-amd64-amd64-xl-qemuu-ws16-amd64  9 windows-installfail never pass
 test-amd64-amd64-libvirt-xsm 12 migrate-support-checkfail   never pass
 test-amd64-amd64-libvirt 12 migrate-support-checkfail   never pass
 test-arm64-arm64-xl-multivcpu 12 migrate-support-checkfail  never pass
 test-arm64-arm64-xl-multivcpu 13 saverestore-support-checkfail  never pass
 test-arm64-arm64-libvirt-xsm 12 migrate-support-checkfail   never pass
 test-arm64-arm64-libvirt-xsm 13 saverestore-support-checkfail   never pass
 test-arm64-arm64-xl  12 migrate-support-checkfail   never pass
 test-arm64-arm64-xl  13 saverestore-support-checkfail   never pass
 test-arm64-arm64-xl-xsm  12 migrate-support-checkfail   never pass
 test-arm64-arm64-xl-xsm  13 saverestore-support-checkfail   never pass
 test-armhf-armhf-xl-arndale  12 migrate-support-checkfail   never pass
 test-armhf-armhf-xl-arndale  13 saverestore-support-checkfail   never pass
 test-arm64-arm64-xl-rtds 12 migrate-support-checkfail   never pass
 test-arm64-arm64-xl-rtds 13 saverestore-support-checkfail   never pass
 test-amd64-amd64-libvirt-vhd 11 migrate-support-checkfail   never pass
 test-amd64-amd64-qemuu-nested-amd 16 debian-hvm-install/l1/l2  fail never pass
 test-armhf-armhf-xl-credit2  12 migrate-support-checkfail   never pass
 test-armhf-armhf-xl-credit2  13 saverestore-support-checkfail   never pass
 test-armhf-armhf-xl-xsm  12 migrate-support-checkfail   never pass
 test-armhf-armhf-xl-xsm  13 saverestore-support-checkfail   never pass
 test-armhf-armhf-libvirt 12 migrate-support-checkfail   never pass
 test-armhf-armhf-xl-rtds 12 migrate-support-checkfail   never pass
 test-armhf-armhf-xl-rtds 13 saverestore-support-checkfail   never pass
 test-amd64-amd64-libvirt-qemuu-debianhvm-amd64-xsm 10 migrate-support-check 
fail never pass
 test-armhf-armhf-xl-vhd  11 migrate-support-checkfail   never pass
 test-armhf-armhf-xl-vhd  12 saverestore-support-checkfail   never pass
 test-arm64-arm64-libvirt 12 migrate-support-checkfail   never pass
 test-arm64-arm64-libvirt 13 saverestore-support-checkfail   never pass
 test-arm64-arm64-xl-credit2  12 migrate-support-checkfail   never pass
 test-arm64-arm64-xl-credit2  13 saverestore-support-checkfail   never pass
 test-armhf-armhf-xl-cubietruck 12 migrate-support-checkfail never pass
 test-armhf-armhf-xl-cubietruck 13 saverestore-support-checkfail never pass
 test-armhf-armhf-xl-multivcpu 12 migrate-support-checkfail  never pass
 test-armhf-armhf-xl-multivcpu 13 saverestore-support-checkfail  never pass
 test-arm64-arm64-libvirt-qcow2 11 migrate-support-checkfail never pass
 test-arm64-arm64-libvirt-qcow2 12 saverestore-support-checkfail never pass
 test-amd64-i386-xl-qemut-win10-i386  9 windows-install fail never pass
 test-amd64-amd64-xl-qemuu-win10-i386  9 windows-installfail never pass
 test-amd64-i386-xl-qemuu-win10-i386  9 windows-install fail never pass
 test-amd64-i386-xl-qemuu-ws16-amd64  9 windows-install fail never pass
 test-amd64-amd64-xl-qemut-win10-i386  9 windows-installfail never pass
 test-amd64-i386-xl-qemut-ws16-amd64  9 windows-install fail never pass
 test-armhf-armhf-xl  12 migrate-support-checkfail   never pass
 test-armhf-armhf-xl  13 saverestore-support-checkfail   nev

Re: [Xen-devel] [RFC PATCH V2 1/2] xen-pt: bind/unbind interrupt remapping format MSI

2017-05-23 Thread Lan Tianyu
On 2017年05月24日 01:06, Anthony PERARD wrote:
> On Tue, May 23, 2017 at 08:16:25PM +0800, Lan Tianyu wrote:
>> On 2017年05月19日 20:04, Jan Beulich wrote:
>> On 19.05.17 at 13:16,  wrote:
 On Thu, May 18, 2017 at 01:32:59AM -0400, Lan Tianyu wrote:
> --- a/include/hw/i386/apic-msidef.h
> +++ b/include/hw/i386/apic-msidef.h
> @@ -26,6 +26,7 @@
>  
>  #define MSI_ADDR_DEST_ID_SHIFT  12
>  #define MSI_ADDR_DEST_IDX_SHIFT 4
> -#define  MSI_ADDR_DEST_ID_MASK  0x000
> +#define  MSI_ADDR_DEST_ID_MASK  0x000fff00
 The value of MSI_ADDR_DEST_ID_MASK is changed here. I think the patch
 should be:
 +#define  MSI_ADDR_DEST_ID_MASK  0x0000
>>> Judging from other sources, rather the other way around - the
>>> mask needs to have further bits removed (should be 0x000ff000
>>> afaict). Xen sources confirm this, and while Linux has the value
>>> you suggest, that contradicts
>> Agree. Defining the mask as "0x000ff000" makes more sense.
>> Just check Qemu source code. Only apic_send_msi() and msi_dest_id() use
>> the mask
>> to get dest apic id. They mask MSI address field with 
>> MSI_ADDR_DEST_ID_MASK and
>> then right-shift 12bit. The low 12bit won't be used.
>>
>> Anthony, does this make sense?
> Yes, it does.
> The change to MSI_ADDR_DEST_ID_MASK should probably go in its own patch.
>
OK. Will update.


-- 
Best regards
Tianyu Lan

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


[Xen-devel] [PATCH 31/31] xen/scsifront: Remove code that zeroes driver-private command data

2017-05-23 Thread Bart Van Assche
Since the SCSI core zeroes driver-private command data, remove
that code from the xen-scsifront driver.

Signed-off-by: Bart Van Assche 
Cc: Juergen Gross 
Cc: xen-de...@lists.xenproject.org
---
 drivers/scsi/xen-scsifront.c | 1 -
 1 file changed, 1 deletion(-)

diff --git a/drivers/scsi/xen-scsifront.c b/drivers/scsi/xen-scsifront.c
index a6a8b60d4902..36f59a1be7e9 100644
--- a/drivers/scsi/xen-scsifront.c
+++ b/drivers/scsi/xen-scsifront.c
@@ -534,7 +534,6 @@ static int scsifront_queuecommand(struct Scsi_Host *shost,
int err;
 
sc->result = 0;
-   memset(shadow, 0, sizeof(*shadow));
 
shadow->sc  = sc;
shadow->act = VSCSIIF_ACT_SCSI_CDB;
-- 
2.12.2


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


[Xen-devel] [PATCH] ARM: vGIC: avoid rank lock when reading priority

2017-05-23 Thread Andre Przywara
When reading the priority value of a virtual interrupt, we were taking
the respective rank lock so far.
However for forwarded interrupts (Dom0 only so far) this may lead to a
deadlock with the following call chain:
- MMIO access to change the IRQ affinity, calling the ITARGETSR handler
- this handler takes the appropriate rank lock and calls vgic_store_itargetsr()
- vgic_store_itargetsr() will eventually call vgic_migrate_irq()
- if this IRQ is already in-flight, it will remove it from the old
  VCPU and inject it into the new one, by calling vgic_vcpu_inject_irq()
- vgic_vcpu_inject_irq will call vgic_get_virq_priority()
- vgic_get_virq_priority() tries to take the rank lock - again!
It seems like this code path has never been exercised before.

Fix this by avoiding taking the lock in vgic_get_virq_priority() (like we
do in vgic_get_target_vcpu()).
Actually we are just reading one byte, and priority changes while
interrupts are handled are a benign race that can happen on real hardware
too. So it looks safe to just use read_atomic() instead.

Signed-off-by: Andre Przywara 
---
 xen/arch/arm/vgic.c | 8 +---
 1 file changed, 1 insertion(+), 7 deletions(-)

diff --git a/xen/arch/arm/vgic.c b/xen/arch/arm/vgic.c
index 83569b0..54b2aad 100644
--- a/xen/arch/arm/vgic.c
+++ b/xen/arch/arm/vgic.c
@@ -227,14 +227,8 @@ struct vcpu *vgic_get_target_vcpu(struct vcpu *v, unsigned 
int virq)
 static int vgic_get_virq_priority(struct vcpu *v, unsigned int virq)
 {
 struct vgic_irq_rank *rank = vgic_rank_irq(v, virq);
-unsigned long flags;
-int priority;
-
-vgic_lock_rank(v, rank, flags);
-priority = rank->priority[virq & INTERRUPT_RANK_MASK];
-vgic_unlock_rank(v, rank, flags);
 
-return priority;
+return read_atomic(&rank->priority[virq & INTERRUPT_RANK_MASK]);
 }
 
 bool vgic_migrate_irq(struct vcpu *old, struct vcpu *new, unsigned int irq)
-- 
2.8.2


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


[Xen-devel] [PATCH 17/33] xen/scsiback: Make TMF processing slightly faster

2017-05-23 Thread Bart Van Assche
Target drivers must guarantee that struct se_cmd and struct se_tmr_req
exist as long as target_tmr_work() is in progress. Since the last
access by the LIO core is a call to .check_stop_free() and since the
Xen scsiback .check_stop_free() drops a reference to the TMF, it is
already guaranteed that the struct se_cmd that corresponds to the TMF
exists as long as target_tmr_work() is in progress. Hence change the
second argument of transport_generic_free_cmd() from 1 into 0.

Signed-off-by: Bart Van Assche 
Cc: Juergen Gross 
Cc: Christoph Hellwig 
Cc: Hannes Reinecke 
Cc: David Disseldorp 
Cc: xen-de...@lists.xenproject.org
---
 drivers/xen/xen-scsiback.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/xen/xen-scsiback.c b/drivers/xen/xen-scsiback.c
index 4cb33a0916a8..7bc88fd43cfc 100644
--- a/drivers/xen/xen-scsiback.c
+++ b/drivers/xen/xen-scsiback.c
@@ -614,7 +614,7 @@ static void scsiback_device_action(struct vscsibk_pend 
*pending_req,
SUCCESS : FAILED;
 
scsiback_do_resp_with_sense(NULL, err, 0, pending_req);
-   transport_generic_free_cmd(&pending_req->se_cmd, 1);
+   transport_generic_free_cmd(&pending_req->se_cmd, 0);
return;
 
 err:
-- 
2.12.2


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


[Xen-devel] [PATCH 16/33] xen/scsiback: Replace a waitqueue and a counter by a completion

2017-05-23 Thread Bart Van Assche
This patch simplifies the implementation of the scsiback driver
but does not change its behavior.

Signed-off-by: Bart Van Assche 
Cc: Juergen Gross 
Cc: Christoph Hellwig 
Cc: Hannes Reinecke 
Cc: David Disseldorp 
Cc: xen-de...@lists.xenproject.org
---
 drivers/xen/xen-scsiback.c | 11 ---
 1 file changed, 4 insertions(+), 7 deletions(-)

diff --git a/drivers/xen/xen-scsiback.c b/drivers/xen/xen-scsiback.c
index 980f32817305..4cb33a0916a8 100644
--- a/drivers/xen/xen-scsiback.c
+++ b/drivers/xen/xen-scsiback.c
@@ -135,8 +135,7 @@ struct vscsibk_pend {
 
struct se_cmd se_cmd;
 
-   atomic_t tmr_complete;
-   wait_queue_head_t tmr_wait;
+   struct completion tmr_done;
 };
 
 #define VSCSI_DEFAULT_SESSION_TAGS 128
@@ -600,7 +599,7 @@ static void scsiback_device_action(struct vscsibk_pend 
*pending_req,
u64 unpacked_lun = pending_req->v2p->lun;
int rc, err = FAILED;
 
-   init_waitqueue_head(&pending_req->tmr_wait);
+   init_completion(&pending_req->tmr_done);
 
rc = target_submit_tmr(&pending_req->se_cmd, nexus->tvn_se_sess,
   &pending_req->sense_buffer[0],
@@ -609,8 +608,7 @@ static void scsiback_device_action(struct vscsibk_pend 
*pending_req,
if (rc)
goto err;
 
-   wait_event(pending_req->tmr_wait,
-  atomic_read(&pending_req->tmr_complete));
+   wait_for_completion(&pending_req->tmr_done);
 
err = (se_cmd->se_tmr_req->response == TMR_FUNCTION_COMPLETE) ?
SUCCESS : FAILED;
@@ -1443,8 +1441,7 @@ static void scsiback_queue_tm_rsp(struct se_cmd *se_cmd)
struct vscsibk_pend *pending_req = container_of(se_cmd,
struct vscsibk_pend, se_cmd);
 
-   atomic_set(&pending_req->tmr_complete, 1);
-   wake_up(&pending_req->tmr_wait);
+   complete(&pending_req->tmr_done);
 }
 
 static void scsiback_aborted_task(struct se_cmd *se_cmd)
-- 
2.12.2


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


[Xen-devel] [PATCH 15/33] xen/scsiback: Fix a use-after-free

2017-05-23 Thread Bart Van Assche
scsiback_release_cmd() must not dereference se_cmd->se_tmr_req
because that memory is freed by target_free_cmd_mem() before
scsiback_release_cmd() is called. Fix this use-after-free by
inlining struct scsiback_tmr into struct vscsibk_pend.

Signed-off-by: Bart Van Assche 
Cc: Juergen Gross 
Cc: Christoph Hellwig 
Cc: Hannes Reinecke 
Cc: David Disseldorp 
Cc: xen-de...@lists.xenproject.org
---
 drivers/xen/xen-scsiback.c | 33 +
 1 file changed, 9 insertions(+), 24 deletions(-)

diff --git a/drivers/xen/xen-scsiback.c b/drivers/xen/xen-scsiback.c
index d6950e0802b7..980f32817305 100644
--- a/drivers/xen/xen-scsiback.c
+++ b/drivers/xen/xen-scsiback.c
@@ -134,9 +134,7 @@ struct vscsibk_pend {
struct page *pages[VSCSI_MAX_GRANTS];
 
struct se_cmd se_cmd;
-};
 
-struct scsiback_tmr {
atomic_t tmr_complete;
wait_queue_head_t tmr_wait;
 };
@@ -599,26 +597,20 @@ static void scsiback_device_action(struct vscsibk_pend 
*pending_req,
struct scsiback_tpg *tpg = pending_req->v2p->tpg;
struct scsiback_nexus *nexus = tpg->tpg_nexus;
struct se_cmd *se_cmd = &pending_req->se_cmd;
-   struct scsiback_tmr *tmr;
u64 unpacked_lun = pending_req->v2p->lun;
int rc, err = FAILED;
 
-   tmr = kzalloc(sizeof(struct scsiback_tmr), GFP_KERNEL);
-   if (!tmr) {
-   target_put_sess_cmd(se_cmd);
-   goto err;
-   }
-
-   init_waitqueue_head(&tmr->tmr_wait);
+   init_waitqueue_head(&pending_req->tmr_wait);
 
rc = target_submit_tmr(&pending_req->se_cmd, nexus->tvn_se_sess,
   &pending_req->sense_buffer[0],
-  unpacked_lun, tmr, act, GFP_KERNEL,
+  unpacked_lun, NULL, act, GFP_KERNEL,
   tag, TARGET_SCF_ACK_KREF);
if (rc)
goto err;
 
-   wait_event(tmr->tmr_wait, atomic_read(&tmr->tmr_complete));
+   wait_event(pending_req->tmr_wait,
+  atomic_read(&pending_req->tmr_complete));
 
err = (se_cmd->se_tmr_req->response == TMR_FUNCTION_COMPLETE) ?
SUCCESS : FAILED;
@@ -626,9 +618,8 @@ static void scsiback_device_action(struct vscsibk_pend 
*pending_req,
scsiback_do_resp_with_sense(NULL, err, 0, pending_req);
transport_generic_free_cmd(&pending_req->se_cmd, 1);
return;
+
 err:
-   if (tmr)
-   kfree(tmr);
scsiback_do_resp_with_sense(NULL, err, 0, pending_req);
 }
 
@@ -1389,12 +1380,6 @@ static int scsiback_check_stop_free(struct se_cmd 
*se_cmd)
 static void scsiback_release_cmd(struct se_cmd *se_cmd)
 {
struct se_session *se_sess = se_cmd->se_sess;
-   struct se_tmr_req *se_tmr = se_cmd->se_tmr_req;
-
-   if (se_tmr && se_cmd->se_cmd_flags & SCF_SCSI_TMR_CDB) {
-   struct scsiback_tmr *tmr = se_tmr->fabric_tmr_ptr;
-   kfree(tmr);
-   }
 
percpu_ida_free(&se_sess->sess_tag_pool, se_cmd->map_tag);
 }
@@ -1455,11 +1440,11 @@ static int scsiback_queue_status(struct se_cmd *se_cmd)
 
 static void scsiback_queue_tm_rsp(struct se_cmd *se_cmd)
 {
-   struct se_tmr_req *se_tmr = se_cmd->se_tmr_req;
-   struct scsiback_tmr *tmr = se_tmr->fabric_tmr_ptr;
+   struct vscsibk_pend *pending_req = container_of(se_cmd,
+   struct vscsibk_pend, se_cmd);
 
-   atomic_set(&tmr->tmr_complete, 1);
-   wake_up(&tmr->tmr_wait);
+   atomic_set(&pending_req->tmr_complete, 1);
+   wake_up(&pending_req->tmr_wait);
 }
 
 static void scsiback_aborted_task(struct se_cmd *se_cmd)
-- 
2.12.2


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


Re: [Xen-devel] [PATCH v2 for-4.9] x86/mm: Fix incorrect unmapping of 2MB and 1GB pages

2017-05-23 Thread Boris Ostrovsky
On 05/23/2017 10:32 AM, Boris Ostrovsky wrote:
> On 05/23/2017 10:05 AM, Jan Beulich wrote:
> On 23.05.17 at 15:40,  wrote:
>>> And you haven't been able to reproduce this? I see this fail on two AMD
>>> systems (different processor families).
>> I didn't even have the time to try.
>>
>>> And this:
>>>
>>> --- a/xen/arch/x86/mm/p2m.c
>>> +++ b/xen/arch/x86/mm/p2m.c
>>> @@ -560,7 +560,7 @@ int p2m_set_entry(struct p2m_domain *p2m, unsigned long 
>>> gfn, mfn_t mfn,
>>>  {
>>>  if ( hap_enabled(d) )
>>>  {
>>> -unsigned long fn_mask = !mfn_eq(mfn, INVALID_MFN) ?
>>> +unsigned long fn_mask = (!mfn_eq(mfn, INVALID_MFN) || 1)?
>>>   (gfn | mfn_x(mfn) | todo) : (gfn | 
>>> todo);
>>>  
>>>  order = (!(fn_mask & ((1ul << PAGE_ORDER_1G) - 1)) &&
>>>
>>>
>>> makes the problem go away.
>> Interesting. I took another look at p2m-pt.c, this time paying
>> particular attention to INVALID_MFN uses. And right the first one
>> may already provide a hint: Perhaps we now need L2 and L3
>> counterparts to p2m_l1e_from_pfn(). 
> Defining p2m_l2e_from_pfn indeed helps a bit with HVM --- the guest now
> goes as far as loading balloon driver (when it crashes).
>
>
>> Further changes may then
>> be needed to the splitting of large pages (in p2m_next_level())
>> depending on whether INVALID_MFN entries can make it there.
> Let me see what I can do here.

TBH, I don't see what needs to be done in p2m_next_level(). mfn doesn't
enter the calculation there.


-boris

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


Re: [Xen-devel] [For Xen-4.10 Resend PATCH 3/3] Avoid excess icache flushes in populate_physmap() before domain has been created

2017-05-23 Thread Stefano Stabellini
On Mon, 15 May 2017, Punit Agrawal wrote:
> populate_physmap() calls alloc_heap_pages() per requested
> extent. alloc_heap_pages() invalidates the entire icache per
> extent. During domain creation, the icache invalidations can be deffered
> until all the extents have been allocated as there is no risk of
> executing stale instructions from the icache.
> 
> Introduce a new flag "MEMF_no_icache_flush" to be used to prevent
> alloc_heap_pages() from performing icache maintenance operations. Use
> the flag in populate_physmap() before the domain has been unpaused and
> perform required icache maintenance function at the end of the
> allocation.
> 
> One concern is the lack of synchronisation around testing for
> "creation_finished". But it seems, in practice the window where it is
> out of sync should be small enough to not matter.
> 
> Signed-off-by: Punit Agrawal 

Reviewed-by: Stefano Stabellini 


> ---
>  xen/common/memory.c| 31 ++-
>  xen/common/page_alloc.c|  2 +-
>  xen/include/asm-x86/page.h |  4 
>  xen/include/xen/mm.h   |  2 ++
>  4 files changed, 29 insertions(+), 10 deletions(-)
> 
> diff --git a/xen/common/memory.c b/xen/common/memory.c
> index 52879e7438..34d2dda8b4 100644
> --- a/xen/common/memory.c
> +++ b/xen/common/memory.c
> @@ -152,16 +152,26 @@ static void populate_physmap(struct memop_args *a)
>  max_order(curr_d)) )
>  return;
>  
> -/*
> - * With MEMF_no_tlbflush set, alloc_heap_pages() will ignore
> - * TLB-flushes. After VM creation, this is a security issue (it can
> - * make pages accessible to guest B, when guest A may still have a
> - * cached mapping to them). So we do this only during domain creation,
> - * when the domain itself has not yet been unpaused for the first
> - * time.
> - */
>  if ( unlikely(!d->creation_finished) )
> +{
> +/*
> + * With MEMF_no_tlbflush set, alloc_heap_pages() will ignore
> + * TLB-flushes. After VM creation, this is a security issue (it can
> + * make pages accessible to guest B, when guest A may still have a
> + * cached mapping to them). So we do this only during domain 
> creation,
> + * when the domain itself has not yet been unpaused for the first
> + * time.
> + */
>  a->memflags |= MEMF_no_tlbflush;
> +/*
> + * With MEMF_no_icache_flush, alloc_heap_pages() will skip
> + * performing icache flushes. We do it only before domain
> + * creation as once the domain is running there is a danger of
> + * executing instructions from stale caches if icache flush is
> + * delayed.
> + */
> +a->memflags |= MEMF_no_icache_flush;
> +}
>  
>  for ( i = a->nr_done; i < a->nr_extents; i++ )
>  {
> @@ -211,7 +221,6 @@ static void populate_physmap(struct memop_args *a)
>  }
>  
>  mfn = gpfn;
> -page = mfn_to_page(mfn);
>  }
>  else
>  {
> @@ -255,6 +264,10 @@ static void populate_physmap(struct memop_args *a)
>  out:
>  if ( need_tlbflush )
>  filtered_flush_tlb_mask(tlbflush_timestamp);
> +
> +if ( a->memflags & MEMF_no_icache_flush )
> +invalidate_icache();
> +
>  a->nr_done = i;
>  }
>  
> diff --git a/xen/common/page_alloc.c b/xen/common/page_alloc.c
> index eba78f1a3d..8bcef6a547 100644
> --- a/xen/common/page_alloc.c
> +++ b/xen/common/page_alloc.c
> @@ -833,7 +833,7 @@ static struct page_info *alloc_heap_pages(
>  /* Ensure cache and RAM are consistent for platforms where the
>   * guest can control its own visibility of/through the cache.
>   */
> -flush_page_to_ram(page_to_mfn(&pg[i]), true);
> +flush_page_to_ram(page_to_mfn(&pg[i]), !(memflags & 
> MEMF_no_icache_flush));
>  }
>  
>  spin_unlock(&heap_lock);
> diff --git a/xen/include/asm-x86/page.h b/xen/include/asm-x86/page.h
> index 4cadb12646..3a375282f6 100644
> --- a/xen/include/asm-x86/page.h
> +++ b/xen/include/asm-x86/page.h
> @@ -375,6 +375,10 @@ perms_strictly_increased(uint32_t old_flags, uint32_t 
> new_flags)
>  
>  #define PAGE_ALIGN(x) (((x) + PAGE_SIZE - 1) & PAGE_MASK)
>  
> +static inline void invalidate_icache(void)
> +{
> +}
> +
>  #endif /* __X86_PAGE_H__ */
>  
>  /*
> diff --git a/xen/include/xen/mm.h b/xen/include/xen/mm.h
> index 88de3c1fa6..ee50d4cd7b 100644
> --- a/xen/include/xen/mm.h
> +++ b/xen/include/xen/mm.h
> @@ -224,6 +224,8 @@ struct npfec {
>  #define  MEMF_no_owner(1U<<_MEMF_no_owner)
>  #define _MEMF_no_tlbflush 6
>  #define  MEMF_no_tlbflush (1U<<_MEMF_no_tlbflush)
> +#define _MEMF_no_icache_flush 7
> +#define  MEMF_no_icache_flush (1U<<_MEMF_no_icache_flush)
>  #define _MEMF_node8
>  #define  MEMF_node_mask   ((1U << (8 * sizeof(nodeid_t))) - 1)
>  #define  MEMF_node(n) n) + 1) & MEMF_node_mask) << _MEMF_node)

Re: [Xen-devel] [PATCH] xen/x86: Add Xenoprofile support for AMD Family 17h

2017-05-23 Thread Boris Ostrovsky
On 05/23/2017 05:51 PM, Gary R Hook wrote:
> On 5/23/2017 4:46 PM, Boris Ostrovsky wrote:
>> On 05/23/2017 05:28 PM, Gary R Hook wrote:
>>> Signed-off-by: Gary R Hook 
>>> ---
>>>   xen/arch/x86/oprofile/nmi_int.c |4 
>>>   1 file changed, 4 insertions(+)
>>>
>>> diff --git a/xen/arch/x86/oprofile/nmi_int.c
>>> b/xen/arch/x86/oprofile/nmi_int.c
>>> index 13534d491405..5ad48c12e515 100644
>>> --- a/xen/arch/x86/oprofile/nmi_int.c
>>> +++ b/xen/arch/x86/oprofile/nmi_int.c
>>> @@ -419,6 +419,10 @@ static int __init nmi_init(void)
>>>   model = &op_athlon_spec;
>>>   cpu_type = "x86-64/family16h";
>>>   break;
>>> +case 0x17:
>>> +model = &op_amd_fam15h_spec;
>>> +cpu_type = "x86-64/family17h";
>>> +break;
>>>   }
>>>   break;
>>
>>
>> Have you actually tried this? I don't know whether oprofile still works
>> since corresponding kernel patches that I am aware of are at least 5
>> years old.
>
> Yes, I was getting a complaint during boot. That's why I did it. Works
> a treat on my family 17 system :-)
>
> I don't know whether the code is relevant (and if not, it should be
> removed, right?) but I don't like complaints, no matter how spurious.
> Thus, I minor patch.


FWIW, it looks like last meaningful patch to Linux oprofile code
(baremetal) was around 2015.

-boris

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


Re: [Xen-devel] [PATCH] xen/x86: Add Xenoprofile support for AMD Family 17h

2017-05-23 Thread Gary R Hook

On 5/23/2017 4:46 PM, Boris Ostrovsky wrote:

On 05/23/2017 05:28 PM, Gary R Hook wrote:

Signed-off-by: Gary R Hook 
---
  xen/arch/x86/oprofile/nmi_int.c |4 
  1 file changed, 4 insertions(+)

diff --git a/xen/arch/x86/oprofile/nmi_int.c b/xen/arch/x86/oprofile/nmi_int.c
index 13534d491405..5ad48c12e515 100644
--- a/xen/arch/x86/oprofile/nmi_int.c
+++ b/xen/arch/x86/oprofile/nmi_int.c
@@ -419,6 +419,10 @@ static int __init nmi_init(void)
model = &op_athlon_spec;
cpu_type = "x86-64/family16h";
break;
+   case 0x17:
+model = &op_amd_fam15h_spec;
+   cpu_type = "x86-64/family17h";
+   break;
}
break;



Have you actually tried this? I don't know whether oprofile still works
since corresponding kernel patches that I am aware of are at least 5
years old.


Yes, I was getting a complaint during boot. That's why I did it. Works a 
treat on my family 17 system :-)


I don't know whether the code is relevant (and if not, it should be
removed, right?) but I don't like complaints, no matter how spurious. 
Thus, I minor patch.


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


Re: [Xen-devel] [PATCH] xen/x86: Add Xenoprofile support for AMD Family 17h

2017-05-23 Thread Boris Ostrovsky
On 05/23/2017 05:28 PM, Gary R Hook wrote:
> Signed-off-by: Gary R Hook 
> ---
>  xen/arch/x86/oprofile/nmi_int.c |4 
>  1 file changed, 4 insertions(+)
>
> diff --git a/xen/arch/x86/oprofile/nmi_int.c b/xen/arch/x86/oprofile/nmi_int.c
> index 13534d491405..5ad48c12e515 100644
> --- a/xen/arch/x86/oprofile/nmi_int.c
> +++ b/xen/arch/x86/oprofile/nmi_int.c
> @@ -419,6 +419,10 @@ static int __init nmi_init(void)
>   model = &op_athlon_spec;
>   cpu_type = "x86-64/family16h";
>   break;
> + case 0x17:
> +model = &op_amd_fam15h_spec;
> + cpu_type = "x86-64/family17h";
> + break;
>   }
>   break;


Have you actually tried this? I don't know whether oprofile still works
since corresponding kernel patches that I am aware of are at least 5
years old.

-boris


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


Re: [Xen-devel] [For Xen-4.10 Resend PATCH 1/3] Allow control of icache invalidations when calling flush_page_to_ram()

2017-05-23 Thread Stefano Stabellini
On Mon, 15 May 2017, Punit Agrawal wrote:
> flush_page_to_ram() unconditionally drops the icache. In certain
> situations this leads to execessive icache flushes when
> flush_page_to_ram() ends up being repeatedly called in a loop.
> 
> Introduce a parameter to allow callers of flush_page_to_ram() to take
> responsibility of synchronising the icache. This is in preparations for
> adding logic to make the callers perform the necessary icache
> maintenance operations.
> 
> Signed-off-by: Punit Agrawal 

Reviewed-by: Stefano Stabellini 

> ---
>  xen/arch/arm/mm.c  | 5 +++--
>  xen/arch/arm/p2m.c | 2 +-
>  xen/common/page_alloc.c| 2 +-
>  xen/include/asm-arm/page.h | 2 +-
>  xen/include/asm-x86/flushtlb.h | 2 +-
>  5 files changed, 7 insertions(+), 6 deletions(-)
> 
> diff --git a/xen/arch/arm/mm.c b/xen/arch/arm/mm.c
> index 48f74f6e65..082c872c72 100644
> --- a/xen/arch/arm/mm.c
> +++ b/xen/arch/arm/mm.c
> @@ -420,7 +420,7 @@ unsigned long domain_page_map_to_mfn(const void *ptr)
>  }
>  #endif
>  
> -void flush_page_to_ram(unsigned long mfn)
> +void flush_page_to_ram(unsigned long mfn, bool sync_icache)
>  {
>  void *v = map_domain_page(_mfn(mfn));
>  
> @@ -435,7 +435,8 @@ void flush_page_to_ram(unsigned long mfn)
>   * I-Cache (See D4.9.2 in ARM DDI 0487A.k_iss10775). Instead of using 
> flush
>   * by VA on select platforms, we just flush the entire cache here.
>   */
> -invalidate_icache();
> +if ( sync_icache )
> +invalidate_icache();
>  }
>  
>  void __init arch_init_memory(void)
> diff --git a/xen/arch/arm/p2m.c b/xen/arch/arm/p2m.c
> index 34d57760d7..29f2e2fad3 100644
> --- a/xen/arch/arm/p2m.c
> +++ b/xen/arch/arm/p2m.c
> @@ -1392,7 +1392,7 @@ int p2m_cache_flush(struct domain *d, gfn_t start, 
> unsigned long nr)
>  /* XXX: Implement preemption */
>  while ( gfn_x(start) < gfn_x(next_gfn) )
>  {
> -flush_page_to_ram(mfn_x(mfn));
> +flush_page_to_ram(mfn_x(mfn), true);
>  
>  start = gfn_add(start, 1);
>  mfn = mfn_add(mfn, 1);
> diff --git a/xen/common/page_alloc.c b/xen/common/page_alloc.c
> index 9e41fb4cd3..eba78f1a3d 100644
> --- a/xen/common/page_alloc.c
> +++ b/xen/common/page_alloc.c
> @@ -833,7 +833,7 @@ static struct page_info *alloc_heap_pages(
>  /* Ensure cache and RAM are consistent for platforms where the
>   * guest can control its own visibility of/through the cache.
>   */
> -flush_page_to_ram(page_to_mfn(&pg[i]));
> +flush_page_to_ram(page_to_mfn(&pg[i]), true);
>  }
>  
>  spin_unlock(&heap_lock);
> diff --git a/xen/include/asm-arm/page.h b/xen/include/asm-arm/page.h
> index 4b46e8831c..497b4c86ad 100644
> --- a/xen/include/asm-arm/page.h
> +++ b/xen/include/asm-arm/page.h
> @@ -407,7 +407,7 @@ static inline void flush_xen_data_tlb_range_va(unsigned 
> long va,
>  }
>  
>  /* Flush the dcache for an entire page. */
> -void flush_page_to_ram(unsigned long mfn);
> +void flush_page_to_ram(unsigned long mfn, bool sync_icache);
>  
>  /*
>   * Print a walk of a page table or p2m
> diff --git a/xen/include/asm-x86/flushtlb.h b/xen/include/asm-x86/flushtlb.h
> index 8b7adef7c5..bd2be7e482 100644
> --- a/xen/include/asm-x86/flushtlb.h
> +++ b/xen/include/asm-x86/flushtlb.h
> @@ -118,7 +118,7 @@ void flush_area_mask(const cpumask_t *, const void *va, 
> unsigned int flags);
>  #define flush_tlb_one_all(v)\
>  flush_tlb_one_mask(&cpu_online_map, v)
>  
> -static inline void flush_page_to_ram(unsigned long mfn) {}
> +static inline void flush_page_to_ram(unsigned long mfn, bool sync_icache) {}
>  static inline int invalidate_dcache_va_range(const void *p,
>   unsigned long size)
>  { return -EOPNOTSUPP; }
> -- 
> 2.11.0
> 

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


[Xen-devel] [PATCH 2/3] raisin: check for invalid initrds

2017-05-23 Thread Stefano Stabellini
get_host_initrd can return an invalid or null initrd. Do not set the
ramdisk option in the VM config file to an invalid value.

Signed-off-by: Stefano Stabellini 
---
 tests/busybox-pv | 5 -
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/tests/busybox-pv b/tests/busybox-pv
index a7ae976..7ad4f7a 100755
--- a/tests/busybox-pv
+++ b/tests/busybox-pv
@@ -21,7 +21,6 @@ function busybox-pv-test() {
 
 cat >busybox-pv <> busybox-pv
+fi
 
 $SUDO xl create busybox-pv
 check_guest_alive
-- 
1.9.1


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


[Xen-devel] [PATCH 3/3] raisin/arm: properly ignore tests that don't work on ARM

2017-05-23 Thread Stefano Stabellini
Ignore all cirros tests on ARM for now. Print a warning for PV tests,
which could work on ARM one day (HVM tests won't work any time soon,
given that there is no HVM builder type on ARM).

Do not exit 0 when we detect ARM in a test: it causes the whole raise to
exit. Return 0 instead.

Signed-off-by: Stefano Stabellini 
---
 tests/busybox-hvm | 2 +-
 tests/busybox-hvm-migrate | 2 +-
 tests/cirros-minios-stubdom-hvm   | 5 +
 tests/cirros-minios-stubdom-pvhvm | 5 +
 tests/cirros-pvgrub2-pv   | 5 +
 tests/cirros-pygrub-pv| 6 ++
 tests/cirros-qemu-hvm | 5 +
 tests/cirros-qemu-pvhvm   | 5 +
 tests/cirros-separate-kernel-pv   | 6 ++
 9 files changed, 39 insertions(+), 2 deletions(-)

diff --git a/tests/busybox-hvm b/tests/busybox-hvm
index 51e9e19..fcffdc9 100755
--- a/tests/busybox-hvm
+++ b/tests/busybox-hvm
@@ -14,7 +14,7 @@ function busybox-hvm-test() {
 if [[ $RAISIN_ARCH != "x86_64" && $RAISIN_ARCH != "x86_32" ]]
 then
 echo $PREPEND busybox hvm test only valid on x86
-exit 0
+return 0
 fi
 
 TMPDIR=`mktemp -d`
diff --git a/tests/busybox-hvm-migrate b/tests/busybox-hvm-migrate
index 8e8213b..779f14d 100755
--- a/tests/busybox-hvm-migrate
+++ b/tests/busybox-hvm-migrate
@@ -13,7 +13,7 @@ function busybox-hvm-migrate-test() {
 if [[ $RAISIN_ARCH != "x86_64" && $RAISIN_ARCH != "x86_32" ]]
 then
 echo $PREPEND busybox hvm test only valid on x86
-exit 0
+return 0
 fi
 
 busybox-hvm-test
diff --git a/tests/cirros-minios-stubdom-hvm b/tests/cirros-minios-stubdom-hvm
index 43dc568..258b08b 100644
--- a/tests/cirros-minios-stubdom-hvm
+++ b/tests/cirros-minios-stubdom-hvm
@@ -7,6 +7,11 @@ function cirros-minios-stubdom-hvm-cleanup() {
 }
 
 function cirros-minios-stubdom-hvm-test() {
+if [[ $RAISIN_ARCH != "x86_64" && $RAISIN_ARCH != "x86_32" ]]
+then
+return 0
+fi
+
 download_cirros_components
 testdir=`mktemp -d`
 cp $CIRROS_DOWNLOADS/$CIRROS_DISK_FILE $testdir
diff --git a/tests/cirros-minios-stubdom-pvhvm 
b/tests/cirros-minios-stubdom-pvhvm
index 719b78d..fc0ac1d 100644
--- a/tests/cirros-minios-stubdom-pvhvm
+++ b/tests/cirros-minios-stubdom-pvhvm
@@ -7,6 +7,11 @@ function cirros-minios-stubdom-pvhvm-cleanup() {
 }
 
 function cirros-minios-stubdom-pvhvm-test() {
+if [[ $RAISIN_ARCH != "x86_64" && $RAISIN_ARCH != "x86_32" ]]
+then
+return 0
+fi
+
 download_cirros_components
 testdir=`mktemp -d`
 cp $CIRROS_DOWNLOADS/$CIRROS_DISK_FILE $testdir
diff --git a/tests/cirros-pvgrub2-pv b/tests/cirros-pvgrub2-pv
index 4994ea9..26dc4c1 100644
--- a/tests/cirros-pvgrub2-pv
+++ b/tests/cirros-pvgrub2-pv
@@ -7,6 +7,11 @@ function cirros-pvgrub2-pv-cleanup() {
 }
 
 function cirros-pvgrub2-pv-test() {
+if [[ $RAISIN_ARCH != "x86_64" && $RAISIN_ARCH != "x86_32" ]]
+then
+return 0
+fi
+
 download_cirros_components
 testdir=`mktemp -d`
 cp $CIRROS_DOWNLOADS/$CIRROS_DISK_FILE $testdir
diff --git a/tests/cirros-pygrub-pv b/tests/cirros-pygrub-pv
index 37e288c..e34d0be 100644
--- a/tests/cirros-pygrub-pv
+++ b/tests/cirros-pygrub-pv
@@ -7,6 +7,12 @@ function cirros-pygrub-pv-cleanup() {
 }
 
 function cirros-pygrub-pv-test() {
+if [[ $RAISIN_ARCH != "x86_64" && $RAISIN_ARCH != "x86_32" ]]
+then
+echo $PREPEND cirros tests disabled on ARM for now
+return 0
+fi
+
 download_cirros_components
 testdir=`mktemp -d`
 cp $CIRROS_DOWNLOADS/$CIRROS_DISK_FILE $testdir
diff --git a/tests/cirros-qemu-hvm b/tests/cirros-qemu-hvm
index 2e4ec2a..82fa1f1 100644
--- a/tests/cirros-qemu-hvm
+++ b/tests/cirros-qemu-hvm
@@ -7,6 +7,11 @@ function cirros-qemu-hvm-cleanup() {
 }
 
 function cirros-qemu-hvm-test() {
+if [[ $RAISIN_ARCH != "x86_64" && $RAISIN_ARCH != "x86_32" ]]
+then
+return 0
+fi
+
 download_cirros_components
 testdir=`mktemp -d`
 cp $CIRROS_DOWNLOADS/$CIRROS_DISK_FILE $testdir
diff --git a/tests/cirros-qemu-pvhvm b/tests/cirros-qemu-pvhvm
index 6cf33e0..296b924 100644
--- a/tests/cirros-qemu-pvhvm
+++ b/tests/cirros-qemu-pvhvm
@@ -7,6 +7,11 @@ function cirros-qemu-pvhvm-cleanup() {
 }
 
 function cirros-qemu-pvhvm-test() {
+if [[ $RAISIN_ARCH != "x86_64" && $RAISIN_ARCH != "x86_32" ]]
+then
+return 0
+fi
+
 download_cirros_components
 testdir=`mktemp -d`
 cp $CIRROS_DOWNLOADS/$CIRROS_DISK_FILE $testdir
diff --git a/tests/cirros-separate-kernel-pv b/tests/cirros-separate-kernel-pv
index fab5856..af950f4 100644
--- a/tests/cirros-separate-kernel-pv
+++ b/tests/cirros-separate-kernel-pv
@@ -7,6 +7,12 @@ function cirros-separate-kernel-pv-cleanup() {
 }
 
 function cirros-separate-kernel-pv-test() {
+if [[ $RAISIN_ARCH != "x86_64" && $RAISIN_ARCH != "x86_32" ]]
+then
+echo $PREPEND cirros tests disabled on ARM for now
+return 0
+fi
+
 downlo

[Xen-devel] [PATCH 1/3] raisin: introduce TEST_KERNEL and TEST_INITRD

2017-05-23 Thread Stefano Stabellini
We don't necessarely always want to guess and use the dom0 kernel and
initrd for tests. Introduce two options, TEST_KERNEL and TEST_INITRD,
that allow a user to manually specify which kernel and initrd to use.

Signed-off-by: Stefano Stabellini 
---
 defconfig   |  8 
 lib/common-functions.sh | 30 ++
 lib/common-tests.sh | 13 ++---
 3 files changed, 40 insertions(+), 11 deletions(-)

diff --git a/defconfig b/defconfig
index bdacc7e..2e2dc50 100644
--- a/defconfig
+++ b/defconfig
@@ -32,3 +32,11 @@ GIT_TRANSPORT="git"
 ## All tests: busybox-pv busybox-hvm
 ## ENABLED_TESTS is the list of test run by raise test
 ENABLED_TESTS="busybox-pv busybox-hvm cirros-separate-kernel-pv 
cirros-pygrub-pv cirros-pvgrub2-pv cirros-qemu-hvm cirros-qemu-pvhvm"
+
+# Kernel to use for tests. If not specified, raisin will try to use your
+# Dom0 kernel.
+#TEST_KERNEL=/boot/kernel
+
+# Initrd to use for tests. If not specified, raisin will try to use your
+# Dom0 initrd. If you don't need an initrd, please specify:
+#TEST_INITRD="none"
diff --git a/lib/common-functions.sh b/lib/common-functions.sh
index efc92ff..56e9bdf 100644
--- a/lib/common-functions.sh
+++ b/lib/common-functions.sh
@@ -402,6 +402,36 @@ function init_tests() {
 $SUDO brctl addbr xenbr1
 $SUDO ifconfig xenbr1 169.254.0.1 up
 fi
+
+if [[ -z "$TEST_KERNEL" ]]
+then
+TEST_KERNEL="/boot/vmlinuz-`uname -r`"
+fi
+if [[ -e "$TEST_KERNEL" ]]
+then
+export TEST_KERNEL="$TEST_KERNEL"
+else
+echo "Could not find kernel to use for tests, please specify 
TEST_KERNEL"
+exit 1
+fi
+
+if [[ -z "$TEST_INITRD" ]]
+then
+if [[ $DISTRO = "Debian" ]]
+then
+TEST_INITRD="/boot/initrd.img-`uname -r`"
+elif [[ $DISTRO = "Fedora" ]]
+then
+TEST_INITRD="/boot/initramfs-`uname -r`".img
+fi
+fi
+if [[ -e "$TEST_INITRD" || "$TEST_INITRD" = "none" ]]
+then
+export TEST_INITRD="$TEST_INITRD"
+else
+echo "Could not find initrd to use for tests, please specify 
TEST_INITRD"
+exit 1
+fi
 }
 
 function _build_package_deb() {
diff --git a/lib/common-tests.sh b/lib/common-tests.sh
index c07bb18..dfe01bd 100644
--- a/lib/common-tests.sh
+++ b/lib/common-tests.sh
@@ -163,20 +163,11 @@ function check_guest_alive() {
 }
 
 function get_host_kernel() {
-echo "/boot/vmlinuz-`uname -r`"
+echo "$TEST_KERNEL"
 }
 
 function get_host_initrd() {
-if [[ $DISTRO = "Debian" ]]
-then
-echo "/boot/initrd.img-`uname -r`"
-elif [[ $DISTRO = "Fedora" ]]
-then
-echo "/boot/initramfs-`uname -r`".img
-else
-echo "$PREPEND I don't know how to find the initrd" >&2
-exit 1
-fi
+echo "$TEST_INITRD"
 }
 
 function cirros_network_init() {
-- 
1.9.1


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


[Xen-devel] [PATCH 0/3] raisin test fixes

2017-05-23 Thread Stefano Stabellini
Hi all,

this small patch series fixes a couple of issues with ./raise test and
makes tests work on ARM (actually just busybox-pv for now, the others
are disabled).


Stefano Stabellini (3):
  raisin: introduce TEST_KERNEL and TEST_INITRD
  raisin: check for invalid initrds
  raisin/arm: properly ignore tests that don't work on ARM

 defconfig |  8 
 lib/common-functions.sh   | 30 ++
 lib/common-tests.sh   | 13 ++---
 tests/busybox-hvm |  2 +-
 tests/busybox-hvm-migrate |  2 +-
 tests/busybox-pv  |  5 -
 tests/cirros-minios-stubdom-hvm   |  5 +
 tests/cirros-minios-stubdom-pvhvm |  5 +
 tests/cirros-pvgrub2-pv   |  5 +
 tests/cirros-pygrub-pv|  6 ++
 tests/cirros-qemu-hvm |  5 +
 tests/cirros-qemu-pvhvm   |  5 +
 tests/cirros-separate-kernel-pv   |  6 ++
 13 files changed, 83 insertions(+), 14 deletions(-)

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


[Xen-devel] [PATCH] xen/x86: Add Xenoprofile support for AMD Family 17h

2017-05-23 Thread Gary R Hook
Signed-off-by: Gary R Hook 
---
 xen/arch/x86/oprofile/nmi_int.c |4 
 1 file changed, 4 insertions(+)

diff --git a/xen/arch/x86/oprofile/nmi_int.c b/xen/arch/x86/oprofile/nmi_int.c
index 13534d491405..5ad48c12e515 100644
--- a/xen/arch/x86/oprofile/nmi_int.c
+++ b/xen/arch/x86/oprofile/nmi_int.c
@@ -419,6 +419,10 @@ static int __init nmi_init(void)
model = &op_athlon_spec;
cpu_type = "x86-64/family16h";
break;
+   case 0x17:
+model = &op_amd_fam15h_spec;
+   cpu_type = "x86-64/family17h";
+   break;
}
break;
 


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


[Xen-devel] [ovmf baseline-only test] 71417: tolerable FAIL

2017-05-23 Thread Platform Team regression test user
This run is configured for baseline tests only.

flight 71417 ovmf real [real]
http://osstest.xs.citrite.net/~osstest/testlogs/logs/71417/

Failures :-/ but no regressions.

Regressions which are regarded as allowable (not blocking):
 build-amd64-libvirt   5 libvirt-buildfail   like 71414
 build-i386-libvirt5 libvirt-buildfail   like 71414

version targeted for testing:
 ovmf 1c47fcd465a496fe1d1493f97da02cb6b07364f5
baseline version:
 ovmf 3b2928b46987693caaaeefbb7b799d1e1de803c0

Last test of basis71414  2017-05-23 13:16:36 Z0 days
Testing same since71417  2017-05-23 18:16:38 Z0 days1 attempts


People who touched revisions under test:
  Laszlo Ersek 

jobs:
 build-amd64-xsm  pass
 build-i386-xsm   pass
 build-amd64  pass
 build-i386   pass
 build-amd64-libvirt  fail
 build-i386-libvirt   fail
 build-amd64-pvopspass
 build-i386-pvops pass
 test-amd64-amd64-xl-qemuu-ovmf-amd64 pass
 test-amd64-i386-xl-qemuu-ovmf-amd64  pass



sg-report-flight on osstest.xs.citrite.net
logs: /home/osstest/logs
images: /home/osstest/images

Logs, config files, etc. are available at
http://osstest.xs.citrite.net/~osstest/testlogs/logs

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


Push not applicable.


commit 1c47fcd465a496fe1d1493f97da02cb6b07364f5
Author: Laszlo Ersek 
Date:   Wed May 3 19:37:06 2017 +0200

OvmfPkg: make the 4MB flash size the default (again)

Xen gained support for the 4MB flash image in Xen commit 0d6968635ce5
("hvmloader: avoid tests when they would clobber used memory",
2017-05-19), which is part of Xen 4.9.0-rc6.

The previously default 2MB can be explicitly selected with

  -D FD_SIZE_2MB

or

  -D FD_SIZE_IN_KB=2048

Cc: Jordan Justen 
Suggested-by: Jordan Justen 
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Laszlo Ersek 
(cherry picked from commit bba8dfbec3bbc4fba7fa6398ba3cf76593e0725e)
Reviewed-by: Jordan Justen 
[ler...@redhat.com: reference Xen commit in commit message]
Signed-off-by: Laszlo Ersek 

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


Re: [Xen-devel] [TESTDAY] Test report

2017-05-23 Thread Stefano Stabellini
On Tue, 23 May 2017, Andrii Anisov wrote:
> Raisin is not functional as described [2]:
> 
> root@salvator-x-domx:/raisin# ./raise test
> No config file found, copying default config
> [raisin] I don't know distro unknown. It might be missing packages.
> [raisin] I don't know distro unknown. It might be missing packages.
> [raisin] I don't know distro unknown. Cannot install packages.
> 
> [1] http://elinux.org/R-Car/Boards/Yocto-Gen3
> [2] https://wiki.xenproject.org/wiki/Xen_ARM_Manual_Smoke_Test

Hi Andrii,

thanks for testing! I have just run `raise test` on ARM64 to double
check: it works OK as long as it can recognize the distro and find the
host kernel and initrd appropriately (for example, as I was using a
custom built xen and dom0 kernel I had to use the appended patch).

In your case the problem is that you are using yocto and basically there
is no yocto support in raisin at the moment: it cannot recognize it as a
distro, therefore it cannot figure out if bridge-utils is already
installed for example. It would be nice to have yocto support for it
though, I don't think it would be hard to come up with a patch and it
gives you a very quick way to do testing! ;-)


diff --git a/lib/common-tests.sh b/lib/common-tests.sh
index c07bb18..80b61d5 100644
--- a/lib/common-tests.sh
+++ b/lib/common-tests.sh
@@ -163,20 +163,11 @@ function check_guest_alive() {
 }
 
 function get_host_kernel() {
-echo "/boot/vmlinuz-`uname -r`"
+echo "/boot/kernel"
 }
 
 function get_host_initrd() {
-if [[ $DISTRO = "Debian" ]]
-then
-echo "/boot/initrd.img-`uname -r`"
-elif [[ $DISTRO = "Fedora" ]]
-then
-echo "/boot/initramfs-`uname -r`".img
-else
-echo "$PREPEND I don't know how to find the initrd" >&2
-exit 1
-fi
+echo ""
 }
 
 function cirros_network_init() {


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


[Xen-devel] [linux-4.9 test] 109693: regressions - FAIL

2017-05-23 Thread osstest service owner
flight 109693 linux-4.9 real [real]
http://logs.test-lab.xenproject.org/osstest/logs/109693/

Regressions :-(

Tests which did not succeed and are blocking,
including tests which could not be run:
 test-armhf-armhf-xl-credit2   6 xen-boot fail REGR. vs. 107358
 test-amd64-amd64-xl-qemuu-win7-amd64 15 guest-localmigrate/x10 fail REGR. vs. 
107358

Tests which are failing intermittently (not blocking):
 test-amd64-i386-xl-qemut-win7-amd64 15 guest-localmigrate/x10 fail in 109681 
pass in 109693
 test-amd64-amd64-libvirt-pair 20 guest-start/debianfail pass in 109681
 test-amd64-i386-xl-qemuu-win7-amd64 15 guest-localmigrate/x10 fail pass in 
109681

Regressions which are regarded as allowable (not blocking):
 test-amd64-amd64-xl-rtds  9 debian-install   fail REGR. vs. 107358
 test-amd64-i386-xl-qemuu-win7-amd64 16 guest-stop fail in 109681 REGR. vs. 
107358

Tests which did not succeed, but are not blocking:
 test-arm64-arm64-examine  6 reboot  fail baseline untested
 test-amd64-amd64-xl-qemut-win7-amd64 17 guest-start/win.repeat fail blocked in 
107358
 test-armhf-armhf-libvirt-raw  6 xen-boot fail  like 107358
 test-armhf-armhf-libvirt  6 xen-boot fail  like 107358
 test-armhf-armhf-libvirt-xsm  6 xen-boot fail  like 107358
 test-armhf-armhf-xl-rtds  6 xen-boot fail  like 107358
 test-armhf-armhf-xl-xsm   6 xen-boot fail  like 107358
 test-armhf-armhf-xl   6 xen-boot fail  like 107358
 test-armhf-armhf-xl-multivcpu  6 xen-boot fail like 107358
 test-armhf-armhf-xl-vhd   6 xen-boot fail  like 107358
 test-amd64-i386-xl-qemut-win7-amd64 16 guest-stop fail like 107358
 test-amd64-amd64-xl-qemuu-ws16-amd64  9 windows-installfail never pass
 test-amd64-i386-libvirt-xsm  12 migrate-support-checkfail   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-armhf-armhf-examine  6 reboot   fail   never pass
 test-armhf-armhf-xl-arndale   6 xen-boot fail   never pass
 test-amd64-amd64-xl-qemut-ws16-amd64  9 windows-installfail never pass
 test-arm64-arm64-xl-multivcpu 12 migrate-support-checkfail  never pass
 test-arm64-arm64-xl-multivcpu 13 saverestore-support-checkfail  never pass
 test-arm64-arm64-xl-credit2  12 migrate-support-checkfail   never pass
 test-arm64-arm64-xl-credit2  13 saverestore-support-checkfail   never pass
 test-arm64-arm64-libvirt-xsm 12 migrate-support-checkfail   never pass
 test-arm64-arm64-libvirt-xsm 13 saverestore-support-checkfail   never pass
 test-amd64-i386-libvirt-qemuu-debianhvm-amd64-xsm 10 migrate-support-check 
fail never pass
 test-arm64-arm64-xl-rtds 12 migrate-support-checkfail   never pass
 test-arm64-arm64-xl-rtds 13 saverestore-support-checkfail   never pass
 test-amd64-amd64-libvirt-qemuu-debianhvm-amd64-xsm 10 migrate-support-check 
fail never pass
 test-amd64-amd64-qemuu-nested-amd 16 debian-hvm-install/l1/l2  fail never pass
 test-amd64-amd64-libvirt-vhd 11 migrate-support-checkfail   never pass
 test-armhf-armhf-xl-cubietruck 12 migrate-support-checkfail never pass
 test-armhf-armhf-xl-cubietruck 13 saverestore-support-checkfail never pass
 test-arm64-arm64-xl-xsm  12 migrate-support-checkfail   never pass
 test-arm64-arm64-xl-xsm  13 saverestore-support-checkfail   never pass
 test-arm64-arm64-xl  12 migrate-support-checkfail   never pass
 test-arm64-arm64-xl  13 saverestore-support-checkfail   never pass
 test-arm64-arm64-libvirt 12 migrate-support-checkfail   never pass
 test-arm64-arm64-libvirt 13 saverestore-support-checkfail   never pass
 test-arm64-arm64-libvirt-qcow2 11 migrate-support-checkfail never pass
 test-arm64-arm64-libvirt-qcow2 12 saverestore-support-checkfail never pass
 test-amd64-i386-xl-qemut-win10-i386  9 windows-install fail never pass
 test-amd64-amd64-xl-qemuu-win10-i386  9 windows-installfail never pass
 test-amd64-amd64-xl-qemut-win10-i386  9 windows-installfail never pass
 test-amd64-i386-xl-qemuu-win10-i386  9 windows-install fail never pass
 test-amd64-i386-xl-qemut-ws16-amd64  9 windows-install fail never pass
 test-amd64-i386-xl-qemuu-ws16-amd64  9 windows-install fail never pass

version targeted for testing:
 linuxf5eea276d8de10a32e68721707ae8f2fdfaa0960
baseline version:
 linux37feaf8095d352014555b82adb4a04609ca17d3f

Last test of basis   107358  2017-04-10 19:42:52 Z   42 days
Failing sinc

Re: [Xen-devel] [PATCH for-next] xen/arm: Remove unused helpers access_ok and array_access_ok

2017-05-23 Thread Stefano Stabellini
On Tue, 23 May 2017, Julien Grall wrote:
> Both helpers access_ok and array_access_ok are not used on ARM. Remove
> them.
> 
> Signed-off-by: Julien Grall 

Reviewed-by: Stefano Stabellini 

> ---
>  xen/include/asm-arm/guest_access.h | 7 ---
>  1 file changed, 7 deletions(-)
> 
> diff --git a/xen/include/asm-arm/guest_access.h 
> b/xen/include/asm-arm/guest_access.h
> index 421bca5f36..251e935597 100644
> --- a/xen/include/asm-arm/guest_access.h
> +++ b/xen/include/asm-arm/guest_access.h
> @@ -4,13 +4,6 @@
>  #include 
>  #include 
>  
> -/* Guests have their own comlete address space */
> -#define access_ok(addr,size) (1)
> -
> -#define array_access_ok(addr,count,size) \
> -(likely((count) < (~0UL / (size))) && \
> - access_ok(addr, 0 + (count) * (size)))
> -
>  unsigned long raw_copy_to_guest(void *to, const void *from, unsigned len);
>  unsigned long raw_copy_to_guest_flush_dcache(void *to, const void *from,
>   unsigned len);
> -- 
> 2.11.0
> 

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


Re: [Xen-devel] [PATCH v9 20/28] ARM: GICv3: handle unmapped LPIs

2017-05-23 Thread Stefano Stabellini
On Tue, 23 May 2017, Julien Grall wrote:
> Hi Stefano,
> 
> On 23/05/17 00:48, Stefano Stabellini wrote:
> > On Fri, 19 May 2017, Stefano Stabellini wrote:
> > > On Thu, 11 May 2017, Andre Przywara wrote:
> > > > When LPIs get unmapped by a guest, they might still be in some LR of
> > > > some VCPU. Nevertheless we remove the corresponding pending_irq
> > > > (possibly freeing it), and detect this case (irq_to_pending() returns
> > > > NULL) when the LR gets cleaned up later.
> > > > However a *new* LPI may get mapped with the same number while the old
> > > > LPI is *still* in some LR. To avoid getting the wrong state, we mark
> > > > every newly mapped LPI as PRISTINE, which means: has never been in an
> > > > LR before. If we detect the LPI in an LR anyway, it must have been an
> > > > older one, which we can simply retire.
> > > > Before inserting such a PRISTINE LPI into an LR, we must make sure that
> > > > it's not already in another LR, as the architecture forbids two
> > > > interrupts with the same virtual IRQ number on one CPU.
> > > > 
> > > > Signed-off-by: Andre Przywara 
> > > > ---
> > > >  xen/arch/arm/gic.c | 55
> > > > +-
> > > >  xen/include/asm-arm/vgic.h |  6 +
> > > >  2 files changed, 56 insertions(+), 5 deletions(-)
> > > > 
> > > > diff --git a/xen/arch/arm/gic.c b/xen/arch/arm/gic.c
> > > > index fd3fa05..8bf0578 100644
> > > > --- a/xen/arch/arm/gic.c
> > > > +++ b/xen/arch/arm/gic.c
> > > > @@ -375,6 +375,8 @@ static inline void gic_set_lr(int lr, struct
> > > > pending_irq *p,
> > > >  {
> > > >  ASSERT(!local_irq_is_enabled());
> > > > 
> > > > +clear_bit(GIC_IRQ_GUEST_PRISTINE_LPI, &p->status);
> > > > +
> > > >  gic_hw_ops->update_lr(lr, p, state);
> > > > 
> > > >  set_bit(GIC_IRQ_GUEST_VISIBLE, &p->status);
> > > > @@ -442,12 +444,41 @@ void gic_raise_inflight_irq(struct vcpu *v,
> > > > unsigned int virtual_irq)
> > > >  #endif
> > > >  }
> > > > 
> > > > +/*
> > > > + * Find an unused LR to insert an IRQ into. If this new interrupt is a
> > > > + * PRISTINE LPI, scan the other LRs to avoid inserting the same IRQ
> > > > twice.
> > > > + */
> > > > +static int gic_find_unused_lr(struct vcpu *v, struct pending_irq *p,
> > > > int lr)
> > > > +{
> > > > +unsigned int nr_lrs = gic_hw_ops->info->nr_lrs;
> > > > +unsigned long *lr_mask = (unsigned long *) &this_cpu(lr_mask);
> > > > +struct gic_lr lr_val;
> > > > +
> > > > +ASSERT(spin_is_locked(&v->arch.vgic.lock));
> > > > +
> > > > +if ( test_bit(GIC_IRQ_GUEST_PRISTINE_LPI, &p->status) )
> > > 
> > > Maybe we should add an "unlikely".
> > > 
> > > I can see how this would be OKish at runtime, but at boot time there
> > > might be a bunch of PRISTINE_LPIs, but no MAPDs have been issued yet,
> > > right?
> 
> You cannot have any PRISTINE_LPIs without any MAPDs done. This bit will be set
> when you do the first MAPTI.
> 
> > > 
> > > I have a suggestion, I'll leave it to you and Julien if you want to do
> > > this now, or maybe consider it as a TODO item. I am OK either way (I
> > > don't want to delay the ITS any longer).
> > > 
> > > I am thinking we should do this scanning only after at least one MAPD
> > > has been issued for a given cpu at least once. I would resurrect the
> > > idea of a DISCARD flag, but not on the pending_irq, that I believe it's
> > > difficult to handle, but a single global DISCARD flag per struct vcpu.
> > > 
> > > On MAPD, we set DISCARD for the target vcpu of the LPI we are dropping.
> > > Next time we want to inject a PRISTINE_IRQ on that cpu interface, we
> > > scan all LRs for interrupts with a NULL pending_irq. We remove those
> > > from LRs, then we remove the DISCARD flag.
> > > 
> > > Do you think it would work?
> 
> I don't understand the point to do that. Ok, you will get the first
> PRISTINE_LPI "fast" (though likely LRs will be empty), but all the other will
> be "slow" (though likely LRs will be empty too).
> 
> The pain to implement your suggestion does not seem to be worth it so far.

Let me explain it a bit better, I think I didn't clarify it well enough.
Let me also premise, that this would be fine to do later, it doesn't
have to be part of this patch.

When I wrote MAPD above, I meant actually any commands that delete an
existing pending_irq - vLPI mapping. Specifically, DISCARD, and MAPD
when the 

if ( !valid )
/* Discard all events and remove pending LPIs. */
its_unmap_device(its, devid);

code path is taken, which should not be the case at boot time, right?
Are there any other commands that remove a pending_irq - vLPI mapping
that I missed?

The idea is that we could add a VGIC_V3_LPIS_DISCARD flag to arch_vcpu.
VGIC_V3_LPIS_DISCARD is set on a DISCARD command, and on a MAPD (!valid)
command. If VGIC_V3_LPIS_DISCARD is not set, there is no need to scan
anything. If VGIC_V3_LPIS_DISCARD is set *and* we want to inject a
PRISTINE_IRQ, then we do the scanning.

When we 

[Xen-devel] [OSSTEST PATCH] ts-examine-logs-save: Do not do readdir $! check

2017-05-23 Thread Ian Jackson
In perl 5.14 in Massachusetts, this produces this message
  /home/logs/logs/109694/test-amd64-amd64-examine Bad file descriptor at 
./ts-examine-logs-save line 100.

Sadly this means there is no way to tell failure apart from end of
directory.  This patch should be reverted when we have a fixed version
of perl.

Signed-off-by: Ian Jackson 
---
 ts-examine-logs-save | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/ts-examine-logs-save b/ts-examine-logs-save
index 014522a..b9c9941 100755
--- a/ts-examine-logs-save
+++ b/ts-examine-logs-save
@@ -97,7 +97,7 @@ sub save_logs () {
logm("saving $f");
link "$stash/$f", "$td/$f" or die "$stash $td $f $!";
 }
-die "$stash $!" if $!;
+# die "$stash $!" if $!;
 closedir D;
 }
 
-- 
2.1.4


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


[Xen-devel] [ovmf test] 109700: all pass - PUSHED

2017-05-23 Thread osstest service owner
flight 109700 ovmf real [real]
http://logs.test-lab.xenproject.org/osstest/logs/109700/

Perfect :-)
All tests in this flight passed as required
version targeted for testing:
 ovmf 1c47fcd465a496fe1d1493f97da02cb6b07364f5
baseline version:
 ovmf 3b2928b46987693caaaeefbb7b799d1e1de803c0

Last test of basis   109695  2017-05-23 07:47:03 Z0 days
Testing same since   109700  2017-05-23 16:17:26 Z0 days1 attempts


People who touched revisions under test:
  Laszlo Ersek 

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-ovmf-amd64 pass
 test-amd64-i386-xl-qemuu-ovmf-amd64  pass



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

Explanation of these reports, and of osstest in general, is at
http://xenbits.xen.org/gitweb/?p=osstest.git;a=blob;f=README.email;hb=master
http://xenbits.xen.org/gitweb/?p=osstest.git;a=blob;f=README;hb=master

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


Pushing revision :

+ branch=ovmf
+ revision=1c47fcd465a496fe1d1493f97da02cb6b07364f5
+ . ./cri-lock-repos
++ . ./cri-common
+++ . ./cri-getconfig
+++ umask 002
+++ getrepos
 getconfig Repos
 perl -e '
use Osstest;
readglobalconfig();
print $c{"Repos"} or die $!;
'
+++ local repos=/home/osstest/repos
+++ '[' -z /home/osstest/repos ']'
+++ '[' '!' -d /home/osstest/repos ']'
+++ echo /home/osstest/repos
++ repos=/home/osstest/repos
++ repos_lock=/home/osstest/repos/lock
++ '[' x '!=' x/home/osstest/repos/lock ']'
++ OSSTEST_REPOS_LOCK_LOCKED=/home/osstest/repos/lock
++ exec with-lock-ex -w /home/osstest/repos/lock ./ap-push ovmf 
1c47fcd465a496fe1d1493f97da02cb6b07364f5
+ branch=ovmf
+ revision=1c47fcd465a496fe1d1493f97da02cb6b07364f5
+ . ./cri-lock-repos
++ . ./cri-common
+++ . ./cri-getconfig
+++ umask 002
+++ getrepos
 getconfig Repos
 perl -e '
use Osstest;
readglobalconfig();
print $c{"Repos"} or die $!;
'
+++ local repos=/home/osstest/repos
+++ '[' -z /home/osstest/repos ']'
+++ '[' '!' -d /home/osstest/repos ']'
+++ echo /home/osstest/repos
++ repos=/home/osstest/repos
++ repos_lock=/home/osstest/repos/lock
++ '[' x/home/osstest/repos/lock '!=' x/home/osstest/repos/lock ']'
+ . ./cri-common
++ . ./cri-getconfig
++ umask 002
+ select_xenbranch
+ case "$branch" in
+ tree=ovmf
+ xenbranch=xen-unstable
+ '[' xovmf = xlinux ']'
+ linuxbranch=
+ '[' x = x ']'
+ qemuubranch=qemu-upstream-unstable
+ select_prevxenbranch
++ ./cri-getprevxenbranch xen-unstable
+ prevxenbranch=xen-4.8-testing
+ '[' x1c47fcd465a496fe1d1493f97da02cb6b07364f5 = x ']'
+ : tested/2.6.39.x
+ . ./ap-common
++ : osst...@xenbits.xen.org
+++ getconfig OsstestUpstream
+++ perl -e '
use Osstest;
readglobalconfig();
print $c{"OsstestUpstream"} or die $!;
'
++ :
++ : git://xenbits.xen.org/xen.git
++ : osst...@xenbits.xen.org:/home/xen/git/xen.git
++ : git://xenbits.xen.org/qemu-xen-traditional.git
++ : git://git.kernel.org
++ : git://git.kernel.org/pub/scm/linux/kernel/git
++ : git
++ : git://xenbits.xen.org/xtf.git
++ : osst...@xenbits.xen.org:/home/xen/git/xtf.git
++ : git://xenbits.xen.org/xtf.git
++ : git://xenbits.xen.org/libvirt.git
++ : osst...@xenbits.xen.org:/home/xen/git/libvirt.git
++ : git://xenbits.xen.org/libvirt.git
++ : git://xenbits.xen.org/osstest/rumprun.git
++ : git
++ : git://xenbits.xen.org/osstest/rumprun.git
++ : osst...@xenbits.xen.org:/home/xen/git/osstest/rumprun.git
++ : git://git.seabios.org/seabios.git
++ : osst...@xenbits.xen.org:/home/xen/git/osstest/seabios.git
++ : git://xenbits.xen.org/osstest/seabios.git
++ : https://github.com/tianocore/edk2.git
++ : osst...@xenbits.xen.org:/home/xen/git/osstest/ovmf.git
++ : git://xenbits.xen.org/osstest/ovmf.git
++ : git://xenbits.xen.org/osstest/linux-firmware.git
++ : osst...@xenbits.xen.org:/home/osstest/ext/linux-firmware.git
++ : git://git.kernel.org/pub/scm/linux/kernel/git/firmware/linux-firmware.git
++ : osst...@xenbits.xen.org:/home/xen/git/linux-pvops

Re: [Xen-devel] [PATCH 5/7] osstest: introduce a FreeBSD build script

2017-05-23 Thread Ian Jackson
Roger Pau Monne writes ("[PATCH 5/7] osstest: introduce a FreeBSD build 
script"):
> -my $path= "path_${part}dist";
> -logm("checking $k $path");
> -get_stashed($path, $r{$k});
> +if ("$part" eq "freebsd") {
> +foreach (qw(base kernel manifest image)) {
> +my $path= "path_${part}-$_";
> +logm("checking $k $path");
> +get_stashed($path, $r{$k});
> +}
> +} else {
> +my $path= "path_${part}dist";
> +logm("checking $k $path");
> +get_stashed($path, $r{$k});

This is quite ugly.  I don't think this knowledge should be in
ts-build-check.

...

I think in fact that the right answer is probably to have
ts-build-check be more general somehow.

I have looked through the history of ts-{,xen-}build-check and I think
the current approach is a historical accident.  In the beginning it
was a wrapper around ts-xen-install which used a special check flag;
then that gradually generalised to what we have now - but it still
retains the same origins.

I was going to suggest checking the job status, but might be an
inconvenience during by-hand testing.

I considered having sg-run-job specify the parts it's going to use, as
command line arguments, with plumbing in sg-run-job from the recipe,
but that's still going to have to be buildjob-runvar-specific.

I considered controlling this via runvars from make-flight:
   freebsdbuildjob=391031.build-amd64-freebsd
   freebsdbuildjobpaths=-base,-kernel,-manifest,-image
But it's also quite ugly.

I have a radical suggestion:

Suppose we have ts-freebsd-build set
path_freebsddist=$stash/build/freebsd/
and have it put the files in there with fixed, known, names
path_freebsddist=$stash/build/freebsd/image
path_freebsddist=$stash/build/freebsd/manifest
path_freebsddist=$stash/build/freebsd/kernel.sets
path_freebsddist=$stash/build/freebsd/base.sets
or something ?

Is there a reason why that wouldn't work ?

The stashing process would have to take care to set the runvar only
after it had created all the files.

> +target_cmd_build($ho, 7200, $builddir, < +cd freebsd
> +export MAKEOBJDIRPREFIX=$builddir/obj
> +(make $makeflags TARGET=$r{arch} buildworld 2>&1 && touch ../build-ok-stamp) 
> \\
> +|tee ../log

How about using Osstest::BuildSupport::buildcmd_stamped_logged ?

> +logm("Creating the install sets");
> +# NB: the steps below need to be done as root or the permissions
> +# of the files won't be properly set (and the target will fail).
> +target_cmd_root($ho, < +# Enable DHCP on all network interfaces
> +echo 'ifconfig_DEFAULT="DHCP"' >> \$target/etc/rc.conf

Is this wise ?  We may at some point have hosts which have two network
interfaces connected (perhaps to the test network, or to each other,
or something) in which case this is probably wrong.

There are a lot of \.  I wonder if you might find
<<'ENDQ'.

Re: [Xen-devel] [PATCH v9 12/28] ARM: vGIC: advertise LPI support

2017-05-23 Thread Stefano Stabellini
On Tue, 23 May 2017, Julien Grall wrote:
> Hi Stefano,
> 
> On 22/05/17 23:19, Stefano Stabellini wrote:
> > On Tue, 16 May 2017, Julien Grall wrote:
> > > > @@ -436,8 +473,26 @@ static int __vgic_v3_rdistr_rd_mmio_write(struct
> > > > vcpu
> > > > *v, mmio_info_t *info,
> > > >  switch ( gicr_reg )
> > > >  {
> > > >  case VREG32(GICR_CTLR):
> > > > -/* LPI's not implemented */
> > > > -goto write_ignore_32;
> > > > +{
> > > > +unsigned long flags;
> > > > +
> > > > +if ( !v->domain->arch.vgic.has_its )
> > > > +goto write_ignore_32;
> > > > +if ( dabt.size != DABT_WORD ) goto bad_width;
> > > > +
> > > > +vgic_lock(v);   /* protects rdists_enabled */
> > > 
> > > Getting back to the locking. I don't see any place where we get the domain
> > > vgic lock before vCPU vgic lock. So this raises the question why this
> > > ordering
> > > and not moving this lock into vgic_vcpu_enable_lpis.
> > > 
> > > At least this require documentation in the code and explanation in the
> > > commit
> > > message.
> > 
> > It doesn't look like we need to take the v->arch.vgic.lock here. What is
> > it protecting?
> 
> The name of the function is a bit confusion. It does not take the vCPU vgic
> lock but the domain vgic lock.
> 
> I believe the vcpu is passed to avoid have v->domain in most of the callers.
> But we should probably rename the function.
> 
> In this case it protects vgic_vcpu_enable_lpis because you can configure the
> number of LPIs per re-distributor but this is a domain wide value. I know the
> spec is confusing on this.

The quoting here is very unhelpful. In Andre's patch:

@@ -436,8 +473,26 @@ static int __vgic_v3_rdistr_rd_mmio_write(struct vcpu *v, 
mmio_info_t *info,
 switch ( gicr_reg )
 {
 case VREG32(GICR_CTLR):
-/* LPI's not implemented */
-goto write_ignore_32;
+{
+unsigned long flags;
+
+if ( !v->domain->arch.vgic.has_its )
+goto write_ignore_32;
+if ( dabt.size != DABT_WORD ) goto bad_width;
+
+vgic_lock(v);   /* protects rdists_enabled */
+spin_lock_irqsave(&v->arch.vgic.lock, flags);
+
+/* LPIs can only be enabled once, but never disabled again. */
+if ( (r & GICR_CTLR_ENABLE_LPIS) &&
+ !(v->arch.vgic.flags & VGIC_V3_LPIS_ENABLED) )
+vgic_vcpu_enable_lpis(v);
+
+spin_unlock_irqrestore(&v->arch.vgic.lock, flags);
+vgic_unlock(v);
+
+return 1;
+}

My question is: do we need to take both vgic_lock and v->arch.vgic.lock?
If so, why?

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


Re: [Xen-devel] [PATCH v9 21/28] ARM: vITS: handle MAPTI command

2017-05-23 Thread Stefano Stabellini
On Tue, 23 May 2017, Andre Przywara wrote:
> Hi,
> 
> On 23/05/17 00:39, Stefano Stabellini wrote:
> > On Thu, 11 May 2017, Andre Przywara wrote:
> >> @@ -556,6 +583,93 @@ static int its_handle_mapd(struct virt_its *its, 
> >> uint64_t *cmdptr)
> >>  return ret;
> >>  }
> >>  
> >> +static int its_handle_mapti(struct virt_its *its, uint64_t *cmdptr)
> >> +{
> >> +uint32_t devid = its_cmd_get_deviceid(cmdptr);
> >> +uint32_t eventid = its_cmd_get_id(cmdptr);
> >> +uint32_t intid = its_cmd_get_physical_id(cmdptr), _intid;
> >> +uint16_t collid = its_cmd_get_collection(cmdptr);
> >> +struct pending_irq *pirq;
> >> +struct vcpu *vcpu = NULL;
> >> +int ret = -1;
> > 
> > I think we need to check the eventid to be valid, don't we?
> 
> Yes, but this will be done below as part of write_itte_locked(), in fact
> already read_itte_locked().
> Shall I add a comment about this?

No need, thanks

> 
> >> +if ( its_cmd_get_command(cmdptr) == GITS_CMD_MAPI )
> >> +intid = eventid;
> >> +
> >> +spin_lock(&its->its_lock);
> >> +/*
> >> + * Check whether there is a valid existing mapping. If yes, behavior 
> >> is
> >> + * unpredictable, we choose to ignore this command here.
> >> + * This makes sure we start with a pristine pending_irq below.
> >> + */
> >> +if ( read_itte_locked(its, devid, eventid, &vcpu, &_intid) &&
> >> + _intid != INVALID_LPI )
> >> +{
> >> +spin_unlock(&its->its_lock);
> >> +return -1;
> >> +}
> >> +
> >> +/* Enter the mapping in our virtual ITS tables. */
> >> +if ( !write_itte_locked(its, devid, eventid, collid, intid, &vcpu) )
> >> +{
> >> +spin_unlock(&its->its_lock);
> >> +return -1;
> >> +}
> >> +
> >> +spin_unlock(&its->its_lock);
> >> +
> >> +/*
> >> + * Connect this virtual LPI to the corresponding host LPI, which is
> >> + * determined by the same device ID and event ID on the host side.
> >> + * This returns us the corresponding, still unused pending_irq.
> >> + */
> >> +pirq = gicv3_assign_guest_event(its->d, its->doorbell_address,
> >> +devid, eventid, vcpu, intid);
> >> +if ( !pirq )
> >> +goto out_remove_mapping;
> >> +
> >> +vgic_init_pending_irq(pirq, intid);
> >> +
> >> +/*
> >> + * Now read the guest's property table to initialize our cached state.
> >> + * It can't fire at this time, because it is not known to the host 
> >> yet.
> >> + * We don't need the VGIC VCPU lock here, because the pending_irq 
> >> isn't
> >> + * in the radix tree yet.
> >> + */
> >> +ret = update_lpi_property(its->d, pirq);
> >> +if ( ret )
> >> +goto out_remove_host_entry;
> >> +
> >> +pirq->lpi_vcpu_id = vcpu->vcpu_id;
> >> +/*
> >> + * Mark this LPI as new, so any older (now unmapped) LPI in any LR
> >> + * can be easily recognised as such.
> >> + */
> >> +set_bit(GIC_IRQ_GUEST_PRISTINE_LPI, &pirq->status);
> >> +
> >> +/*
> >> + * Now insert the pending_irq into the domain's LPI tree, so that
> >> + * it becomes live.
> >> + */
> >> +write_lock(&its->d->arch.vgic.pend_lpi_tree_lock);
> >> +ret = radix_tree_insert(&its->d->arch.vgic.pend_lpi_tree, intid, 
> >> pirq);
> >> +write_unlock(&its->d->arch.vgic.pend_lpi_tree_lock);
> >> +
> >> +if ( !ret )
> >> +return 0;
> >> +
> >> +out_remove_host_entry:
> >> +gicv3_remove_guest_event(its->d, its->doorbell_address, devid, 
> >> eventid);
> >> +
> >> +out_remove_mapping:
> >> +spin_lock(&its->its_lock);
> >> +write_itte_locked(its, devid, eventid,
> >> +  UNMAPPED_COLLECTION, INVALID_LPI, NULL);
> >> +spin_unlock(&its->its_lock);
> >> +
> >> +return ret;
> >> +}
> 

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


Re: [Xen-devel] [PATCH v9 13/28] ARM: vITS: add command handling stub and MMIO emulation

2017-05-23 Thread Stefano Stabellini
On Tue, 23 May 2017, Julien Grall wrote:
> Hi Stefano,
> 
> On 22/05/17 23:32, Stefano Stabellini wrote:
> > On Thu, 11 May 2017, Andre Przywara wrote:
> > > +case VREG64(GITS_CWRITER):
> > > +if ( !vgic_reg64_check_access(info->dabt) ) goto bad_width;
> > > +
> > > +reg = its->cwriter;
> > > +*r = vgic_reg64_extract(reg, info);
> > 
> > Why is this not protected by a lock? Also from the comment above I
> > cannot tell if it should be protected by its_lock or by vcmd_lock.
> 
> Because if you take the vcmd_lock, the vCPU will spin until we finish to
> handle the command queue. This means a guest can potentially block multiple
> pCPUs for a long time.
> 
> In this case, cwriter can be read atomically as it was updated by the guest
> itself ...
> > 
> > 
> > > +break;
> > > +case VREG64(GITS_CREADR):
> > > +if ( !vgic_reg64_check_access(info->dabt) ) goto bad_width;
> > > +
> > > +reg = its->creadr;
> > > +*r = vgic_reg64_extract(reg, info);
> > > +break;
> > 
> > Same here
> 
> For here, the command queue handler will write to creader atomically every a
> command is been executed. Making this lockless also allow a domain keep track
> where we are on the command queue handling.
> 
> This is something we already discussed quite a few times. So we should
> probably have a comment in the code to avoid this question to come up again.

All right, thanks


> [...]
> 
> > > +case VREG64(GITS_CWRITER):
> > > +if ( !vgic_reg64_check_access(info->dabt) ) goto bad_width;
> > > +
> > > +spin_lock(&its->vcmd_lock);
> > > +reg = ITS_CMD_OFFSET(its->cwriter);
> > > +vgic_reg64_update(®, r, info);
> > > +its->cwriter = ITS_CMD_OFFSET(reg);
> > > +
> > > +if ( its->enabled )
> > > +if ( vgic_its_handle_cmds(d, its) )
> > > +gdprintk(XENLOG_WARNING, "error handling ITS
> > > commands\n");
> > > +
> > > +spin_unlock(&its->vcmd_lock);
> > 
> > OK, so it looks like the reads should be protected by vcmd_lock
> 
> See my comment above.
> 
> > 
> > 
> > > +return 1;
> > > +
> > > +case VREG64(GITS_CREADR):
> 
> -- 
> Julien Grall
> 

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


Re: [Xen-devel] Proposal to allow setting up shared memory areas between VMs from xl config file

2017-05-23 Thread Stefano Stabellini
On Wed, 24 May 2017, Zhongze Liu wrote:
> Hi there,
> 
> Thanks for your comments. They are all very insightful.
> 
> Having read through the discussions so far, I can draw the
> following conclusions:
> 
> 0. The syntax and semantics of the new config option should be more clearlly
> defined. And this actually depends on the following:
> 
> 1. If we're going to make this project arch-neutral, then the manifestation
> of the frame numbers should also be arch-neutral;
> 
> 2. Attributes such as readability, writability (and maybe even
> cacheability and shareability) should be able to be specified in the
> config files
> 
> 3. We should allow users to specify the mfn of the shared pages as well. (but
> I think maybe we could just specify a memory zone (if we're dealing
> with NUMA) instead of a specific physical address).
> 
> 4. (maybe in the future) Set up a notification channel between domains
> who are communicating through shared memory regions. The
>channel could be built upon PPI or SGI.
> 
> 5. Clearify the ownership of shared pages, and thus the creation order.
> I thinks I've already clearify this in my proposal -- we just
> treat the first domain
> created with the shared memory range as the owner.
> But specifying  this in the config file also makes sense. Then we'll have 
> to
> enforced that the owner is created prior to all the "clients".

Right, I think we have to be explicit about this to avoid scenarios
where it is not known deterministically which domain is created first.
Imagine if the user gets the idea of doing:

  xl create dom1 &
  xl create dom2 &


> After talking to stefano, I'll try to first come out with a tiny but
> working prototype
> and do some evaluations on it. I'll not fully deny the possibility of using
> the grants api as the final implementation choice.
> 
> This list might be incomplete. Please tell me if I missed or misunderstand any
> important information.

Thanks Zhongze!

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


Re: [Xen-devel] Proposal to allow setting up shared memory areas between VMs from xl config file

2017-05-23 Thread Zhongze Liu
Hi there,

Thanks for your comments. They are all very insightful.

Having read through the discussions so far, I can draw the
following conclusions:

0. The syntax and semantics of the new config option should be more clearlly
defined. And this actually depends on the following:

1. If we're going to make this project arch-neutral, then the manifestation
of the frame numbers should also be arch-neutral;

2. Attributes such as readability, writability (and maybe even
cacheability and shareability) should be able to be specified in the
config files

3. We should allow users to specify the mfn of the shared pages as well. (but
I think maybe we could just specify a memory zone (if we're dealing
with NUMA) instead of a specific physical address).

4. (maybe in the future) Set up a notification channel between domains
who are communicating through shared memory regions. The
   channel could be built upon PPI or SGI.

5. Clearify the ownership of shared pages, and thus the creation order.
I thinks I've already clearify this in my proposal -- we just
treat the first domain
created with the shared memory range as the owner.
But specifying  this in the config file also makes sense. Then we'll have to
enforced that the owner is created prior to all the "clients".

After talking to stefano, I'll try to first come out with a tiny but
working prototype
and do some evaluations on it. I'll not fully deny the possibility of using
the grants api as the final implementation choice.

This list might be incomplete. Please tell me if I missed or misunderstand any
important information.


Cheers,


Zhongze Liu

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


Re: [Xen-devel] [PATCH v9 18/28] ARM: vITS: handle CLEAR command

2017-05-23 Thread Andre Przywara
Hi,

On 17/05/17 18:45, Julien Grall wrote:
> Hi Andre,
> 
> On 11/05/17 18:53, Andre Przywara wrote:
>> This introduces the ITS command handler for the CLEAR command, which
>> clears the pending state of an LPI.
>> This removes a not-yet injected, but already queued IRQ from a VCPU.
>> As read_itte() is now eventually used, we add the static keyword.
>>
>> Signed-off-by: Andre Przywara 
>> ---
>>  xen/arch/arm/vgic-v3-its.c | 59
>> --
>>  1 file changed, 57 insertions(+), 2 deletions(-)
>>
>> diff --git a/xen/arch/arm/vgic-v3-its.c b/xen/arch/arm/vgic-v3-its.c
>> index 8f1c217..8a200e9 100644
>> --- a/xen/arch/arm/vgic-v3-its.c
>> +++ b/xen/arch/arm/vgic-v3-its.c
>> @@ -52,6 +52,7 @@
>>   */
>>  struct virt_its {
>>  struct domain *d;
>> +paddr_t doorbell_address;
>>  unsigned int devid_bits;
>>  unsigned int evid_bits;
>>  spinlock_t vcmd_lock;   /* Protects the virtual command
>> buffer, which */
>> @@ -251,8 +252,8 @@ static bool read_itte_locked(struct virt_its *its,
>> uint32_t devid,
>>   * This function takes care of the locking by taking the its_lock
>> itself, so
>>   * a caller shall not hold this. Before returning, the lock is
>> dropped again.
>>   */
>> -bool read_itte(struct virt_its *its, uint32_t devid, uint32_t evid,
>> -   struct vcpu **vcpu_ptr, uint32_t *vlpi_ptr)
>> +static bool read_itte(struct virt_its *its, uint32_t devid, uint32_t
>> evid,
>> +  struct vcpu **vcpu_ptr, uint32_t *vlpi_ptr)
>>  {
>>  bool ret;
>>
>> @@ -362,6 +363,57 @@ static int its_handle_mapc(struct virt_its *its,
>> uint64_t *cmdptr)
>>  return 0;
>>  }
>>
>> +/*
>> + * CLEAR removes the pending state from an LPI. */
>> +static int its_handle_clear(struct virt_its *its, uint64_t *cmdptr)
>> +{
>> +uint32_t devid = its_cmd_get_deviceid(cmdptr);
>> +uint32_t eventid = its_cmd_get_id(cmdptr);
>> +struct pending_irq *p;
>> +struct vcpu *vcpu;
>> +uint32_t vlpi;
>> +unsigned long flags;
>> +int ret = -1;
>> +
>> +spin_lock(&its->its_lock);
>> +
>> +/* Translate the DevID/EvID pair into a vCPU/vLPI pair. */
>> +if ( !read_itte_locked(its, devid, eventid, &vcpu, &vlpi) )
>> +goto out_unlock;
>> +
>> +p = gicv3_its_get_event_pending_irq(its->d, its->doorbell_address,
>> +devid, eventid);
>> +/* Protect against an invalid LPI number. */
>> +if ( unlikely(!p) )
>> +goto out_unlock;
>> +
>> +spin_lock_irqsave(&vcpu->arch.vgic.lock, flags);
> 
> My comment in patch #9 about crafting the memory handed over to the ITS
> applies here too.
> 
>> +
>> +/*
>> + * If the LPI is already visible on the guest, it is too late to
>> + * clear the pending state. However this is a benign race that can
>> + * happen on real hardware, too: If the LPI has already been
>> forwarded
>> + * to a CPU interface, a CLEAR request reaching the redistributor
>> has
>> + * no effect on that LPI anymore. Since LPIs are edge triggered and
>> + * have no active state, we don't need to care about this here.
>> + */
>> +if ( !test_bit(GIC_IRQ_GUEST_VISIBLE, &p->status) )
>> +{
>> +/* Remove a pending, but not yet injected guest IRQ. */
>> +clear_bit(GIC_IRQ_GUEST_QUEUED, &p->status);
>> +list_del_init(&p->inflight);
>> +list_del_init(&p->lr_queue);
> 
> On the previous version I was against this open-coding of
> gic_remove_from_queues and instead rework the function.

Well, I consider gic_remove_from_queues() somewhat broken:
- It should be called vgic_remove... and live in vgic.c, because it
deals with the virtual side only.
- The plural in the name is wrong, since it only removes the IRQ from
lr_pending, not inflight.
- vgic_migrate_irq removes an IRQ from both queues as well, and doesn't
use the function (for the same reason).

So to make it usable in our case, I'd need to either open code the
inflight removal here (which would make calling this function a bit
pointless) or add that to the function, but remove the existing caller.
Looks like a can of worms to me and a distraction from the actual goal
of getting the ITS in place.
So I will surely address this with the VGIC rework (possibly removing
this function altogether), but would like to avoid doing this rework
*now*. To catch all users of the list I would need to grep for inflight
and lr_pending anyway, so one more "open-coded" place is not a big deal.

> It still does not make any sense to me because if one day someone
> decides to update gic_remove_from_queues (such as you because you are
> going to rework the vGIC), he will have to remember that you open-coded
> in MOVE because you didn't want to touch the common code.

As I mentioned above this is the same situation for vgic_migrate_irq()
already.

> Common code is not set in stone. The goal is to abstract all the issues
> to make easier to propagate chang

Re: [Xen-devel] [PATCH v9 12/28] ARM: vGIC: advertise LPI support

2017-05-23 Thread Andre Przywara
Hi,

On 16/05/17 14:03, Julien Grall wrote:
> Hi Andre,
> 
> On 11/05/17 18:53, Andre Przywara wrote:
>> To let a guest know about the availability of virtual LPIs, set the
>> respective bits in the virtual GIC registers and let a guest control
>> the LPI enable bit.
>> Only report the LPI capability if the host has initialized at least
>> one ITS.
>> This removes a "TBD" comment, as we now populate the processor number
>> in the GICR_TYPE register.
> 
> s/GICR_TYPE/GICR_TYPER/
> 
> Also, I think it would be worth explaining that you populate
> GICR_TYPER.Process_Number because the ITS will use it later on.
> 
>> Advertise 24 bits worth of LPIs to the guest.
> 
> Again this is not valid anymore. You said you would drop it on the
> previous version. So why it has not been done?
> 
>>
>> Signed-off-by: Andre Przywara 
>> ---
>>  xen/arch/arm/vgic-v3.c | 70
>> ++
>>  1 file changed, 65 insertions(+), 5 deletions(-)
>>
>> diff --git a/xen/arch/arm/vgic-v3.c b/xen/arch/arm/vgic-v3.c
>> index 38c123c..6dbdb2e 100644
>> --- a/xen/arch/arm/vgic-v3.c
>> +++ b/xen/arch/arm/vgic-v3.c
>> @@ -170,8 +170,19 @@ static int __vgic_v3_rdistr_rd_mmio_read(struct
>> vcpu *v, mmio_info_t *info,
>>  switch ( gicr_reg )
>>  {
>>  case VREG32(GICR_CTLR):
>> -/* We have not implemented LPI's, read zero */
>> -goto read_as_zero_32;
>> +{
>> +unsigned long flags;
>> +
>> +if ( !v->domain->arch.vgic.has_its )
>> +goto read_as_zero_32;
>> +if ( dabt.size != DABT_WORD ) goto bad_width;
>> +
>> +spin_lock_irqsave(&v->arch.vgic.lock, flags);
>> +*r = vgic_reg32_extract(!!(v->arch.vgic.flags &
>> VGIC_V3_LPIS_ENABLED),
>> +info);
>> +spin_unlock_irqrestore(&v->arch.vgic.lock, flags);
>> +return 1;
>> +}
>>
>>  case VREG32(GICR_IIDR):
>>  if ( dabt.size != DABT_WORD ) goto bad_width;
>> @@ -183,16 +194,20 @@ static int __vgic_v3_rdistr_rd_mmio_read(struct
>> vcpu *v, mmio_info_t *info,
>>  uint64_t typer, aff;
>>
>>  if ( !vgic_reg64_check_access(dabt) ) goto bad_width;
>> -/* TBD: Update processor id in [23:8] when ITS support is
>> added */
>>  aff = (MPIDR_AFFINITY_LEVEL(v->arch.vmpidr, 3) << 56 |
>> MPIDR_AFFINITY_LEVEL(v->arch.vmpidr, 2) << 48 |
>> MPIDR_AFFINITY_LEVEL(v->arch.vmpidr, 1) << 40 |
>> MPIDR_AFFINITY_LEVEL(v->arch.vmpidr, 0) << 32);
>>  typer = aff;
>> +/* We use the VCPU ID as the redistributor ID in bits[23:8] */
>> +typer |= (v->vcpu_id & 0x) << 8;
> 
> Why the mask here? This sound like a bug to me if vcpu_id does not fit
> it and you would make it worst by the mask.
> 
> But this is already addressed by max_vcpus in the vgic_ops. So please
> drop the pointless mask.
> 
> Lastly, I would have expected to try to address my remark everywhere
> regarding hardcoding offset. In this case,

Fixed.

>>
>>  if ( v->arch.vgic.flags & VGIC_V3_RDIST_LAST )
>>  typer |= GICR_TYPER_LAST;
>>
>> +if ( v->domain->arch.vgic.has_its )
>> +typer |= GICR_TYPER_PLPIS;
>> +
>>  *r = vgic_reg64_extract(typer, info);
>>
>>  return 1;
>> @@ -426,6 +441,28 @@ static uint64_t sanitize_pendbaser(uint64_t reg)
>>  return reg;
>>  }
>>
>> +static void vgic_vcpu_enable_lpis(struct vcpu *v)
>> +{
>> +uint64_t reg = v->domain->arch.vgic.rdist_propbase;
>> +unsigned int nr_lpis = BIT((reg & 0x1f) + 1);
>> +
>> +/* rdists_enabled is protected by the domain lock. */
>> +ASSERT(spin_is_locked(&v->domain->arch.vgic.lock));
>> +
>> +if ( nr_lpis < LPI_OFFSET )
>> +nr_lpis = 0;
>> +else
>> +nr_lpis -= LPI_OFFSET;
>> +
>> +if ( !v->domain->arch.vgic.rdists_enabled )
>> +{
>> +v->domain->arch.vgic.nr_lpis = nr_lpis;
>> +v->domain->arch.vgic.rdists_enabled = true;
>> +}
>> +
>> +v->arch.vgic.flags |= VGIC_V3_LPIS_ENABLED;
>> +}
>> +
>>  static int __vgic_v3_rdistr_rd_mmio_write(struct vcpu *v, mmio_info_t
>> *info,
>>uint32_t gicr_reg,
>>register_t r)
>> @@ -436,8 +473,26 @@ static int __vgic_v3_rdistr_rd_mmio_write(struct
>> vcpu *v, mmio_info_t *info,
>>  switch ( gicr_reg )
>>  {
>>  case VREG32(GICR_CTLR):
>> -/* LPI's not implemented */
>> -goto write_ignore_32;
>> +{
>> +unsigned long flags;
>> +
>> +if ( !v->domain->arch.vgic.has_its )
>> +goto write_ignore_32;
>> +if ( dabt.size != DABT_WORD ) goto bad_width;
>> +
>> +vgic_lock(v);   /* protects rdists_enabled */
> 
> Getting back to the locking. I don't see any place where we get the
> domain vgic lock before vCPU vgic lock.

Because that seems to be the natural locking order, given that one
domai

Re: [Xen-devel] [PATCH v9 16/28] ARM: vITS: handle INT command

2017-05-23 Thread Andre Przywara
Hi,

On 17/05/17 17:17, Julien Grall wrote:
> Hi Andre,
> 
> On 11/05/17 18:53, Andre Przywara wrote:
>> The INT command sets a given LPI identified by a DeviceID/EventID pair
>> as pending and thus triggers it to be injected.
>>
>> Signed-off-by: Andre Przywara 
>> ---
>>  xen/arch/arm/vgic-v3-its.c | 21 +
>>  1 file changed, 21 insertions(+)
>>
>> diff --git a/xen/arch/arm/vgic-v3-its.c b/xen/arch/arm/vgic-v3-its.c
>> index 12ec5f1..f9379c9 100644
>> --- a/xen/arch/arm/vgic-v3-its.c
>> +++ b/xen/arch/arm/vgic-v3-its.c
>> @@ -300,6 +300,24 @@ static uint64_t its_cmd_mask_field(uint64_t
>> *its_cmd, unsigned int word,
>>  #define its_cmd_get_validbit(cmd)   its_cmd_mask_field(cmd, 2,
>> 63,  1)
>>  #define its_cmd_get_ittaddr(cmd)(its_cmd_mask_field(cmd, 2,
>> 8, 44) << 8)
>>
>> +static int its_handle_int(struct virt_its *its, uint64_t *cmdptr)
>> +{
>> +uint32_t devid = its_cmd_get_deviceid(cmdptr);
>> +uint32_t eventid = its_cmd_get_id(cmdptr);
>> +struct vcpu *vcpu;
>> +uint32_t vlpi;
>> +
>> +if ( !read_itte(its, devid, eventid, &vcpu, &vlpi) )
>> +return -1;
> 
> See my comment on patch #13 about crafting the memory.

So read_itte goes through some checks already (valid VCPU IDs, valid
device table pointer, valid event ID, ...). I believe we can't do much
more than this. I added a fat TODO and an ASSERT(is_dom0) in
vgic_v3_verify_its_status() to not forget about this problem.
Ideally it shouldn't matter what the guest writes into the table,
hopefully the per-IRQ locking ensures this.

Cheers,
Andre.

> 
>> +
>> +if ( vlpi == INVALID_LPI )
>> +return -1;
>> +
>> +vgic_vcpu_inject_irq(vcpu, vlpi);
>> +
>> +return 0;
>> +}
>> +
>>  #define ITS_CMD_BUFFER_SIZE(baser)  baser) & 0xff) + 1) << 12)
>>  #define ITS_CMD_OFFSET(reg) ((reg) & GENMASK(19, 5))
>>
>> @@ -329,6 +347,9 @@ static int vgic_its_handle_cmds(struct domain *d,
>> struct virt_its *its)
>>
>>  switch ( its_cmd_get_command(command) )
>>  {
>> +case GITS_CMD_INT:
>> +ret = its_handle_int(its, command);
>> +break;
>>  case GITS_CMD_SYNC:
>>  /* We handle ITS commands synchronously, so we ignore
>> SYNC. */
>>  break;
>>
> 
> Cheers,
> 

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


Re: [Xen-devel] [PATCH 4/7] osstest: add a FreeBSD host install recipe

2017-05-23 Thread Ian Jackson
Roger Pau Monne writes ("[PATCH 4/7] osstest: add a FreeBSD host install 
recipe"):
> The installation is performed using the bsdinstall tool, which is
> part of the FreeBSD base system. The installer image is setup with
> the osstest ssh keys and sshd enabled by default, which allows the
> test harness to just ssh into the box, create the install config
> file and launch the scripted install.
...
> +our $image = $r{"freebsd_image"} ||
> + get_stashed("path_freebsd-image", $r{"freebsd_buildjob"});

I've had a thought about this.

Maybe it would be worth mentioning near the top of the script the
runvars it consumes (and any it sets) ?

I realise I haven't documented the runvars very much so far but maybe
we should start.  What do you think ?

Ian.

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


Re: [Xen-devel] [OSSTEST PATCH 08/24] cs-hosts-list: Support --suites

2017-05-23 Thread Ian Jackson
Roger Pau Monné writes ("Re: [Xen-devel] [OSSTEST PATCH 08/24] cs-hosts-list: 
Support --suites"):
> I should add a --freebsd=... option.

Yes.  Although currently my host examination uses only Linux and Xen.

Do you think there's any value in doing it with FreeBSD as well ?

Ian.

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


Re: [Xen-devel] [RFC PATCH V2 1/2] xen-pt: bind/unbind interrupt remapping format MSI

2017-05-23 Thread Anthony PERARD
On Tue, May 23, 2017 at 08:16:25PM +0800, Lan Tianyu wrote:
> On 2017年05月19日 20:04, Jan Beulich wrote:
>  On 19.05.17 at 13:16,  wrote:
> >> On Thu, May 18, 2017 at 01:32:59AM -0400, Lan Tianyu wrote:
> >>> --- a/include/hw/i386/apic-msidef.h
> >>> +++ b/include/hw/i386/apic-msidef.h
> >>> @@ -26,6 +26,7 @@
> >>>  
> >>>  #define MSI_ADDR_DEST_ID_SHIFT  12
> >>>  #define MSI_ADDR_DEST_IDX_SHIFT 4
> >>> -#define  MSI_ADDR_DEST_ID_MASK  0x000
> >>> +#define  MSI_ADDR_DEST_ID_MASK  0x000fff00
> >> The value of MSI_ADDR_DEST_ID_MASK is changed here. I think the patch
> >> should be:
> >> +#define  MSI_ADDR_DEST_ID_MASK  0x0000
> > Judging from other sources, rather the other way around - the
> > mask needs to have further bits removed (should be 0x000ff000
> > afaict). Xen sources confirm this, and while Linux has the value
> > you suggest, that contradicts
> Agree. Defining the mask as "0x000ff000" makes more sense.
> Just check Qemu source code. Only apic_send_msi() and msi_dest_id() use
> the mask
> to get dest apic id. They mask MSI address field with 
> MSI_ADDR_DEST_ID_MASK and
> then right-shift 12bit. The low 12bit won't be used.
> 
> Anthony, does this make sense?

Yes, it does.
The change to MSI_ADDR_DEST_ID_MASK should probably go in its own patch.

-- 
Anthony PERARD

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


[Xen-devel] [TESTDAY] Test report

2017-05-23 Thread Andrii Anisov

* Hardware:
Salvator-X board with Renesas R-Car H3 SoC (ARM64)

* Software:
XEN 4.9-rc6
System based on Renesas Yocto 2.19.0 BSP [1]
Linux kernel 4.9

* Guest operating systems:
The same system as dom0.

* Functionality tested:
xl create/restart/shutdown
Guest domain reboot from its console
PV NET (nfsroot in domU) , PV Block (copy from xvda to nfsroot in DomU)

* Comments:

On DomU startup messages like following appeared:

root@salvator-x-domx:~# (XEN) printk: 9 messages suppressed.
(XEN) d1v0: vGICD: unhandled word write 0x to ICACTIVER0
(XEN) d1v1: vGICD: unhandled word write 0x to ICACTIVER0
(XEN) d1v2: vGICD: unhandled word write 0x to ICACTIVER0
(XEN) d1v3: vGICD: unhandled word write 0x to ICACTIVER0
[   65.333062] xen-blkback: backend/vbd/1/51713: using 4 queues, 
protocol 1 (arm-abi) persistent grants
[   65.357846] xen-blkback: backend/vbd/1/51714: using 4 queues, 
protocol 1 (arm-abi) persistent grants

[   65.514054] vif vif-1-0 vif1.0: Guest Rx ready
[   65.518485] IPv6: ADDRCONF(NETDEV_CHANGE): vif1.0: link becomes 
ready

[   65.525021] xenbr0: port 2(vif1.0) entered blocking state
[   65.530359] xenbr0: port 2(vif1.0) entered forwarding state
[   65.815976] xen_add_phys_to_mach_entry: cannot add 
pfn=0x00063772 -> mfn=0x0072abb0: pfn=0x00063772 
-> mfn=0x00727aad already exists
[   65.834442] xen_add_phys_to_mach_entry: cannot add 
pfn=0x0006374e -> mfn=0x0072abb0: pfn=0x0006374e 
-> mfn=0x00727aad already exists
[   66.025979] xen_add_phys_to_mach_entry: cannot add 
pfn=0x0006379c -> mfn=0x0072abb3: pfn=0x0006379c 
-> mfn=0x0072abb1 already exists
[   66.273534] xen_add_phys_to_mach_entry: cannot add 
pfn=0x00063731 -> mfn=0x00727c3d: pfn=0x00063731 
-> mfn=0x00727c3e already exists
[   66.328245] xen_add_phys_to_mach_entry: cannot add 
pfn=0x000637ee -> mfn=0x00727c3f: pfn=0x000637ee 
-> mfn=0x00727c3d already exists


root@salvator-x-domx:

Raisin is not functional as described [2]:

root@salvator-x-domx:/raisin# ./raise test
No config file found, copying default config
[raisin] I don't know distro unknown. It might be missing packages.
[raisin] I don't know distro unknown. It might be missing packages.
[raisin] I don't know distro unknown. Cannot install packages.

[1] http://elinux.org/R-Car/Boards/Yocto-Gen3
[2] https://wiki.xenproject.org/wiki/Xen_ARM_Manual_Smoke_Test

--

*Andrii Anisov*



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


[Xen-devel] [PATCH for-next] xen/arm: Remove unused helpers access_ok and array_access_ok

2017-05-23 Thread Julien Grall
Both helpers access_ok and array_access_ok are not used on ARM. Remove
them.

Signed-off-by: Julien Grall 
---
 xen/include/asm-arm/guest_access.h | 7 ---
 1 file changed, 7 deletions(-)

diff --git a/xen/include/asm-arm/guest_access.h 
b/xen/include/asm-arm/guest_access.h
index 421bca5f36..251e935597 100644
--- a/xen/include/asm-arm/guest_access.h
+++ b/xen/include/asm-arm/guest_access.h
@@ -4,13 +4,6 @@
 #include 
 #include 
 
-/* Guests have their own comlete address space */
-#define access_ok(addr,size) (1)
-
-#define array_access_ok(addr,count,size) \
-(likely((count) < (~0UL / (size))) && \
- access_ok(addr, 0 + (count) * (size)))
-
 unsigned long raw_copy_to_guest(void *to, const void *from, unsigned len);
 unsigned long raw_copy_to_guest_flush_dcache(void *to, const void *from,
  unsigned len);
-- 
2.11.0


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


Re: [Xen-devel] Xen 4.9 rc6

2017-05-23 Thread Ian Jackson
Julien Grall writes ("Re: [Xen-devel] Xen 4.9 rc6"):
> On 23/05/17 10:24, M A Young wrote:
> > I had build problems with these two patches added (and before I added
> > them). It looks like at the stage in my build process where
> > make -j2 prefix=/usr tools
> > gets run it is running
> > make -C tools/include install
> > make -C tools/include dist
> > together and it fails soon after when the alignment checks run at the same
> > time.

I think this is happening because, in xen.git/Makeefile:

   dist-tools: dist-tools-public-headers

   dist-%: DESTDIR=$(DISTDIR)/install
   dist-%: install-%
   @: # do nothing

   install-tools: build-tools-public-headers

So make thinks it can try to `build' the targets
build-tools-public-headers and dist-tools-public-headers
simultaneously.

The problem here is that
 1. /Makefile needs to invoke each subdirectory exactly
once, not multiple times, or they come in parallel
 2. /Makefile is (now) confused about when it should
handle the relationship between different targets for
the same subcomponent, and when the subdirectory
Makefile is supposed to do that.

The rule for (2) used to be:
  /Makefile converts  make dist  to  DESTDIR=... make install
  for all other targets, /Makefile's make -
  passes the  to  and does not consider
  what  might mean and whether it ought to imply
  some other targets in subdir.

I think therefore that maybe this can fixed by:

  * Dropping the `dist-tools' dependency on dist-tools-p.-h.

  * Replacing the `install-tools' dependency by one on
install-tools-p-h.

  * Replacing the rules for *-public-headers with something
like

%-tools-public-headers:
$(MAKE) -C tools/include $*

Does this sound plausible ?

Ian.

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


Re: [Xen-devel] Is: Fix for 4MB BIOS payload in hvmloader. Was:Re: [edk2] [PATCH 0/5] OvmfPkg: complete the 4MB flash image support ("-bios" / emulated variables)

2017-05-23 Thread Laszlo Ersek
On 05/23/17 17:02, Julien Grall wrote:
> Hi,
> 
> On 23/05/17 15:12, Konrad Rzeszutek Wilk wrote:
 The primary location for reporting bugs against the hypervisor and
 associated bundled tools [...] is by posting to the xen-devel mailing
 list (list info). Please tag your subject line with a '[BUG]' prefix.
 Note that you do not need to be subscribed to the list to post
 (although non-subscribers are moderated this usually happens pretty
 quickly) and that list policy is to CC people so you shouldn't miss
 any replies.

 [...]

 Although a bugzilla instance does exist it is not well maintained or
 widely used by developers. If you really want to file a bug in
 bugzilla you are strongly recommended to also post to the mailing
 list.
>>>
>>> This does not make things easier for us, because rather than recurrently
>>> check a simple bug status field in the Xen tracker, we'd have to be
>>> tapped into Xen development, and follow the email thread & any relevant
>>> commits closely. In reality I'm not even subscribed to xen-devel.
> 
> We recently introduced a tracker ([1]) to help us following the state of
> bugs/features. It is managed by maintainers and read-only for the others.
> 
> The usual process is to report the bug on the mailing-list and a
> maintainer will create a bug on the tracker if we have no immediate
> solution.

That's perfect; we'll be able to reference Xen issue reports with URLs
like (just an example) ,
from TianoCore BZs. That should enable us to quickly re-check the state
of the Xen report whenever we revisit the dependent TianoCore BZ.

... Can you please add the information about "xenproject.atlassian.net"
to the Xen Wiki article at
?

> In this case, the patch made rc6. So I believe the problem is resolved.

Yes, it is. Thanks!
Laszlo

> Cheers,
> 
> [1] https://xenproject.atlassian.net/projects/XEN/issues
> 


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


[Xen-devel] [libvirt test] 109692: tolerable all pass - PUSHED

2017-05-23 Thread osstest service owner
flight 109692 libvirt real [real]
http://logs.test-lab.xenproject.org/osstest/logs/109692/

Failures :-/ but no regressions.

Tests which did not succeed, but are not blocking:
 test-armhf-armhf-libvirt-xsm 13 saverestore-support-checkfail  like 109637
 test-armhf-armhf-libvirt 13 saverestore-support-checkfail  like 109637
 test-armhf-armhf-libvirt-raw 12 saverestore-support-checkfail  like 109637
 test-amd64-amd64-libvirt-xsm 12 migrate-support-checkfail   never pass
 test-amd64-i386-libvirt  12 migrate-support-checkfail   never pass
 test-amd64-i386-libvirt-xsm  12 migrate-support-checkfail   never pass
 test-amd64-amd64-libvirt 12 migrate-support-checkfail   never pass
 test-arm64-arm64-libvirt 12 migrate-support-checkfail   never pass
 test-arm64-arm64-libvirt 13 saverestore-support-checkfail   never pass
 test-amd64-amd64-libvirt-qemuu-debianhvm-amd64-xsm 10 migrate-support-check 
fail never pass
 test-amd64-i386-libvirt-qemuu-debianhvm-amd64-xsm 10 migrate-support-check 
fail never pass
 test-arm64-arm64-libvirt-xsm 12 migrate-support-checkfail   never pass
 test-arm64-arm64-libvirt-xsm 13 saverestore-support-checkfail   never pass
 test-amd64-amd64-libvirt-vhd 11 migrate-support-checkfail   never pass
 test-arm64-arm64-libvirt-qcow2 11 migrate-support-checkfail never pass
 test-arm64-arm64-libvirt-qcow2 12 saverestore-support-checkfail never pass
 test-armhf-armhf-libvirt 12 migrate-support-checkfail   never pass
 test-armhf-armhf-libvirt-xsm 12 migrate-support-checkfail   never pass
 test-armhf-armhf-libvirt-raw 11 migrate-support-checkfail   never pass

version targeted for testing:
 libvirt  3c845817b885ce0adc8141c7f451a2e02e538d1b
baseline version:
 libvirt  4cd3f241399eb691a7fc9a1279938bfe76215a77

Last test of basis   109637  2017-05-20 05:03:34 Z3 days
Testing same since   109692  2017-05-23 04:21:13 Z0 days1 attempts


People who touched revisions under test:
  Andrea Bolognani 
  Daniel P. Berrange 
  Jim Fehlig 
  Julio Faracco 
  Ján Tomko 
  Kothapally Madhu Pavan 
  Laine Stump 
  Michal Privoznik 
  Peter Krempa 
  Wang King 

jobs:
 build-amd64-xsm  pass
 build-arm64-xsm  pass
 build-armhf-xsm  pass
 build-i386-xsm   pass
 build-amd64  pass
 build-arm64  pass
 build-armhf  pass
 build-i386   pass
 build-amd64-libvirt  pass
 build-arm64-libvirt  pass
 build-armhf-libvirt  pass
 build-i386-libvirt   pass
 build-amd64-pvopspass
 build-arm64-pvopspass
 build-armhf-pvopspass
 build-i386-pvops pass
 test-amd64-amd64-libvirt-qemuu-debianhvm-amd64-xsm   pass
 test-amd64-i386-libvirt-qemuu-debianhvm-amd64-xsmpass
 test-amd64-amd64-libvirt-xsm pass
 test-arm64-arm64-libvirt-xsm pass
 test-armhf-armhf-libvirt-xsm pass
 test-amd64-i386-libvirt-xsm  pass
 test-amd64-amd64-libvirt pass
 test-arm64-arm64-libvirt pass
 test-armhf-armhf-libvirt pass
 test-amd64-i386-libvirt  pass
 test-amd64-amd64-libvirt-pairpass
 test-amd64-i386-libvirt-pair pass
 test-arm64-arm64-libvirt-qcow2   pass
 test-armhf-armhf-libvirt-raw pass
 test-amd64-amd64-libvirt-vhd pass



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

Explanation of these reports, and of osstest in general, is at
http://xenbits.xen.org/gitweb/?p=osstest.git;a=blob;f=README.email;hb=master
http://xenbits.xen.org/gitweb/?p=osstest.git;a=blob;f=README;hb=mas

Re: [Xen-devel] [PATCH 4/7] osstest: add a FreeBSD host install recipe

2017-05-23 Thread Ian Jackson
Roger Pau Monne writes ("[PATCH 4/7] osstest: add a FreeBSD host install 
recipe"):
> The installation is performed using the bsdinstall tool, which is
> part of the FreeBSD base system. The installer image is setup with
> the osstest ssh keys and sshd enabled by default, which allows the
> test harness to just ssh into the box, create the install config
> file and launch the scripted install.

Thanks.  I've read this in some detail now.  My comments follow.

> In order to support the FreeBSD installer a new method is added,
> that allows setting the pxe boot of a host using a memdisk. Also, a
> new tftp path is added in order to point to the place where the
> FreeBSD installed images should be stored.

Can you please add to the commit message a deployment note that the
tftp root needs to be provide with a copy of memdisk, eg
   /home/tftp/memdisk -> /usr/lib/syslinux/memdisk

> diff --git a/Osstest.pm b/Osstest.pm
> index a78728cd..a0c0339c 100644
> --- a/Osstest.pm
> +++ b/Osstest.pm
> @@ -227,6 +227,7 @@ sub readglobalconfig () {
>  $c{TftpTmpDir} ||= "$c{TftpPlayDir}tmp/";
>  
>  $c{TftpDiBase} ||= "$c{TftpPlayDir}debian-installer";
> +$c{TftpFreeBSDBase} ||= "$c{TftpPlayDir}freebsd-installer";

You need to document this in README.

> +foreach (@sets, "MANIFEST") {

I think it would be better to give this loop control variable a name.
When the scope of a use of $_ is too big, $_ has a tendency to get
trashed; this makes the code fragile in the face of future changes.

> +if (!defined($r{"freebsd_sets"})) {
> +# Get everything before the "." (ie: get base from base.txz)
> +my $stash_name = lc((split /\./)[0]);

IMO that's not very idomatic perl.  I won't insist you change it, but
maybe this would be better

   my $stash_name = $set;
   $stash_name =~ s/[^.]+$//;

or

   $set =~ m/^[^.]+/ or die "$set ?";
   $stash_name = $&;

(Do you intend to split on the first `.' ?)

> +sub setup_netboot_installer () {
> +my $pxeimg = "$ho->{Tftp}{FreeBSDBase}/install-$ho->{Name}.img";

I think this would be better under TftpTmpDir.  Cf ts-host-install's
placement of $ho--initrd.gz.

Maybe we want a function target_tftp_prefix or something which returns
   $ho->{Tftp}{TmpDir}".hostnamepath($ho)
?

Also the sha names could be in {TmpDir}/freebsd-images.  Does this, in
fact, need to be configurable at all ?  I think probably not.

> +my $script = < +set -ex
> +basedir=$ho->{Tftp}{Path}/$ho->{Tftp}{FreeBSDBase}/
> +hash=`sha256sum $image|head -c 64`
> +localpath="$r{arch}/\$hash/install.img";
> +mkdir -p \$basedir
> +(
> +flock -x -w 600 200

In osstest we generally use with-lock-ex from chiark-utils, rather
than flock from util-linux.  (Bonus: it should be more portable for if
someone wants to run a controller on BSD...)

with-lock-ex needs to be used in the wrapper way.
(Also, calling flock on a directory is rather outre'.)

You've written all this in bash because you found it too hard or
annoying in Perl ?  I don't much mind that, but the escaping is a bit
irritating.  Maybe you want to pass the script its parameters as
arguments so that you can use <<'END' rather than < +logm("Executing:\n$script");
> +my $ret = system("/bin/bash -c '$script'");

This is quite wrong.  Your unparsing is unsound.  Amazingly your
script doesn't currently contain ' so this doesn't matter right now,
but that could change.

You should use the multi-argument form of system(3perl).  And, of
course, you should use Osstest::system_checked which does the error
handling for you.

You might want to build a command in an array @cmd, like copydir in
cr-publish-flight-logs does.  (Not sure why that doesn't use
system_checked...)

> +sub install () {
> +my $authkeys = authorized_keys();
> +my $knownhosts = known_hosts();
> +my $sshd_keys_url = create_ssh_overlay();
> +my $disk_names = "ada0 da0 ad0";

This should probably be
   my @disk_names = qw(ada0 da0 ad0);
in case anyone wants to manipulate it in perl.  You can substitute
it straight into the here document; perl will put in the " " again.

> +my $installer_sets = join(" ", @sets);
> +my $target_sets = "/tmp/osstest_sets";

Hardcoded /tmp antipattern.  Maybe this is technicallty OK because
it's an installer environment, but I think it sets a very bad
example.  Is there some other path you could use ?

> +target_cmd_root($ho, 'chsh -s /bin/sh', 10);

!!  What's the default ?

> +for disk in $disk_names; do
> +if [ -c "/dev/\$disk" ]; then
> +echo \$disk
> +exit 0
> +fi
> +done
> +exit 1
> +END
> +defined($disk) or die "Unable to find a valid disk";
> +logm("Using $disk as destination disk device");

I have found that on some hosts, when installing Debian GNU/Linux, I
have to expect a nonstandard disk name.  Currently in the DB I can
only find this
   hydrazine  disk-device/dev/cciss/c0d0
(in Cam

Re: [Xen-devel] Is: Fix for 4MB BIOS payload in hvmloader. Was:Re: [edk2] [PATCH 0/5] OvmfPkg: complete the 4MB flash image support ("-bios" / emulated variables)

2017-05-23 Thread Laszlo Ersek
On 05/23/17 17:01, Jan Beulich wrote:
 On 23.05.17 at 16:12,  wrote:
>> On Thu, May 18, 2017 at 02:36:33PM +0200, Laszlo Ersek wrote:
>>> The situation is further hampered by the fact that Xen is (apparently)
>>> right at 4.9.0-rc5, so they likely won't commit Jan's hvmloader patch
>>> until Xen 4.9 is out. This is a problem for a potential TianoCore-side
>>> BZ because the delay will make us forget about the issue.
> 
> The patch went in in time for rc6.

Thank you Jan for the speedy fix!

While reviewing version 2 of this patch set, Jordan wrote in
:

> With the understanding that we're holding off on the final patch for
> now to coordinate with Xen:
>
> Series Reviewed-by: Jordan Justen 

"the final patch" referenced there was:

  [edk2] [PATCH v2 5/5] OvmfPkg: make the 4MB flash size the default
(again)
  https://lists.01.org/pipermail/edk2-devel/2017-May/010763.html

So I have now modified the commit message on that patch, adding the
following paragraph:

> Xen gained support for the 4MB flash image in Xen commit 0d6968635ce5
> ("hvmloader: avoid tests when they would clobber used memory",
> 2017-05-19), which is part of Xen 4.9.0-rc6.

Seeing Gary's Tested-by on the Xen commit, I've also pushed the reworded
edk2 patch, as commit 1c47fcd465a4.

Thanks!
Laszlo

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


[Xen-devel] [xen-unstable test] 109690: regressions - FAIL

2017-05-23 Thread osstest service owner
flight 109690 xen-unstable real [real]
http://logs.test-lab.xenproject.org/osstest/logs/109690/

Regressions :-(

Tests which did not succeed and are blocking,
including tests which could not be run:
 build-armhf-xsm   5 xen-build  fail in 109679 REGR. vs. 109690

Tests which are failing intermittently (not blocking):
 test-amd64-amd64-xl-qemuu-debianhvm-amd64-xsm 15 guest-localmigrate/x10 fail 
pass in 109679
 test-amd64-amd64-xl-qemut-win7-amd64 17 guest-start/win.repeat fail pass in 
109679

Tests which did not succeed, but are not blocking:
 test-armhf-armhf-libvirt-xsm  1 build-check(1)   blocked in 109679 n/a
 test-armhf-armhf-xl-xsm   1 build-check(1)   blocked in 109679 n/a
 test-amd64-i386-xl-qemut-win7-amd64 17 guest-start/win.repeat fail in 109679 
blocked in 109690
 test-amd64-i386-xl-qemuu-win7-amd64 15 guest-localmigrate/x10 fail in 109679 
like 109662
 test-armhf-armhf-xl-credit2  15 guest-start/debian.repeatfail  like 109644
 test-amd64-i386-xl-qemuu-win7-amd64 16 guest-stop fail like 109644
 test-armhf-armhf-libvirt-xsm 13 saverestore-support-checkfail  like 109662
 test-amd64-i386-xl-qemut-win7-amd64 15 guest-localmigrate/x10 fail like 109662
 test-armhf-armhf-libvirt 13 saverestore-support-checkfail  like 109679
 test-amd64-amd64-xl-qemuu-win7-amd64 16 guest-stopfail like 109679
 test-armhf-armhf-xl-rtds 15 guest-start/debian.repeatfail  like 109679
 test-amd64-amd64-xl-rtds  9 debian-install   fail  like 109679
 test-armhf-armhf-libvirt-raw 12 saverestore-support-checkfail  like 109679
 test-amd64-i386-libvirt  12 migrate-support-checkfail   never pass
 test-amd64-i386-libvirt-xsm  12 migrate-support-checkfail   never pass
 test-amd64-amd64-libvirt 12 migrate-support-checkfail   never pass
 test-amd64-amd64-libvirt-xsm 12 migrate-support-checkfail   never pass
 test-amd64-amd64-xl-qemut-ws16-amd64  9 windows-installfail never pass
 test-arm64-arm64-xl-multivcpu 12 migrate-support-checkfail  never pass
 test-arm64-arm64-xl-multivcpu 13 saverestore-support-checkfail  never pass
 test-arm64-arm64-xl-credit2  12 migrate-support-checkfail   never pass
 test-arm64-arm64-xl-credit2  13 saverestore-support-checkfail   never pass
 test-arm64-arm64-xl  12 migrate-support-checkfail   never pass
 test-arm64-arm64-xl  13 saverestore-support-checkfail   never pass
 test-arm64-arm64-libvirt-xsm 12 migrate-support-checkfail   never pass
 test-arm64-arm64-libvirt-xsm 13 saverestore-support-checkfail   never pass
 test-arm64-arm64-libvirt 12 migrate-support-checkfail   never pass
 test-arm64-arm64-libvirt 13 saverestore-support-checkfail   never pass
 test-amd64-amd64-libvirt-qemuu-debianhvm-amd64-xsm 10 migrate-support-check 
fail never pass
 test-amd64-i386-libvirt-qemuu-debianhvm-amd64-xsm 10 migrate-support-check 
fail never pass
 test-amd64-amd64-libvirt-vhd 11 migrate-support-checkfail   never pass
 test-amd64-amd64-qemuu-nested-amd 16 debian-hvm-install/l1/l2  fail never pass
 test-armhf-armhf-xl-cubietruck 12 migrate-support-checkfail never pass
 test-armhf-armhf-xl-cubietruck 13 saverestore-support-checkfail never pass
 test-armhf-armhf-xl  12 migrate-support-checkfail   never pass
 test-armhf-armhf-xl  13 saverestore-support-checkfail   never pass
 test-armhf-armhf-libvirt-xsm 12 migrate-support-checkfail   never pass
 test-armhf-armhf-xl-credit2  12 migrate-support-checkfail   never pass
 test-armhf-armhf-xl-credit2  13 saverestore-support-checkfail   never pass
 test-armhf-armhf-libvirt 12 migrate-support-checkfail   never pass
 test-amd64-amd64-xl-qemuu-ws16-amd64  9 windows-installfail never pass
 test-armhf-armhf-xl-rtds 12 migrate-support-checkfail   never pass
 test-armhf-armhf-xl-rtds 13 saverestore-support-checkfail   never pass
 test-armhf-armhf-xl-vhd  11 migrate-support-checkfail   never pass
 test-armhf-armhf-xl-vhd  12 saverestore-support-checkfail   never pass
 test-arm64-arm64-xl-xsm  12 migrate-support-checkfail   never pass
 test-arm64-arm64-xl-xsm  13 saverestore-support-checkfail   never pass
 test-armhf-armhf-xl-xsm  12 migrate-support-checkfail   never pass
 test-armhf-armhf-xl-xsm  13 saverestore-support-checkfail   never pass
 test-arm64-arm64-xl-rtds 12 migrate-support-checkfail   never pass
 test-arm64-arm64-xl-rtds 13 saverestore-support-checkfail   never pass
 test-armhf-armhf-xl-arndale  12 migrate-support-checkfail   never pass
 test-armhf-armhf-xl-arndale  13 saverestore-support-checkfail   never pass
 test-arm64-arm64-libvirt-qcow2 11 migrate-support-checkfail never pass
 test-arm64-arm64-libvirt-qcow2 12 saverestore-support-ch

Re: [Xen-devel] passthrough

2017-05-23 Thread Andrii Anisov

Dear John,


I would speak about XEN on ARM further.

Basically you need a passthrough in XEN terms in case you want a bus 
initiator (i.e. DMA capable) device to be assigned to DomU.


For a passive device it's pretty enough to assign MMIO ranges and 
interrupts using guest domain config. The pitfall here is that a device 
tree generated for guest domain by xen tools will not have any assigned 
device specific nodes.


But a setup with earlyprintk from one guest into the second console of a 
Salvator-X board is pretty straightforward. Something more complex will 
require additional hacks.



On 23.05.17 15:53, George John wrote:
Thanks for the reply. we are using renesas rcar h3 board. Does it 
supports?
XEN passthrough functionality relies on IOMMU. The R-Car Gen3 SoCs have 
a custom IOMMU named IPMMU. XEN does not support IPMMU yet.


--

*Andrii Anisov*



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


Re: [Xen-devel] [[PATCH -v2]] XenBus: Don't wait for the producer to fill the ring if

2017-05-23 Thread Jan Beulich
>>> On 23.05.17 at 16:12,  wrote:
> The condition: if there is a space in the ring then wait for the producer
> to fill the ring also evaluates to true even if the ring if full. It
> leads to a deadlock where producer is waiting for consumer
> to consume the items and consumer is waiting for producer to fill the ring.
> 
> Fix for the issue: check if the ring is full and then break from
> the loop to consume the items from the ring.
> eg. case: prod = 1272, cons = 248.
> 
> Signed-off-by: Anshul Makkar 

Reviewed-by: Jan Beulich 

Julien,

do you want to consider this for 4.9?

Jan


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


Re: [Xen-devel] Proposal to allow setting up shared memory areas between VMs from xl config file

2017-05-23 Thread Edgar E. Iglesias
On Mon, May 22, 2017 at 02:14:41PM -0700, Stefano Stabellini wrote:
> On Mon, 22 May 2017, Ian Jackson wrote:
> > Stefano Stabellini writes ("Re: Proposal to allow setting up shared memory 
> > areas between VMs from xl config file"):
> > > In this scenario, she is going to write to the VM config files of the
> > > two apps that one page will be shared among the two, so that they can
> > > send each other messages. She will hard-code the address of the shared
> > > page in her "bare-metal" app.
> > 
> > Thanks.  This makes some sense.
> > 
> > How do these apps expect to interrupt each other, or do they poll in
> > the shared memory ?  What I'm getting at with this question is that
> > perhaps some event channels will need setting up.
> 
> As a matter of fact, I have been asking myself the same question. Nobody
> asked me explicitly for notifications support, so I didn't include it in
> the original project definition (it can always be added later) but I
> think it would be useful.
> 
> Edgar, Jarvis, do you have an opinion on this? Do (software) interrupts
> need to be setup together with the shared memory region to send
> notifications back and forth between the two guests, or are they
> unnecessary because the apps do polling anyway?

Hi Stefano,

Sorry, I haven't been following this thread in detail.

The requests I've heard of so far involve:

1. Static setup of memory/pages at a given guest physical address.
   Preferably by allowing the setup to control the real physical
   address aswell (e.g, to select on chip memories as the backing).
   Bonus for an option to let Xen dynamically allocate the physical
   memory.

   Preferably avoiding the need for hypercalls and such as the guest
   my be an unmodified program that runs natively (without Xen).

2. Interrupts would be done by means of IPIs like if running natively
   on HW. Either by some dedicated IP device or by using GIC PPIs/SGIs
   to raise interrupts on other cores. PPI's are a bit akward as
   it conflicts with the Xen model of multi-core intra-guest IPIs,
   as oppposed to inter-guest IPIs. SGI's accross guests could work.


> 
> Event channels are not as complex as grants, but they are not trivial
> either. Guests need to support the full event channel ABI even just to
> receive notifications from one event channel only (because they need to
> clear the pending bits), which is not simple and increases latency to
> de-multiplex events. See drivers/xen/events/events_2l.c and
> drivers/xen/events/events_base.c in Linux. I think we would have to
> introduce a simpler model, where each "notification channel" is not
> implemented by an event channel, but by a PPI or SGI instead. We expect
> only one or two to be used. PPIs and SGIs are interrupt classes on ARM,
> it is possible to allocate one or more for notification usage.

Yes, I wrote too fast, you're getting to the same point here...



> 
> I think it is probably best to leave notifications to the future.

Perhaps yes.

In the ZynqMP case, as a first step, we can use the dedicated IPI blocks.
It would simply involve mapping irq's and memory regions to the various guests
and they would be able to raise interrupts to each other by memory
writes to the IPI devices. Xen doesn't need to be involved more.
This should already work today.

Cheers,
Edgar


> 
> 
> > > There is no frontend and backend (as in the usual Xen meaning). In some
> > > configurations one app might be more critical than the other, but in
> > > some other scenarios they might have the same criticality.
> > 
> > Yes.
> > 
> > > If, as Jan pointed out, we need to call out explicitly which is the
> > > frontend and which is the backend for page ownership reasons, then I
> > > suggested we expose that configuration to the user, so that she can
> > > choose.
> > 
> > Indeed.
> > 
> > ISTM that this scenario doesn't depend on new hypervisor
> > functionality.  The toolstack could set up the appropriate page
> > sharing (presumably, this would be done with grants so that the result
> > is like something the guests could have done themselves.)
> 
> Right, I don't think we need new hypervisor functionalities. I don't
> have an opinion on whether it should be done with grants or with other
> hypercalls, although I have the feeling that it might be more difficult
> to achieve with grants. As long as it works... :-)
> 
> 
> > I see no objection to the libxl domain configuration file naming
> > guest-physical addresses for use in this way.
> >
> > One problem, though, is to do with startup order.  To do this in the
> > most natural way, one would want to start both guests at once so that
> > one would know their domids etc.  (Also that avoids questions like
> > `what if one of them crashes'...)
> > 
> > I'm not sure exactly how to fit this into the libxl model, which
> > mostly talks about one guest domain at a time; and each guest config
> > talks about persistent resources, rather than resources which are
> > somehow exposed by a par

[Xen-devel] [ovmf baseline-only test] 71414: tolerable FAIL

2017-05-23 Thread Platform Team regression test user
This run is configured for baseline tests only.

flight 71414 ovmf real [real]
http://osstest.xs.citrite.net/~osstest/testlogs/logs/71414/

Failures :-/ but no regressions.

Regressions which are regarded as allowable (not blocking):
 build-amd64-libvirt   5 libvirt-buildfail   like 71411
 build-i386-libvirt5 libvirt-buildfail   like 71411

version targeted for testing:
 ovmf 3b2928b46987693caaaeefbb7b799d1e1de803c0
baseline version:
 ovmf ac63e9392e7aa3791a4ea00e43c0658e6b20e2ee

Last test of basis71411  2017-05-23 07:49:30 Z0 days
Testing same since71414  2017-05-23 13:16:36 Z0 days1 attempts


People who touched revisions under test:
  Michael D Kinney 
  Michael Kinney 

jobs:
 build-amd64-xsm  pass
 build-i386-xsm   pass
 build-amd64  pass
 build-i386   pass
 build-amd64-libvirt  fail
 build-i386-libvirt   fail
 build-amd64-pvopspass
 build-i386-pvops pass
 test-amd64-amd64-xl-qemuu-ovmf-amd64 pass
 test-amd64-i386-xl-qemuu-ovmf-amd64  pass



sg-report-flight on osstest.xs.citrite.net
logs: /home/osstest/logs
images: /home/osstest/images

Logs, config files, etc. are available at
http://osstest.xs.citrite.net/~osstest/testlogs/logs

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


Push not applicable.


commit 3b2928b46987693caaaeefbb7b799d1e1de803c0
Author: Michael Kinney 
Date:   Wed May 17 12:19:16 2017 -0700

UefiCpuPkg/MpInitLib: Fix X64 XCODE5/NASM compatibility issues

https://bugzilla.tianocore.org/show_bug.cgi?id=565

Fix NASM compatibility issues with XCODE5 tool chain.
The XCODE5 tool chain for X64 builds using PIE (Position
Independent Executable).  For most assembly sources using
PIE mode does not cause any issues.

However, if assembly code is copied to a different address
(such as AP startup code in the MpInitLib), then the
X64 assembly source must be implemented to be compatible
with PIE mode that uses RIP relative addressing.

The specific changes in this patch are:

* Use LEA instruction instead of MOV instruction to lookup
  the addresses of functions.

* The assembly function RendezvousFunnelProc() is copied
  below 1MB so it can be executed as part of the MpInitLib
  AP startup sequence.  RendezvousFunnelProc() calls the
  external function InitializeFloatingPointUnits().  The
  absolute address of InitializeFloatingPointUnits() is
  added to the MP_CPU_EXCHANGE_INFO structure that is passed
  to RendezvousFunnelProc().

Cc: Andrew Fish 
Cc: Jeff Fan 
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Michael D Kinney 
Reviewed-by: Jeff Fan 
Reviewed-by: Andrew Fish 

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


Re: [Xen-devel] Is: Fix for 4MB BIOS payload in hvmloader. Was:Re: [edk2] [PATCH 0/5] OvmfPkg: complete the 4MB flash image support ("-bios" / emulated variables)

2017-05-23 Thread Julien Grall

Hi,

On 23/05/17 15:12, Konrad Rzeszutek Wilk wrote:

The primary location for reporting bugs against the hypervisor and
associated bundled tools [...] is by posting to the xen-devel mailing
list (list info). Please tag your subject line with a '[BUG]' prefix.
Note that you do not need to be subscribed to the list to post
(although non-subscribers are moderated this usually happens pretty
quickly) and that list policy is to CC people so you shouldn't miss
any replies.

[...]

Although a bugzilla instance does exist it is not well maintained or
widely used by developers. If you really want to file a bug in
bugzilla you are strongly recommended to also post to the mailing
list.


This does not make things easier for us, because rather than recurrently
check a simple bug status field in the Xen tracker, we'd have to be
tapped into Xen development, and follow the email thread & any relevant
commits closely. In reality I'm not even subscribed to xen-devel.


We recently introduced a tracker ([1]) to help us following the state of 
bugs/features. It is managed by maintainers and read-only for the others.


The usual process is to report the bug on the mailing-list and a 
maintainer will create a bug on the tracker if we have no immediate 
solution.


In this case, the patch made rc6. So I believe the problem is resolved.

Cheers,

[1] https://xenproject.atlassian.net/projects/XEN/issues

--
Julien Grall

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


Re: [Xen-devel] [PATCH 3/7] osstest: fix regular expression used to match buildjob in ts-build-check

2017-05-23 Thread Ian Jackson
Roger Pau Monne writes ("[PATCH 3/7] osstest: fix regular expression used to 
match buildjob in ts-build-check"):
> Current regular expression used to match the buildjob works correctly when the
> buildjob runvar has the buildjob format, but not when the format is
> _buildjob (the first match group is empty in this case). Change it 
> so
> that it works for both formats.

I think I have misled you.  Looking at the database I see there are
runvars with names like this

  src_host_xenbuildjob
  guests_rumpuserxenbuildjob

Ie, the part before the _ (if any), is a scope (like a host ident).
So this patch is wrong, and also, your other patches have to use
`freebsdbuildjob'.

Sorry :-/.

Ian.

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


[Xen-devel] Is: Fix for 4MB BIOS payload in hvmloader. Was:Re: [edk2] [PATCH 0/5] OvmfPkg: complete the 4MB flash image support ("-bios" / emulated variables)

2017-05-23 Thread Jan Beulich
>>> On 23.05.17 at 16:12,  wrote:
> On Thu, May 18, 2017 at 02:36:33PM +0200, Laszlo Ersek wrote:
>> The situation is further hampered by the fact that Xen is (apparently)
>> right at 4.9.0-rc5, so they likely won't commit Jan's hvmloader patch
>> until Xen 4.9 is out. This is a problem for a potential TianoCore-side
>> BZ because the delay will make us forget about the issue.

The patch went in in time for rc6.

Jan


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


Re: [Xen-devel] [PATCH 2/7] osstest: move known_hosts generation to TestSupport

2017-05-23 Thread Ian Jackson
Roger Pau Monne writes ("[PATCH 2/7] osstest: move known_hosts generation to 
TestSupport"):
> This is equivalent to the already existing authorized_keys function, and
> generates the contents of the known_hosts file that should be installed on
> targets.

Acked-by: Ian Jackson 

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


Re: [Xen-devel] [PATCH 1/7] osstest: make built_stash_file store a path_ runvar for each file

2017-05-23 Thread Ian Jackson
Roger Pau Monne writes ("[PATCH 1/7] osstest: make built_stash_file store a 
path_ runvar for each file"):
> And introduce built_stash_debugfile in order the keep the previous behavior of
> built_stash_file.

Acked-by: Ian Jackson 

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


Re: [Xen-devel] [PATCH v9 20/28] ARM: GICv3: handle unmapped LPIs

2017-05-23 Thread Andre Przywara
Hi Stefano,

On 20/05/17 02:25, Stefano Stabellini wrote:
> On Thu, 11 May 2017, Andre Przywara wrote:
>> When LPIs get unmapped by a guest, they might still be in some LR of
>> some VCPU. Nevertheless we remove the corresponding pending_irq
>> (possibly freeing it), and detect this case (irq_to_pending() returns
>> NULL) when the LR gets cleaned up later.
>> However a *new* LPI may get mapped with the same number while the old
>> LPI is *still* in some LR. To avoid getting the wrong state, we mark
>> every newly mapped LPI as PRISTINE, which means: has never been in an
>> LR before. If we detect the LPI in an LR anyway, it must have been an
>> older one, which we can simply retire.
>> Before inserting such a PRISTINE LPI into an LR, we must make sure that
>> it's not already in another LR, as the architecture forbids two
>> interrupts with the same virtual IRQ number on one CPU.
>>
>> Signed-off-by: Andre Przywara 
>> ---
>>  xen/arch/arm/gic.c | 55 
>> +-
>>  xen/include/asm-arm/vgic.h |  6 +
>>  2 files changed, 56 insertions(+), 5 deletions(-)
>>
>> diff --git a/xen/arch/arm/gic.c b/xen/arch/arm/gic.c
>> index fd3fa05..8bf0578 100644
>> --- a/xen/arch/arm/gic.c
>> +++ b/xen/arch/arm/gic.c
>> @@ -375,6 +375,8 @@ static inline void gic_set_lr(int lr, struct pending_irq 
>> *p,
>>  {
>>  ASSERT(!local_irq_is_enabled());
>>  
>> +clear_bit(GIC_IRQ_GUEST_PRISTINE_LPI, &p->status);
>> +
>>  gic_hw_ops->update_lr(lr, p, state);
>>  
>>  set_bit(GIC_IRQ_GUEST_VISIBLE, &p->status);
>> @@ -442,12 +444,41 @@ void gic_raise_inflight_irq(struct vcpu *v, unsigned 
>> int virtual_irq)
>>  #endif
>>  }
>>  
>> +/*
>> + * Find an unused LR to insert an IRQ into. If this new interrupt is a
>> + * PRISTINE LPI, scan the other LRs to avoid inserting the same IRQ twice.
>> + */
>> +static int gic_find_unused_lr(struct vcpu *v, struct pending_irq *p, int lr)
>> +{
>> +unsigned int nr_lrs = gic_hw_ops->info->nr_lrs;
>> +unsigned long *lr_mask = (unsigned long *) &this_cpu(lr_mask);
>> +struct gic_lr lr_val;
>> +
>> +ASSERT(spin_is_locked(&v->arch.vgic.lock));
>> +
>> +if ( test_bit(GIC_IRQ_GUEST_PRISTINE_LPI, &p->status) )
> 
> Maybe we should add an "unlikely".
> 
> I can see how this would be OKish at runtime, but at boot time there
> might be a bunch of PRISTINE_LPIs,

What is your concern here, performance?
Let's put this into perspective:
- The PRISTINE bit gets set upon MAPTI, which Linux usually does *once*
when the driver gets loaded. It gets cleared after the first injection.
- If that happens, we scan all LRs. Most implementations have 4(!) of
them (ARM GIC implementations, for instance), also the algorithm only
scans *used* LRs, so normally just one or two.
- Reading the LR is a *local* system register *read*, not an MMIO
access, and not propagated to other cores. Yes, this may be "costly"
(compared to other instructions), but it's probably still cheaper than a
page table walk (TLB miss) or L2 cache miss.

So to summarize: this is rare, iterates over only a very small number of
registers and is not hugely expensive.
At this point in time I would refrain from any kind of performance
optimization, at least unless we have solved all the other issues and
have done some benchmarking/profiling (on different hardware platforms).

> but no MAPDs have been issued yet, right?

As Julien already mentioned, this gets set after a MAPTI, which requires
a MAPD before.

Cheers,
Andre.

> I have a suggestion, I'll leave it to you and Julien if you want to do
> this now, or maybe consider it as a TODO item. I am OK either way (I
> don't want to delay the ITS any longer).
> 
> I am thinking we should do this scanning only after at least one MAPD
> has been issued for a given cpu at least once. I would resurrect the
> idea of a DISCARD flag, but not on the pending_irq, that I believe it's
> difficult to handle, but a single global DISCARD flag per struct vcpu.
> 
> On MAPD, we set DISCARD for the target vcpu of the LPI we are dropping.
> Next time we want to inject a PRISTINE_IRQ on that cpu interface, we
> scan all LRs for interrupts with a NULL pending_irq. We remove those
> from LRs, then we remove the DISCARD flag.
> 
> Do you think it would work?
> 
> 
>> +{
>> +int used_lr = 0;
>> +
>> +while ( (used_lr = find_next_bit(lr_mask, nr_lrs, used_lr)) < 
>> nr_lrs )
>> +{
>> +gic_hw_ops->read_lr(used_lr, &lr_val);
>> +if ( lr_val.virq == p->irq )
>> +return used_lr;
>> +}
>> +}
>> +
>> +lr = find_next_zero_bit(lr_mask, nr_lrs, lr);
>> +
>> +return lr;
>> +}
>> +
>>  void gic_raise_guest_irq(struct vcpu *v, unsigned int virtual_irq,
>>  unsigned int priority)
>>  {
>> -int i;
>> -unsigned int nr_lrs = gic_hw_ops->info->nr_lrs;
>>  struct pending_irq *p = irq_to_pending(v, virtual_irq);
>> +unsigned int nr_lrs = gic_hw_ops->info->nr_lr

Re: [Xen-devel] [PATCH v2 for-4.9] x86/mm: Fix incorrect unmapping of 2MB and 1GB pages

2017-05-23 Thread Boris Ostrovsky
On 05/23/2017 10:05 AM, Jan Beulich wrote:
 On 23.05.17 at 15:40,  wrote:
>> And you haven't been able to reproduce this? I see this fail on two AMD
>> systems (different processor families).
> I didn't even have the time to try.
>
>> And this:
>>
>> --- a/xen/arch/x86/mm/p2m.c
>> +++ b/xen/arch/x86/mm/p2m.c
>> @@ -560,7 +560,7 @@ int p2m_set_entry(struct p2m_domain *p2m, unsigned long 
>> gfn, mfn_t mfn,
>>  {
>>  if ( hap_enabled(d) )
>>  {
>> -unsigned long fn_mask = !mfn_eq(mfn, INVALID_MFN) ?
>> +unsigned long fn_mask = (!mfn_eq(mfn, INVALID_MFN) || 1)?
>>   (gfn | mfn_x(mfn) | todo) : (gfn | 
>> todo);
>>  
>>  order = (!(fn_mask & ((1ul << PAGE_ORDER_1G) - 1)) &&
>>
>>
>> makes the problem go away.
> Interesting. I took another look at p2m-pt.c, this time paying
> particular attention to INVALID_MFN uses. And right the first one
> may already provide a hint: Perhaps we now need L2 and L3
> counterparts to p2m_l1e_from_pfn(). 

Defining p2m_l2e_from_pfn indeed helps a bit with HVM --- the guest now
goes as far as loading balloon driver (when it crashes).


> Further changes may then
> be needed to the splitting of large pages (in p2m_next_level())
> depending on whether INVALID_MFN entries can make it there.

Let me see what I can do here.

-boris


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


Re: [Xen-devel] [OSSTEST PATCH 08/24] cs-hosts-list: Support --suites

2017-05-23 Thread Roger Pau Monné
On Thu, May 18, 2017 at 12:01:18PM +0100, Ian Jackson wrote:
> Signed-off-by: Ian Jackson 
> ---
>  cs-hosts-list | 16 
>  1 file changed, 16 insertions(+)
> 
> diff --git a/cs-hosts-list b/cs-hosts-list
> index 92f44ee..9b82d51 100755
> --- a/cs-hosts-list
> +++ b/cs-hosts-list
> @@ -31,6 +31,7 @@ csreadconfig();
>  
>  our @kernels = qw(xen linux);
>  our @arches;
> +our @suites;
>  
>  while (@ARGV && $ARGV[0] =~ m/^-/) {
>  $_ = shift @ARGV;
> @@ -40,6 +41,8 @@ while (@ARGV && $ARGV[0] =~ m/^-/) {
>   @arches = split /\,/, $1;
>   } elsif (s/^--kernels=(.*)/-/) {
>   @kernels = split /\,/, $1;
> + } elsif (s/^--suites=(.*)/-/) {
> + @suites = split /\,/, $1;

I should add a --freebsd=... option.

Acked-by: Roger Pau Monné 

Roger.

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


Re: [Xen-devel] [OSSTEST PATCH 06/24] cs-hosts-list: New utility

2017-05-23 Thread Roger Pau Monné
On Tue, May 23, 2017 at 02:54:16PM +0100, Ian Jackson wrote:
> Roger Pau Monné writes ("Re: [Xen-devel] [OSSTEST PATCH 06/24] cs-hosts-list: 
> New utility"):
> > On Thu, May 18, 2017 at 12:01:16PM +0100, Ian Jackson wrote:
> > > +foreach my $flag (grep { length} split /\,/, $flags) {
> > > +$qtxt.= < > > +AND EXISTS (SELECT 1 FROM HOSTFLAGS f
> > > +WHERE resname=f.hostname
> > > +  AND f.hostflag=?)
> > 
> > There seems to be a mix between hard tabs and spaces above.
> 
> Indeed.  Does that bother you ?  osstest is full of that and it
> doesn't bothere me...

Not really, but for new scripts I've tried to keep a more uniform style,
although vim was very confused about whether it should use hard tabs or spaces
:).

Roger.

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


[Xen-devel] [[PATCH -v2]] XenBus: Don't wait for the producer to fill the ring if

2017-05-23 Thread Anshul Makkar
The condition: if there is a space in the ring then wait for the producer
to fill the ring also evaluates to true even if the ring if full. It
leads to a deadlock where producer is waiting for consumer
to consume the items and consumer is waiting for producer to fill the ring.

Fix for the issue: check if the ring is full and then break from
the loop to consume the items from the ring.
eg. case: prod = 1272, cons = 248.

Signed-off-by: Anshul Makkar 
---
v2:
 * resolved the coding style issue.
 * modified the "if" condition statement to make it simpler.

 tools/firmware/hvmloader/xenbus.c | 12 
 1 file changed, 12 insertions(+)

diff --git a/tools/firmware/hvmloader/xenbus.c 
b/tools/firmware/hvmloader/xenbus.c
index 448157d..2b89a56 100644
--- a/tools/firmware/hvmloader/xenbus.c
+++ b/tools/firmware/hvmloader/xenbus.c
@@ -141,7 +141,19 @@ static void ring_read(char *data, uint32_t len)
 /* Don't overrun the producer pointer */
 while ( (part = MASK_XENSTORE_IDX(rings->rsp_prod -
   rings->rsp_cons)) == 0 )
+{
+/*
+ * Don't wait for producer to fill the ring if it is already full.
+ * Condition happens when you write string > 1K into the ring.
+ * eg case prod=1272 cons=248.
+ */
+if ( rings->rsp_prod - rings->rsp_cons == XENSTORE_RING_SIZE )
+{
+part = XENSTORE_RING_SIZE;
+break;
+}
 ring_wait();
+}
 /* Don't overrun the end of the ring */
 if ( part > (XENSTORE_RING_SIZE - MASK_XENSTORE_IDX(rings->rsp_cons)) )
 part = XENSTORE_RING_SIZE - MASK_XENSTORE_IDX(rings->rsp_cons);
-- 
2.7.4


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


[Xen-devel] Is: Fix for 4MB BIOS payload in hvmloader. Was:Re: [edk2] [PATCH 0/5] OvmfPkg: complete the 4MB flash image support ("-bios" / emulated variables)

2017-05-23 Thread Konrad Rzeszutek Wilk
Adding Jan (autor of patch) and Julien (Xen release manager);

Pls see below.

On Thu, May 18, 2017 at 02:36:33PM +0200, Laszlo Ersek wrote:
> On 05/16/17 06:20, Gary Lin wrote:
> > On Mon, May 15, 2017 at 05:40:59PM -0700, Jordan Justen wrote:
> >> On 2017-05-12 01:40:34, Laszlo Ersek wrote:
> >>> On 05/12/17 04:02, Gary Lin wrote:
>  On Mon, May 08, 2017 at 12:27:59PM +0800, Gary Lin wrote:
> > On Sat, May 06, 2017 at 09:30:18PM +0200, Laszlo Ersek wrote:
> >> (All hail Saturday!)
> >>
> >> Gary, can you please fetch this from my repo (URL & branch name below)
> >> and test it with Xen? Please test both the 4MB and the 2MB build. (I
> >> also tested both, with qemu + "-bios".)
> > Hi Laszlo,
> >
> > I have done some simples test with xen, and the 2MB build seems fine.
> > It booted into grub2 menu successfully. However, the 4MB build never 
> > boots.
> > The QEMU window showed less than 1 sec and then disappeared.
> >
> > Here is the snippet from 'xl dmesg'
> >
> > (d15)  - CPU0 ... 39-bit phys ... fixed MTRRs ... var MTRRs [1/8] ... 
> > done.
> > (d15) Testing HVM environment:
> > (d15)  - REP INSB across page boundaries ... passed
> > (d15)  - GS base MSRs and SWAPGS ... passed
> > (d15) Passed 2 of 2 tests
> > (d15) Writing SMBIOS tables ...
> > (d15) Loading OVMF ...
> > (d15) no BIOS ROM image found
> > (d15) *** HVMLoader bug at hvmloader.c:381
> > (d15) *** HVMLoader crashed.
> >
> > I'm pretty sure that the ovmf path is right, so it seems Xen just 
> > rejected
> > the 4MB build :-\
> >
> > I'll try to dig more information.
> >
>  There is a function in the xen hvmloader clearing the memory from
>  0x40 to 0x80. Unfortunately, the hvm_start_info struct of the
>  4MB OVMF was loaded to 0x588000, so the struct was cleared mistakenly
>  and hvmloader cannot find the firmware. Xen is not ready for the 4MB
>  build yet :-\
> 
>  The discussion in xen-devel:
>  https://lists.xen.org/archives/html/xen-devel/2017-05/msg01053.html
> >>>
> >>> Thank you for the feedback!
> >>>
> >>> In this case, I think we should drop the last patch from this series.
> >>
> >> Can we come up with a plan for trying to fix this? Gary, would it be
> >> okay if we opened a bug and assigned it to you? Or, do you have
> >> another suggestion for a possible Xen owner?
> >>
> > Jan Beulich (also a SUSE employee) is working on the patch(*), and it
> > works for me.
> 
> We should distinguish a TianoCore BZ entry for this, from a Xen bug
> report for this. The former would depend on the latter.
> 
> The TianoCore BZ assignee's job would be to monitor the upstream Xen
> fix, and to submit the last patch of this series -- separated out -- to
> edk2-devel once upstream Xen commits the fix.
> 
> Upstream Xen does not have a bug tracker that is widely used in their
> community:
> 
> https://wiki.xen.org/wiki/Reporting_Bugs_against_Xen_Project
> 
> > The primary location for reporting bugs against the hypervisor and
> > associated bundled tools [...] is by posting to the xen-devel mailing
> > list (list info). Please tag your subject line with a '[BUG]' prefix.
> > Note that you do not need to be subscribed to the list to post
> > (although non-subscribers are moderated this usually happens pretty
> > quickly) and that list policy is to CC people so you shouldn't miss
> > any replies.
> >
> > [...]
> >
> > Although a bugzilla instance does exist it is not well maintained or
> > widely used by developers. If you really want to file a bug in
> > bugzilla you are strongly recommended to also post to the mailing
> > list.
> 
> This does not make things easier for us, because rather than recurrently
> check a simple bug status field in the Xen tracker, we'd have to be
> tapped into Xen development, and follow the email thread & any relevant
> commits closely. In reality I'm not even subscribed to xen-devel.
> 
> The situation is further hampered by the fact that Xen is (apparently)
> right at 4.9.0-rc5, so they likely won't commit Jan's hvmloader patch
> until Xen 4.9 is out. This is a problem for a potential TianoCore-side
> BZ because the delay will make us forget about the issue.
> 
> Thanks,
> Laszlo
> 
> > 
> > Cheers,
> > 
> > Gary Lin
> > 
> > (*) https://lists.xen.org/archives/html/xen-devel/2017-05/msg01242.html
> >> Thanks,
> >>
> >> -Jordan
> >>
> >>>
> >>> However, your test results also confirm that the 2MB build continues to
> >>> work with Xen, which means that the reworking of the
> >>> EmuVariableFvbRuntimeDxe driver in this series, and the underlying
> >>> tweaks+cleanups series, cause no regression.
> >>>
> >>> Can you please respond, with your "Regression-tested-by", to:
> >>>
> >>> (1) the full series
> >>>
> >>>   [edk2] [PATCH 0/7] OvmfPkg: small cleanups and tweaks
> >>>
> >>> (2) and patches 1 through 3 in this series? (Patch #4 is just
> >>> 

Re: [Xen-devel] [PATCH v2 for-4.9] x86/mm: Fix incorrect unmapping of 2MB and 1GB pages

2017-05-23 Thread Jan Beulich
>>> On 23.05.17 at 15:40,  wrote:
> And you haven't been able to reproduce this? I see this fail on two AMD
> systems (different processor families).

I didn't even have the time to try.

> And this:
> 
> --- a/xen/arch/x86/mm/p2m.c
> +++ b/xen/arch/x86/mm/p2m.c
> @@ -560,7 +560,7 @@ int p2m_set_entry(struct p2m_domain *p2m, unsigned long 
> gfn, mfn_t mfn,
>  {
>  if ( hap_enabled(d) )
>  {
> -unsigned long fn_mask = !mfn_eq(mfn, INVALID_MFN) ?
> +unsigned long fn_mask = (!mfn_eq(mfn, INVALID_MFN) || 1)?
>   (gfn | mfn_x(mfn) | todo) : (gfn | 
> todo);
>  
>  order = (!(fn_mask & ((1ul << PAGE_ORDER_1G) - 1)) &&
> 
> 
> makes the problem go away.

Interesting. I took another look at p2m-pt.c, this time paying
particular attention to INVALID_MFN uses. And right the first one
may already provide a hint: Perhaps we now need L2 and L3
counterparts to p2m_l1e_from_pfn(). Further changes may then
be needed to the splitting of large pages (in p2m_next_level())
depending on whether INVALID_MFN entries can make it there.

Jan


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


Re: [Xen-devel] [OSSTEST PATCH 03/24] cs-flight-create: Fix usage error message

2017-05-23 Thread Roger Pau Monné
On Thu, May 18, 2017 at 12:01:13PM +0100, Ian Jackson wrote:
> This spuriously prints $!.  It's still a poor message.
> 
> Signed-off-by: Ian Jackson 
> ---
>  cs-flight-create | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/cs-flight-create b/cs-flight-create
> index a412396..dc61e62 100755
> --- a/cs-flight-create
> +++ b/cs-flight-create
> @@ -24,7 +24,7 @@ use Osstest;
>  
>  csreadconfig();
>  
> -@ARGV==2 or die $!;
> +@ARGV==2 or die;

Maybe a "Invalid number of arguments provided, expected 2"?

In any case:

Acked-by: Roger Pau Monné 

Roger.

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


Re: [Xen-devel] [OSSTEST PATCH 06/24] cs-hosts-list: New utility

2017-05-23 Thread Ian Jackson
Roger Pau Monné writes ("Re: [Xen-devel] [OSSTEST PATCH 06/24] cs-hosts-list: 
New utility"):
> On Thu, May 18, 2017 at 12:01:16PM +0100, Ian Jackson wrote:
> > +foreach my $flag (grep { length} split /\,/, $flags) {
> > +$qtxt.= < > +  AND EXISTS (SELECT 1 FROM HOSTFLAGS f
> > +  WHERE resname=f.hostname
> > +AND f.hostflag=?)
> 
> There seems to be a mix between hard tabs and spaces above.

Indeed.  Does that bother you ?  osstest is full of that and it
doesn't bothere me...

Ian.

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


Re: [Xen-devel] [OSSTEST PATCH 05/24] tcmd: Work around ssh bug with `ssh host ""'

2017-05-23 Thread Ian Jackson
Roger Pau Monné writes ("Re: [Xen-devel] [OSSTEST PATCH 05/24] tcmd: Work 
around ssh bug with `ssh host ""'"):
> On Thu, May 18, 2017 at 12:01:15PM +0100, Ian Jackson wrote:
> > This runs an interactive shell session on the host, rathern than
> > running `sh -c ""' on it.
> > 
> > Evidently ssh checks for the presence of a command line specification
> > after (foolishly, but now historically unavoidably) concatenating all
> > the command line arguments with spaces in between.
> > 
> > Turn  ssh host ""  into  ssh host " "  which is the expected no-op.
> >
> > Signed-off-by: Ian Jackson 
> 
> SoB doesn't match "From:", apart from that:
> 
> Acked-by: Roger Pau Monné 

Thanks for the reviews.  Sadly I already pushed this with the wrong
From:.  I'm not sure exactly how that snuck in.  I probably committed
that on my laptop but the tree has a user.email config...

Ian.

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


[Xen-devel] [PATCH 3/7] osstest: fix regular expression used to match buildjob in ts-build-check

2017-05-23 Thread Roger Pau Monne
Current regular expression used to match the buildjob works correctly when the
buildjob runvar has the buildjob format, but not when the format is
_buildjob (the first match group is empty in this case). Change it so
that it works for both formats.

Signed-off-by: Roger Pau Monné 
---
 ts-build-check | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/ts-build-check b/ts-build-check
index 92e19fb0..b9ade876 100755
--- a/ts-build-check
+++ b/ts-build-check
@@ -26,7 +26,7 @@ die if @ARGV && $ARGV[0] =~ m/^-/;
 logm("checking builds ...");
 
 foreach my $k (sort keys %r) {
-next unless $k =~ m/^(?:.*_)?([^_]*)buildjob$/;
+next unless $k =~ m/^(.*?)(_?)buildjob$/;
 my $part= $1;
 my $path= "path_${part}dist";
 logm("checking $k $path");
-- 
2.11.0 (Apple Git-81)


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


[Xen-devel] [PATCH 5/7] osstest: introduce a FreeBSD build script

2017-05-23 Thread Roger Pau Monne
In order to generate the FreeBSD installer image and the install media.

The install sets are the vanilla ones generated by the 'ftp' release target.
The installer image is handcrafted based on the filesystem created by the
'bootonly' target, which is then populated with the ssh host keys, and setup
in order to use the serial console. The other difference from upstream FreeBSD
installer images is that the one built by osstest uses a ramdisk instead of
relying on the installer media to be somehow attached, either on a CD or USB
drive. This is required in order to boot the image from pxelinux (where no CD
or USB is actually attached to the host, and everything is fetched from tftp).

Due to the nature of the FreeBSD build, the outputs are different from what
osstest expects from a buildjob, more specifically there's no path_freebsdist
produced, and thus ts-build-check needs to be modified in order to accommodate
this. The FreeBSD build output is going to produce the following binaries
path_freebsd-{base,kernel,manifest,image}.

Signed-off-by: Roger Pau Monné 
---
 ts-build-check   |  14 +++-
 ts-freebsd-build | 230 +++
 2 files changed, 241 insertions(+), 3 deletions(-)
 create mode 100755 ts-freebsd-build

diff --git a/ts-build-check b/ts-build-check
index b9ade876..68d6cc2d 100755
--- a/ts-build-check
+++ b/ts-build-check
@@ -28,9 +28,17 @@ logm("checking builds ...");
 foreach my $k (sort keys %r) {
 next unless $k =~ m/^(.*?)(_?)buildjob$/;
 my $part= $1;
-my $path= "path_${part}dist";
-logm("checking $k $path");
-get_stashed($path, $r{$k});
+if ("$part" eq "freebsd") {
+foreach (qw(base kernel manifest image)) {
+my $path= "path_${part}-$_";
+logm("checking $k $path");
+get_stashed($path, $r{$k});
+}
+} else {
+my $path= "path_${part}dist";
+logm("checking $k $path");
+get_stashed($path, $r{$k});
+}
 }
 
 logm("all ok.");
diff --git a/ts-freebsd-build b/ts-freebsd-build
new file mode 100755
index ..c0366c97
--- /dev/null
+++ b/ts-freebsd-build
@@ -0,0 +1,230 @@
+#!/usr/bin/perl -w
+# This is part of "osstest", an automated testing framework for Xen.
+# Copyright (C) 2017 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 .
+
+use strict qw(vars);
+use DBI;
+use POSIX;
+
+unshift @INC, qw(.);
+use Osstest;
+use Osstest::TestSupport;
+use Osstest::BuildSupport;
+
+tsreadconfig();
+
+selectbuildhost(\@ARGV);
+builddirsprops();
+
+sub install_deps () {
+target_cmd_root($ho, 'pkg install git', 300);
+}
+
+sub checkout () {
+prepbuilddirs();
+
+# Remove the directory as root, there might be files owned by root
+target_cmd_root($ho, ) {
+target_putfile_root($ho, 30, $file,
+"$builddir/freebsd/release/$target/etc/ssh/");
+}
+
+logm("Configuring the installer image");
+target_cmd_root($ho, <> \$target/etc/rc.conf
+
+# Allow root login and copy the keys
+echo 'PermitRootLogin yes' >> \$target/etc/ssh/sshd_config
+mkdir -p \$target/root/.ssh
+cat << ENDKEYS > \$target/root/.ssh/authorized_keys
+$authkeys
+ENDKEYS
+
+# Set host keys permissions
+chown root:wheel \$target/etc/ssh/ssh_host_*_key*
+chmod 0600 \$target/etc/ssh/ssh_host_*_key
+chmod 0644 \$target/etc/ssh/ssh_host_*_key.pub
+
+# Setup serial cons

[Xen-devel] [PATCH 1/7] osstest: make built_stash_file store a path_ runvar for each file

2017-05-23 Thread Roger Pau Monne
And introduce built_stash_debugfile in order the keep the previous behavior of
built_stash_file.

Signed-off-by: Roger Pau Monné 
---
Cc: Ian Jackson 
---
 Osstest/TestSupport.pm | 14 --
 ts-kernel-build|  4 ++--
 ts-xen-build   |  8 
 3 files changed, 18 insertions(+), 8 deletions(-)

diff --git a/Osstest/TestSupport.pm b/Osstest/TestSupport.pm
index c23ac135..5f13eb0b 100644
--- a/Osstest/TestSupport.pm
+++ b/Osstest/TestSupport.pm
@@ -83,7 +83,7 @@ BEGIN {
   get_stashed open_unique_stashfile compress_stashed
   dir_identify_vcs
   build_url_vcs build_clone
-  built_stash built_stash_file
+  built_stash built_stash_file built_stash_debugfile
   built_compress_stashed
   hg_dir_revision git_dir_revision vcs_dir_revision
   store_revision store_vcs_revision
@@ -1445,7 +1445,7 @@ END
 store_runvar("path_$item", $stashleaf);
 }
 
-sub built_stash_file (;$) {
+sub built_stash_debugfile (;$) {
 my ($ho, $builddir, $item, $fname, $optional) = @_;
 my $build= "build";
 my $stashleaf= "$build/$item";
@@ -1458,6 +1458,16 @@ sub built_stash_file (;$) {
"$stash/$stashleaf");
 }
 
+sub built_stash_file (;$) {
+my ($ho, $builddir, $item, $fname, $optional) = @_;
+my $build= "build";
+my $stashleaf= "$build/$item";
+
+built_stash_debugfile($ho, $builddir, $item, $fname, $optional);
+store_runvar("path_$item", $stashleaf);
+}
+
+
 sub built_compress_stashed($) {
 my ($path) = @_;
 compress_stashed("build/$path");
diff --git a/ts-kernel-build b/ts-kernel-build
index 94e67a47..5b87f5a7 100755
--- a/ts-kernel-build
+++ b/ts-kernel-build
@@ -438,9 +438,9 @@ if ($r{tree_linuxfirmware}) {
 fwinstall();
 }
 built_stash($ho, $builddir, 'dist', 'kerndist');
-built_stash_file($ho, $builddir, 'vmlinux', 'linux/vmlinux');
+built_stash_debugfile($ho, $builddir, 'vmlinux', 'linux/vmlinux');
 built_compress_stashed('vmlinux');
-built_stash_file($ho, $builddir, 'config', 'linux/.config');
+built_stash_debugfile($ho, $builddir, 'config', 'linux/.config');
 
 sub enable_xen_config () {
 return <<'END';
diff --git a/ts-xen-build b/ts-xen-build
index 31acb9dd..0152ea05 100755
--- a/ts-xen-build
+++ b/ts-xen-build
@@ -209,10 +209,10 @@ sub stash () {
 "xen/dist/${part}install",
 "${part}dist");
 }
-built_stash_file($ho, $builddir, "xen-syms", "xen/xen/xen-syms", 1);
-built_stash_file($ho, $builddir, "xen-config", "xen/.config", 1);
-built_stash_file($ho, $builddir, "xen-hv-config", "xen/xen/.config", 1);
-built_stash_file($ho, $builddir, "seabios-config",
+built_stash_debugfile($ho, $builddir, "xen-syms", "xen/xen/xen-syms", 1);
+built_stash_debugfile($ho, $builddir, "xen-config", "xen/.config", 1);
+built_stash_debugfile($ho, $builddir, "xen-hv-config", "xen/xen/.config", 
1);
+built_stash_debugfile($ho, $builddir, "seabios-config",
 "xen/tools/firmware/seabios-dir-remote/.config", 1);
 built_compress_stashed("xen-syms");
 }
-- 
2.11.0 (Apple Git-81)


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


[Xen-devel] [PATCH 7/7] osstest: introduce make-freebsd-flight

2017-05-23 Thread Roger Pau Monne
At the moment this flight only contains a build-amd64-freebsd and
build-amd64-freebsd-again jobs, because that's all osstest can do with FreeBSD
now.

This allows testing FreeBSD specific functionality without generating a
fully-fledged flight, that also includes the Linux jobs.

Signed-off-by: Roger Pau Monné 
---
 make-freebsd-flight | 62 +
 1 file changed, 62 insertions(+)
 create mode 100755 make-freebsd-flight

diff --git a/make-freebsd-flight b/make-freebsd-flight
new file mode 100755
index ..f67d0171
--- /dev/null
+++ b/make-freebsd-flight
@@ -0,0 +1,62 @@
+#!/bin/bash
+
+# This is part of "osstest", an automated testing framework for Xen.
+# Copyright (C) 2017 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 .
+
+
+set -e -o posix
+
+branch=$1
+xenbranch=$2
+blessing=$3
+buildflight=$4
+
+flight=`./cs-flight-create $blessing $branch`
+
+. ./cri-common
+. ./ap-common
+. ./mfi-common
+
+arch=amd64
+
+job_create_build_filter_callback () {
+:
+}
+
+job_create_build build-$arch-freebsd build-freebsd   \
+arch=$arch   \
+$RUNVARS $BUILD_RUNVARS $BUILD_FREEBSD_RUNVARS $arch_runvars \
+tree_freebsd=$TREE_FREEBSD   \
+revision_freebsd=$REVISION_FREEBSD
+version=`set_freebsd_build_job_flags $arch`
+
+# Pass new hostflags, now the buildhost must not be shared, since we are
+# testing the newly built image
+job_create_build build-$arch-freebsd-again build-freebsd \
+arch=$arch   \
+$RUNVARS $BUILD_RUNVARS $BUILD_FREEBSD_RUNVARS $arch_runvars \
+host_hostflags=arch-$arch,freebsd-$version,purpose-build \
+tree_freebsd=$TREE_FREEBSD   \
+revision_freebsd=$REVISION_FREEBSD   \
+freebsd_buildjob=build-$arch-freebsd
+
+echo $flight
+
+# Local variables:
+# mode: sh
+# sh-basic-offset: 2
+# indent-tabs-mode: nil
+# End:
-- 
2.11.0 (Apple Git-81)


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


[Xen-devel] [PATCH 4/7] osstest: add a FreeBSD host install recipe

2017-05-23 Thread Roger Pau Monne
The installation is performed using the bsdinstall tool, which is part of the
FreeBSD base system. The installer image is setup with the osstest ssh keys and
sshd enabled by default, which allows the test harness to just ssh into the
box, create the install config file and launch the scripted install.

Currently the installation is done with ZFS only, in stripe mode, and a single
disk.

In order to support the FreeBSD installer a new method is added, that allows
setting the pxe boot of a host using a memdisk. Also, a new tftp path is added
in order to point to the place where the FreeBSD installed images should be
stored.

The install script either picks the binary images from the output of a previous
FreeBSD buildjob (yet to be introduced), or from the freebsd_image and
freebsd_sets runvars, that should point to a FreeBSD installer image and to the
folder that contain the install sets respectively.

When relying on the output from a previous FreeBSD buildjob (freebsd_buildjob
runvar is set), the install image is picked from the path_freebsd-image runvar,
and the sets from path_freebsd-{base,kernel,manifest} of the previous job.

Signed-off-by: Roger Pau Monné 
---
 Osstest.pm  |   1 +
 Osstest/TestSupport.pm  |  18 +++-
 ts-freebsd-host-install | 259 
 3 files changed, 276 insertions(+), 2 deletions(-)
 create mode 100755 ts-freebsd-host-install

diff --git a/Osstest.pm b/Osstest.pm
index a78728cd..a0c0339c 100644
--- a/Osstest.pm
+++ b/Osstest.pm
@@ -227,6 +227,7 @@ sub readglobalconfig () {
 $c{TftpTmpDir} ||= "$c{TftpPlayDir}tmp/";
 
 $c{TftpDiBase} ||= "$c{TftpPlayDir}debian-installer";
+$c{TftpFreeBSDBase} ||= "$c{TftpPlayDir}freebsd-installer";
 $c{TftpDiVersion} ||= $c{ "TftpDiVersion_$c{DebianSuite}" } // 'current';
 
 $c{TftpGrubBase} ||= "$c{TftpPlayDir}grub";
diff --git a/Osstest/TestSupport.pm b/Osstest/TestSupport.pm
index 8c7078c5..4418f024 100644
--- a/Osstest/TestSupport.pm
+++ b/Osstest/TestSupport.pm
@@ -118,7 +118,7 @@ BEGIN {
   await_webspace_fetch_byleaf create_webfile
   file_link_contents get_timeout
   setup_netboot_di setup_netboot_local host_netboot_file
- subst_netboot_template
+  subst_netboot_template setup_netboot_memdisk
 
   ether_prefix
 
@@ -1032,7 +1032,7 @@ sub selecthost ($) {
 $ho->{Tftp} = { };
 $ho->{Tftp}{$_} = $c{"Tftp${_}_${tftpscope}"} || $c{"Tftp${_}"}
 foreach qw(Path TmpDir PxeDir NetbootGroup PxeTemplates 
PxeTemplatesReal
-   DiBase GrubBase
+   DiBase GrubBase FreeBSDBase
NetGrubDir NetGrubTemplates NetGrubTemplatesReal
PxeGroup);
 $ho->{TftpNetbootGroup} //= $ho->{TftpPxeGroup}; # compatibility
@@ -2553,6 +2553,20 @@ default local
 END
 }
 
+sub setup_netboot_memdisk ($$) {
+my ($ho, $img) = @_;
+setup_netboot_bootcfg($ho, .
+
+use strict qw(vars);
+use DBI;
+use POSIX;
+
+unshift @INC, qw(.);
+use Osstest;
+use Osstest::TestSupport;
+
+tsreadconfig();
+
+our %xopts;
+
+our ($whhost) = @ARGV;
+$whhost ||= 'host';
+our $ho= selecthost($whhost);
+exit 0 if $ho->{Flags}{'no-reinstall'};
+exit 0 if $ho->{SharedReady};
+
+our %timeout= qw(Sshd 1000);
+
+our @sets = qw(base.txz kernel.txz);
+
+our $image = $r{"freebsd_image"} ||
+ get_stashed("path_freebsd-image", $r{"freebsd_buildjob"});
+
+sub get_sets_path () {
+my @paths;
+
+foreach (@sets, "MANIFEST") {
+my $path;
+
+if (!defined($r{"freebsd_sets"})) {
+# Get everything before the "." (ie: get base from base.txz)
+my $stash_name = lc((split /\./)[0]);
+$path = get_stashed("path_freebsd-$stash_name",
+$r{"freebsd_buildjob"});
+} else {
+$path = $r{"freebsd_sets"} . "/$_";
+}
+
+push @paths, { name => "$_", path => "$path" };
+}
+
+return @paths;
+}
+
+sub create_ssh_overlay () {
+my $url = create_webfile($ho, "ssh.tar", sub {
+my ($fh) = @_;
+contents_make_cpio($fh, 'ustar',  "$c{OverlayLocal}/etc/ssh/");
+});
+
+return $url;
+}
+
+sub setup_netboot_installer () {
+my $pxeimg = "$ho->{Tftp}{FreeBSDBase}/install-$ho->{Name}.img";
+my $script = <{Tftp}{Path}/$ho->{Tftp}{FreeBSDBase}/
+hash=`sha256sum $image|head -c 64`
+localpath="$r{arch}/\$hash/install.img";
+mkdir -p \$basedir
+(
+flock -x -w 600 200
+cd \$basedir
+if [ ! -f \$localpath ]; then
+mkdir -p `dirname \$localpath`
+cp $image \$localpath
+fi
+rm -f install-$ho->{Name}.img
+ln \$localpath install-$ho->{Name}.img
+for hash in `ls $r{arch}/`; do
+count=`stat -c %h $r{arch}/\$hash/install.img`
+if [ \$count -eq 1 ]; then
+rm -rf $r{arch}/\$hash
+fi
+done
+) 200<\$basedir
+END
+
+logm("Executing:\n$script");
+

[Xen-devel] [PATCH 0/7] osstest: initial FreeBSD support

2017-05-23 Thread Roger Pau Monne
Hello,

This series introduces initial FreeBSD host support to osstest. The current
series allow installing a bare-metal host with FreeBSD and building FreeBSD on
it in order to generate new install media that can be fed into the installer
script.

This is still very limited, since no Xen testing is done on those hosts,
however it sets the base to add a Xen build test for FreeBSD.

Note that it should be quite easy to add more steps to the build script so that
FreeBSD VM images are also generated, that could be used by osstest.

I've tried to add a detailed commit log at each relevant patch, so not much
more to add here in the cover letter.

The series can also be found on my git repo:

git://xenbits.xen.org/people/royger/osstest.git freebsd_v1

Thanks, Roger.


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


[Xen-devel] [PATCH 6/7] osstest: add a FreeBSD build to flights

2017-05-23 Thread Roger Pau Monne
This requires changes in several places in order to accommodate the FreeBSD
build, which although it's a build job, it doesn't have the same set of
dependencies as the current builds.

First, a new build recipe is added to sg-run-job, and accordingly sg-run-job is
also made aware about the differences between a Linux and a FreeBSD build job.
A Linux build job requires ts-host-allocate + ts-host-install-twice +
ts-xen-build-prep, while a FreeBSD build job requires ts-host-allocate +
ts-freebsd-host-install.

All the current build jobs are kept to use the Linux build recipe, while the
newly added build-freebsd is using the new FreeBSD recipe.

cri-getconfig is also modified to introduce two new helpers, used to fetch a
runvar and a stashed file from a specific job. This is needed by the FreeBSD
build job creator in order to fetch information from a previous buildjob (so
the output from a previous buildjob can be used as input to a new buildjob).

Finally, the logic to create a FreeBSD build job is added to mfi-common. This
includes creating a FreeBSD build job, and also testing the output of that
build job (by creating another build job that depends on the output of the
first).

Note that the FreeBSD build job needs some input in order to setup a FreeBSD
host, and that can be fetched from different places:

1. Env variable FREEBSD_BUILDJOB: use the output from a previous
build--freebsd.

2. Env variables FREEBSD_IMAGE, FREEBSD_SETS, FREEBSD_VERSION: set before
calling into make-flight, provide the installer image, the sets to install and
the version being installed.

3. Config file FreeBSDImage, FreeBSDSets and FreeBSDVersion: same as 2. except
that they are set on the config file.

Signed-off-by: Roger Pau Monné 
---
 ap-common |  4 
 cri-getconfig | 37 
 mfi-common| 68 +++
 sg-run-job| 39 +++---
 4 files changed, 136 insertions(+), 12 deletions(-)

diff --git a/ap-common b/ap-common
index cbb815ce..d4fa7aef 100644
--- a/ap-common
+++ b/ap-common
@@ -37,6 +37,10 @@
 : ${PUSH_TREE_XTF:=$XENBITS:/home/xen/git/xtf.git}
 : ${BASE_TREE_XTF:=git://xenbits.xen.org/xtf.git}
 
+: ${TREE_FREEBSD:=git://github.com/freebsd/freebsd.git}
+: ${PUSH_TREE_FREEBSD:=$XENBITS:/home/xen/git/freebsd.git}
+: ${BASE_TREE_FREEBSD:=git://xenbits.xen.org/freebsd.git}
+
 : ${TREE_LIBVIRT:=git://libvirt.org/libvirt.git}
 : ${PUSH_TREE_LIBVIRT:=$XENBITS:/home/xen/git/libvirt.git}
 : ${BASE_TREE_LIBVIRT:=git://xenbits.xen.org/libvirt.git}
diff --git a/cri-getconfig b/cri-getconfig
index b2c91ac7..b7f7ae0c 100644
--- a/cri-getconfig
+++ b/cri-getconfig
@@ -25,6 +25,43 @@ getconfig () {
 '
 }
 
+# Get the path to a stashed file from another job.
+#
+# $1: current flight
+# $2: current job
+# $3: name of the stashed file
+# $4: flight (optional) and job where to fetch the stashed file from
+# (in $flight.$job format or $job).
+getstashed() {
+   perl -e '
+   use Osstest;
+   use Osstest::TestSupport;
+   csreadconfig();
+   $flight = "'$1'";
+   $job = "'$2'";
+   print get_stashed("'$3'", "'$4'") or die $!;
+   '
+}
+
+# Get a runvar from another job.
+#
+# $1: current flight
+# $2: current job
+# $3: name of the runvar
+# $4: flight (optional) and job where to fetch the runvar from
+# (in $flight.$job format or $job).
+
+getrunvar() {
+   perl -e '
+   use Osstest;
+   use Osstest::TestSupport;
+   csreadconfig();
+   $flight = "'$1'";
+   $job = "'$2'";
+   print get_runvar("'$3'", "'$4'") or die $!;
+   '
+}
+
 getconfig_TftpDiVersion_suite () {
perl -e '
use Osstest;
diff --git a/mfi-common b/mfi-common
index ec31e2ef..0f85e90a 100644
--- a/mfi-common
+++ b/mfi-common
@@ -96,6 +96,54 @@ set_hostos_runvars () {
   esac
 }
 
+set_freebsd_build_job_flags () {
+arch=$1
+job="build-$arch-freebsd"
+
+# Figure out where are the installer binaries. The order is the following:
+#
+# 1. Env variable FREEBSD_BUILDJOB: use the output from a previous
+# build--freebsd.
+#
+# 2. Env variables FREEBSD_IMAGE, FREEBSD_SETS, FREEBSD_VERSION: set
+# before calling into make-flight, provide the installer image, the sets
+# to install and the version being installed.
+#
+# 3. Config file FreeBSDImage, FreeBSDSets and FreeBSDVersion: same as 2.
+# except that they are set on the config file.
+#
+# This is slightly convoluted because in order to fetch a runvar or stashed
+# file osstest needs a current flight and job, so the FreeBSD build flight
+# is created with missing runvars, then this newly created job is used to
+# fetch runvars from other jobs if needed, and finally the missing runvars
+# in the newly created flight are set using cs-adjust-flight.
+

[Xen-devel] [PATCH 2/7] osstest: move known_hosts generation to TestSupport

2017-05-23 Thread Roger Pau Monne
This is equivalent to the already existing authorized_keys function, and
generates the contents of the known_hosts file that should be installed on
targets.

Signed-off-by: Roger Pau Monné 
---
 Osstest/Debian.pm  | 36 +---
 Osstest/TestSupport.pm | 41 -
 2 files changed, 41 insertions(+), 36 deletions(-)

diff --git a/Osstest/Debian.pm b/Osstest/Debian.pm
index 8ba48bfa..87539822 100644
--- a/Osstest/Debian.pm
+++ b/Osstest/Debian.pm
@@ -709,41 +709,7 @@ sub preseed_ssh ($$) {
 my ($ho,$sfx) = @_;
 
 my $authkeys_url= create_webfile($ho, "authkeys$sfx", authorized_keys());
-
-my $hostkeyfile= "$c{OverlayLocal}/etc/ssh/ssh_host_rsa_key.pub";
-my $hostkey= get_filecontents($hostkeyfile);
-chomp($hostkey); $hostkey.="\n";
-my $knownhosts= '';
-
-my $hostsq= $dbh_tests->prepare(fetchrow_array()) {
-my $defaultfqdn = $node;
-$defaultfqdn .= ".$c{TestHostDomain}" unless $defaultfqdn =~ m/\./;
-
-my %props;
-$mhostdb->get_properties($node, \%props);
-
-my $longname= $props{Fqdn} // $defaultfqdn;
-my (@hostent)= gethostbyname($longname);
-if (!@hostent) {
-logm("skipping host key for nonexistent host $longname");
-next;
-}
-my $specs= join ',', $longname, $node, map {
-join '.', unpack 'W4', $_;
-} @hostent[4..$#hostent];
-logm("adding host key for $specs");
-$knownhosts.= "$specs ".$hostkey;
-}
-$hostsq->finish();
-
-$knownhosts.= "localhost,127.0.0.1 ".$hostkey;
-my $knownhosts_url= create_webfile($ho, "known_hosts$sfx", $knownhosts);
+my $knownhosts_url= create_webfile($ho, "known_hosts$sfx", known_hosts());
 
 preseed_hook_command($ho, 'late_command', $sfx, fetchrow_array()) {
+my $defaultfqdn = $node;
+$defaultfqdn .= ".$c{TestHostDomain}" unless $defaultfqdn =~ m/\./;
+
+my %props;
+$mhostdb->get_properties($node, \%props);
+
+my $longname= $props{Fqdn} // $defaultfqdn;
+my (@hostent)= gethostbyname($longname);
+if (!@hostent) {
+logm("skipping host key for nonexistent host $longname");
+next;
+}
+my $specs= join ',', $longname, $node, map {
+join '.', unpack 'W4', $_;
+} @hostent[4..$#hostent];
+logm("adding host key for $specs");
+$knownhosts.= "$specs ".$hostkey;
+}
+$hostsq->finish();
+
+$knownhosts.= "localhost,127.0.0.1 ".$hostkey;
+
+return $knownhosts;
+}
+
 sub cfg_tftp_di_version ($) {
 my ($suite) = @_;
 $suite //= 'x def suite'; # will not find $c{...}
-- 
2.11.0 (Apple Git-81)


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


Re: [Xen-devel] [PATCH] XenBus: Don't wait for producer to fill the ring if the ring

2017-05-23 Thread Ian Jackson
Jan Beulich writes ("Re: [Xen-devel] [PATCH] XenBus: Don't wait for producer to 
fill the ring if the ring"):
> On 23.05.17 at 14:42,  wrote:
> > Thanks, and sorry to tetch.

[ much deleted because I really don't see much point me me arguing
  this further ]

> While I can vaguely guess what you mean here, would you mind
> helping out with neither me nor my dictionary knowing the word
> "tetch"?

`To tetch' is the verb from `tetchy', which means something like
`irritable'.

Ian.

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


Re: [Xen-devel] [PATCH v2 for-4.9] x86/mm: Fix incorrect unmapping of 2MB and 1GB pages

2017-05-23 Thread Boris Ostrovsky
On 05/23/2017 09:17 AM, Jan Beulich wrote:
 On 23.05.17 at 15:00,  wrote:
>> (d1) Testing HVM environment:
>> (XEN) d1v0 Triple fault - invoking HVM shutdown action 1
>> (XEN) *** Dumping Dom1 vcpu#0 state: ***
>> (XEN) [ Xen-4.9-rc  x86_64  debug=y   Tainted:  C   ]
>> (XEN) CPU:11
>> (XEN) RIP:0018:[<0010815c>]
>> (XEN) RFLAGS: 0086   CONTEXT: hvm guest (d1v0)
>> (XEN) rax: 8011   rbx: 0017c000   rcx: 3000
>> (XEN) rdx: ffef   rsi:    rdi: 
>> (XEN) rbp: 00136478   rsp: 00136478   r8:  
>> (XEN) r9:     r10:    r11: 
>> (XEN) r12:    r13:    r14: 
>> (XEN) r15:    cr0: 8011   cr4: 
>> (XEN) cr3: 0080   cr2: 0010815c
>> (XEN) ds: 0020   es: 0020   fs: 0020   gs: 0020   ss: 0020   cs: 0018
>>
>>
>> 0x10815c is tools/firmware/hvmloader/tests.c:start_paging(), the 'jmp'
>> after we enable paging (load cr0 with bit 31 set).
> Odd. Suggests page tables are completely screwed.
>
>> root@ovs101> xl create -c ~/virt/pvh.conf
>> Parsing config from /root/virt/pvh.conf
>> libxl: notice: libxl_numa.c:518:libxl__get_numa_candidate: NUMA
>> placement failed, performance might be affected
>> S3 disabled
>> S4 disabled
>> CONV disabled
>> xc: error: panic: xc_dom_boot.c:178: xc_dom_boot_domU_map: failed to
>> mmap domU pages 0x1000+0x1062 [mmap, errno=22 (Invalid argument)]:
>> Internal error
> This is even more strange. I can't seem to make a connection to
> the changes in said commit at all. And I did go through p2m-pt.c's
> relevant code another time this morning, without spotting any
> possible oversight by Igor. IOW I'm now really curious what it is
> that I'm not seeing (and that's apparently NPT-specific).

And you haven't been able to reproduce this? I see this fail on two AMD
systems (different processor families).

What's interesting (I just noticed this) is that while PVH fails in the
same manner, HVM crashes differently. The second crash is

(d11) xen: copy e820...
(XEN) d11v0 Triple fault - invoking HVM shutdown action 1
(XEN) *** Dumping Dom11 vcpu#0 state: ***
(XEN) [ Xen-4.9-rc  x86_64  debug=n   Tainted:  C   ]
(XEN) CPU:0
(XEN) RIP:0008:[<000da54c>]
(XEN) RFLAGS: 0093   CONTEXT: hvm guest (d11v0)
(XEN) rax: 8ee08e90   rbx: 8ee08ec0   rcx: 
(XEN) rdx: 6f74   rsi: 9ea91ce8   rdi: 
(XEN) rbp: 6fd8   rsp: 6f64   r8:  
(XEN) r9:     r10:    r11: 
(XEN) r12:    r13:    r14: 
(XEN) r15:    cr0: 0011   cr4: 
(XEN) cr3:    cr2: 
(XEN) ds: 0010   es: 0010   fs: 0010   gs: 0010   ss: 0010   cs: 0008


so paging is off and it dies not in hvmloader.

And this:

diff --git a/xen/arch/x86/mm/p2m.c b/xen/arch/x86/mm/p2m.c
index c6ec1a4..0051623 100644
--- a/xen/arch/x86/mm/p2m.c
+++ b/xen/arch/x86/mm/p2m.c
@@ -560,7 +560,7 @@ int p2m_set_entry(struct p2m_domain *p2m, unsigned
long gfn, mfn_t mfn,
 {
 if ( hap_enabled(d) )
 {
-unsigned long fn_mask = !mfn_eq(mfn, INVALID_MFN) ?
+unsigned long fn_mask = (!mfn_eq(mfn, INVALID_MFN) || 1)?
  (gfn | mfn_x(mfn) | todo) : (gfn |
todo);
 
 order = (!(fn_mask & ((1ul << PAGE_ORDER_1G) - 1)) &&


makes the problem go away.

-boris

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


Re: [Xen-devel] Emulation of xen ARM on qemux86_64

2017-05-23 Thread Julien Grall



On 23/05/17 14:35, Iurii Mykhalskyi wrote:

Hi Pranay,

As I say in my previous e-mail:

"I'm not familiar with QEMU, but  in general case - you can't just take
image (for example RCAR-H3) and run it inside QEMU - a some things might
be different - uart, gic, timer, etc.
And i'm not sure about support of HW virtualization on QEMU - looks like
your are asking about emulation ARM HW virtualization on X86_64 platform."

I don't think that it is possible to emulate ARM HW virtualization on
x86_64 platform via QEMU.

So - in my opinion -  layers such as you are asking doesn't existing for
QEMU.

According to [1] looks like ARM Ltd provides emulator, called ARMv8
Foundation Model  - that is supports Xen [2].
But I never used it and looks like its not free and has some limited
trial period.


The Foundation Model (search for the name in the web page) is a free model.

Cheers,

--
Julien Grall

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


Re: [Xen-devel] Emulation of xen ARM on qemux86_64

2017-05-23 Thread Iurii Mykhalskyi
Hi Pranay,

As I say in my previous e-mail:

"I'm not familiar with QEMU, but  in general case - you can't just take
image (for example RCAR-H3) and run it inside QEMU - a some things might be
different - uart, gic, timer, etc.
And i'm not sure about support of HW virtualization on QEMU - looks like
your are asking about emulation ARM HW virtualization on X86_64 platform."

I don't think that it is possible to emulate ARM HW virtualization on
x86_64 platform via QEMU.

So - in my opinion -  layers such as you are asking doesn't existing for
QEMU.

According to [1] looks like ARM Ltd provides emulator, called ARMv8
Foundation Model  - that is supports Xen [2].
But I never used it and looks like its not free and has some limited trial
period.

[1] https://wiki.xenproject.org/wiki/Xen_ARM_with_Virtualization_Extensions
[2] https://developer.arm.com/products/system-design/fixed-virtual-platforms

With the best regards,
Iurii

On Tue, May 23, 2017 at 4:17 PM, pranay kukreti 
wrote:

>
>
>
> Hi,
> Thank you for the quick response.
> What I wanted to know is that if there is any yocto layer support for
> XEN-ARM on QEMU machine, which could be used for testing purposes. Like for
> RCAR there is a [1] Meta-platform-xen layer which provides support for
> RCAR. Same way, is there a layer which can be used for QEMU?
> [1] https://github.com/qbeeukraine/meta-platform-xen
> regards,
> Pranay Kukreti
> VIT university, Vellore.
>
>
> On Monday, 22 May 2017, 22:55, Iurii Mykhalskyi <
> iurii.mykhals...@globallogic.com> wrote:
>
>
> Hi Pranay,
>
> I'm not familiar with QEMU, but  in general case - you can't just take
> image (for example RCAR-H3) and run it inside QEMU - a some things might be
> different - uart, gic, timer, etc.
> And i'm not sure about support of HW virtualization on QEMU - looks like
> your are asking about emulation ARM HW virtualization on X86_64 platform.
>
> If you want to play with virtualization, try to get some widely available
> board - Allwinner based or some OMAP4/5 based boards, etc [1]
>
> For debug purposes we are mostly using printk  and sometimes blinking LEDS
> :)
>
> With the best regards,
> Iurii
>
> [1] https://wiki.xenproject.org/wiki/Xen_ARM_with_
> Virtualization_Extensions
>
>
> On Mon, May 22, 2017 at 8:08 PM, Iurii Konovalenko  globallogic.com> wrote:
>
> + Iurii Mykhalkyi
>
> Best regards.
>
> Iurii Konovalenko | Associate Manager, Engineering
> GlobalLogic
> P +3.8044.492 ext. 4704 M +38.099.932.2909
> S yufuntik
> www.globallogic.com
> http://www.globallogic.com/ email_disclaimer.txt
> 
>
> On Mon, May 22, 2017 at 8:38 AM, pranay kukreti 
> wrote:
>
> Hi,
>
>
> I am new to xen-arm development on yocto-project. Right now i don't have
> the hardware, but i was able to create an image of xen-arm for RCAR-H3. I
> wanted to see how xen-arm works, so was wondering if xen-arm can be
> implemented to be used with a qemu machine. If so please let me know where
> can i find the resources. Also which debugger would you recommend to be
> used with the RCAR-H3.
> It would be really kind of you if you could solve my queries.
> Thanks,
> Pranay Kukreti
> VIT University, Vellore.
>
>
>
>
>
>
> --
>
> Iurii Mykhalskyi | Lead Software Engineer
> GlobalLogic
> P +38.044.492.9695x3664  M +38.096.311.5467 <+380%2096%20311%205467>  S
> mad-nemoi
> www.globallogic.com
> 
> http://www.globallogic.com/email_disclaimer.txt
>
>
>


-- 

Iurii Mykhalskyi | Lead Software Engineer
GlobalLogic
P +38.044.492.9695x3664  M +38.096.311.5467  S mad-nemoi
www.globallogic.com

http://www.globallogic.com/email_disclaimer.txt
___
Xen-devel mailing list
Xen-devel@lists.xen.org
https://lists.xen.org/xen-devel


Re: [Xen-devel] passthrough

2017-05-23 Thread Julien Grall

Hello,

On 23/05/17 14:18, Jan Beulich wrote:

On 23.05.17 at 14:53,  wrote:

Thanks for the reply. we are using renesas rcar h3 board. Does it supports?


A general rule is to provide as much as details on your mail so we can 
provide the best feedback.


In this case, I don't fully understand what you want to passthrough. Are 
those UARTs part of PCI device or integrated device?


The work for PCI passthrough is still on-going. For integrated device, 
you may want to look at [1].


Cheers,

[1] https://events.linuxfoundation.org/sites/events/files/slides/talk_5.pdf

--
Julien Grall

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


Re: [Xen-devel] [OSSTEST PATCH 01/24] README: Advise using `play' for playground flights

2017-05-23 Thread Roger Pau Monné
On Thu, May 18, 2017 at 12:01:11PM +0100, Ian Jackson wrote:
> Any flight eventually blessed `adhoc' is supposed to contain, in the
> db, accurate information corresponding to a real clean run.  This is
> not appropriate for playing about.
> 
> Using `play' usefully disables a number of safety catches, including
> one which prevents post-startup flight modification.
> 
> Signed-off-by: Ian Jackson 

Acked-by: Roger Pau Monné 


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


Re: [Xen-devel] [OSSTEST PATCH 06/24] cs-hosts-list: New utility

2017-05-23 Thread Roger Pau Monné
On Thu, May 18, 2017 at 12:01:16PM +0100, Ian Jackson wrote:
> No callers yet.
> 
> Signed-off-by: Ian Jackson 
> ---
>  cs-hosts-list | 64 
> +++
>  1 file changed, 64 insertions(+)
>  create mode 100755 cs-hosts-list
> 
> diff --git a/cs-hosts-list b/cs-hosts-list
> new file mode 100755
> index 000..1fea3cd
> --- /dev/null
> +++ b/cs-hosts-list
> @@ -0,0 +1,64 @@
> +#!/usr/bin/perl -w
> +
> +# This is part of "osstest", an automated testing framework for Xen.
> +# Copyright (C) 2009-2013 Citrix Inc.
^ 2017?
> +# 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:
> +#   ./cs-hosts-list HOSTFLAG[,...]
> +# prints the names of all hosts which have all of the HOSTFLAGs set,
> +# one per line
> +
> +use strict qw(vars);
> +use DBI;
> +unshift @INC, qw(.);
> +use Osstest;
> +
> +csreadconfig();
> +
> +@ARGV == 1 or die $!;
> +my ($flags) = @ARGV;
> +$flags =~ m/^-/ and die $!;
> +
> +my @qargs;
> +my $qtxt= < +SELECT resname
> +  FROM resources
> + WHERE restype='host'
> +END
> +foreach my $flag (grep { length} split /\,/, $flags) {
> +$qtxt.= < +AND EXISTS (SELECT 1 FROM HOSTFLAGS f
> +WHERE resname=f.hostname
> +  AND f.hostflag=?)

There seems to be a mix between hard tabs and spaces above.

> +END
> +push @qargs, $flag;
> +}
> +
> +my $q= $dbh_tests->prepare($qtxt);
> +my $o;
> +
> +db_retry($dbh_tests,[],sub {
> +$o='';
> +$q->execute(@qargs);
> +while (my ($host) = $q->fetchrow_array()) {
> + $o .= $host;
> + $o .= "\n";
> +}
> +});
> +
> +print $o or die $!;
> +close STDOUT or die $!;

Don't know that much about osstest DB (or DB's in general), but I don't see
anything obviously wrong:

Acked-by: Roger Pau Monné 



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


Re: [Xen-devel] passthrough

2017-05-23 Thread Jan Beulich
>>> On 23.05.17 at 14:53,  wrote:
> Thanks for the reply. we are using renesas rcar h3 board. Does it supports?

I have no idea, I'm an x86 person.

Also please don't top-post.

Jan

> On Tuesday, May 23, 2017, Jan Beulich  wrote:
> 
>> >>> On 23.05.17 at 11:38, >
>> wrote:
>> > Is it possible to give each channels of uart to different guests via pass
>> > through mechanism?
>>
>> If each channel is represented by a separate PCI device/function,
>> then likely yes. If they're all one PCI device, or not a PCI device
>> at all, then you may be able to hand them through (by allowing
>> each guest to access the respective port numbers or MMIO space),
>> but an IOMMU in the system could not be leveraged to make this
>> half way secure.
>>
>> Jan
>>
>>




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


Re: [Xen-devel] [OSSTEST PATCH 05/24] tcmd: Work around ssh bug with `ssh host ""'

2017-05-23 Thread Roger Pau Monné
On Thu, May 18, 2017 at 12:01:15PM +0100, Ian Jackson wrote:
> This runs an interactive shell session on the host, rathern than
> running `sh -c ""' on it.
> 
> Evidently ssh checks for the presence of a command line specification
> after (foolishly, but now historically unavoidably) concatenating all
> the command line arguments with spaces in between.
> 
> Turn  ssh host ""  into  ssh host " "  which is the expected no-op.
>
> Signed-off-by: Ian Jackson 

SoB doesn't match "From:", apart from that:

Acked-by: Roger Pau Monné 


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


Re: [Xen-devel] [PATCH v2 for-4.9] x86/mm: Fix incorrect unmapping of 2MB and 1GB pages

2017-05-23 Thread Jan Beulich
>>> On 23.05.17 at 15:00,  wrote:
> (d1) Testing HVM environment:
> (XEN) d1v0 Triple fault - invoking HVM shutdown action 1
> (XEN) *** Dumping Dom1 vcpu#0 state: ***
> (XEN) [ Xen-4.9-rc  x86_64  debug=y   Tainted:  C   ]
> (XEN) CPU:11
> (XEN) RIP:0018:[<0010815c>]
> (XEN) RFLAGS: 0086   CONTEXT: hvm guest (d1v0)
> (XEN) rax: 8011   rbx: 0017c000   rcx: 3000
> (XEN) rdx: ffef   rsi:    rdi: 
> (XEN) rbp: 00136478   rsp: 00136478   r8:  
> (XEN) r9:     r10:    r11: 
> (XEN) r12:    r13:    r14: 
> (XEN) r15:    cr0: 8011   cr4: 
> (XEN) cr3: 0080   cr2: 0010815c
> (XEN) ds: 0020   es: 0020   fs: 0020   gs: 0020   ss: 0020   cs: 0018
> 
> 
> 0x10815c is tools/firmware/hvmloader/tests.c:start_paging(), the 'jmp'
> after we enable paging (load cr0 with bit 31 set).

Odd. Suggests page tables are completely screwed.

> root@ovs101> xl create -c ~/virt/pvh.conf
> Parsing config from /root/virt/pvh.conf
> libxl: notice: libxl_numa.c:518:libxl__get_numa_candidate: NUMA
> placement failed, performance might be affected
> S3 disabled
> S4 disabled
> CONV disabled
> xc: error: panic: xc_dom_boot.c:178: xc_dom_boot_domU_map: failed to
> mmap domU pages 0x1000+0x1062 [mmap, errno=22 (Invalid argument)]:
> Internal error

This is even more strange. I can't seem to make a connection to
the changes in said commit at all. And I did go through p2m-pt.c's
relevant code another time this morning, without spotting any
possible oversight by Igor. IOW I'm now really curious what it is
that I'm not seeing (and that's apparently NPT-specific).

Jan


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


Re: [Xen-devel] [PATCH] XenBus: Don't wait for producer to fill the ring if the ring

2017-05-23 Thread Jan Beulich
>>> On 23.05.17 at 14:42,  wrote:
> Jan Beulich writes ("Re: [Xen-devel] [PATCH] XenBus: Don't wait for producer 
> to fill the ring if the ring"):
>> On 17.05.17 at 16:57,  wrote:
>> > --- a/tools/firmware/hvmloader/xenbus.c
>> > +++ b/tools/firmware/hvmloader/xenbus.c
>> > @@ -141,7 +141,18 @@ static void ring_read(char *data, uint32_t len)
>> >  /* Don't overrun the producer pointer */
>> >  while ( (part = MASK_XENSTORE_IDX(rings->rsp_prod -
>> >rings->rsp_cons)) == 0 )
>> > +{
>> > +/* don't wait for producer to fill the ring if it is already 
>> > full.
>> > + * Condition happens when you write string > 1K into the ring.
>> > + * eg case prod=1272 cons=248.
>> > + */
>> 
>> Comment style.
> 
> What specifically are you complaining about here ?
> 
> If you're talking about the fact that the opening /* is on the same
> line as the first line of text, observe that the rest of
> hvmloader/xenbus.c has most multi-line comments in these styles:
> 
>  /* If the backend reads the state while we're erasing it then the
>   * ring state will become corrupted, preventing guest frontends from
>   * connecting. This is rare. To help diagnose the failure, we fill
>   * the ring with XS_INVALID packets. */
> 
>  /* Read a xenstore key.  Returns a nul-terminated string (even if the XS
>   * data wasn't nul-terminated) or NULL.  The returned string is in a
>   * static buffer, so only valid until the next xenstore/xenbus operation.
>   * If @default_resp is specified, it is returned in preference to a NULL or
>   * empty string received from xenstore.
>   */
> 
> The only exceptions are the copyright notice and the local variables
> block.
> 
> So if this is what you are complaining about, I think this is
> unhelpful nit-picking, given the state of rest of the hvmloader source
> code.  It obviously doesn't really matter whether /* and */ are on a
> line by themselves.
> 
> At the very least, if you're going to insist on some particular style,
> you could:
> 
>  * acknowledge that the existing style is not always consistent
>and that therefore the submitter couldn't necessarily be expected
>to get this "right" (whatever that means) without help
> 
>  * clearly state what your problem is and which style is to be
>used (instead of the obvious candidate which is the style
>of the surrounding code) rather than just writing `comment style'

I admit that in the given case I didn't go look in what state the file
as a whole is. Yet while indeed I _could_ do better with my
comment, I even more so think that submitters _could_ do better
by not introducing obvious style violations. The more I as a
reviewer see such, the more I'm inclined to use very terse
comments. I realize this may occasionally be unfair, as the
particular contributor may not have had much other history. But
please do realize that with the amount of patches these days
being _far_ beyond what I can reasonably review (and apparently
others too, or I'd have seen quite a few more reviews recently), it
doesn't look very reasonable for me to always go and write
extended explanations of what's wrong (and no, I don't fancy
simply skipping such cosmetic items - when they're really easy to
correct I sometimes offer fixing them while committing). I try to do
so when I recognize newcomers.

> Or maybe you are talking about the lack of a capital d in "don't" ?
> I agree that a capital letter would be better.  But I think "comment
> style" is quite an opaque way of making that observation.

And indeed I've given the comment because of both of the issues
you name.

> Thanks, and sorry to tetch.

While I can vaguely guess what you mean here, would you mind
helping out with neither me nor my dictionary knowing the word
"tetch"?

Jan


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


Re: [Xen-devel] [OSSTEST PATCH 1/3] host examination: Actually permanently save the logs

2017-05-23 Thread Roger Pau Monné
On Mon, May 22, 2017 at 04:45:20PM +0100, Ian Jackson wrote:
> Due to an oversight, this was not plumbed into sg-run-job.
> 
> Signed-off-by: Ian Jackson 

Acked-by: Roger Pau Monné 

Roger.

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


Re: [Xen-devel] [OSSTEST PATCH 2/3] ap-common: Switch to Linux 4.9 by default

2017-05-23 Thread Roger Pau Monné
On Mon, May 22, 2017 at 04:45:21PM +0100, Ian Jackson wrote:
> I ran a special report[1] to see what to expect and:
> 
>Tests which did not succeed and are blocking,
>including tests which could not be run:
> test-amd64-i386-xl-qemuu-win7-amd64 15 guest-localmigrate/x10 fail REGR.
> test-amd64-i386-xl-qemut-win7-amd64 15 guest-localmigrate/x10 fail REGR.
> 
> These Windows 7 migration tests have been failing on many branches and
> don't look like they are something to do with the version of Linux
> used in dom0.
> 
> Accordingly I intend to push this change to switch osstest to using
> Linux 4.9 by default.  ARM tests are not affected at this time.
> 
> [1] ./sg-report-flight --that-linux=b65f2f457c49b2cfd7967c34b7a0b04c25587f13 
> --this-linux=f5eea276d8de10a32e68721707ae8f2fdfaa0960 
> --branches-also=linux-3.14,linux-arm-xen 109662 |less
> 
> CC: Boris Ostrovsky 
> CC: Juergen Gross 
> CC: Stefano Stabellini 
> CC: Wei Liu 
> CC: Konrad Rzeszutek Wilk 
> CC: Roger Pau Monné 
> Signed-off-by: Ian Jackson 

Yes please:

Acked-by: Roger Pau Monné 


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


Re: [Xen-devel] [PATCH v2 for-4.9] x86/mm: Fix incorrect unmapping of 2MB and 1GB pages

2017-05-23 Thread Boris Ostrovsky
On 05/23/2017 04:07 AM, Jan Beulich wrote:
 On 22.05.17 at 20:01,  wrote:
>> On 05/10/2017 07:13 AM, Igor Druzhinin wrote:
>>> The same set of functions is used to set as well as to clean
>>> P2M entries, except that for clean operations INVALID_MFN (~0UL)
>>> is passed as a parameter. Unfortunately, when calculating an
>>> appropriate target order for a particular mapping INVALID_MFN
>>> is not taken into account which leads to 4K page target order
>>> being set each time even for 2MB and 1GB mappings. This eventually
>>> breaks down an EPT structure irreversibly into 4K mappings which
>>> prevents consecutive high order mappings to this area.
>>>
>>> Signed-off-by: Igor Druzhinin 
>> This patch breaks HVM/PVH on AMD when maxmem > memory.
> To be honest, a little more detail might help addressing the issue
> in a timely manner. I'd suppose you know more than just "breaks"
> ...

Uhm.. yes, this was somewhat lacking in details, sorry. I poked a bit at
this yesterday but haven't found anything obvious yet.

So with HVM:

builder = "hvm"
name = "fedora"
memory=1024
maxmem=2048
vcpus = 2
vif=['mac=00:21:F6:00:01:DC,bridge=xenbr0']
disk = [ '/root/virt/fedora2.img,raw,hda,rw' ]
vnc = 1
boot="dc"
vncdisplay=1
serial='pty'

(d1) HVM Loader
(d1) Detected Xen v4.9-rc
(d1) Xenbus rings @0xfeffc000, event channel 1
(d1) System requested SeaBIOS
(d1) CPU speed is 2494 MHz
(d1) Relocating guest memory for lowmem MMIO space disabled
(XEN) irq.c:285: Dom1 PCI link 0 changed 0 -> 5
(d1) PCI-ISA link 0 routed to IRQ5
(XEN) irq.c:285: Dom1 PCI link 1 changed 0 -> 10
(d1) PCI-ISA link 1 routed to IRQ10
(XEN) irq.c:285: Dom1 PCI link 2 changed 0 -> 11
(d1) PCI-ISA link 2 routed to IRQ11
(XEN) irq.c:285: Dom1 PCI link 3 changed 0 -> 5
(d1) PCI-ISA link 3 routed to IRQ5
(d1) pci dev 01:3 INTA->IRQ10
(d1) pci dev 02:0 INTA->IRQ11
(d1) pci dev 04:0 INTA->IRQ5
(d1) No RAM in high memory; setting high_mem resource base to 1
(d1) pci dev 03:0 bar 10 size 00200: 0f008
(d1) pci dev 02:0 bar 14 size 00100: 0f208
(d1) pci dev 04:0 bar 30 size 4: 0f300
(d1) pci dev 03:0 bar 30 size 1: 0f304
(d1) pci dev 03:0 bar 14 size 01000: 0f305
(d1) pci dev 02:0 bar 10 size 00100: 0c001
(d1) pci dev 04:0 bar 10 size 00100: 0c101
(d1) pci dev 04:0 bar 14 size 00100: 0f3051000
(d1) pci dev 01:1 bar 20 size 00010: 0c201
(d1) Multiprocessor initialisation:
(d1)  - CPU0 ... 48-bit phys ... fixed MTRRs ... var MTRRs [1/8] ... done.
(d1)  - CPU1 ... 48-bit phys ... fixed MTRRs ... var MTRRs [1/8] ... done.
(d1) Testing HVM environment:
(XEN) d1v0 Triple fault - invoking HVM shutdown action 1
(XEN) *** Dumping Dom1 vcpu#0 state: ***
(XEN) [ Xen-4.9-rc  x86_64  debug=y   Tainted:  C   ]
(XEN) CPU:11
(XEN) RIP:0018:[<0010815c>]
(XEN) RFLAGS: 0086   CONTEXT: hvm guest (d1v0)
(XEN) rax: 8011   rbx: 0017c000   rcx: 3000
(XEN) rdx: ffef   rsi:    rdi: 
(XEN) rbp: 00136478   rsp: 00136478   r8:  
(XEN) r9:     r10:    r11: 
(XEN) r12:    r13:    r14: 
(XEN) r15:    cr0: 8011   cr4: 
(XEN) cr3: 0080   cr2: 0010815c
(XEN) ds: 0020   es: 0020   fs: 0020   gs: 0020   ss: 0020   cs: 0018


0x10815c is tools/firmware/hvmloader/tests.c:start_paging(), the 'jmp'
after we enable paging (load cr0 with bit 31 set).


With PVH:

kernel="/root/linux/vmlinux"
extra="root=/dev/xvda2 debug earlyprintk=xen console=hvc0"
memory=1024
maxmem=12000
vcpus=2
maxvcpus=3
builder="hvm"
device_model_version="none"
name = "pvh"
on_crash="preserve"
disk=['/root/virt/fedora.img,raw,hda,rw']

root@ovs101> xl create -c ~/virt/pvh.conf
Parsing config from /root/virt/pvh.conf
libxl: notice: libxl_numa.c:518:libxl__get_numa_candidate: NUMA
placement failed, performance might be affected
S3 disabled
S4 disabled
CONV disabled
xc: error: panic: xc_dom_boot.c:178: xc_dom_boot_domU_map: failed to
mmap domU pages 0x1000+0x1062 [mmap, errno=22 (Invalid argument)]:
Internal error
libxl: error: libxl_dom.c:679:libxl__build_dom: xc_dom_build_image
failed: Invalid argument
libxl: error: libxl_create.c:1217:domcreate_rebuild_done: Domain
4:cannot (re-)build domain: -3
libxl: error: libxl_domain.c:1003:libxl__destroy_domid: Domain
4:Non-existant domain
libxl: error: libxl_domain.c:962:domain_destroy_callback: Domain
4:Unable to destroy guest
libxl: error: libxl_domain.c:889:domain_destroy_cb: Domain 4:Destruction
of domain failed
root@ovs101>



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


Re: [Xen-devel] passthrough

2017-05-23 Thread George John
Thanks for the reply. we are using renesas rcar h3 board. Does it supports?

On Tuesday, May 23, 2017, Jan Beulich  wrote:

> >>> On 23.05.17 at 11:38, >
> wrote:
> > Is it possible to give each channels of uart to different guests via pass
> > through mechanism?
>
> If each channel is represented by a separate PCI device/function,
> then likely yes. If they're all one PCI device, or not a PCI device
> at all, then you may be able to hand them through (by allowing
> each guest to access the respective port numbers or MMIO space),
> but an IOMMU in the system could not be leveraged to make this
> half way secure.
>
> Jan
>
>
___
Xen-devel mailing list
Xen-devel@lists.xen.org
https://lists.xen.org/xen-devel


Re: [Xen-devel] [PATCH v3 7/9] vpci: add a priority field to the vPCI register initializer

2017-05-23 Thread Jan Beulich
>>> On 27.04.17 at 16:35,  wrote:
> +#define REGISTER_VPCI_INIT(f, p)\
> +  static const struct vpci_register_init\
> +  x##_entry __used_section(".data.vpci") = {\
> +.init = f,  \
> +.priority = p,  \
> +}

I think I'd rather see this done by ordering the entries in
.data.vpci suitably, e.g. by adding numeric tags and using SORT()
or some such in the linker script. Iirc upstream Linux did change to
such a model for some of their initialization, so you may be able to
glean something there.

Jan


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


Re: [Xen-devel] [PATCH v3 6/9] xen/vpci: trap access to the list of PCI capabilities

2017-05-23 Thread Jan Beulich
>>> On 27.04.17 at 16:35,  wrote:
> Add traps to each capability PCI_CAP_LIST_NEXT field in order to mask them on
> request.
> 
> All capabilities from the device are fetched and stored in an internal list,
> that's later used in order to return the next capability to the guest. Note
> that this only removes the capability from the linked list as seen by the
> guest, but the actual capability structure could still be accessed by the
> guest, provided that it's position can be found using another mechanism.

Which is a problem. Drivers tied to a single device or a narrow set
aren't unknown to do such. In fact in the past Intel has given us
workaround outlines for some of their chipset issues which directed
us to fixed offsets instead of using the capability chains.

> Finally the MSI and MSI-X capabilities are masked until Xen knows how to
> properly handle accesses to them.
> 
> This should allow a PVH Dom0 to boot on some hardware, provided that the
> hardware doesn't require MSI/MSI-X and that there are no SR-IOV devices in the
> system, so the panic at the end of the PVH Dom0 build is replaced by a
> warning.

While this is certainly nice for development / debugging purposes,
what's the longer term intention with the functionality being added
here? We had no need to mask capabilities for PV Dom0, so I would
have hoped to get away without for PVH too.

Assuming there is a reason other than to temporarily hide MSI/MSI-X,
I'll give some comments on the patch itself anyway.

> --- /dev/null
> +++ b/xen/drivers/vpci/capabilities.c
> @@ -0,0 +1,159 @@
> +/*
> + * Generic functionality for handling accesses to the PCI capabilities from
> + * the configuration space.
> + *
> + * Copyright (C) 2017 Citrix Systems R&D
> + *
> + * This program is free software; you can redistribute it and/or
> + * modify it under the terms and conditions of the GNU General Public
> + * License, version 2, as published by the Free Software Foundation.
> + *
> + * 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, see 
> .
> + */
> +
> +#include 
> +#include 
> +
> +struct vpci_capability {
> +struct list_head next;
> +uint8_t offset;
> +bool masked;

I think I'd prefer "hidden" or "suppressed".

> +};
> +
> +static int vpci_cap_read(struct pci_dev *pdev, unsigned int reg,
> + union vpci_val *val, void *data)
> +{
> +struct vpci_capability *cap = data;
> +
> +val->half_word = 0;

Instead of doing such (and, like here, leaving part of what val
points to uninitialized), wouldn't is be better to do this in the code
calling these helpers?

> +static int vpci_cap_write(struct pci_dev *pdev, unsigned int reg,
> +  union vpci_val val, void *data)
> +{
> +/* Ignored. */
> +return 0;
> +}

One possible example of what a NULL write handler might mean.

> +static int vpci_index_capabilities(struct pci_dev *pdev)
> +{
> +uint8_t seg = pdev->seg, bus = pdev->bus;
> +uint8_t slot = PCI_SLOT(pdev->devfn), func = PCI_FUNC(pdev->devfn);
> +uint8_t pos = PCI_CAPABILITY_LIST;
> +uint16_t status;
> +unsigned int max_cap = 48;

I think it's high time to introduce a #define for this, which is now
at least the 3rd instance.

> +struct vpci_capability *cap;
> +int rc;
> +
> +INIT_LIST_HEAD(&pdev->vpci->cap_list);
> +
> +/* Check if device has capabilities. */
> +status = pci_conf_read16(seg, bus, slot, func, PCI_STATUS);
> +if ( !(status & PCI_STATUS_CAP_LIST) )
> +return 0;
> +
> +/* Add the root capability pointer. */
> +cap = xzalloc(struct vpci_capability);
> +if ( !cap )
> +return -ENOMEM;
> +
> +cap->offset = pos;

Please be consistent with the naming of field and variable.

> +list_add_tail(&cap->next, &pdev->vpci->cap_list);
> +rc = xen_vpci_add_register(pdev, vpci_cap_read, vpci_cap_write, pos,
> +   1, cap);
> +if ( rc )
> +return rc;
> +
> +/*
> + * Iterate over the list of capabilities present in the device, and
> + * add a handler for each register pointer to the next item
> + * (PCI_CAP_LIST_NEXT).
> + */
> +while ( max_cap-- )
> +{
> +pos = pci_conf_read8(seg, bus, slot, func, pos);
> +if ( pos < 0x40 )
> +break;
> +
> +cap = xzalloc(struct vpci_capability);
> +if ( !cap )
> +return -ENOMEM;
> +
> +cap->offset = pos;

Pre-existing code clears the low two bits from the value read and
also checks whether the capability ID is 0xff.

> +static int vpci_capabilities_init(struct pci_dev *pdev)
> +{
> +int rc;
> +
> 

[Xen-devel] [ovmf test] 109695: all pass - PUSHED

2017-05-23 Thread osstest service owner
flight 109695 ovmf real [real]
http://logs.test-lab.xenproject.org/osstest/logs/109695/

Perfect :-)
All tests in this flight passed as required
version targeted for testing:
 ovmf 3b2928b46987693caaaeefbb7b799d1e1de803c0
baseline version:
 ovmf ac63e9392e7aa3791a4ea00e43c0658e6b20e2ee

Last test of basis   109691  2017-05-23 02:47:34 Z0 days
Testing same since   109695  2017-05-23 07:47:03 Z0 days1 attempts


People who touched revisions under test:
  Michael D Kinney 
  Michael Kinney 

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-ovmf-amd64 pass
 test-amd64-i386-xl-qemuu-ovmf-amd64  pass



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

Explanation of these reports, and of osstest in general, is at
http://xenbits.xen.org/gitweb/?p=osstest.git;a=blob;f=README.email;hb=master
http://xenbits.xen.org/gitweb/?p=osstest.git;a=blob;f=README;hb=master

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


Pushing revision :

+ branch=ovmf
+ revision=3b2928b46987693caaaeefbb7b799d1e1de803c0
+ . ./cri-lock-repos
++ . ./cri-common
+++ . ./cri-getconfig
+++ umask 002
+++ getrepos
 getconfig Repos
 perl -e '
use Osstest;
readglobalconfig();
print $c{"Repos"} or die $!;
'
+++ local repos=/home/osstest/repos
+++ '[' -z /home/osstest/repos ']'
+++ '[' '!' -d /home/osstest/repos ']'
+++ echo /home/osstest/repos
++ repos=/home/osstest/repos
++ repos_lock=/home/osstest/repos/lock
++ '[' x '!=' x/home/osstest/repos/lock ']'
++ OSSTEST_REPOS_LOCK_LOCKED=/home/osstest/repos/lock
++ exec with-lock-ex -w /home/osstest/repos/lock ./ap-push ovmf 
3b2928b46987693caaaeefbb7b799d1e1de803c0
+ branch=ovmf
+ revision=3b2928b46987693caaaeefbb7b799d1e1de803c0
+ . ./cri-lock-repos
++ . ./cri-common
+++ . ./cri-getconfig
+++ umask 002
+++ getrepos
 getconfig Repos
 perl -e '
use Osstest;
readglobalconfig();
print $c{"Repos"} or die $!;
'
+++ local repos=/home/osstest/repos
+++ '[' -z /home/osstest/repos ']'
+++ '[' '!' -d /home/osstest/repos ']'
+++ echo /home/osstest/repos
++ repos=/home/osstest/repos
++ repos_lock=/home/osstest/repos/lock
++ '[' x/home/osstest/repos/lock '!=' x/home/osstest/repos/lock ']'
+ . ./cri-common
++ . ./cri-getconfig
++ umask 002
+ select_xenbranch
+ case "$branch" in
+ tree=ovmf
+ xenbranch=xen-unstable
+ '[' xovmf = xlinux ']'
+ linuxbranch=
+ '[' x = x ']'
+ qemuubranch=qemu-upstream-unstable
+ select_prevxenbranch
++ ./cri-getprevxenbranch xen-unstable
+ prevxenbranch=xen-4.8-testing
+ '[' x3b2928b46987693caaaeefbb7b799d1e1de803c0 = x ']'
+ : tested/2.6.39.x
+ . ./ap-common
++ : osst...@xenbits.xen.org
+++ getconfig OsstestUpstream
+++ perl -e '
use Osstest;
readglobalconfig();
print $c{"OsstestUpstream"} or die $!;
'
++ :
++ : git://xenbits.xen.org/xen.git
++ : osst...@xenbits.xen.org:/home/xen/git/xen.git
++ : git://xenbits.xen.org/qemu-xen-traditional.git
++ : git://git.kernel.org
++ : git://git.kernel.org/pub/scm/linux/kernel/git
++ : git
++ : git://xenbits.xen.org/xtf.git
++ : osst...@xenbits.xen.org:/home/xen/git/xtf.git
++ : git://xenbits.xen.org/xtf.git
++ : git://xenbits.xen.org/libvirt.git
++ : osst...@xenbits.xen.org:/home/xen/git/libvirt.git
++ : git://xenbits.xen.org/libvirt.git
++ : git://xenbits.xen.org/osstest/rumprun.git
++ : git
++ : git://xenbits.xen.org/osstest/rumprun.git
++ : osst...@xenbits.xen.org:/home/xen/git/osstest/rumprun.git
++ : git://git.seabios.org/seabios.git
++ : osst...@xenbits.xen.org:/home/xen/git/osstest/seabios.git
++ : git://xenbits.xen.org/osstest/seabios.git
++ : https://github.com/tianocore/edk2.git
++ : osst...@xenbits.xen.org:/home/xen/git/osstest/ovmf.git
++ : git://xenbits.xen.org/osstest/ovmf.git
++ : git://xenbits.xen.org/osstest/linux-firmware.git
++ : osst...@xenbits.xen.org:/home/osstest/ext/linux-firmware.git
++ : git://git.kernel.org/pub/scm/linux/kernel/git/firmware/linux-firmware.git
++ : osst...@xenbits.xen.org:/ho

  1   2   >