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

2017-06-30 Thread osstest service owner
flight 111209 libvirt real [real]
http://logs.test-lab.xenproject.org/osstest/logs/111209/

Failures :-/ but no regressions.

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

version targeted for testing:
 libvirt  e007e764e19a498873eff4b342f09c7644fd8717
baseline version:
 libvirt  2065499b607a8df771761dc4249eff6ebc3adb5a

Last test of basis   111061  2017-06-25 20:57:28 Z5 days
Failing since111084  2017-06-27 05:51:54 Z4 days4 attempts
Testing same since   111209  2017-06-30 04:20:13 Z1 days1 attempts


People who touched revisions under test:
  Andrea Bolognani 
  Cole Robinson 
  Daniel Liu 
  Erik Skultety 
  Jiri Denemark 
  John Ferlan 
  Julio Faracco 
  Lily Zhu 
  Martin Kletzander 
  Michal Privoznik 
  Mikhail Feoktistov 
  Peter Krempa 
  Roman Bogorodskiy 

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.or

[Xen-devel] [linux-4.1 baseline-only test] 71621: tolerable trouble: blocked/broken/fail/pass

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

flight 71621 linux-4.1 real [real]
http://osstest.xs.citrite.net/~osstest/testlogs/logs/71621/

Failures :-/ but no regressions.

Regressions which are regarded as allowable (not blocking):
 test-amd64-amd64-xl-qemuu-win7-amd64 17 guest-start/win.repeat fail blocked in 
71580
 test-amd64-i386-xl-qemuu-win7-amd64 16 guest-stopfail blocked in 71580
 build-amd64-libvirt   5 libvirt-buildfail   like 71580
 build-i386-libvirt5 libvirt-buildfail   like 71580
 build-armhf-libvirt   5 libvirt-buildfail   like 71580
 test-amd64-i386-xl-qemut-winxpsp3-vcpus1 17 guest-start/win.repeat fail like 
71580

Tests which did not succeed, but are not blocking:
 test-amd64-amd64-libvirt-vhd  1 build-check(1)   blocked  n/a
 test-arm64-arm64-libvirt-xsm  1 build-check(1)   blocked  n/a
 test-amd64-i386-libvirt-qemuu-debianhvm-amd64-xsm 1 build-check(1) blocked n/a
 test-armhf-armhf-libvirt  1 build-check(1)   blocked  n/a
 test-arm64-arm64-xl   1 build-check(1)   blocked  n/a
 build-arm64-libvirt   1 build-check(1)   blocked  n/a
 test-arm64-arm64-libvirt-qcow2  1 build-check(1)   blocked  n/a
 test-amd64-amd64-libvirt-pair  1 build-check(1)   blocked  n/a
 test-amd64-i386-libvirt   1 build-check(1)   blocked  n/a
 test-armhf-armhf-libvirt-raw  1 build-check(1)   blocked  n/a
 test-arm64-arm64-libvirt  1 build-check(1)   blocked  n/a
 test-amd64-i386-libvirt-xsm   1 build-check(1)   blocked  n/a
 test-amd64-amd64-libvirt-xsm  1 build-check(1)   blocked  n/a
 test-amd64-amd64-libvirt  1 build-check(1)   blocked  n/a
 test-arm64-arm64-xl-credit2   1 build-check(1)   blocked  n/a
 test-amd64-amd64-libvirt-qemuu-debianhvm-amd64-xsm 1 build-check(1) blocked n/a
 test-arm64-arm64-xl-rtds  1 build-check(1)   blocked  n/a
 test-arm64-arm64-xl-multivcpu  1 build-check(1)   blocked  n/a
 test-armhf-armhf-libvirt-xsm  1 build-check(1)   blocked  n/a
 test-amd64-i386-libvirt-pair  1 build-check(1)   blocked  n/a
 test-arm64-arm64-xl-xsm   1 build-check(1)   blocked  n/a
 build-arm64   2 hosts-allocate   broken never pass
 build-arm64-pvops 2 hosts-allocate   broken never pass
 build-arm64-xsm   2 hosts-allocate   broken never pass
 build-arm64-xsm   3 capture-logs broken never pass
 build-arm64   3 capture-logs broken never pass
 build-arm64-pvops 3 capture-logs broken 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-midway   12 migrate-support-checkfail   never pass
 test-armhf-armhf-xl-midway   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-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-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-amd64-amd64-xl-qemut-win7-amd64 17 guest-start/win.repeat fail never pass
 test-amd64-amd64-qemuu-nested-amd 16 debian-hvm-install/l1/l2  fail never pass
 test-amd64-i386-xl-qemut-win7-amd64 17 guest-start/win.repeat  fail never pass

version targeted for testing:
 linux2ac51e21d8c50ca37fc9b5b9a9b4937c810b0d0a
baseline version:
 linux4bd4cfc5210ef2f9002e54a16334a56acd295e4b

Last test of basis71580  2017-06-16 17:47:33 Z   14 days
Testing same since71621  2017-06-30 20:50:20 Z0 days1 attempts


People who touched revisions under test:
  "Eric W. Biederman" 
  Al Viro 
  Alan Stern 
  Alex Deucher 
  Alexander Potapenko 
  Alexey Khoroshilov 
  Andrew Morton 
  Andrey Konovalov 
  Andrey Ryabinin 
  Anssi Hannula 
  Anton Bondarenko 
  Ard Biesheuvel 
  Arnd Bergmann 
  Ben Hutchings 
  Ben Skeggs 
  Bjorn Helgaas 
  Bjørn Mork 
  Brian Foster 
  Bryant G. Ly 
  Carlos Maiolino 
  Catalin Marinas 
 

[Xen-devel] [xtf test] 111251: regressions - trouble: broken/pass

2017-06-30 Thread osstest service owner
flight 111251 xtf real [real]
http://logs.test-lab.xenproject.org/osstest/logs/111251/

Regressions :-(

Tests which did not succeed and are blocking,
including tests which could not be run:
 test-xtf-amd64-amd64-4   59 leak-check/check fail REGR. vs. 111074
 test-xtf-amd64-amd64-2   59 leak-check/check fail REGR. vs. 111074
 test-xtf-amd64-amd64-3   59 leak-check/check fail REGR. vs. 111074
 test-xtf-amd64-amd64-1   59 leak-check/check fail REGR. vs. 111074
 test-xtf-amd64-amd64-5   59 leak-check/check fail REGR. vs. 111074

Tests which did not succeed, but are not blocking:
 test-xtf-amd64-amd64-4   58 xtf/test-hvm64-xsa-221   fail   never pass
 test-xtf-amd64-amd64-2   58 xtf/test-hvm64-xsa-221   fail   never pass
 test-xtf-amd64-amd64-3   58 xtf/test-hvm64-xsa-221   fail   never pass
 test-xtf-amd64-amd64-1   58 xtf/test-hvm64-xsa-221   fail   never pass
 test-xtf-amd64-amd64-5   58 xtf/test-hvm64-xsa-221   fail   never pass

version targeted for testing:
 xtf  0d6dddbd5a5666cb7d052688724662214a771033
baseline version:
 xtf  6723a66fe3e2a60793ec4fdbcd67250c954fe5d9

Last test of basis   111074  2017-06-26 14:44:07 Z4 days
Failing since44  2017-06-28 10:53:08 Z2 days   10 attempts
Testing same since   111230  2017-06-30 13:18:23 Z0 days4 attempts


People who touched revisions under test:
  Andrew Cooper 
  Haozhong Zhang 

jobs:
 build-amd64-xtf  pass
 build-amd64  pass
 build-amd64-pvopspass
 test-xtf-amd64-amd64-1   broken  
 test-xtf-amd64-amd64-2   broken  
 test-xtf-amd64-amd64-3   broken  
 test-xtf-amd64-amd64-4   broken  
 test-xtf-amd64-amd64-5   broken  



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


Not pushing.


commit 0d6dddbd5a5666cb7d052688724662214a771033
Author: Haozhong Zhang 
Date:   Fri Dec 16 21:43:48 2016 +0800

vvmx: Test vmxon in VMX root w/ CPL = 3 and w/ current VMCS

Fault #GP(0) is expected in this test.

Signed-off-by: Haozhong Zhang 
Rebase and cleanup.
Signed-off-by: Andrew Cooper 

commit 23ce3ed364ffc850f6f239b056f45d66f7d24a5f
Author: Haozhong Zhang 
Date:   Fri Dec 16 21:43:47 2016 +0800

vvmx: Test vmxon in VMX root w/ CPL = 0 and w/ current VMCS

VMfailvalid() is expected in this test.

Signed-off-by: Haozhong Zhang 
Rebase and cleanup.
Signed-off-by: Andrew Cooper 

commit aaadefde675900471464c7c174248dc9cd14f3db
Author: Haozhong Zhang 
Date:   Fri Dec 16 21:43:46 2016 +0800

vvmx: Test vmxon in VMX root w/ CPL = 3 and w/o current VMCS

Fault #GP(0) is expected in this test.

Signed-off-by: Haozhong Zhang 
Rebase and cleanup.
Signed-off-by: Andrew Cooper 

commit bf97d4fb323194bff1d92f2ed52dcaeedcf4c39e
Author: Haozhong Zhang 
Date:   Fri Dec 16 21:43:45 2016 +0800

vvmx: Test vmxon in VMX root w/ CPL = 0 and w/o current VMCS

VMfailInvalid is expected in this test.

Signed-off-by: Haozhong Zhang 
Rebase and cleanup.
Signed-off-by: Andrew Cooper 

commit 6c9b86ca32ef8a375cd4346ba71d0e2b039d120b
Author: Haozhong Zhang 
Date:   Fri Dec 16 21:43:44 2016 +0800

vvmx: Test the correct vmxon

No error is expected in this test.

Signed-off-by: Haozhong Zhang 
Rebase and cleanup.
Signed-off-by: Andrew Cooper 

commit b7972eae5aa91c72c3db2ac991b9317c88f30ff5
Author: Haozhong Zhang 
Date:   Fri Dec 16 21:43:43 2016 +0800

vvmx: Test vmxon with bit 31 of VMCS revision ID set

VMfailInvalid is expected in this test.

Signed-off-by: Haozhong Zhang 
Rebase and cleanup.
Signed-off-by: Andrew Cooper 

commit 11f3f33f343a50cd62f7522758c30ea5a0e6877a
Author: Haozhong Zhang 
Date:   Fri Dec 16 21:43:42 2016 +0800

vvmx: Test vmxon with mismatched VMCS revision ID

VMfailInvalid is expected in this test.

Signed-off-by: Haozhong Zhang 
Rebase and cleanup.
Signed-off-by: Andrew C

[Xen-devel] [linux-3.18 test] 111215: regressions - trouble: blocked/broken/fail/pass

2017-06-30 Thread osstest service owner
flight 111215 linux-3.18 real [real]
http://logs.test-lab.xenproject.org/osstest/logs/111215/

Regressions :-(

Tests which did not succeed and are blocking,
including tests which could not be run:
 test-amd64-i386-qemut-rhel6hvm-amd 12 guest-start/redhat.repeat fail REGR. vs. 
110441

Tests which are failing intermittently (not blocking):
 test-amd64-i386-qemut-rhel6hvm-amd 10 redhat-install fail in 91 pass in 
111215
 test-armhf-armhf-xl-vhd   6 xen-install  fail in 91 pass in 111215
 test-amd64-amd64-xl-qemuu-win7-amd64 17 guest-stop fail pass in 91

Regressions which are regarded as allowable (not blocking):
 test-amd64-amd64-xl-qemut-win7-amd64 17 guest-stop   fail REGR. vs. 110441

Tests which did not succeed, but are not blocking:
 test-arm64-arm64-libvirt-xsm  1 build-check(1)   blocked  n/a
 test-arm64-arm64-xl   1 build-check(1)   blocked  n/a
 test-arm64-arm64-examine  1 build-check(1)   blocked  n/a
 test-arm64-arm64-xl-credit2   1 build-check(1)   blocked  n/a
 test-arm64-arm64-xl-xsm   1 build-check(1)   blocked  n/a
 test-armhf-armhf-xl-multivcpu  4 host-install(4)  broken blocked in 110441
 test-amd64-i386-xl-qemut-win7-amd64 17 guest-stop   fail blocked in 110441
 test-amd64-amd64-xl-qemuu-win7-amd64 18 guest-start/win.repeat fail in 91 
like 110441
 test-amd64-i386-xl-qemut-win7-amd64 16 guest-localmigrate/x10 fail in 91 
like 110441
 test-armhf-armhf-xl-multivcpu 13 migrate-support-check fail in 91 never 
pass
 test-armhf-armhf-xl-multivcpu 14 saverestore-support-check fail in 91 
never pass
 test-armhf-armhf-libvirt 14 saverestore-support-checkfail  like 110441
 test-armhf-armhf-libvirt-xsm 14 saverestore-support-checkfail  like 110441
 test-amd64-i386-xl-qemuu-win7-amd64 16 guest-localmigrate/x10 fail like 110441
 test-armhf-armhf-libvirt-raw 13 saverestore-support-checkfail  like 110441
 test-amd64-i386-libvirt  13 migrate-support-checkfail   never pass
 test-amd64-amd64-xl-qemut-ws16-amd64 10 windows-installfail never pass
 test-amd64-amd64-xl-qemuu-ws16-amd64 10 windows-installfail never pass
 test-amd64-i386-libvirt-xsm  13 migrate-support-checkfail   never pass
 test-amd64-amd64-libvirt 13 migrate-support-checkfail   never pass
 test-amd64-amd64-libvirt-xsm 13 migrate-support-checkfail   never pass
 test-amd64-amd64-libvirt-qemuu-debianhvm-amd64-xsm 11 migrate-support-check 
fail never pass
 test-amd64-i386-libvirt-qemuu-debianhvm-amd64-xsm 11 migrate-support-check 
fail never pass
 test-armhf-armhf-xl-arndale  13 migrate-support-checkfail   never pass
 test-armhf-armhf-xl-arndale  14 saverestore-support-checkfail   never pass
 test-amd64-amd64-libvirt-vhd 12 migrate-support-checkfail   never pass
 test-amd64-amd64-qemuu-nested-amd 17 debian-hvm-install/l1/l2  fail never pass
 test-amd64-i386-xl-qemuu-ws16-amd64 13 guest-saverestore   fail never pass
 build-arm64-pvops 6 kernel-build fail   never pass
 test-amd64-i386-xl-qemut-ws16-amd64 13 guest-saverestore   fail never pass
 test-armhf-armhf-xl-credit2  13 migrate-support-checkfail   never pass
 test-armhf-armhf-xl-credit2  14 saverestore-support-checkfail   never pass
 test-armhf-armhf-xl-xsm  13 migrate-support-checkfail   never pass
 test-armhf-armhf-libvirt 13 migrate-support-checkfail   never pass
 test-armhf-armhf-xl-xsm  14 saverestore-support-checkfail   never pass
 test-armhf-armhf-xl  13 migrate-support-checkfail   never pass
 test-armhf-armhf-xl  14 saverestore-support-checkfail   never pass
 test-armhf-armhf-libvirt-xsm 13 migrate-support-checkfail   never pass
 test-armhf-armhf-xl-cubietruck 13 migrate-support-checkfail never pass
 test-armhf-armhf-xl-cubietruck 14 saverestore-support-checkfail never pass
 test-armhf-armhf-xl-rtds 13 migrate-support-checkfail   never pass
 test-armhf-armhf-xl-rtds 14 saverestore-support-checkfail   never pass
 test-armhf-armhf-libvirt-raw 12 migrate-support-checkfail   never pass
 test-armhf-armhf-xl-vhd  12 migrate-support-checkfail   never pass
 test-armhf-armhf-xl-vhd  13 saverestore-support-checkfail   never pass
 test-amd64-i386-xl-qemuu-win10-i386 10 windows-install fail never pass
 test-amd64-amd64-xl-qemuu-win10-i386 10 windows-installfail never pass
 test-amd64-i386-xl-qemut-win10-i386 10 windows-install fail never pass
 test-amd64-amd64-xl-qemut-win10-i386 10 windows-installfail never pass

version targeted for testing:
 linux985c6fe6e0357c79642bc506f15932983571ce93
baseline version:
 linux8366868460f8784e30302f441546a9d72ffe1236

Last test of basis   110441  2017-06-14 13:16:35 Z   16 days
Failing since111069

[Xen-devel] [xtf test] 111247: regressions - trouble: broken/pass

2017-06-30 Thread osstest service owner
flight 111247 xtf real [real]
http://logs.test-lab.xenproject.org/osstest/logs/111247/

Regressions :-(

Tests which did not succeed and are blocking,
including tests which could not be run:
 test-xtf-amd64-amd64-4   59 leak-check/check fail REGR. vs. 111074
 test-xtf-amd64-amd64-2   59 leak-check/check fail REGR. vs. 111074
 test-xtf-amd64-amd64-3   59 leak-check/check fail REGR. vs. 111074
 test-xtf-amd64-amd64-1   59 leak-check/check fail REGR. vs. 111074
 test-xtf-amd64-amd64-5   59 leak-check/check fail REGR. vs. 111074

Tests which did not succeed, but are not blocking:
 test-xtf-amd64-amd64-4   58 xtf/test-hvm64-xsa-221   fail   never pass
 test-xtf-amd64-amd64-2   58 xtf/test-hvm64-xsa-221   fail   never pass
 test-xtf-amd64-amd64-3   58 xtf/test-hvm64-xsa-221   fail   never pass
 test-xtf-amd64-amd64-1   58 xtf/test-hvm64-xsa-221   fail   never pass
 test-xtf-amd64-amd64-5   58 xtf/test-hvm64-xsa-221   fail   never pass

version targeted for testing:
 xtf  0d6dddbd5a5666cb7d052688724662214a771033
baseline version:
 xtf  6723a66fe3e2a60793ec4fdbcd67250c954fe5d9

Last test of basis   111074  2017-06-26 14:44:07 Z4 days
Failing since44  2017-06-28 10:53:08 Z2 days9 attempts
Testing same since   111230  2017-06-30 13:18:23 Z0 days3 attempts


People who touched revisions under test:
  Andrew Cooper 
  Haozhong Zhang 

jobs:
 build-amd64-xtf  pass
 build-amd64  pass
 build-amd64-pvopspass
 test-xtf-amd64-amd64-1   broken  
 test-xtf-amd64-amd64-2   broken  
 test-xtf-amd64-amd64-3   broken  
 test-xtf-amd64-amd64-4   broken  
 test-xtf-amd64-amd64-5   broken  



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


Not pushing.


commit 0d6dddbd5a5666cb7d052688724662214a771033
Author: Haozhong Zhang 
Date:   Fri Dec 16 21:43:48 2016 +0800

vvmx: Test vmxon in VMX root w/ CPL = 3 and w/ current VMCS

Fault #GP(0) is expected in this test.

Signed-off-by: Haozhong Zhang 
Rebase and cleanup.
Signed-off-by: Andrew Cooper 

commit 23ce3ed364ffc850f6f239b056f45d66f7d24a5f
Author: Haozhong Zhang 
Date:   Fri Dec 16 21:43:47 2016 +0800

vvmx: Test vmxon in VMX root w/ CPL = 0 and w/ current VMCS

VMfailvalid() is expected in this test.

Signed-off-by: Haozhong Zhang 
Rebase and cleanup.
Signed-off-by: Andrew Cooper 

commit aaadefde675900471464c7c174248dc9cd14f3db
Author: Haozhong Zhang 
Date:   Fri Dec 16 21:43:46 2016 +0800

vvmx: Test vmxon in VMX root w/ CPL = 3 and w/o current VMCS

Fault #GP(0) is expected in this test.

Signed-off-by: Haozhong Zhang 
Rebase and cleanup.
Signed-off-by: Andrew Cooper 

commit bf97d4fb323194bff1d92f2ed52dcaeedcf4c39e
Author: Haozhong Zhang 
Date:   Fri Dec 16 21:43:45 2016 +0800

vvmx: Test vmxon in VMX root w/ CPL = 0 and w/o current VMCS

VMfailInvalid is expected in this test.

Signed-off-by: Haozhong Zhang 
Rebase and cleanup.
Signed-off-by: Andrew Cooper 

commit 6c9b86ca32ef8a375cd4346ba71d0e2b039d120b
Author: Haozhong Zhang 
Date:   Fri Dec 16 21:43:44 2016 +0800

vvmx: Test the correct vmxon

No error is expected in this test.

Signed-off-by: Haozhong Zhang 
Rebase and cleanup.
Signed-off-by: Andrew Cooper 

commit b7972eae5aa91c72c3db2ac991b9317c88f30ff5
Author: Haozhong Zhang 
Date:   Fri Dec 16 21:43:43 2016 +0800

vvmx: Test vmxon with bit 31 of VMCS revision ID set

VMfailInvalid is expected in this test.

Signed-off-by: Haozhong Zhang 
Rebase and cleanup.
Signed-off-by: Andrew Cooper 

commit 11f3f33f343a50cd62f7522758c30ea5a0e6877a
Author: Haozhong Zhang 
Date:   Fri Dec 16 21:43:42 2016 +0800

vvmx: Test vmxon with mismatched VMCS revision ID

VMfailInvalid is expected in this test.

Signed-off-by: Haozhong Zhang 
Rebase and cleanup.
Signed-off-by: Andrew C

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

2017-06-30 Thread osstest service owner
flight 111201 xen-unstable real [real]
http://logs.test-lab.xenproject.org/osstest/logs/111201/

Regressions :-(

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

Regressions which are regarded as allowable (not blocking):
 test-armhf-armhf-xl-rtds 12 guest-start  fail REGR. vs. 110465

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

version targeted for testing:
 xen  989563f97b3b255152c85c12b180a128e7c9202e
baseline version:
 xen  695bb5f504ab48c1d546446f104c1b6c0ead126d

Last test of basis   110465  2017-06-15 09:46:33 Z   15 days
Failing since110484  2017-06-16 09:32:22 Z   14 days   15 attempts
Testing same since   111201  2017-06-29 22:20:43 Z1 days1 attempts


People who touched revisions under test:
  Andrew Cooper 
  Andrew Morton 
  Artem Bityutskiy 
  Bernhard M. Wiedemann 
  Bernhard M. Wiedemann 
  Bhupinder Thakur 
  Dario Faggioli 
  David Woodhouse 
  Doug Goldstein 
  Dushyant Behl 
  George Dunlap 
  Ian Jackson 
  Jan B

[Xen-devel] [xen-unstable-smoke test] 111244: tolerable trouble: broken/pass - PUSHED

2017-06-30 Thread osstest service owner
flight 111244 xen-unstable-smoke real [real]
http://logs.test-lab.xenproject.org/osstest/logs/111244/

Failures :-/ but no regressions.

Tests which did not succeed, but are not blocking:
 test-arm64-arm64-xl-xsm   1 build-check(1)   blocked  n/a
 test-amd64-amd64-libvirt 13 migrate-support-checkfail   never pass
 test-armhf-armhf-xl  13 migrate-support-checkfail   never pass
 test-armhf-armhf-xl  14 saverestore-support-checkfail   never pass

version targeted for testing:
 xen  d468f4299cef469d882f4bed8530fca53ebf2ebd
baseline version:
 xen  4f671de7f8970831fcf132d6ec63aa637ed51f22

Last test of basis   111241  2017-06-30 21:02:16 Z0 days
Testing same since   111244  2017-06-30 23:01:04 Z0 days1 attempts


People who touched revisions under test:
  Julien Grall 

jobs:
 build-amd64  pass
 build-armhf  pass
 build-amd64-libvirt  pass
 test-armhf-armhf-xl  pass
 test-arm64-arm64-xl-xsm  broken  
 test-amd64-amd64-xl-qemuu-debianhvm-i386 pass
 test-amd64-amd64-libvirt 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=xen-unstable-smoke
+ revision=d468f4299cef469d882f4bed8530fca53ebf2ebd
+ . ./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 xen-unstable-smoke 
d468f4299cef469d882f4bed8530fca53ebf2ebd
+ branch=xen-unstable-smoke
+ revision=d468f4299cef469d882f4bed8530fca53ebf2ebd
+ . ./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=xen
+ xenbranch=xen-unstable-smoke
+ qemuubranch=qemu-upstream-unstable
+ '[' xxen = xlinux ']'
+ linuxbranch=
+ '[' xqemu-upstream-unstable = x ']'
+ select_prevxenbranch
++ ./cri-getprevxenbranch xen-unstable-smoke
+ prevxenbranch=xen-4.9-testing
+ '[' xd468f4299cef469d882f4bed8530fca53ebf2ebd = 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/osstes

[Xen-devel] [xtf test] 111240: regressions - trouble: broken/pass

2017-06-30 Thread osstest service owner
flight 111240 xtf real [real]
http://logs.test-lab.xenproject.org/osstest/logs/111240/

Regressions :-(

Tests which did not succeed and are blocking,
including tests which could not be run:
 test-xtf-amd64-amd64-4   59 leak-check/check fail REGR. vs. 111074
 test-xtf-amd64-amd64-5   59 leak-check/check fail REGR. vs. 111074
 test-xtf-amd64-amd64-1   59 leak-check/check fail REGR. vs. 111074
 test-xtf-amd64-amd64-2   59 leak-check/check fail REGR. vs. 111074
 test-xtf-amd64-amd64-3   59 leak-check/check fail REGR. vs. 111074

Tests which did not succeed, but are not blocking:
 test-xtf-amd64-amd64-4   58 xtf/test-hvm64-xsa-221   fail   never pass
 test-xtf-amd64-amd64-5   58 xtf/test-hvm64-xsa-221   fail   never pass
 test-xtf-amd64-amd64-1   58 xtf/test-hvm64-xsa-221   fail   never pass
 test-xtf-amd64-amd64-2   58 xtf/test-hvm64-xsa-221   fail   never pass
 test-xtf-amd64-amd64-3   58 xtf/test-hvm64-xsa-221   fail   never pass

version targeted for testing:
 xtf  0d6dddbd5a5666cb7d052688724662214a771033
baseline version:
 xtf  6723a66fe3e2a60793ec4fdbcd67250c954fe5d9

Last test of basis   111074  2017-06-26 14:44:07 Z4 days
Failing since44  2017-06-28 10:53:08 Z2 days8 attempts
Testing same since   111230  2017-06-30 13:18:23 Z0 days2 attempts


People who touched revisions under test:
  Andrew Cooper 
  Haozhong Zhang 

jobs:
 build-amd64-xtf  pass
 build-amd64  pass
 build-amd64-pvopspass
 test-xtf-amd64-amd64-1   broken  
 test-xtf-amd64-amd64-2   broken  
 test-xtf-amd64-amd64-3   broken  
 test-xtf-amd64-amd64-4   broken  
 test-xtf-amd64-amd64-5   broken  



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


Not pushing.


commit 0d6dddbd5a5666cb7d052688724662214a771033
Author: Haozhong Zhang 
Date:   Fri Dec 16 21:43:48 2016 +0800

vvmx: Test vmxon in VMX root w/ CPL = 3 and w/ current VMCS

Fault #GP(0) is expected in this test.

Signed-off-by: Haozhong Zhang 
Rebase and cleanup.
Signed-off-by: Andrew Cooper 

commit 23ce3ed364ffc850f6f239b056f45d66f7d24a5f
Author: Haozhong Zhang 
Date:   Fri Dec 16 21:43:47 2016 +0800

vvmx: Test vmxon in VMX root w/ CPL = 0 and w/ current VMCS

VMfailvalid() is expected in this test.

Signed-off-by: Haozhong Zhang 
Rebase and cleanup.
Signed-off-by: Andrew Cooper 

commit aaadefde675900471464c7c174248dc9cd14f3db
Author: Haozhong Zhang 
Date:   Fri Dec 16 21:43:46 2016 +0800

vvmx: Test vmxon in VMX root w/ CPL = 3 and w/o current VMCS

Fault #GP(0) is expected in this test.

Signed-off-by: Haozhong Zhang 
Rebase and cleanup.
Signed-off-by: Andrew Cooper 

commit bf97d4fb323194bff1d92f2ed52dcaeedcf4c39e
Author: Haozhong Zhang 
Date:   Fri Dec 16 21:43:45 2016 +0800

vvmx: Test vmxon in VMX root w/ CPL = 0 and w/o current VMCS

VMfailInvalid is expected in this test.

Signed-off-by: Haozhong Zhang 
Rebase and cleanup.
Signed-off-by: Andrew Cooper 

commit 6c9b86ca32ef8a375cd4346ba71d0e2b039d120b
Author: Haozhong Zhang 
Date:   Fri Dec 16 21:43:44 2016 +0800

vvmx: Test the correct vmxon

No error is expected in this test.

Signed-off-by: Haozhong Zhang 
Rebase and cleanup.
Signed-off-by: Andrew Cooper 

commit b7972eae5aa91c72c3db2ac991b9317c88f30ff5
Author: Haozhong Zhang 
Date:   Fri Dec 16 21:43:43 2016 +0800

vvmx: Test vmxon with bit 31 of VMCS revision ID set

VMfailInvalid is expected in this test.

Signed-off-by: Haozhong Zhang 
Rebase and cleanup.
Signed-off-by: Andrew Cooper 

commit 11f3f33f343a50cd62f7522758c30ea5a0e6877a
Author: Haozhong Zhang 
Date:   Fri Dec 16 21:43:42 2016 +0800

vvmx: Test vmxon with mismatched VMCS revision ID

VMfailInvalid is expected in this test.

Signed-off-by: Haozhong Zhang 
Rebase and cleanup.
Signed-off-by: Andrew C

Re: [Xen-devel] [PATCH 4/4] xen: don't use xenstore to save/restore physmap anymore

2017-06-30 Thread Stefano Stabellini
On Fri, 30 Jun 2017, Igor Druzhinin wrote:
> If we have a system with xenforeignmemory_map2() implemented
> we don't need to save/restore physmap on suspend/restore
> anymore. In case we resume a VM without physmap - try to
> recreate the physmap during memory region restore phase and
> remap map cache entries accordingly. The old code is left
> for compatibility reasons.
> 
> Signed-off-by: Igor Druzhinin 
> ---
>  hw/i386/xen/xen-hvm.c   | 45 
> ++---
>  include/hw/xen/xen_common.h |  1 +
>  2 files changed, 35 insertions(+), 11 deletions(-)
> 
> diff --git a/hw/i386/xen/xen-hvm.c b/hw/i386/xen/xen-hvm.c
> index d259cf7..1b6a5ce 100644
> --- a/hw/i386/xen/xen-hvm.c
> +++ b/hw/i386/xen/xen-hvm.c
> @@ -305,6 +305,7 @@ static hwaddr xen_phys_offset_to_gaddr(hwaddr start_addr,
>  return start_addr;
>  }
>  
> +#ifdef XEN_COMPAT_PHYSMAP
>  static int xen_save_physmap(XenIOState *state, XenPhysmap *physmap)
>  {
>  char path[80], value[17];
> @@ -334,6 +335,12 @@ static int xen_save_physmap(XenIOState *state, 
> XenPhysmap *physmap)
>  }
>  return 0;
>  }
> +#else
> +static int xen_save_physmap(XenIOState *state, XenPhysmap *physmap)
> +{
> +return 0;
> +}
> +#endif
>  
>  static int xen_add_to_physmap(XenIOState *state,
>hwaddr start_addr,
> @@ -368,6 +375,26 @@ go_physmap:
>  DPRINTF("mapping vram to %"HWADDR_PRIx" - %"HWADDR_PRIx"\n",
>  start_addr, start_addr + size);
>  
> +mr_name = memory_region_name(mr);
> +
> +physmap = g_malloc(sizeof (XenPhysmap));
> +
> +physmap->start_addr = start_addr;
> +physmap->size = size;
> +physmap->name = mr_name;
> +physmap->phys_offset = phys_offset;
> +
> +QLIST_INSERT_HEAD(&state->physmap, physmap, list);
> +
> +if (runstate_check(RUN_STATE_INMIGRATE)) {
> +/* Now when we have a physmap entry we can remap a dummy mapping and 
> change
> + * it to a real one of guest foreign memory. */
> +uint8_t *p = xen_remap_cache_entry(phys_offset, size);
> +assert(p && p == memory_region_get_ram_ptr(mr));

I would just pass start_addr to xen_remap_cache_entry as argument. It
would make things easier. With that, I think we should also be able to
#ifdef xen_phys_offset_to_gaddr and the call to phys_offset_to_gaddr in
xen_map_cache_unlocked, right?  It would make things simpler.


> +return 0;
> +}
>  pfn = phys_offset >> TARGET_PAGE_BITS;
>  start_gpfn = start_addr >> TARGET_PAGE_BITS;
>  for (i = 0; i < size >> TARGET_PAGE_BITS; i++) {
> @@ -382,21 +409,11 @@ go_physmap:
>  }
>  }
>  
> -mr_name = memory_region_name(mr);
> -
> -physmap = g_malloc(sizeof (XenPhysmap));
> -
> -physmap->start_addr = start_addr;
> -physmap->size = size;
> -physmap->name = mr_name;
> -physmap->phys_offset = phys_offset;
> -
> -QLIST_INSERT_HEAD(&state->physmap, physmap, list);
> -
>  xc_domain_pin_memory_cacheattr(xen_xc, xen_domid,
> start_addr >> TARGET_PAGE_BITS,
> (start_addr + size - 1) >> 
> TARGET_PAGE_BITS,
> XEN_DOMCTL_MEM_CACHEATTR_WB);
> +

Spurious change


>  return xen_save_physmap(state, physmap);
>  }
>  
> @@ -1158,6 +1175,7 @@ static void xen_exit_notifier(Notifier *n, void *data)
>  xs_daemon_close(state->xenstore);
>  }
>  
> +#ifdef XEN_COMPAT_PHYSMAP
>  static void xen_read_physmap(XenIOState *state)
>  {
>  XenPhysmap *physmap = NULL;
> @@ -1205,6 +1223,11 @@ static void xen_read_physmap(XenIOState *state)
>  }
>  free(entries);
>  }
> +#else
> +static void xen_read_physmap(XenIOState *state)
> +{
> +}
> +#endif
>  
>  static void xen_wakeup_notifier(Notifier *notifier, void *data)
>  {
> diff --git a/include/hw/xen/xen_common.h b/include/hw/xen/xen_common.h
> index 70a5cad..c04c5c9 100644
> --- a/include/hw/xen/xen_common.h
> +++ b/include/hw/xen/xen_common.h
> @@ -80,6 +80,7 @@ extern xenforeignmemory_handle *xen_fmem;
>  
>  #if CONFIG_XEN_CTRL_INTERFACE_VERSION < 41000
>  
> +#define XEN_COMPAT_PHYSMAP
>  #define xenforeignmemory_map2(h, d, a, p, f, ps, ar, e) \
>  xenforeignmemory_map(h, d, p, ps, ar, e)
>  
> -- 
> 2.7.4
> 

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


Re: [Xen-devel] [PATCH 3/4] xen/mapcache: introduce xen_remap_cache_entry()

2017-06-30 Thread Stefano Stabellini
On Fri, 30 Jun 2017, Igor Druzhinin wrote:
> This new call is trying to update a requested map cache entry
> according to the changes in the physmap. The call is searching
> for the entry, unmaps it, tries to translate the address and
> maps again at the same place. If the mapping is dummy this call
> will make it real.
> 
> This function makes use of a new xenforeignmemory_map2() call
> with extended interface that was recently introduced in
> libxenforeignmemory [1].
> 
> [1] https://www.mail-archive.com/xen-devel@lists.xen.org/msg113007.html
> 
> Signed-off-by: Igor Druzhinin 
> ---
>  configure |  18 
>  hw/i386/xen/xen-mapcache.c| 105 
> +++---
>  include/hw/xen/xen_common.h   |   7 +++
>  include/sysemu/xen-mapcache.h |   6 +++
>  4 files changed, 130 insertions(+), 6 deletions(-)
> 
> diff --git a/configure b/configure
> index c571ad1..ad6156b 100755
> --- a/configure
> +++ b/configure
> @@ -2021,6 +2021,24 @@ EOF
>  # Xen unstable
>  elif
>  cat > $TMPC < +#undef XC_WANT_COMPAT_MAP_FOREIGN_API
> +#include 
> +int main(void) {
> +  xenforeignmemory_handle *xfmem;
> +
> +  xfmem = xenforeignmemory_open(0, 0);
> +  xenforeignmemory_map2(xfmem, 0, 0, 0, 0, 0, 0, 0);
> +
> +  return 0;
> +}
> +EOF
> +compile_prog "" "$xen_libs -lxendevicemodel $xen_stable_libs"
> +  then
> +  xen_stable_libs="-lxendevicemodel $xen_stable_libs"
> +  xen_ctrl_version=41000
> +  xen=yes
> +elif
> +cat > $TMPC <  #undef XC_WANT_COMPAT_DEVICEMODEL_API
>  #define __XEN_TOOLS__
>  #include 
> diff --git a/hw/i386/xen/xen-mapcache.c b/hw/i386/xen/xen-mapcache.c
> index 05050de..5d8d990 100644
> --- a/hw/i386/xen/xen-mapcache.c
> +++ b/hw/i386/xen/xen-mapcache.c
> @@ -149,6 +149,7 @@ void xen_map_cache_init(phys_offset_to_gaddr_t f, void 
> *opaque)
>  }
>  
>  static void xen_remap_bucket(MapCacheEntry *entry,
> + void *vaddr,
>   hwaddr size,
>   hwaddr address_index,
>   bool dummy)
> @@ -179,11 +180,11 @@ static void xen_remap_bucket(MapCacheEntry *entry,
>  }
>  
>  if (!dummy) {
> -vaddr_base = xenforeignmemory_map(xen_fmem, xen_domid,
> -   PROT_READ|PROT_WRITE,
> +vaddr_base = xenforeignmemory_map2(xen_fmem, xen_domid, vaddr,
> +   PROT_READ|PROT_WRITE, 0,
> nb_pfn, pfns, err);
>  if (vaddr_base == NULL) {
> -perror("xenforeignmemory_map");
> +perror("xenforeignmemory_map2");
>  exit(-1);
>  }
>  } else {
> @@ -191,7 +192,7 @@ static void xen_remap_bucket(MapCacheEntry *entry,
>   * We create dummy mappings where we are unable to create a foreign
>   * mapping immediately due to certain circumstances (i.e. on resume 
> now)
>   */
> -vaddr_base = mmap(NULL, size, PROT_READ|PROT_WRITE,
> +vaddr_base = mmap(vaddr, size, PROT_READ|PROT_WRITE,
>MAP_ANON|MAP_SHARED, -1, 0);
>  if (vaddr_base == NULL) {
>  perror("mmap");
> @@ -278,14 +279,14 @@ tryagain:
>  if (!entry) {
>  entry = g_malloc0(sizeof (MapCacheEntry));
>  pentry->next = entry;
> -xen_remap_bucket(entry, cache_size, address_index, dummy);
> +xen_remap_bucket(entry, NULL, cache_size, address_index, dummy);
>  } else if (!entry->lock) {
>  if (!entry->vaddr_base || entry->paddr_index != address_index ||
>  entry->size != cache_size ||
>  !test_bits(address_offset >> XC_PAGE_SHIFT,
>  test_bit_size >> XC_PAGE_SHIFT,
>  entry->valid_mapping)) {
> -xen_remap_bucket(entry, cache_size, address_index, dummy);
> +xen_remap_bucket(entry, NULL, cache_size, address_index, dummy);
>  }
>  }
>  
> @@ -482,3 +483,95 @@ void xen_invalidate_map_cache(void)
>  
>  mapcache_unlock();
>  }
> +
> +static uint8_t *xen_remap_cache_entry_unlocked(hwaddr phys_addr, hwaddr size)

I think it's best if we use a more descriptive name, such as
xen_replace_dummy_entry to avoid confusion.


> +{
> +MapCacheEntry *entry, *pentry = NULL;
> +hwaddr address_index;
> +hwaddr address_offset;
> +hwaddr cache_size = size;
> +hwaddr test_bit_size;
> +void *vaddr = NULL;
> +uint8_t lock;
> +
> +address_index  = phys_addr >> MCACHE_BUCKET_SHIFT;
> +address_offset = phys_addr & (MCACHE_BUCKET_SIZE - 1);
> +
> +/* test_bit_size is always a multiple of XC_PAGE_SIZE */
> +if (size) {

There is no need to make xen_remap_cache_entry_unlocked generic: it's
only used with explicitly sized mappings, right? We could assert(!size).


> +test_bit_size = size + (phys_addr & (XC_PAGE_SIZE - 1));
>

Re: [Xen-devel] [PATCH 2/4] xen/mapcache: add an ability to create dummy mappings

2017-06-30 Thread Stefano Stabellini
On Fri, 30 Jun 2017, Igor Druzhinin wrote:
> Dummys are simple anonymous mappings that are placed instead
> of regular foreign mappings in certain situations when we need
> to postpone the actual mapping but still have to give a
> memory region to QEMU to play with.
> 
> This is planned to be used for restore on Xen.
> 
> Signed-off-by: Igor Druzhinin 
>
> ---
>  hw/i386/xen/xen-mapcache.c | 36 
>  1 file changed, 28 insertions(+), 8 deletions(-)
> 
> diff --git a/hw/i386/xen/xen-mapcache.c b/hw/i386/xen/xen-mapcache.c
> index e60156c..05050de 100644
> --- a/hw/i386/xen/xen-mapcache.c
> +++ b/hw/i386/xen/xen-mapcache.c
> @@ -150,7 +150,8 @@ void xen_map_cache_init(phys_offset_to_gaddr_t f, void 
> *opaque)
>  
>  static void xen_remap_bucket(MapCacheEntry *entry,
>   hwaddr size,
> - hwaddr address_index)
> + hwaddr address_index,
> + bool dummy)
>  {
>  uint8_t *vaddr_base;
>  xen_pfn_t *pfns;
> @@ -177,11 +178,25 @@ static void xen_remap_bucket(MapCacheEntry *entry,
>  pfns[i] = (address_index << (MCACHE_BUCKET_SHIFT-XC_PAGE_SHIFT)) + i;
>  }
>  
> -vaddr_base = xenforeignmemory_map(xen_fmem, xen_domid, 
> PROT_READ|PROT_WRITE,
> -  nb_pfn, pfns, err);
> -if (vaddr_base == NULL) {
> -perror("xenforeignmemory_map");
> -exit(-1);
> +if (!dummy) {
> +vaddr_base = xenforeignmemory_map(xen_fmem, xen_domid,
> +   PROT_READ|PROT_WRITE,
> +   nb_pfn, pfns, err);
> +if (vaddr_base == NULL) {
> +perror("xenforeignmemory_map");
> +exit(-1);
> +}
> +} else {
> +/*
> + * We create dummy mappings where we are unable to create a foreign
> + * mapping immediately due to certain circumstances (i.e. on resume 
> now)
> + */
> +vaddr_base = mmap(NULL, size, PROT_READ|PROT_WRITE,
> +  MAP_ANON|MAP_SHARED, -1, 0);
> +if (vaddr_base == NULL) {
> +perror("mmap");
> +exit(-1);
> +}

For our sanity in debugging this in the future, I think it's best if we
mark this mapcache entry as "dummy". Since we are at it, we could turn
the lock field of MapCacheEntry into a flag field and #define LOCK as
(1<<0) and DUMMY as (1<<1). Please do that as a separate patch.


>  }
>  
>  entry->vaddr_base = vaddr_base;
> @@ -211,6 +226,7 @@ static uint8_t *xen_map_cache_unlocked(hwaddr phys_addr, 
> hwaddr size,
>  hwaddr cache_size = size;
>  hwaddr test_bit_size;
>  bool translated = false;
> +bool dummy = false;
>  
>  tryagain:
>  address_index  = phys_addr >> MCACHE_BUCKET_SHIFT;
> @@ -262,14 +278,14 @@ tryagain:
>  if (!entry) {
>  entry = g_malloc0(sizeof (MapCacheEntry));
>  pentry->next = entry;
> -xen_remap_bucket(entry, cache_size, address_index);
> +xen_remap_bucket(entry, cache_size, address_index, dummy);
>  } else if (!entry->lock) {
>  if (!entry->vaddr_base || entry->paddr_index != address_index ||
>  entry->size != cache_size ||
>  !test_bits(address_offset >> XC_PAGE_SHIFT,
>  test_bit_size >> XC_PAGE_SHIFT,
>  entry->valid_mapping)) {
> -xen_remap_bucket(entry, cache_size, address_index);
> +xen_remap_bucket(entry, cache_size, address_index, dummy);
>  }
>  }
>  
> @@ -282,6 +298,10 @@ tryagain:
>  translated = true;
>  goto tryagain;
>  }
> +if (!dummy && runstate_check(RUN_STATE_INMIGRATE)) {
> +dummy = true;
> +goto tryagain;
> +}
>  trace_xen_map_cache_return(NULL);
>  return NULL;
>  }
> -- 
> 2.7.4
> 

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


Re: [Xen-devel] [PATCH 1/4] xen: move physmap saving into a separate function

2017-06-30 Thread Stefano Stabellini
On Fri, 30 Jun 2017, Igor Druzhinin wrote:
> Non-functional change.
> 
> Signed-off-by: Igor Druzhinin 

Reviewed-by: Stefano Stabellini 


> ---
>  hw/i386/xen/xen-hvm.c | 57 
> ---
>  1 file changed, 31 insertions(+), 26 deletions(-)
> 
> diff --git a/hw/i386/xen/xen-hvm.c b/hw/i386/xen/xen-hvm.c
> index cffa7e2..d259cf7 100644
> --- a/hw/i386/xen/xen-hvm.c
> +++ b/hw/i386/xen/xen-hvm.c
> @@ -305,6 +305,36 @@ static hwaddr xen_phys_offset_to_gaddr(hwaddr start_addr,
>  return start_addr;
>  }
>  
> +static int xen_save_physmap(XenIOState *state, XenPhysmap *physmap)
> +{
> +char path[80], value[17];
> +
> +snprintf(path, sizeof(path),
> +"/local/domain/0/device-model/%d/physmap/%"PRIx64"/start_addr",
> +xen_domid, (uint64_t)physmap->phys_offset);
> +snprintf(value, sizeof(value), "%"PRIx64, (uint64_t)physmap->start_addr);
> +if (!xs_write(state->xenstore, 0, path, value, strlen(value))) {
> +return -1;
> +}
> +snprintf(path, sizeof(path),
> +"/local/domain/0/device-model/%d/physmap/%"PRIx64"/size",
> +xen_domid, (uint64_t)physmap->phys_offset);
> +snprintf(value, sizeof(value), "%"PRIx64, (uint64_t)physmap->size);
> +if (!xs_write(state->xenstore, 0, path, value, strlen(value))) {
> +return -1;
> +}
> +if (physmap->name) {
> +snprintf(path, sizeof(path),
> +"/local/domain/0/device-model/%d/physmap/%"PRIx64"/name",
> +xen_domid, (uint64_t)physmap->phys_offset);
> +if (!xs_write(state->xenstore, 0, path,
> +  physmap->name, strlen(physmap->name))) {
> +return -1;
> +}
> +}
> +return 0;
> +}
> +
>  static int xen_add_to_physmap(XenIOState *state,
>hwaddr start_addr,
>ram_addr_t size,
> @@ -316,7 +346,6 @@ static int xen_add_to_physmap(XenIOState *state,
>  XenPhysmap *physmap = NULL;
>  hwaddr pfn, start_gpfn;
>  hwaddr phys_offset = memory_region_get_ram_addr(mr);
> -char path[80], value[17];
>  const char *mr_name;
>  
>  if (get_physmapping(state, start_addr, size)) {
> @@ -368,31 +397,7 @@ go_physmap:
> start_addr >> TARGET_PAGE_BITS,
> (start_addr + size - 1) >> 
> TARGET_PAGE_BITS,
> XEN_DOMCTL_MEM_CACHEATTR_WB);
> -
> -snprintf(path, sizeof(path),
> -"/local/domain/0/device-model/%d/physmap/%"PRIx64"/start_addr",
> -xen_domid, (uint64_t)phys_offset);
> -snprintf(value, sizeof(value), "%"PRIx64, (uint64_t)start_addr);
> -if (!xs_write(state->xenstore, 0, path, value, strlen(value))) {
> -return -1;
> -}
> -snprintf(path, sizeof(path),
> -"/local/domain/0/device-model/%d/physmap/%"PRIx64"/size",
> -xen_domid, (uint64_t)phys_offset);
> -snprintf(value, sizeof(value), "%"PRIx64, (uint64_t)size);
> -if (!xs_write(state->xenstore, 0, path, value, strlen(value))) {
> -return -1;
> -}
> -if (mr_name) {
> -snprintf(path, sizeof(path),
> -"/local/domain/0/device-model/%d/physmap/%"PRIx64"/name",
> -xen_domid, (uint64_t)phys_offset);
> -if (!xs_write(state->xenstore, 0, path, mr_name, strlen(mr_name))) {
> -return -1;
> -}
> -}
> -
> -return 0;
> +return xen_save_physmap(state, physmap);
>  }
>  
>  static int xen_remove_from_physmap(XenIOState *state,
> -- 
> 2.7.4
> 

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


[Xen-devel] [xen-unstable-smoke test] 111241: tolerable trouble: broken/pass - PUSHED

2017-06-30 Thread osstest service owner
flight 111241 xen-unstable-smoke real [real]
http://logs.test-lab.xenproject.org/osstest/logs/111241/

Failures :-/ but no regressions.

Tests which did not succeed, but are not blocking:
 test-arm64-arm64-xl-xsm   1 build-check(1)   blocked  n/a
 test-amd64-amd64-libvirt 13 migrate-support-checkfail   never pass
 test-armhf-armhf-xl  13 migrate-support-checkfail   never pass
 test-armhf-armhf-xl  14 saverestore-support-checkfail   never pass

version targeted for testing:
 xen  4f671de7f8970831fcf132d6ec63aa637ed51f22
baseline version:
 xen  c2ce38d3adda75215d53cb930ac23abaa668f4fe

Last test of basis   111237  2017-06-30 18:02:01 Z0 days
Testing same since   111241  2017-06-30 21:02:16 Z0 days1 attempts


People who touched revisions under test:
  Julien Grall 
  Konrad Rzeszutek Wilk 

jobs:
 build-amd64  pass
 build-armhf  pass
 build-amd64-libvirt  pass
 test-armhf-armhf-xl  pass
 test-arm64-arm64-xl-xsm  broken  
 test-amd64-amd64-xl-qemuu-debianhvm-i386 pass
 test-amd64-amd64-libvirt 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=xen-unstable-smoke
+ revision=4f671de7f8970831fcf132d6ec63aa637ed51f22
+ . ./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 xen-unstable-smoke 
4f671de7f8970831fcf132d6ec63aa637ed51f22
+ branch=xen-unstable-smoke
+ revision=4f671de7f8970831fcf132d6ec63aa637ed51f22
+ . ./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=xen
+ xenbranch=xen-unstable-smoke
+ qemuubranch=qemu-upstream-unstable
+ '[' xxen = xlinux ']'
+ linuxbranch=
+ '[' xqemu-upstream-unstable = x ']'
+ select_prevxenbranch
++ ./cri-getprevxenbranch xen-unstable-smoke
+ prevxenbranch=xen-4.9-testing
+ '[' x4f671de7f8970831fcf132d6ec63aa637ed51f22 = 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

Re: [Xen-devel] [RFC] DOMCTL_memattrs_op : a new DOMCTL to play with stage-2 page attributes

2017-06-30 Thread Stefano Stabellini
On Sat, 1 Jul 2017, Zhongze Liu wrote:
> 
>DOMCTL_memattrs_op : a new DOMCTL to play with stage-2 page attributes
> 
>   Zhongze Liu 
> 
> 
> 
>   Motivation and Description
>   ~~
> 
> During the dicussion about the proposal "allow setting up shared memory areas
> between VMs from xl config file" (see [1]), it's getting clear that when we
> setup shared memory areas for VM communications from xl config file, we would
> appreciate the ability to control the permissions and some attributes of the
> shared memory pages: in the simplest the cases, regular cacheable RAM with 
> read
  ^ of

> write permissions will be enough (For ARM, it would be p2m_ram_rw and 
> MATTR_MEM,
> LPAE_SH_INNER). But there are also complicated cases where we might need 
> deeper
> control over the permissions, cacheability and shareability of the shared RAM
> pages to meet some extra requirements (see [2]). And this could be done via
> playing with the stage-2 page tables, on both x86 and ARM.
> 
> So there comes to the need for a DOMCTL that can set the permissions and
> attributes (currently, only cacheability and shareability is in the plan) of a
> given RAM page in the stage-2 page talbes. The only related work can be seen 
> so
  ^ tables


> far is DOMCTL_pin_mem_cacheattr (see [3]), which is for controlling the
> cacheability of pages and is x86 HVM only. There seems to be no arch-neutral
> DOMCTL interfaces that can meet our requirements.
> 
> That's why we need a new arch-neutral DOMCTL, which is tentatively called
> DOMCTL_mem_attrs_op in this proposal and would enable us to control the access
> permissions, cacheability and shareability (ARM only) attributes of RAM pages.
> 
> 
>   Interface Specification
>   ~~~
> 
> A current draft of the interface looks like this:
> 
> /*
>  * Set access permissions, cacheability and shareability (ARM only) of a
>  * continuos range of normal memory (RAM) in the stage-2 page table.
>  */
> /* XEN_DOMCTL_memattrs_op */
> 
> /* set chacheability and shareability */
^ cacheability


> #define XEN_DOMCTL_MEMATTRS_OP_SET_CACHEATTRS  1
> /* set access permissions */
> #define XEN_DOMCTL_MEMATTRS_OP_SET_PERMISSIONS 2
> /* get chacheability and shareability */
^ cacheability

> #define XEN_DOMCTL_MEMATTRS_OP_GET_CACHEATTRS  1
> /* get access permissions */
> #define XEN_DOMCTL_MEMATTRS_OP_GET_PERMISSIONS 2
> 
> /* flags for XEN_DOMCTL_MEMATTRS_OP_SET_CACHEATTRS */
> /* chacheability flags, the values happen to be the same with those in
^ cacheability

>  * x86 PAT.  (See [4])
>  */
> /* uncacheable */
> #define XEN_DOMCTL_MEMATTRS_UC 0x00U
> /* write combine, x86 only */
> #define XEN_DOMCTL_MEMATTRS_CACHE_WC   0x01U
> /* write through */
> #define XEN_DOMCTL_MEMATTRS_CACHE_WT   0x04U
> /* write protect, x86 only */
> #define XEN_DOMCTL_MEMATTRS_CACHE_WP   0x05U
> /* write back */
> #define XEN_DOMCTL_MEMATTRS_CACHE_WB   0x06U
> /* strong uncacheable, x86 only*/
> #define XEN_DOMCTL_MEMATTRS_SUC0x07U

On the ARM side, we are missing BUFFERABLE and WRITEALLOC. I don't know
how they map to these tags, which comes from the x86 world. Maybe we
should just add them separately as ARM only, like:

  /* bufferable, ARM only */
  #define XEN_DOMCTL_MEMATTRS_BUFFERABLE 0x08U
  /* write alloc, ARM only */
  #define XEN_DOMCTL_MEMATTRS_CACHE_WA   0x09U

Theoretically, we could say XEN_DOMCTL_MEMATTRS_UC means "BUFFERABLE" on
ARM and XEN_DOMCTL_MEMATTRS_SUC means "UNCACHED", because that's
actually what they correspond to I think. However using x86 names for
ARM caching attributes is very confusing and error prone. So I would
prefer introducing separate tags for ARM and x86. However, reusing
XEN_DOMCTL_MEMATTRS_UC, XEN_DOMCTL_MEMATTRS_CACHE_WT and
XEN_DOMCTL_MEMATTRS_CACHE_WB as Zhongze did in this proposal would be OK
for me.

Julien, what do you think?


> /* shareability flags (See [5]), arm only, the value is taken from
>  * asm-arm/page.h, but live in the second 8-bit.
>  */
> #define XEN_DOMCTL_MEMATTRS_SHAREABILITY_SHIFT 8
> #define XEN_DOMCTL_MEMATTRS_SH_NON_SHAREABLE (LPAE_SH_NON_SHAREABLE<<8)
> #define XEN_DOMCTL_MEMATTRS_SH_UNPREDICTALE  (LPAE_SH_UNPREDICTALE<<8)

We don't need UNPREDICTALE as a possible value :-)


> #define XEN_DOMCTL_MEMATTRS_SH_OUTER (LPAE_SH_OUTER<<8)
> #define XEN_DOMCTL_MEMATTRS_SH_INNER (LPAE_SH_INNER<<8)
> 
> /* flags for XEN_DOMCTL_MEMATTRS_OP_SET_PERMISSIONS */
> #define XEN_DOMCTL_MEMATTRS_ACCESS_N 0x00U
> #define XEN_DOMCTL_MEMATTRS_ACCESS_R (0x01U<<0)
> #define XEN_DOMCTL_MEMATTRS_ACCESS_

[Xen-devel] [qemu-mainline baseline-only test] 71617: tolerable trouble: blocked/broken/fail/pass

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

flight 71617 qemu-mainline real [real]
http://osstest.xs.citrite.net/~osstest/testlogs/logs/71617/

Failures :-/ but no regressions.

Regressions which are regarded as allowable (not blocking):
 test-amd64-i386-xl-qemuu-winxpsp3-vcpus1 17 guest-start/win.repeat fail 
blocked in 71606
 test-amd64-i386-xl-qemuu-winxpsp3 17 guest-start/win.repeat fail blocked in 
71606
 build-armhf-libvirt   5 libvirt-buildfail   like 71606
 build-i386-libvirt5 libvirt-buildfail   like 71606
 build-amd64-libvirt   5 libvirt-buildfail   like 71606
 test-amd64-amd64-xl-qemuu-win7-amd64 15 guest-localmigrate/x10 fail like 71606
 test-amd64-i386-xl-qemuu-win7-amd64 16 guest-stop  fail like 71606

Tests which did not succeed, but are not blocking:
 test-amd64-amd64-libvirt-vhd  1 build-check(1)   blocked  n/a
 test-arm64-arm64-libvirt-xsm  1 build-check(1)   blocked  n/a
 test-amd64-i386-libvirt-qemuu-debianhvm-amd64-xsm 1 build-check(1) blocked n/a
 test-armhf-armhf-libvirt  1 build-check(1)   blocked  n/a
 test-arm64-arm64-xl   1 build-check(1)   blocked  n/a
 build-arm64-libvirt   1 build-check(1)   blocked  n/a
 test-arm64-arm64-libvirt-qcow2  1 build-check(1)   blocked  n/a
 test-amd64-amd64-libvirt-pair  1 build-check(1)   blocked  n/a
 test-amd64-i386-libvirt   1 build-check(1)   blocked  n/a
 test-armhf-armhf-libvirt-raw  1 build-check(1)   blocked  n/a
 test-arm64-arm64-libvirt  1 build-check(1)   blocked  n/a
 test-amd64-i386-libvirt-xsm   1 build-check(1)   blocked  n/a
 test-amd64-amd64-libvirt-xsm  1 build-check(1)   blocked  n/a
 test-amd64-amd64-libvirt  1 build-check(1)   blocked  n/a
 test-arm64-arm64-xl-credit2   1 build-check(1)   blocked  n/a
 test-amd64-amd64-libvirt-qemuu-debianhvm-amd64-xsm 1 build-check(1) blocked n/a
 test-arm64-arm64-xl-rtds  1 build-check(1)   blocked  n/a
 test-arm64-arm64-xl-multivcpu  1 build-check(1)   blocked  n/a
 test-armhf-armhf-libvirt-xsm  1 build-check(1)   blocked  n/a
 test-amd64-i386-libvirt-pair  1 build-check(1)   blocked  n/a
 test-arm64-arm64-xl-xsm   1 build-check(1)   blocked  n/a
 build-arm64-xsm   2 hosts-allocate   broken never pass
 build-arm64   2 hosts-allocate   broken never pass
 build-arm64-pvops 2 hosts-allocate   broken never pass
 build-arm64-xsm   3 capture-logs broken never pass
 build-arm64   3 capture-logs broken never pass
 build-arm64-pvops 3 capture-logs broken 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-xl-xsm  12 migrate-support-checkfail   never pass
 test-armhf-armhf-xl-xsm  13 saverestore-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-midway   12 migrate-support-checkfail   never pass
 test-armhf-armhf-xl-midway   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-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-amd64-amd64-qemuu-nested-amd 16 debian-hvm-install/l1/l2  fail never pass

version targeted for testing:
 qemuu577caa2672ccde7352fda3ef17e44993de862f0e
baseline version:
 qemuu931892e8a691a8a4151cc5fe1e13c14294bb28fb

Last test of basis71606  2017-06-27 10:15:21 Z3 days
Testing same since71617  2017-06-30 04:44:47 Z0 days1 attempts


People who touched revisions under test:
  Alberto Garcia 
  Edgar E. Iglesias 
  Kevin Wolf 
  KONRAD Frederic 
  Laszlo Ersek 
  Manos Pitsidianakis 
  Max Reitz 
  Peter Maydell 
  sochin.jiang 
  Stefan Hajnoczi 
  Stephen Bates 

jobs:
 build-amd64-xsm  pass
 build-arm64-xsm  broken  
 build-armhf-xsm  pass
 build-i386-xsm

Re: [Xen-devel] [PATCH v3 16/16] xen/arm: lpae: Switch from bool_t to bool

2017-06-30 Thread Stefano Stabellini
On Fri, 30 Jun 2017, Julien Grall wrote:
> On Fri, 30 Jun 2017, 21:12 Stefano Stabellini,  wrote:
>   On Fri, 30 Jun 2017, Julien Grall wrote:
>   > We are phasing out the use of bool_t in the hypervisor code.
> 
>   This is missing your signed-off-by.
> 
>   Reviewed-by: Stefano Stabellini 
> 
> 
> Doh.
> 
> Signed-off-by: Julien Grall 
> 
> Shall I resend the patch?

No, I can fix this.

> 
>   > ---
>   >     Changes in v3:
>   >         - Patch added
>   > ---
>   >  xen/include/asm-arm/lpae.h | 6 +++---
>   >  1 file changed, 3 insertions(+), 3 deletions(-)
>   >
>   > diff --git a/xen/include/asm-arm/lpae.h b/xen/include/asm-arm/lpae.h
>   > index 6fbf7c606c..a62b118630 100644
>   > --- a/xen/include/asm-arm/lpae.h
>   > +++ b/xen/include/asm-arm/lpae.h
>   > @@ -126,7 +126,7 @@ typedef union {
>   >      lpae_walk_t walk;
>   >  } lpae_t;
>   >
>   > -static inline bool_t lpae_valid(lpae_t pte)
>   > +static inline bool lpae_valid(lpae_t pte)
>   >  {
>   >      return pte.walk.valid;
>   >  }
>   > @@ -136,12 +136,12 @@ static inline bool_t lpae_valid(lpae_t pte)
>   >   * the table bit and therefore these would return the opposite to 
> what
>   >   * you would expect.
>   >   */
>   > -static inline bool_t lpae_table(lpae_t pte)
>   > +static inline bool lpae_table(lpae_t pte)
>   >  {
>   >      return lpae_valid(pte) && pte.walk.table;
>   >  }
>   >
>   > -static inline bool_t lpae_mapping(lpae_t pte)
>   > +static inline bool lpae_mapping(lpae_t pte)
>   >  {
>   >      return lpae_valid(pte) && !pte.walk.table;
>   >  }
>   > --
>   > 2.11.0
>   >
> 
>   ___
>   Xen-devel mailing list
>   Xen-devel@lists.xen.org
>   https://lists.xen.org/xen-devel
> 
> 
> ___
Xen-devel mailing list
Xen-devel@lists.xen.org
https://lists.xen.org/xen-devel


Re: [Xen-devel] [PATCH v2 4/4] vsmc: psci: remove 64 bit mode check

2017-06-30 Thread Stefano Stabellini
On Thu, 22 Jun 2017, Volodymyr Babchuk wrote:
> PSCI handling code had helper routine that checked calling convention.
> It does not needed anymore, because:
> 
>  - Generic handler checks that 64 bit calls can be made only by
>64 bit guests.
> 
>  - SMCCC requires that 64-bit handler should support both 32 and 64 bit
>calls even if they originate from 64 bit caller.
> 
> This patch removes that extra check.
> 
> Signed-off-by: Volodymyr Babchuk 
> ---
>  xen/arch/arm/vsmc.c | 13 +
>  1 file changed, 1 insertion(+), 12 deletions(-)
> 
> diff --git a/xen/arch/arm/vsmc.c b/xen/arch/arm/vsmc.c
> index 5f10fd1..1983e0e 100644
> --- a/xen/arch/arm/vsmc.c
> +++ b/xen/arch/arm/vsmc.c
> @@ -98,12 +98,6 @@ static bool handle_arch(struct cpu_user_regs *regs)
>  return false;
>  }
>  
> -/* helper function for checking arm mode 32/64 bit */
> -static inline int psci_mode_check(struct domain *d, register_t fid)
> -{
> -return !( is_64bit_domain(d)^( (fid & PSCI_0_2_64BIT) >> 30 ) );
> -}
> -
>  /* PSCI 2.0 interface */
>  static bool handle_ssc(struct cpu_user_regs *regs)
>  {
> @@ -125,8 +119,7 @@ static bool handle_ssc(struct cpu_user_regs *regs)
>  return true;
>  case ARM_SMCCC_FUNC_NUM(PSCI_0_2_FN_MIGRATE_INFO_UP_CPU):
>  perfc_incr(vpsci_migrate_info_up_cpu);
> -if ( psci_mode_check(current->domain, fid) )
> -set_user_reg(regs, 0, do_psci_0_2_migrate_info_up_cpu());
> +set_user_reg(regs, 0, do_psci_0_2_migrate_info_up_cpu());
>  return true;
>  case ARM_SMCCC_FUNC_NUM(PSCI_0_2_FN_SYSTEM_OFF):
>  perfc_incr(vpsci_system_off);
> @@ -140,7 +133,6 @@ static bool handle_ssc(struct cpu_user_regs *regs)
>  return true;
>  case ARM_SMCCC_FUNC_NUM(PSCI_0_2_FN_CPU_ON):
>  perfc_incr(vpsci_cpu_on);
> -if ( psci_mode_check(current->domain, fid) )

I would prefer if the `return true' was within the { } block. But anyway
it's just a code style issue, so:

Reviewed-by: Stefano Stabellini 


>  {
>  register_t vcpuid = get_user_reg(regs, 1);
>  register_t epoint = get_user_reg(regs, 2);
> @@ -151,7 +143,6 @@ static bool handle_ssc(struct cpu_user_regs *regs)
>  return true;
>  case ARM_SMCCC_FUNC_NUM(PSCI_0_2_FN_CPU_SUSPEND):
>  perfc_incr(vpsci_cpu_suspend);
> -if ( psci_mode_check(current->domain, fid) )
>  {
>  uint32_t pstate = get_user_reg(regs, 1);
>  register_t epoint = get_user_reg(regs, 2);
> @@ -162,7 +153,6 @@ static bool handle_ssc(struct cpu_user_regs *regs)
>  return true;
>  case ARM_SMCCC_FUNC_NUM(PSCI_0_2_FN_AFFINITY_INFO):
>  perfc_incr(vpsci_cpu_affinity_info);
> -if ( psci_mode_check(current->domain, fid) )
>  {
>  register_t taff = get_user_reg(regs, 1);
>  uint32_t laff = get_user_reg(regs,2);
> @@ -172,7 +162,6 @@ static bool handle_ssc(struct cpu_user_regs *regs)
>  return true;
>  case ARM_SMCCC_FUNC_NUM(PSCI_0_2_FN_MIGRATE):
>  perfc_incr(vpsci_cpu_migrate);
> -if ( psci_mode_check(current->domain, fid) )
>  {
>  uint32_t tcpu = get_user_reg(regs, 1);
>  set_user_reg(regs, 0, do_psci_0_2_migrate(tcpu));
> -- 
> 2.7.4
> 

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


Re: [Xen-devel] [PATCH v2 3/4] arm: traps: handle PSCI calls inside `vsmc.c`

2017-06-30 Thread Stefano Stabellini
On Thu, 22 Jun 2017, Volodymyr Babchuk wrote:
> PSCI is part of HVC/SMC interface, so it should be handled in
> appropriate place: `vsmc.c`. This patch just moves PSCI
> handler calls from `traps.c` to `vsmc.c`.
> 
> PSCI is considered as two different "services" in terms of SMCCC.
> Older PSCI 1.0 is treated as "architecture service", while never
> PSCI 2.0 is defined as "standard secure service".
> 
> Signed-off-by: Volodymyr Babchuk 
> Reviewed-by: Oleksandr Andrushchenko 
> Reviewed-by: Oleksandr Tyshchenko 
> ---
> Splitted this patch into two. Now this patch does not change the way,
> how PSCI code accesses the arguments.
> ---
>  xen/arch/arm/traps.c  | 124 --
>  xen/arch/arm/vsmc.c   | 136 
> ++
>  xen/include/public/arch-arm/smc.h |   5 ++
>  3 files changed, 153 insertions(+), 112 deletions(-)
> 
> diff --git a/xen/arch/arm/traps.c b/xen/arch/arm/traps.c
> index 66242e5..e806474 100644
> --- a/xen/arch/arm/traps.c
> +++ b/xen/arch/arm/traps.c
> @@ -39,7 +39,6 @@
>  #include 
>  #include 
>  #include 
> -#include 
>  #include 
>  #include 
>  #include 
> @@ -1450,113 +1449,6 @@ static void do_debug_trap(struct cpu_user_regs *regs, 
> unsigned int code)
>  }
>  #endif
>  
> -/* helper function for checking arm mode 32/64 bit */
> -static inline int psci_mode_check(struct domain *d, register_t fid)
> -{
> -return !( is_64bit_domain(d)^( (fid & PSCI_0_2_64BIT) >> 30 ) );
> -}
> -
> -static void do_trap_psci(struct cpu_user_regs *regs)
> -{
> -register_t fid = get_user_reg(regs,0);
> -
> -/* preloading in case psci_mode_check fails */
> -set_user_reg(regs, 0, PSCI_INVALID_PARAMETERS);
> -switch( fid )
> -{
> -case PSCI_cpu_off:
> -{
> -uint32_t pstate = get_user_reg(regs, 1);
> -perfc_incr(vpsci_cpu_off);
> -set_user_reg(regs, 0, do_psci_cpu_off(pstate));
> -}
> -break;
> -case PSCI_cpu_on:
> -{
> -uint32_t vcpuid =  get_user_reg(regs, 1);
> -register_t epoint = get_user_reg(regs, 2);
> -perfc_incr(vpsci_cpu_on);
> -set_user_reg(regs, 0, do_psci_cpu_on(vcpuid, epoint));
> -}
> -break;
> -case PSCI_0_2_FN_PSCI_VERSION:
> -perfc_incr(vpsci_version);
> -set_user_reg(regs, 0, do_psci_0_2_version());
> -break;
> -case PSCI_0_2_FN_CPU_OFF:
> -perfc_incr(vpsci_cpu_off);
> -set_user_reg(regs, 0, do_psci_0_2_cpu_off());
> -break;
> -case PSCI_0_2_FN_MIGRATE_INFO_TYPE:
> -perfc_incr(vpsci_migrate_info_type);
> -set_user_reg(regs, 0, do_psci_0_2_migrate_info_type());
> -break;
> -case PSCI_0_2_FN_MIGRATE_INFO_UP_CPU:
> -case PSCI_0_2_FN64_MIGRATE_INFO_UP_CPU:
> -perfc_incr(vpsci_migrate_info_up_cpu);
> -if ( psci_mode_check(current->domain, fid) )
> -set_user_reg(regs, 0, do_psci_0_2_migrate_info_up_cpu());
> -break;
> -case PSCI_0_2_FN_SYSTEM_OFF:
> -perfc_incr(vpsci_system_off);
> -do_psci_0_2_system_off();
> -set_user_reg(regs, 0, PSCI_INTERNAL_FAILURE);
> -break;
> -case PSCI_0_2_FN_SYSTEM_RESET:
> -perfc_incr(vpsci_system_reset);
> -do_psci_0_2_system_reset();
> -set_user_reg(regs, 0, PSCI_INTERNAL_FAILURE);
> -break;
> -case PSCI_0_2_FN_CPU_ON:
> -case PSCI_0_2_FN64_CPU_ON:
> -perfc_incr(vpsci_cpu_on);
> -if ( psci_mode_check(current->domain, fid) )
> -{
> -register_t vcpuid = get_user_reg(regs, 1);
> -register_t epoint = get_user_reg(regs, 2);
> -register_t cid = get_user_reg(regs, 3);
> -set_user_reg(regs, 0,
> - do_psci_0_2_cpu_on(vcpuid, epoint, cid));
> -}
> -break;
> -case PSCI_0_2_FN_CPU_SUSPEND:
> -case PSCI_0_2_FN64_CPU_SUSPEND:
> -perfc_incr(vpsci_cpu_suspend);
> -if ( psci_mode_check(current->domain, fid) )
> -{
> -uint32_t pstate = get_user_reg(regs, 1);
> -register_t epoint = get_user_reg(regs, 2);
> -register_t cid = get_user_reg(regs, 3);
> -set_user_reg(regs, 0,
> - do_psci_0_2_cpu_suspend(pstate, epoint, cid));
> -}
> -break;
> -case PSCI_0_2_FN_AFFINITY_INFO:
> -case PSCI_0_2_FN64_AFFINITY_INFO:
> -perfc_incr(vpsci_cpu_affinity_info);
> -if ( psci_mode_check(current->domain, fid) )
> -{
> -register_t taff = get_user_reg(regs, 1);
> -uint32_t laff = get_user_reg(regs, 2);
> -set_user_reg(regs, 0,
> - do_psci_0_2_affinity_info(taff, laff));
> -}
> -break;
> -case PSCI_0_2_FN_MIGRATE:
> -case PSCI_0_2_FN64_MIGRATE:
> -perfc_incr(vpsci_cpu_migrate);
> -if ( psci_mode_check(cur

[Xen-devel] [xtf test] 111230: regressions - trouble: broken/pass

2017-06-30 Thread osstest service owner
flight 111230 xtf real [real]
http://logs.test-lab.xenproject.org/osstest/logs/111230/

Regressions :-(

Tests which did not succeed and are blocking,
including tests which could not be run:
 test-xtf-amd64-amd64-1   59 leak-check/check fail REGR. vs. 111074
 test-xtf-amd64-amd64-4   59 leak-check/check fail REGR. vs. 111074
 test-xtf-amd64-amd64-5   59 leak-check/check fail REGR. vs. 111074
 test-xtf-amd64-amd64-2   59 leak-check/check fail REGR. vs. 111074
 test-xtf-amd64-amd64-3   59 leak-check/check fail REGR. vs. 111074

Tests which did not succeed, but are not blocking:
 test-xtf-amd64-amd64-1   58 xtf/test-hvm64-xsa-221   fail   never pass
 test-xtf-amd64-amd64-4   58 xtf/test-hvm64-xsa-221   fail   never pass
 test-xtf-amd64-amd64-5   58 xtf/test-hvm64-xsa-221   fail   never pass
 test-xtf-amd64-amd64-2   58 xtf/test-hvm64-xsa-221   fail   never pass
 test-xtf-amd64-amd64-3   58 xtf/test-hvm64-xsa-221   fail   never pass

version targeted for testing:
 xtf  0d6dddbd5a5666cb7d052688724662214a771033
baseline version:
 xtf  6723a66fe3e2a60793ec4fdbcd67250c954fe5d9

Last test of basis   111074  2017-06-26 14:44:07 Z4 days
Failing since44  2017-06-28 10:53:08 Z2 days7 attempts
Testing same since   111230  2017-06-30 13:18:23 Z0 days1 attempts


People who touched revisions under test:
  Andrew Cooper 
  Haozhong Zhang 

jobs:
 build-amd64-xtf  pass
 build-amd64  pass
 build-amd64-pvopspass
 test-xtf-amd64-amd64-1   broken  
 test-xtf-amd64-amd64-2   broken  
 test-xtf-amd64-amd64-3   broken  
 test-xtf-amd64-amd64-4   broken  
 test-xtf-amd64-amd64-5   broken  



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


Not pushing.


commit 0d6dddbd5a5666cb7d052688724662214a771033
Author: Haozhong Zhang 
Date:   Fri Dec 16 21:43:48 2016 +0800

vvmx: Test vmxon in VMX root w/ CPL = 3 and w/ current VMCS

Fault #GP(0) is expected in this test.

Signed-off-by: Haozhong Zhang 
Rebase and cleanup.
Signed-off-by: Andrew Cooper 

commit 23ce3ed364ffc850f6f239b056f45d66f7d24a5f
Author: Haozhong Zhang 
Date:   Fri Dec 16 21:43:47 2016 +0800

vvmx: Test vmxon in VMX root w/ CPL = 0 and w/ current VMCS

VMfailvalid() is expected in this test.

Signed-off-by: Haozhong Zhang 
Rebase and cleanup.
Signed-off-by: Andrew Cooper 

commit aaadefde675900471464c7c174248dc9cd14f3db
Author: Haozhong Zhang 
Date:   Fri Dec 16 21:43:46 2016 +0800

vvmx: Test vmxon in VMX root w/ CPL = 3 and w/o current VMCS

Fault #GP(0) is expected in this test.

Signed-off-by: Haozhong Zhang 
Rebase and cleanup.
Signed-off-by: Andrew Cooper 

commit bf97d4fb323194bff1d92f2ed52dcaeedcf4c39e
Author: Haozhong Zhang 
Date:   Fri Dec 16 21:43:45 2016 +0800

vvmx: Test vmxon in VMX root w/ CPL = 0 and w/o current VMCS

VMfailInvalid is expected in this test.

Signed-off-by: Haozhong Zhang 
Rebase and cleanup.
Signed-off-by: Andrew Cooper 

commit 6c9b86ca32ef8a375cd4346ba71d0e2b039d120b
Author: Haozhong Zhang 
Date:   Fri Dec 16 21:43:44 2016 +0800

vvmx: Test the correct vmxon

No error is expected in this test.

Signed-off-by: Haozhong Zhang 
Rebase and cleanup.
Signed-off-by: Andrew Cooper 

commit b7972eae5aa91c72c3db2ac991b9317c88f30ff5
Author: Haozhong Zhang 
Date:   Fri Dec 16 21:43:43 2016 +0800

vvmx: Test vmxon with bit 31 of VMCS revision ID set

VMfailInvalid is expected in this test.

Signed-off-by: Haozhong Zhang 
Rebase and cleanup.
Signed-off-by: Andrew Cooper 

commit 11f3f33f343a50cd62f7522758c30ea5a0e6877a
Author: Haozhong Zhang 
Date:   Fri Dec 16 21:43:42 2016 +0800

vvmx: Test vmxon with mismatched VMCS revision ID

VMfailInvalid is expected in this test.

Signed-off-by: Haozhong Zhang 
Rebase and cleanup.
Signed-off-by: Andrew C

[Xen-devel] [linux-4.1 test] 111195: tolerable FAIL - PUSHED

2017-06-30 Thread osstest service owner
flight 95 linux-4.1 real [real]
http://logs.test-lab.xenproject.org/osstest/logs/95/

Failures :-/ but no regressions.

Regressions which are regarded as allowable (not blocking):
 test-armhf-armhf-xl-rtds16 guest-start/debian.repeat fail REGR. vs. 110472

Tests which did not succeed, but are not blocking:
 test-amd64-amd64-xl-qemut-win7-amd64 17 guest-stop  fail blocked in 110472
 test-amd64-i386-xl-qemut-win7-amd64 17 guest-stop   fail blocked in 110472
 test-armhf-armhf-libvirt 14 saverestore-support-checkfail  like 110472
 test-armhf-armhf-libvirt-xsm 14 saverestore-support-checkfail  like 110472
 test-amd64-amd64-xl-qemuu-win7-amd64 16 guest-localmigrate/x10 fail like 110472
 test-amd64-i386-xl-qemuu-win7-amd64 16 guest-localmigrate/x10 fail like 110472
 test-amd64-i386-libvirt-xsm  13 migrate-support-checkfail   never pass
 test-amd64-i386-libvirt  13 migrate-support-checkfail   never pass
 test-amd64-amd64-xl-qemuu-ws16-amd64 10 windows-installfail never pass
 test-amd64-amd64-libvirt-xsm 13 migrate-support-checkfail   never pass
 test-amd64-amd64-xl-qemut-ws16-amd64 10 windows-installfail never pass
 test-amd64-i386-libvirt-qemuu-debianhvm-amd64-xsm 11 migrate-support-check 
fail never pass
 test-arm64-arm64-xl   7 xen-boot fail   never pass
 test-arm64-arm64-examine  7 reboot   fail   never pass
 test-arm64-arm64-xl-credit2   7 xen-boot fail   never pass
 test-arm64-arm64-libvirt-xsm  7 xen-boot fail   never pass
 test-arm64-arm64-xl-xsm   7 xen-boot fail   never pass
 test-amd64-amd64-libvirt 13 migrate-support-checkfail   never pass
 test-amd64-amd64-libvirt-qemuu-debianhvm-amd64-xsm 11 migrate-support-check 
fail never pass
 test-armhf-armhf-xl-arndale  13 migrate-support-checkfail   never pass
 test-armhf-armhf-xl-arndale  14 saverestore-support-checkfail   never pass
 test-amd64-amd64-libvirt-vhd 12 migrate-support-checkfail   never pass
 test-armhf-armhf-xl-multivcpu 13 migrate-support-checkfail  never pass
 test-armhf-armhf-xl-multivcpu 14 saverestore-support-checkfail  never pass
 test-amd64-i386-xl-qemuu-ws16-amd64 13 guest-saverestore   fail never pass
 test-armhf-armhf-libvirt 13 migrate-support-checkfail   never pass
 test-amd64-amd64-qemuu-nested-amd 17 debian-hvm-install/l1/l2  fail never pass
 test-amd64-i386-xl-qemut-ws16-amd64 13 guest-saverestore   fail never pass
 test-armhf-armhf-xl-rtds 13 migrate-support-checkfail   never pass
 test-armhf-armhf-xl-rtds 14 saverestore-support-checkfail   never pass
 test-armhf-armhf-xl-cubietruck 13 migrate-support-checkfail never pass
 test-armhf-armhf-xl-cubietruck 14 saverestore-support-checkfail never pass
 test-armhf-armhf-xl-credit2  13 migrate-support-checkfail   never pass
 test-armhf-armhf-xl-credit2  14 saverestore-support-checkfail   never pass
 test-armhf-armhf-libvirt-xsm 13 migrate-support-checkfail   never pass
 test-armhf-armhf-xl-xsm  13 migrate-support-checkfail   never pass
 test-armhf-armhf-xl-xsm  14 saverestore-support-checkfail   never pass
 test-armhf-armhf-xl-vhd  12 migrate-support-checkfail   never pass
 test-armhf-armhf-xl-vhd  13 saverestore-support-checkfail   never pass
 test-armhf-armhf-libvirt-raw 12 migrate-support-checkfail   never pass
 test-armhf-armhf-libvirt-raw 13 saverestore-support-checkfail   never pass
 test-armhf-armhf-xl  13 migrate-support-checkfail   never pass
 test-armhf-armhf-xl  14 saverestore-support-checkfail   never pass
 test-amd64-amd64-xl-qemuu-win10-i386 10 windows-installfail never pass
 test-amd64-amd64-xl-qemut-win10-i386 10 windows-installfail never pass
 test-amd64-i386-xl-qemut-win10-i386 10 windows-install fail never pass
 test-amd64-i386-xl-qemuu-win10-i386 10 windows-install fail never pass

version targeted for testing:
 linux2ac51e21d8c50ca37fc9b5b9a9b4937c810b0d0a
baseline version:
 linux4bd4cfc5210ef2f9002e54a16334a56acd295e4b

Last test of basis   110472  2017-06-15 20:23:20 Z   14 days
Testing same since   95  2017-06-29 17:21:55 Z1 days1 attempts


People who touched revisions under test:
  "Eric W. Biederman" 
  Al Viro 
  Alan Stern 
  Alex Deucher 
  Alexander Potapenko 
  Alexey Khoroshilov 
  Andrew Morton 
  Andrey Konovalov 
  Andrey Ryabinin 
  Anssi Hannula 
  Anton Bondarenko 
  Ard Biesheuvel 
  Arnd Bergmann 
  Ben Hutchings 
  Ben Skeggs 
  Bjorn Helgaas 
  Bjørn Mork 
  Brian Foster 
  Bryant G. Ly 
  Carlos Maiolino 
  Catalin Marinas 
  Chris Brandt 
  Christian König 
  Christoffer Dall 
  Christoph Hellwig 
  Christophe JAILLET 
  Coly 

Re: [Xen-devel] [PATCH v3 16/16] xen/arm: lpae: Switch from bool_t to bool

2017-06-30 Thread Julien Grall
On Fri, 30 Jun 2017, 21:12 Stefano Stabellini, 
wrote:

> On Fri, 30 Jun 2017, Julien Grall wrote:
> > We are phasing out the use of bool_t in the hypervisor code.
>
> This is missing your signed-off-by.
>
> Reviewed-by: Stefano Stabellini 
>

Doh.

Signed-off-by: Julien Grall 

Shall I resend the patch?

Cheers,


> > ---
> > Changes in v3:
> > - Patch added
> > ---
> >  xen/include/asm-arm/lpae.h | 6 +++---
> >  1 file changed, 3 insertions(+), 3 deletions(-)
> >
> > diff --git a/xen/include/asm-arm/lpae.h b/xen/include/asm-arm/lpae.h
> > index 6fbf7c606c..a62b118630 100644
> > --- a/xen/include/asm-arm/lpae.h
> > +++ b/xen/include/asm-arm/lpae.h
> > @@ -126,7 +126,7 @@ typedef union {
> >  lpae_walk_t walk;
> >  } lpae_t;
> >
> > -static inline bool_t lpae_valid(lpae_t pte)
> > +static inline bool lpae_valid(lpae_t pte)
> >  {
> >  return pte.walk.valid;
> >  }
> > @@ -136,12 +136,12 @@ static inline bool_t lpae_valid(lpae_t pte)
> >   * the table bit and therefore these would return the opposite to what
> >   * you would expect.
> >   */
> > -static inline bool_t lpae_table(lpae_t pte)
> > +static inline bool lpae_table(lpae_t pte)
> >  {
> >  return lpae_valid(pte) && pte.walk.table;
> >  }
> >
> > -static inline bool_t lpae_mapping(lpae_t pte)
> > +static inline bool lpae_mapping(lpae_t pte)
> >  {
> >  return lpae_valid(pte) && !pte.walk.table;
> >  }
> > --
> > 2.11.0
> >
>
> ___
> Xen-devel mailing list
> Xen-devel@lists.xen.org
> https://lists.xen.org/xen-devel
>
___
Xen-devel mailing list
Xen-devel@lists.xen.org
https://lists.xen.org/xen-devel


Re: [Xen-devel] [PATCH v3 00/16] xen/arm: Clean-up memory subsystems

2017-06-30 Thread Stefano Stabellini
I committed the first 15 patches (all but the last)

On Fri, 30 Jun 2017, Julien Grall wrote:
> Hi all,
> 
> This series, clean-up a bit the memory subsystems to ease further changes.
> 
> Cheers,
> 
> Julien Grall (16):
>   xen/arm: setup: Remove bogus xenheap_mfn_end in setup_mm for arm64
>   xen/arm: mm: Use typesafe mfn for xenheap_mfn_*
>   xen/arm: p2m: Redefine mfn_to_page and page_to_mfn to use typesafe
>   xen/arm: mm: Redefine virt_to_mfn to support typesafe
>   xen/arm: domain_build: Redefine virt_to_mfn to support typesafe
>   xen/arm: alternative: Redefine virt_to_mfn to support typesafe
>   xen/arm: livepatch: Redefine virt_to_mfn to support typesafe
>   xen/arm: create_xen_entries: Use typesafe MFN
>   xen/arm: Move LPAE definition in a separate header
>   xen/arm: lpae: Fix comments coding style
>   xen/arm: p2m: Rename p2m_valid, p2m_table, p2m_mapping and
> p2m_is_superpage
>   xen/arm: p2m: Move lpae_* helpers in lpae.h
>   xen/arm: mm: Use lpae_valid and lpae_table in create_xen_entries
>   xen/arm: mm: Introduce temporary variable in create_xen_entries
>   xen/arm: mm: Use __func__ rather than plain name in format string
>   xen/arm: lpae: Switch from bool_t to bool
> 
>  xen/arch/arm/alternative.c  |   6 +-
>  xen/arch/arm/domain_build.c |   6 +-
>  xen/arch/arm/livepatch.c|   6 +-
>  xen/arch/arm/mm.c   |  84 +-
>  xen/arch/arm/p2m.c  |  72 ++-
>  xen/arch/arm/setup.c|  20 ++---
>  xen/include/asm-arm/lpae.h  | 209 
> 
>  xen/include/asm-arm/mm.h|  14 +--
>  xen/include/asm-arm/page.h  | 152 +---
>  9 files changed, 315 insertions(+), 254 deletions(-)
>  create mode 100644 xen/include/asm-arm/lpae.h
> 
> -- 
> 2.11.0
> 

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


[Xen-devel] [RFC] DOMCTL_memattrs_op : a new DOMCTL to play with stage-2 page attributes

2017-06-30 Thread Zhongze Liu

   DOMCTL_memattrs_op : a new DOMCTL to play with stage-2 page attributes

  Zhongze Liu 


  Motivation and Description
  ~~

During the dicussion about the proposal "allow setting up shared memory areas
between VMs from xl config file" (see [1]), it's getting clear that when we
setup shared memory areas for VM communications from xl config file, we would
appreciate the ability to control the permissions and some attributes of the
shared memory pages: in the simplest the cases, regular cacheable RAM with read
write permissions will be enough (For ARM, it would be p2m_ram_rw and MATTR_MEM,
LPAE_SH_INNER). But there are also complicated cases where we might need deeper
control over the permissions, cacheability and shareability of the shared RAM
pages to meet some extra requirements (see [2]). And this could be done via
playing with the stage-2 page tables, on both x86 and ARM.

So there comes to the need for a DOMCTL that can set the permissions and
attributes (currently, only cacheability and shareability is in the plan) of a
given RAM page in the stage-2 page talbes. The only related work can be seen so
far is DOMCTL_pin_mem_cacheattr (see [3]), which is for controlling the
cacheability of pages and is x86 HVM only. There seems to be no arch-neutral
DOMCTL interfaces that can meet our requirements.

That's why we need a new arch-neutral DOMCTL, which is tentatively called
DOMCTL_mem_attrs_op in this proposal and would enable us to control the access
permissions, cacheability and shareability (ARM only) attributes of RAM pages.


  Interface Specification
  ~~~

A current draft of the interface looks like this:

/*
 * Set access permissions, cacheability and shareability (ARM only) of a
 * continuos range of normal memory (RAM) in the stage-2 page table.
 */
/* XEN_DOMCTL_memattrs_op */

/* set chacheability and shareability */
#define XEN_DOMCTL_MEMATTRS_OP_SET_CACHEATTRS  1
/* set access permissions */
#define XEN_DOMCTL_MEMATTRS_OP_SET_PERMISSIONS 2
/* get chacheability and shareability */
#define XEN_DOMCTL_MEMATTRS_OP_GET_CACHEATTRS  1
/* get access permissions */
#define XEN_DOMCTL_MEMATTRS_OP_GET_PERMISSIONS 2

/* flags for XEN_DOMCTL_MEMATTRS_OP_SET_CACHEATTRS */
/* chacheability flags, the values happen to be the same with those in
 * x86 PAT.  (See [4])
 */
/* uncacheable */
#define XEN_DOMCTL_MEMATTRS_UC 0x00U
/* write combine, x86 only */
#define XEN_DOMCTL_MEMATTRS_CACHE_WC   0x01U
/* write through */
#define XEN_DOMCTL_MEMATTRS_CACHE_WT   0x04U
/* write protect, x86 only */
#define XEN_DOMCTL_MEMATTRS_CACHE_WP   0x05U
/* write back */
#define XEN_DOMCTL_MEMATTRS_CACHE_WB   0x06U
/* strong uncacheable, x86 only*/
#define XEN_DOMCTL_MEMATTRS_SUC0x07U

/* shareability flags (See [5]), arm only, the value is taken from
 * asm-arm/page.h, but live in the second 8-bit.
 */
#define XEN_DOMCTL_MEMATTRS_SHAREABILITY_SHIFT 8
#define XEN_DOMCTL_MEMATTRS_SH_NON_SHAREABLE (LPAE_SH_NON_SHAREABLE<<8)
#define XEN_DOMCTL_MEMATTRS_SH_UNPREDICTALE  (LPAE_SH_UNPREDICTALE<<8)
#define XEN_DOMCTL_MEMATTRS_SH_OUTER (LPAE_SH_OUTER<<8)
#define XEN_DOMCTL_MEMATTRS_SH_INNER (LPAE_SH_INNER<<8)

/* flags for XEN_DOMCTL_MEMATTRS_OP_SET_PERMISSIONS */
#define XEN_DOMCTL_MEMATTRS_ACCESS_N 0x00U
#define XEN_DOMCTL_MEMATTRS_ACCESS_R (0x01U<<0)
#define XEN_DOMCTL_MEMATTRS_ACCESS_W (0x01U<<1)
#define XEN_DOMCTL_MEMATTRS_ACCESS_X (0x01U<<2)
#define XEN_DOMCTL_MEMATTRS_ACCESS_RW\
(XEN_DOMCTL_MEMATTRS_ACCESS_R|XEN_DOMCTL_MEMATTRS_ACCESS_W)
#define XEN_DOMCTL_MEMATTRS_ACCESS_RX\
(XEN_DOMCTL_MEMATTRS_ACCESS_R|XEN_DOMCTL_MEMATTRS_ACCESS_X)
#define XEN_DOMCTL_MEMATTRS_ACCESS_WX\
(XEN_DOMCTL_MEMATTRS_ACCESS_W|XEN_DOMCTL_MEMATTRS_ACCESS_X)
#define XEN_DOMCTL_MEMATTRS_ACCESS_RWX\
(XEN_DOMCTL_MEMATTRS_ACCESS_RW|XEN_DOMCTL_MEMATTRS_ACCESS_X)

struct xen_domctl_memattrs_op {
  int op; /* IN XEN_DOMCTL_MEMATTRS_OP_* */
  xen_pfn_t first_gfn;/* IN first page in range */
  uint32_t nr_gfns;   /* IN number of pages in range */

  XEN_GUEST_HANDLE(uint32_t) attrs;  /* IN/OUT per-page attrs */

  XEN_GUEST_HANDLE(int) errs;   /* OUT Per gfn error code */
}


  Notes
  ~
Since neither x86 nor arm support all the cache/share flags above, the
function will return an err if the one or more flags given by the caller are
not supported.



  References
  ~~
[1] [RFC]Proposal to allow setting up shared memory areas between VMs
from xl config file
v2: https://lists.xen.org/archives/html/xen-devel/2017-06/msg02256.html
  

Re: [Xen-devel] [PATCH v3 16/16] xen/arm: lpae: Switch from bool_t to bool

2017-06-30 Thread Stefano Stabellini
On Fri, 30 Jun 2017, Julien Grall wrote:
> We are phasing out the use of bool_t in the hypervisor code.

This is missing your signed-off-by.

Reviewed-by: Stefano Stabellini 


> ---
> Changes in v3:
> - Patch added
> ---
>  xen/include/asm-arm/lpae.h | 6 +++---
>  1 file changed, 3 insertions(+), 3 deletions(-)
> 
> diff --git a/xen/include/asm-arm/lpae.h b/xen/include/asm-arm/lpae.h
> index 6fbf7c606c..a62b118630 100644
> --- a/xen/include/asm-arm/lpae.h
> +++ b/xen/include/asm-arm/lpae.h
> @@ -126,7 +126,7 @@ typedef union {
>  lpae_walk_t walk;
>  } lpae_t;
>  
> -static inline bool_t lpae_valid(lpae_t pte)
> +static inline bool lpae_valid(lpae_t pte)
>  {
>  return pte.walk.valid;
>  }
> @@ -136,12 +136,12 @@ static inline bool_t lpae_valid(lpae_t pte)
>   * the table bit and therefore these would return the opposite to what
>   * you would expect.
>   */
> -static inline bool_t lpae_table(lpae_t pte)
> +static inline bool lpae_table(lpae_t pte)
>  {
>  return lpae_valid(pte) && pte.walk.table;
>  }
>  
> -static inline bool_t lpae_mapping(lpae_t pte)
> +static inline bool lpae_mapping(lpae_t pte)
>  {
>  return lpae_valid(pte) && !pte.walk.table;
>  }
> -- 
> 2.11.0
> 

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


Re: [Xen-devel] [PATCH v3 03/16] xen/arm: p2m: Redefine mfn_to_page and page_to_mfn to use typesafe

2017-06-30 Thread Stefano Stabellini
On Fri, 30 Jun 2017, Julien Grall wrote:
> The file xen/arch/arm/p2m.c is using typesafe MFN in most of the place.
> This requires caller to mfn_to_page and page_to_mfn to use _mfn/mfn_x.
> 
> To avoid extra _mfn/mfn_x, re-define mfn_to_page and page_to_mfn within
> xen/arch/arm/p2m.c to handle typesafe MFN.
> 
> Signed-off-by: Julien Grall 

Reviewed-by: Stefano Stabellini 


> ---
> The idea behind redefining locally mfn_to_page and page_to_mfn is
> splitting the introduction of typesafe MFN in smaller series and
> between multiple people. We know the file is typesafe ready and if
> we decide to make the main helper typesafe, we would just need to
> drop the definition at the top of the file.
> 
> Changes in v3:
> - Use __page_to_mfn(...) rather than mfn_x(page_to_mfn(...))
> ---
>  xen/arch/arm/p2m.c | 20 +---
>  1 file changed, 13 insertions(+), 7 deletions(-)
> 
> diff --git a/xen/arch/arm/p2m.c b/xen/arch/arm/p2m.c
> index 05eb584e89..3e20a1ec82 100644
> --- a/xen/arch/arm/p2m.c
> +++ b/xen/arch/arm/p2m.c
> @@ -38,6 +38,12 @@ static unsigned int __read_mostly max_vmid = 
> MAX_VMID_8_BIT;
>  
>  #define P2M_ROOT_PAGES(1<  
> +/* Override macros from asm/mm.h to make them work with mfn_t */
> +#undef mfn_to_page
> +#define mfn_to_page(mfn) __mfn_to_page(mfn_x(mfn))
> +#undef page_to_mfn
> +#define page_to_mfn(pg) _mfn(__page_to_mfn(pg))
> +
>  unsigned int __read_mostly p2m_ipa_bits;
>  
>  /* Helpers to lookup the properties of each level */
> @@ -115,7 +121,7 @@ void dump_p2m_lookup(struct domain *d, paddr_t addr)
>  printk("dom%d IPA 0x%"PRIpaddr"\n", d->domain_id, addr);
>  
>  printk("P2M @ %p mfn:0x%lx\n",
> -   p2m->root, page_to_mfn(p2m->root));
> +   p2m->root, __page_to_mfn(p2m->root));
>  
>  dump_pt_walk(page_to_maddr(p2m->root), addr,
>   P2M_ROOT_LEVEL, P2M_ROOT_PAGES);
> @@ -591,7 +597,7 @@ static int p2m_create_table(struct p2m_domain *p2m, 
> lpae_t *entry)
>   * The access value does not matter because the hardware will ignore
>   * the permission fields for table entry.
>   */
> -pte = mfn_to_p2m_entry(_mfn(page_to_mfn(page)), p2m_invalid,
> +pte = mfn_to_p2m_entry(page_to_mfn(page), p2m_invalid,
> p2m->default_access);
>  
>  p2m_write_pte(entry, pte, p2m->clean_pte);
> @@ -650,9 +656,9 @@ static void p2m_put_l3_page(const lpae_t pte)
>   */
>  if ( p2m_is_foreign(pte.p2m.type) )
>  {
> -unsigned long mfn = pte.p2m.base;
> +mfn_t mfn = _mfn(pte.p2m.base);
>  
> -ASSERT(mfn_valid(_mfn(mfn)));
> +ASSERT(mfn_valid(mfn));
>  put_page(mfn_to_page(mfn));
>  }
>  }
> @@ -702,7 +708,7 @@ static void p2m_free_entry(struct p2m_domain *p2m,
>  mfn = _mfn(entry.p2m.base);
>  ASSERT(mfn_valid(mfn));
>  
> -pg = mfn_to_page(mfn_x(mfn));
> +pg = mfn_to_page(mfn);
>  
>  page_list_del(pg, &p2m->pages);
>  free_domheap_page(pg);
> @@ -780,7 +786,7 @@ static bool p2m_split_superpage(struct p2m_domain *p2m, 
> lpae_t *entry,
>  
>  unmap_domain_page(table);
>  
> -pte = mfn_to_p2m_entry(_mfn(page_to_mfn(page)), p2m_invalid,
> +pte = mfn_to_p2m_entry(page_to_mfn(page), p2m_invalid,
> p2m->default_access);
>  
>  /*
> @@ -1442,7 +1448,7 @@ struct page_info *get_page_from_gva(struct vcpu *v, 
> vaddr_t va,
>  if ( !mfn_valid(maddr_to_mfn(maddr)) )
>  goto err;
>  
> -page = mfn_to_page(mfn_x(maddr_to_mfn(maddr)));
> +page = mfn_to_page(maddr_to_mfn(maddr));
>  ASSERT(page);
>  
>  if ( unlikely(!get_page(page, d)) )
> -- 
> 2.11.0
> 

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


Re: [Xen-devel] [PATCH v3 01/16] xen/arm: setup: Remove bogus xenheap_mfn_end in setup_mm for arm64

2017-06-30 Thread Stefano Stabellini
On Fri, 30 Jun 2017, Julien Grall wrote:
> xenheap_mfn_end is storing an MFN and not a physical address. The value will
> be reset after the loop. So drop this bogus xenheap_mfn_end.
> 
> Signed-off-by: Julien Grall 
> ---
> Changes in v2:
> - Update commit message
> 
> Changes in v3:
> - Don't mention the fact that Xen is not currently using
> xenheap_mfn_end.
> - Add Stefano's reviewed-by

You didn't actually add my reviewed-by :-)
But that's OK


> ---
>  xen/arch/arm/setup.c | 2 --
>  1 file changed, 2 deletions(-)
> 
> diff --git a/xen/arch/arm/setup.c b/xen/arch/arm/setup.c
> index f00f29a45b..ab4d8e4218 100644
> --- a/xen/arch/arm/setup.c
> +++ b/xen/arch/arm/setup.c
> @@ -654,8 +654,6 @@ static void __init setup_mm(unsigned long dtb_paddr, 
> size_t dtb_size)
>  if ( e > bank_end )
>  e = bank_end;
>  
> -xenheap_mfn_end = e;
> -
>  dt_unreserved_regions(s, e, init_boot_pages, 0);
>  s = n;
>  }
> -- 
> 2.11.0
> 

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


[Xen-devel] [xen-unstable-smoke test] 111237: tolerable trouble: broken/pass - PUSHED

2017-06-30 Thread osstest service owner
flight 111237 xen-unstable-smoke real [real]
http://logs.test-lab.xenproject.org/osstest/logs/111237/

Failures :-/ but no regressions.

Tests which did not succeed, but are not blocking:
 test-arm64-arm64-xl-xsm   1 build-check(1)   blocked  n/a
 test-amd64-amd64-libvirt 13 migrate-support-checkfail   never pass
 test-armhf-armhf-xl  13 migrate-support-checkfail   never pass
 test-armhf-armhf-xl  14 saverestore-support-checkfail   never pass

version targeted for testing:
 xen  c2ce38d3adda75215d53cb930ac23abaa668f4fe
baseline version:
 xen  143e0c2c2d64e64fce2e1302ffda1cacf0727c8c

Last test of basis   111234  2017-06-30 16:01:12 Z0 days
Testing same since   111237  2017-06-30 18:02:01 Z0 days1 attempts


People who touched revisions under test:
  Andrew Cooper 

jobs:
 build-amd64  pass
 build-armhf  pass
 build-amd64-libvirt  pass
 test-armhf-armhf-xl  pass
 test-arm64-arm64-xl-xsm  broken  
 test-amd64-amd64-xl-qemuu-debianhvm-i386 pass
 test-amd64-amd64-libvirt 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=xen-unstable-smoke
+ revision=c2ce38d3adda75215d53cb930ac23abaa668f4fe
+ . ./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 xen-unstable-smoke 
c2ce38d3adda75215d53cb930ac23abaa668f4fe
+ branch=xen-unstable-smoke
+ revision=c2ce38d3adda75215d53cb930ac23abaa668f4fe
+ . ./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=xen
+ xenbranch=xen-unstable-smoke
+ qemuubranch=qemu-upstream-unstable
+ '[' xxen = xlinux ']'
+ linuxbranch=
+ '[' xqemu-upstream-unstable = x ']'
+ select_prevxenbranch
++ ./cri-getprevxenbranch xen-unstable-smoke
+ prevxenbranch=xen-4.9-testing
+ '[' xc2ce38d3adda75215d53cb930ac23abaa668f4fe = 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/osste

Re: [Xen-devel] [PATCH 10/18] x86/monitor.c: use plain bool

2017-06-30 Thread Razvan Cojocaru
On 06/30/2017 08:45 PM, Andrew Cooper wrote:
> On 30/06/17 18:01, Wei Liu wrote:
>> Signed-off-by: Wei Liu 
> 
> This file falls under introspection maintainership, so CC'ing them (not
> that this change in controversial).
> 
> Reviewed-by: Andrew Cooper 

Acked-by: Razvan Cojocaru 


Thanks,
Razvan


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


Re: [Xen-devel] [PATCH 00/18] x86: more bool_t to bool cleanup

2017-06-30 Thread Andrew Cooper
On 30/06/17 18:01, Wei Liu wrote:
> Seeing that bool_t keeps creeping back in new patches I think the only 
> solution
> is to get rid of bool_t once and for all, as soon as possible.

Patches: 4-13, 16-18

Reviewed-by: Andrew Cooper 

Patch 1 still hasn't arrived in my mailbox yet, so review in shorthand here:

Attribute order on:
static bool __initdata acpi_skip_timer_override;

Prototype for:
cpuidle_using_deep_cstate()

Otherwise, Reviewed-by: Andrew Cooper 

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


Re: [Xen-devel] [OSSTEST PATCH v11 16/20] ts-openstack-tempest: Update list of skipped tests

2017-06-30 Thread Anthony PERARD
On Fri, Jun 30, 2017 at 05:32:56PM +0100, Ian Jackson wrote:
> Anthony PERARD writes ("Re: [OSSTEST PATCH v11 16/20] ts-openstack-tempest: 
> Update list of skipped tests"):
> > But it can be told to print subunit v2, which can be pipped to a different
> > program to transform into want we want, including simple cvs, subunit v1, 
> > and
> > other.
> > 
> > I thing we could try to parse subunit v1, grab the start and finish time
> > of a test, the result, and the output of the tests. And have all that as
> > subunit. During my manual tests, `tempest run --subunit ... | subunit-2to1`
> > only print the stuff about a tests once it is finish, so I guess we'll
> > have to rewrite substep_start() (or another function) to take time as
> > parameter.
> 
> That sounds quite good really.
> 
> I guess you don't want to write a parser for subunit v2 but if there
> is one in Perl already in some package in Debian we could use it.  Or
> subunit-2to1 is fine.

There is one, libsubunit-perl, but its only for subunit v1 :-(. So I
guess I'll use both, the package and subunit-2to1.

-- 
Anthony PERARD

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


[Xen-devel] [xen-unstable-smoke test] 111234: tolerable trouble: broken/pass - PUSHED

2017-06-30 Thread osstest service owner
flight 111234 xen-unstable-smoke real [real]
http://logs.test-lab.xenproject.org/osstest/logs/111234/

Failures :-/ but no regressions.

Tests which did not succeed, but are not blocking:
 test-arm64-arm64-xl-xsm   1 build-check(1)   blocked  n/a
 test-amd64-amd64-libvirt 13 migrate-support-checkfail   never pass
 test-armhf-armhf-xl  13 migrate-support-checkfail   never pass
 test-armhf-armhf-xl  14 saverestore-support-checkfail   never pass

version targeted for testing:
 xen  143e0c2c2d64e64fce2e1302ffda1cacf0727c8c
baseline version:
 xen  6b792e28bca8301e04d7f0f0dd7033410ea941b5

Last test of basis   111226  2017-06-30 11:02:13 Z0 days
Testing same since   111234  2017-06-30 16:01:12 Z0 days1 attempts


People who touched revisions under test:
  Andrew Cooper 
  Igor Druzhinin 
  Marek Marczykowski-Górecki 
  Wei Liu 

jobs:
 build-amd64  pass
 build-armhf  pass
 build-amd64-libvirt  pass
 test-armhf-armhf-xl  pass
 test-arm64-arm64-xl-xsm  broken  
 test-amd64-amd64-xl-qemuu-debianhvm-i386 pass
 test-amd64-amd64-libvirt 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=xen-unstable-smoke
+ revision=143e0c2c2d64e64fce2e1302ffda1cacf0727c8c
+ . ./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 xen-unstable-smoke 
143e0c2c2d64e64fce2e1302ffda1cacf0727c8c
+ branch=xen-unstable-smoke
+ revision=143e0c2c2d64e64fce2e1302ffda1cacf0727c8c
+ . ./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=xen
+ xenbranch=xen-unstable-smoke
+ qemuubranch=qemu-upstream-unstable
+ '[' xxen = xlinux ']'
+ linuxbranch=
+ '[' xqemu-upstream-unstable = x ']'
+ select_prevxenbranch
++ ./cri-getprevxenbranch xen-unstable-smoke
+ prevxenbranch=xen-4.9-testing
+ '[' x143e0c2c2d64e64fce2e1302ffda1cacf0727c8c = 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://xenbi

Re: [Xen-devel] [PATCH 15/18] x86/mpparse.c: use plain bool

2017-06-30 Thread Andrew Cooper
On 30/06/17 18:01, Wei Liu wrote:
> @@ -781,10 +781,7 @@ void __init mp_register_lapic_address (
>  }
>  
>  
> -int mp_register_lapic (
> - u32 id,
> - bool_t  enabled,
> - bool_t  hotplug)
> +int mp_register_lapic(u32 id, bool enabled, bool hotplug)

Prototype.  Otherwise, Reviewed-by: Andrew Cooper


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


Re: [Xen-devel] [PATCH 14/18] x86/io_apic.c: use plain bool

2017-06-30 Thread Andrew Cooper
On 30/06/17 18:01, Wei Liu wrote:
> @@ -229,7 +229,7 @@ union entry_union {
>  };
>  
>  struct IO_APIC_route_entry __ioapic_read_entry(
> -unsigned int apic, unsigned int pin, bool_t raw)
> +unsigned int apic, unsigned int pin, bool raw)

Prototype.

>  {
>  unsigned int (*read)(unsigned int, unsigned int)
>  = raw ? __io_apic_read : io_apic_read;
> @@ -240,7 +240,7 @@ struct IO_APIC_route_entry __ioapic_read_entry(
>  }
>  
>  static struct IO_APIC_route_entry ioapic_read_entry(
> -unsigned int apic, unsigned int pin, bool_t raw)
> +unsigned int apic, unsigned int pin, bool raw)
>  {
>  struct IO_APIC_route_entry entry;
>  unsigned long flags;
> @@ -252,7 +252,7 @@ static struct IO_APIC_route_entry ioapic_read_entry(
>  }
>  
>  void __ioapic_write_entry(
> -unsigned int apic, unsigned int pin, bool_t raw,
> +unsigned int apic, unsigned int pin, bool raw,

Prototype.

Otherwise, Reviewed-by: Andrew Cooper 

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


[Xen-devel] [PATCH 01/18] x86/acpi: use plain bool

2017-06-30 Thread Wei Liu
Signed-off-by: Wei Liu 
---
 xen/arch/x86/acpi/boot.c| 26 +-
 xen/arch/x86/acpi/cpu_idle.c| 19 ++-
 xen/arch/x86/acpi/cpufreq/cpufreq.c |  2 +-
 xen/include/asm-x86/acpi.h  |  5 ++---
 xen/include/asm-x86/cpuidle.h   |  2 +-
 xen/include/asm-x86/softirq.h   |  2 +-
 6 files changed, 28 insertions(+), 28 deletions(-)

diff --git a/xen/arch/x86/acpi/boot.c b/xen/arch/x86/acpi/boot.c
index 83cbff95c1..17ba3c39ac 100644
--- a/xen/arch/x86/acpi/boot.c
+++ b/xen/arch/x86/acpi/boot.c
@@ -44,14 +44,14 @@
 
 #define PREFIX "ACPI: "
 
-bool_t __initdata acpi_noirq;  /* skip ACPI IRQ initialization */
-bool_t __initdata acpi_ht = 1; /* enable HT */
+bool __initdata acpi_noirq; /* skip ACPI IRQ initialization */
+bool __initdata acpi_ht = true; /* enable HT */
 
-bool_t __initdata acpi_lapic;
-bool_t __initdata acpi_ioapic;
+bool __initdata acpi_lapic;
+bool __initdata acpi_ioapic;
 
 /* acpi_skip_timer_override: Skip IRQ0 overrides. */
-static bool_t acpi_skip_timer_override __initdata;
+static bool acpi_skip_timer_override __initdata;
 boolean_param("acpi_skip_timer_override", acpi_skip_timer_override);
 
 static u64 acpi_lapic_addr __initdata = APIC_DEFAULT_PHYS_BASE;
@@ -83,7 +83,7 @@ acpi_parse_x2apic(struct acpi_subtable_header *header, const 
unsigned long end)
 {
struct acpi_madt_local_x2apic *processor =
container_of(header, struct acpi_madt_local_x2apic, header);
-   bool_t enabled = 0;
+   bool enabled = false;
 
if (BAD_MADT_ENTRY(processor, end))
return -EINVAL;
@@ -107,7 +107,7 @@ acpi_parse_x2apic(struct acpi_subtable_header *header, 
const unsigned long end)
if (processor->lapic_flags & ACPI_MADT_ENABLED) {
x86_acpiid_to_apicid[processor->uid] =
processor->local_apic_id;
-   enabled = 1;
+   enabled = true;
}
 
/*
@@ -127,7 +127,7 @@ acpi_parse_lapic(struct acpi_subtable_header * header, 
const unsigned long end)
 {
struct acpi_madt_local_apic *processor =
container_of(header, struct acpi_madt_local_apic, header);
-   bool_t enabled = 0;
+   bool enabled = false;
 
if (BAD_MADT_ENTRY(processor, end))
return -EINVAL;
@@ -137,7 +137,7 @@ acpi_parse_lapic(struct acpi_subtable_header * header, 
const unsigned long end)
/* Record local apic id only when enabled */
if (processor->lapic_flags & ACPI_MADT_ENABLED) {
x86_acpiid_to_apicid[processor->processor_id] = processor->id;
-   enabled = 1;
+   enabled = true;
}
 
/*
@@ -634,7 +634,7 @@ static void __init acpi_process_madt(void)
 */
error = acpi_parse_madt_lapic_entries();
if (!error) {
-   acpi_lapic = 1;
+   acpi_lapic = true;
generic_bigsmp_probe();
  
/*
@@ -642,7 +642,7 @@ static void __init acpi_process_madt(void)
 */
error = acpi_parse_madt_ioapic_entries();
if (!error) {
-   acpi_ioapic = 1;
+   acpi_ioapic = true;
 
smp_found_config = 1;
clustered_apic_check();
@@ -670,8 +670,8 @@ static void __init acpi_process_madt(void)
  * other side effects.
  *
  * side effects of acpi_boot_init:
- * acpi_lapic = 1 if LAPIC found
- * acpi_ioapic = 1 if IOAPIC found
+ * acpi_lapic = true if LAPIC found
+ * acpi_ioapic = true if IOAPIC found
  * if (acpi_lapic && acpi_ioapic) smp_found_config = 1;
  * ...
  *
diff --git a/xen/arch/x86/acpi/cpu_idle.c b/xen/arch/x86/acpi/cpu_idle.c
index e2be474ee1..482b8a78f3 100644
--- a/xen/arch/x86/acpi/cpu_idle.c
+++ b/xen/arch/x86/acpi/cpu_idle.c
@@ -78,7 +78,7 @@ static void lapic_timer_nop(void) { }
 void (*__read_mostly lapic_timer_off)(void);
 void (*__read_mostly lapic_timer_on)(void);
 
-bool_t lapic_timer_init(void)
+bool lapic_timer_init(void)
 {
 if ( boot_cpu_has(X86_FEATURE_ARAT) )
 {
@@ -96,9 +96,9 @@ bool_t lapic_timer_init(void)
 lapic_timer_on = pit_broadcast_exit;
 }
 else
-return 0;
+return false;
 
-return 1;
+return true;
 }
 
 static uint64_t (*__read_mostly tick_to_ns)(uint64_t) = acpi_pm_tick_to_ns;
@@ -106,7 +106,7 @@ static uint64_t (*__read_mostly tick_to_ns)(uint64_t) = 
acpi_pm_tick_to_ns;
 void (*__read_mostly pm_idle_save)(void);
 unsigned int max_cstate __read_mostly = ACPI_PROCESSOR_MAX_POWER - 1;
 integer_param("max_cstate", max_cstate);
-static bool_t __read_mostly local_apic_timer_c2_ok;
+static bool __read_mostly local_apic_timer_c2_ok;
 boolean_param("lapic_timer_c2_ok", local_apic_timer_c2_ok);
 
 struct acpi_processor_power *__read

Re: [Xen-devel] [PATCH 10/18] x86/monitor.c: use plain bool

2017-06-30 Thread Andrew Cooper
On 30/06/17 18:01, Wei Liu wrote:
> Signed-off-by: Wei Liu 

This file falls under introspection maintainership, so CC'ing them (not
that this change in controversial).

Reviewed-by: Andrew Cooper 

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


Re: [Xen-devel] [PATCH 03/18] x86/debug.c: use plain bool

2017-06-30 Thread Andrew Cooper
On 30/06/17 18:01, Wei Liu wrote:
> Signed-off-by: Wei Liu 
> ---
>  xen/arch/x86/debug.c | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/xen/arch/x86/debug.c b/xen/arch/x86/debug.c
> index 2070077ec5..a5d85a92f9 100644
> --- a/xen/arch/x86/debug.c
> +++ b/xen/arch/x86/debug.c
> @@ -156,7 +156,7 @@ dbg_pv_va2mfn(dbgva_t vaddr, struct domain *dp, uint64_t 
> pgd3val)
>  /* Returns: number of bytes remaining to be copied */
>  unsigned int dbg_rw_guest_mem(struct domain *dp, void * __user gaddr,
>void * __user buf, unsigned int len,
> -  bool_t toaddr, uint64_t pgd3)
> +  bool toaddr, uint64_t pgd3)

This can become static, while...

>  {
>  while ( len > 0 )
>  {
> @@ -207,7 +207,7 @@ unsigned int dbg_rw_guest_mem(struct domain *dp, void * 
> __user gaddr,
>   * Returns: number of bytes remaining to be copied. 
>   */
>  unsigned int dbg_rw_mem(void * __user addr, void * __user buf,
> -unsigned int len, domid_t domid, bool_t toaddr,
> +unsigned int len, domid_t domid, bool toaddr,
>  uint64_t pgd3)

this one has a prototype which needs updating.

Otherwise, Reviewed-by: Andrew Cooper 

>  {
>  DBGP2("gmem:addr:%lx buf:%p len:$%u domid:%d toaddr:%x\n",


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


Re: [Xen-devel] [PATCH 02/18] x86/apic.c: use plain bool

2017-06-30 Thread Andrew Cooper
On 30/06/17 18:01, Wei Liu wrote:
> Signed-off-by: Wei Liu 
> ---
>  xen/arch/x86/apic.c| 30 +++---
>  xen/include/asm-x86/apic.h |  4 ++--
>  2 files changed, 17 insertions(+), 17 deletions(-)
>
> diff --git a/xen/arch/x86/apic.c b/xen/arch/x86/apic.c
> index 8c6c2f5819..28a1ef8a58 100644
> --- a/xen/arch/x86/apic.c
> +++ b/xen/arch/x86/apic.c
> @@ -37,8 +37,8 @@
>  #include 
>  #include 
>  
> -static bool_t tdt_enabled __read_mostly;
> -static bool_t tdt_enable __initdata = 1;
> +static bool tdt_enabled __read_mostly;
> +static bool tdt_enable __initdata = true;

As we are cleaning things up,

static bool __read_mostly tdt_enabled;
static bool __initdata tdt_enable = true;

>  boolean_param("tdt", tdt_enable);
>  
>  static struct {
> @@ -70,7 +70,7 @@ static s8 __initdata enable_local_apic; /* 
> -1=force-disable, +1=force-enable */
>   */
>  u8 __read_mostly apic_verbosity;
>  
> -static bool_t __initdata opt_x2apic = 1;
> +static bool __initdata opt_x2apic = true;
>  boolean_param("x2apic", opt_x2apic);
>  
>  /*
> @@ -79,8 +79,8 @@ boolean_param("x2apic", opt_x2apic);
>   */
>  static enum apic_mode apic_boot_mode = APIC_MODE_INVALID;
>  
> -bool_t __read_mostly x2apic_enabled = 0;
> -bool_t __read_mostly directed_eoi_enabled = 0;
> +bool __read_mostly x2apic_enabled = false;
> +bool __read_mostly directed_eoi_enabled = false;

I believe the "= false" are redundant here.

Otherwise, Reviewed-by: Andrew Cooper 

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


Re: [Xen-devel] offtopic: handling patches

2017-06-30 Thread Andrew Cooper
On 30/06/17 17:57, Marek Marczykowski-Górecki wrote:
> Hi,
>
> How you guys handle patches with emails? I know git am and git
> format-patch/send-email, but those tools are quite limited, especially
> when handling patch series, subsequent versions etc.
> What I miss there:
>  - patch versioning (git notes could be used, but it doesn't survive git
>commit --amend, nor git rebase)
>  - keeping/versioning cover email
>  - collecting Cc: from all patches in series into cover email
>  - adding Reviewed-by, Acked-by etc tags
>
> I can't believe you all do this all manually ;)
> Is there any commonly available tool I can't find, or everyone have own
> scripts?

Manually, I'm afraid.  I've never found anything more automatic which works.

My general workflow is a single git branch which is always rebased onto
staging.

Patch version information lives in the commit message under a --- line,
and I am frequent user of `git commit --fixup/--squash` and `git rebase
--interactive`.

I've a separate directory tree where I format patch series including
cover letters, before using `git send-email --dry-run *.patch` to send
them.  These get recycled in a lazy fashon, typically once the series
has been committed, but the old cover letters generally available in an
adjacent directory when sending a newer series.

For collecting and reviewing tags, look at the PatchWork `pwclient`
utility.  Its `git-am` mode automagically collects tags, which is
fantastically useful for applying a patch for committing.  (Then again,
I do always manually check the conversation on list before actually
committing the series.)

~Andrew

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


[Xen-devel] [PATCH 10/18] x86/monitor.c: use plain bool

2017-06-30 Thread Wei Liu
Signed-off-by: Wei Liu 
---
 xen/arch/x86/monitor.c| 20 ++--
 xen/include/asm-x86/monitor.h |  2 +-
 2 files changed, 11 insertions(+), 11 deletions(-)

diff --git a/xen/arch/x86/monitor.c b/xen/arch/x86/monitor.c
index 764195a7d1..706454f23c 100644
--- a/xen/arch/x86/monitor.c
+++ b/xen/arch/x86/monitor.c
@@ -104,17 +104,17 @@ static int monitor_disable_msr(struct domain *d, u32 msr)
 return 0;
 }
 
-bool_t monitored_msr(const struct domain *d, u32 msr)
+bool monitored_msr(const struct domain *d, u32 msr)
 {
 const unsigned long *bitmap;
 
 if ( !d->arch.monitor.msr_bitmap )
-return 0;
+return false;
 
 bitmap = monitor_bitmap_for_msr(d, &msr);
 
 if ( !bitmap )
-return 0;
+return false;
 
 return test_bit(msr, bitmap);
 }
@@ -123,14 +123,14 @@ int arch_monitor_domctl_event(struct domain *d,
   struct xen_domctl_monitor_op *mop)
 {
 struct arch_domain *ad = &d->arch;
-bool_t requested_status = (XEN_DOMCTL_MONITOR_OP_ENABLE == mop->op);
+bool requested_status = (XEN_DOMCTL_MONITOR_OP_ENABLE == mop->op);
 
 switch ( mop->event )
 {
 case XEN_DOMCTL_MONITOR_EVENT_WRITE_CTRLREG:
 {
 unsigned int ctrlreg_bitmask;
-bool_t old_status;
+bool old_status;
 
 if ( unlikely(mop->u.mov_to_cr.index >=
   ARRAY_SIZE(ad->monitor.write_ctrlreg_mask)) )
@@ -183,7 +183,7 @@ int arch_monitor_domctl_event(struct domain *d,
 
 case XEN_DOMCTL_MONITOR_EVENT_MOV_TO_MSR:
 {
-bool_t old_status;
+bool old_status;
 int rc;
 u32 msr = mop->u.mov_to_msr.msr;
 
@@ -209,7 +209,7 @@ int arch_monitor_domctl_event(struct domain *d,
 
 case XEN_DOMCTL_MONITOR_EVENT_SINGLESTEP:
 {
-bool_t old_status = ad->monitor.singlestep_enabled;
+bool old_status = ad->monitor.singlestep_enabled;
 
 if ( unlikely(old_status == requested_status) )
 return -EEXIST;
@@ -243,7 +243,7 @@ int arch_monitor_domctl_event(struct domain *d,
 
 case XEN_DOMCTL_MONITOR_EVENT_SOFTWARE_BREAKPOINT:
 {
-bool_t old_status = ad->monitor.software_breakpoint_enabled;
+bool old_status = ad->monitor.software_breakpoint_enabled;
 
 if ( unlikely(old_status == requested_status) )
 return -EEXIST;
@@ -256,7 +256,7 @@ int arch_monitor_domctl_event(struct domain *d,
 
 case XEN_DOMCTL_MONITOR_EVENT_DEBUG_EXCEPTION:
 {
-bool_t old_status = ad->monitor.debug_exception_enabled;
+bool old_status = ad->monitor.debug_exception_enabled;
 
 if ( unlikely(old_status == requested_status) )
 return -EEXIST;
@@ -272,7 +272,7 @@ int arch_monitor_domctl_event(struct domain *d,
 
 case XEN_DOMCTL_MONITOR_EVENT_CPUID:
 {
-bool_t old_status = ad->monitor.cpuid_enabled;
+bool old_status = ad->monitor.cpuid_enabled;
 
 if ( unlikely(old_status == requested_status) )
 return -EEXIST;
diff --git a/xen/include/asm-x86/monitor.h b/xen/include/asm-x86/monitor.h
index 81a133b679..c5c323b6aa 100644
--- a/xen/include/asm-x86/monitor.h
+++ b/xen/include/asm-x86/monitor.h
@@ -96,6 +96,6 @@ int arch_monitor_init_domain(struct domain *d);
 
 void arch_monitor_cleanup_domain(struct domain *d);
 
-bool_t monitored_msr(const struct domain *d, u32 msr);
+bool monitored_msr(const struct domain *d, u32 msr);
 
 #endif /* __ASM_X86_MONITOR_H__ */
-- 
2.11.0


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


[Xen-devel] [PATCH 17/18] x86/msi.c: use plain bool

2017-06-30 Thread Wei Liu
Signed-off-by: Wei Liu 
---
 xen/arch/x86/msi.c| 32 
 xen/include/asm-x86/msi.h |  6 +++---
 2 files changed, 19 insertions(+), 19 deletions(-)

diff --git a/xen/arch/x86/msi.c b/xen/arch/x86/msi.c
index d98f400699..77998f4fb3 100644
--- a/xen/arch/x86/msi.c
+++ b/xen/arch/x86/msi.c
@@ -121,7 +121,7 @@ static void msix_put_fixmap(struct arch_msix *msix, int idx)
 spin_unlock(&msix->table_lock);
 }
 
-static bool_t memory_decoded(const struct pci_dev *dev)
+static bool memory_decoded(const struct pci_dev *dev)
 {
 u8 bus, slot, func;
 
@@ -142,13 +142,13 @@ static bool_t memory_decoded(const struct pci_dev *dev)
   PCI_COMMAND_MEMORY);
 }
 
-static bool_t msix_memory_decoded(const struct pci_dev *dev, unsigned int pos)
+static bool msix_memory_decoded(const struct pci_dev *dev, unsigned int pos)
 {
 u16 control = pci_conf_read16(dev->seg, dev->bus, PCI_SLOT(dev->devfn),
   PCI_FUNC(dev->devfn), msix_control_reg(pos));
 
 if ( !(control & PCI_MSIX_FLAGS_ENABLE) )
-return 0;
+return false;
 
 return memory_decoded(dev);
 }
@@ -191,7 +191,7 @@ void msi_compose_msg(unsigned vector, const cpumask_t 
*cpu_mask, struct msi_msg
 MSI_DATA_VECTOR(vector);
 }
 
-static bool_t read_msi_msg(struct msi_desc *entry, struct msi_msg *msg)
+static bool read_msi_msg(struct msi_desc *entry, struct msi_msg *msg)
 {
 switch ( entry->msi_attrib.type )
 {
@@ -228,7 +228,7 @@ static bool_t read_msi_msg(struct msi_desc *entry, struct 
msi_msg *msg)
 
 if ( unlikely(!msix_memory_decoded(entry->dev,
entry->msi_attrib.pos)) )
-return 0;
+return false;
 msg->address_lo = readl(base + PCI_MSIX_ENTRY_LOWER_ADDR_OFFSET);
 msg->address_hi = readl(base + PCI_MSIX_ENTRY_UPPER_ADDR_OFFSET);
 msg->data = readl(base + PCI_MSIX_ENTRY_DATA_OFFSET);
@@ -241,7 +241,7 @@ static bool_t read_msi_msg(struct msi_desc *entry, struct 
msi_msg *msg)
 if ( iommu_intremap )
 iommu_read_msi_from_ire(entry, msg);
 
-return 1;
+return true;
 }
 
 static int write_msi_msg(struct msi_desc *entry, struct msi_msg *msg)
@@ -383,13 +383,13 @@ int msi_maskable_irq(const struct msi_desc *entry)
|| entry->msi_attrib.maskbit;
 }
 
-static bool_t msi_set_mask_bit(struct irq_desc *desc, bool_t host, bool_t 
guest)
+static bool msi_set_mask_bit(struct irq_desc *desc, bool host, bool guest)
 {
 struct msi_desc *entry = desc->msi_desc;
 struct pci_dev *pdev;
 u16 seg, control;
 u8 bus, slot, func;
-bool_t flag = host || guest, maskall;
+bool flag = host || guest, maskall;
 
 ASSERT(spin_is_locked(&desc->lock));
 BUG_ON(!entry || !entry->dev);
@@ -434,13 +434,13 @@ static bool_t msi_set_mask_bit(struct irq_desc *desc, 
bool_t host, bool_t guest)
 entry->msi_attrib.host_masked = host;
 entry->msi_attrib.guest_masked = guest;
 
-flag = 1;
+flag = true;
 }
 else if ( flag && !(control & PCI_MSIX_FLAGS_MASKALL) )
 {
 domid_t domid = pdev->domain->domain_id;
 
-maskall = 1;
+maskall = true;
 if ( pdev->msix->warned != domid )
 {
 pdev->msix->warned = domid;
@@ -503,7 +503,7 @@ void unmask_msi_irq(struct irq_desc *desc)
 WARN();
 }
 
-void guest_mask_msi_irq(struct irq_desc *desc, bool_t mask)
+void guest_mask_msi_irq(struct irq_desc *desc, bool mask)
 {
 msi_set_mask_bit(desc, desc->msi_desc->msi_attrib.host_masked, mask);
 }
@@ -850,7 +850,7 @@ static int msix_capability_init(struct pci_dev *dev,
 u8 bus = dev->bus;
 u8 slot = PCI_SLOT(dev->devfn);
 u8 func = PCI_FUNC(dev->devfn);
-bool_t maskall = msix->host_maskall;
+bool maskall = msix->host_maskall;
 
 ASSERT(pcidevs_locked());
 
@@ -984,7 +984,7 @@ static int msix_capability_init(struct pci_dev *dev,
 
 if ( !msix->used_entries )
 {
-maskall = 0;
+maskall = false;
 if ( !msix->guest_maskall )
 control &= ~PCI_MSIX_FLAGS_MASKALL;
 else
@@ -1161,7 +1161,7 @@ static void __pci_disable_msix(struct msi_desc *entry)
PCI_CAP_ID_MSIX);
 u16 control = pci_conf_read16(seg, bus, slot, func,
   msix_control_reg(entry->msi_attrib.pos));
-bool_t maskall = dev->msix->host_maskall;
+bool maskall = dev->msix->host_maskall;
 
 if ( unlikely(!(control & PCI_MSIX_FLAGS_ENABLE)) )
 {
@@ -1181,7 +1181,7 @@ static void __pci_disable_msix(struct msi_desc *entry)
"cannot disable IRQ %d: masking MSI-X on %04x:%02x:%02x.%u\n",
entry->irq, dev->seg, dev->bus,
PCI_SLOT(dev->devfn), PCI_FUNC(dev->devfn));
-maskall = 1;
+maskall = true;
 }
 dev->msix->host_ma

[Xen-devel] [PATCH 13/18] x86/smpboot.c: use plain bool

2017-06-30 Thread Wei Liu
Signed-off-by: Wei Liu 
---
 xen/arch/x86/smpboot.c | 5 +++--
 xen/arch/x86/time.c| 2 +-
 xen/include/asm-x86/time.h | 2 +-
 3 files changed, 5 insertions(+), 4 deletions(-)

diff --git a/xen/arch/x86/smpboot.c b/xen/arch/x86/smpboot.c
index f375eb682d..8d91f6ca01 100644
--- a/xen/arch/x86/smpboot.c
+++ b/xen/arch/x86/smpboot.c
@@ -106,7 +106,7 @@ static void smp_store_cpu_info(int id)
  * TSC's upper 32 bits can't be written in earlier CPUs (before
  * Prescott), there is no way to resync one AP against BP.
  */
-bool_t disable_tsc_sync;
+bool disable_tsc_sync;
 
 static atomic_t tsc_count;
 static uint64_t tsc_value;
@@ -975,7 +975,8 @@ int cpu_add(uint32_t apic_id, uint32_t acpi_id, uint32_t 
pxm)
 /* Physically added CPUs do not have synchronised TSC. */
 if ( boot_cpu_has(X86_FEATURE_TSC_RELIABLE) )
 {
-static bool_t once_only;
+static bool once_only;
+
 if ( !test_and_set_bool(once_only) )
 printk(XENLOG_WARNING
" ** New physical CPU %u may have skewed TSC and hence "
diff --git a/xen/arch/x86/time.c b/xen/arch/x86/time.c
index 780baa55a3..b988b94d2e 100644
--- a/xen/arch/x86/time.c
+++ b/xen/arch/x86/time.c
@@ -1568,7 +1568,7 @@ static void __init tsc_check_writability(void)
 cpuidle_disable_deep_cstate();
 
 /* synchronize_tsc_slave() must do nothing */
-disable_tsc_sync = 1;
+disable_tsc_sync = true;
 }
 
 static void __init reset_percpu_time(void *unused)
diff --git a/xen/include/asm-x86/time.h b/xen/include/asm-x86/time.h
index ef989a69b3..046302ef19 100644
--- a/xen/include/asm-x86/time.h
+++ b/xen/include/asm-x86/time.h
@@ -24,7 +24,7 @@
 
 typedef u64 cycles_t;
 
-extern bool_t disable_tsc_sync;
+extern bool disable_tsc_sync;
 
 static inline cycles_t get_cycles(void)
 {
-- 
2.11.0


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


[Xen-devel] [PATCH 14/18] x86/io_apic.c: use plain bool

2017-06-30 Thread Wei Liu
Signed-off-by: Wei Liu 
---
 xen/arch/x86/apic.c   |  8 
 xen/arch/x86/io_apic.c| 34 +-
 xen/include/asm-x86/io_apic.h |  6 +++---
 3 files changed, 24 insertions(+), 24 deletions(-)

diff --git a/xen/arch/x86/apic.c b/xen/arch/x86/apic.c
index 28a1ef8a58..bcd8a7fd8b 100644
--- a/xen/arch/x86/apic.c
+++ b/xen/arch/x86/apic.c
@@ -381,12 +381,12 @@ int __init verify_local_APIC(void)
  */
 if ( reg0 & APIC_LVR_DIRECTED_EOI )
 {
-if ( ioapic_ack_new == 1 && ioapic_ack_forced == 1 )
+if ( ioapic_ack_new && ioapic_ack_forced )
 printk("Not enabling directed EOI because ioapic_ack_new has been "
"forced on the command line\n");
 else
 {
-ioapic_ack_new = 0;
+ioapic_ack_new = false;
 directed_eoi_enabled = true;
 printk("Enabled directed EOI with ioapic_ack_old on!\n");
 }
@@ -1346,7 +1346,7 @@ int __init APIC_init_uniprocessor (void)
 setup_clear_cpu_cap(X86_FEATURE_APIC);
 
 if (!smp_found_config && !cpu_has_apic) {
-skip_ioapic_setup = 1;
+skip_ioapic_setup = true;
 return -1;
 }
 
@@ -1356,7 +1356,7 @@ int __init APIC_init_uniprocessor (void)
 if (!cpu_has_apic) {
 printk(KERN_ERR "BIOS bug, local APIC #%d not detected!...\n",
boot_cpu_physical_apicid);
-skip_ioapic_setup = 1;
+skip_ioapic_setup = true;
 return -1;
 }
 
diff --git a/xen/arch/x86/io_apic.c b/xen/arch/x86/io_apic.c
index bd59e13fbb..29958dd475 100644
--- a/xen/arch/x86/io_apic.c
+++ b/xen/arch/x86/io_apic.c
@@ -43,9 +43,9 @@ static struct { int pin, apic; } ioapic_i8259 = { -1, -1 };
 
 static DEFINE_SPINLOCK(ioapic_lock);
 
-bool_t __read_mostly skip_ioapic_setup;
-bool_t __initdata ioapic_ack_new = 1;
-bool_t __initdata ioapic_ack_forced = 0;
+bool __read_mostly skip_ioapic_setup;
+bool __initdata ioapic_ack_new = true;
+bool __initdata ioapic_ack_forced;
 
 /*
  * # of IRQ routing registers
@@ -229,7 +229,7 @@ union entry_union {
 };
 
 struct IO_APIC_route_entry __ioapic_read_entry(
-unsigned int apic, unsigned int pin, bool_t raw)
+unsigned int apic, unsigned int pin, bool raw)
 {
 unsigned int (*read)(unsigned int, unsigned int)
 = raw ? __io_apic_read : io_apic_read;
@@ -240,7 +240,7 @@ struct IO_APIC_route_entry __ioapic_read_entry(
 }
 
 static struct IO_APIC_route_entry ioapic_read_entry(
-unsigned int apic, unsigned int pin, bool_t raw)
+unsigned int apic, unsigned int pin, bool raw)
 {
 struct IO_APIC_route_entry entry;
 unsigned long flags;
@@ -252,7 +252,7 @@ static struct IO_APIC_route_entry ioapic_read_entry(
 }
 
 void __ioapic_write_entry(
-unsigned int apic, unsigned int pin, bool_t raw,
+unsigned int apic, unsigned int pin, bool raw,
 struct IO_APIC_route_entry e)
 {
 void (*write)(unsigned int, unsigned int, unsigned int)
@@ -264,7 +264,7 @@ void __ioapic_write_entry(
 }
 
 static void ioapic_write_entry(
-unsigned int apic, unsigned int pin, bool_t raw,
+unsigned int apic, unsigned int pin, bool raw,
 struct IO_APIC_route_entry e)
 {
 unsigned long flags;
@@ -294,7 +294,7 @@ static void __io_apic_eoi(unsigned int apic, unsigned int 
vector, unsigned int p
 /* Else fake an EOI by switching to edge triggered mode
  * and back */
 struct IO_APIC_route_entry entry;
-bool_t need_to_unmask = 0;
+bool need_to_unmask = false;
 
 entry = __ioapic_read_entry(apic, pin, TRUE);
 
@@ -304,7 +304,7 @@ static void __io_apic_eoi(unsigned int apic, unsigned int 
vector, unsigned int p
  * a note to unmask it later */
 entry.mask = 1;
 __ioapic_write_entry(apic, pin, TRUE, entry);
-need_to_unmask = 1;
+need_to_unmask = true;
 }
 
 /* Flip the trigger mode to edge and back */
@@ -1094,7 +1094,7 @@ static inline void UNEXPECTED_IO_APIC(void)
 {
 }
 
-static void /*__init*/ __print_IO_APIC(bool_t boot)
+static void /*__init*/ __print_IO_APIC(bool boot)
 {
 int apic, i;
 union IO_APIC_reg_00 reg_00;
@@ -1585,20 +1585,20 @@ static void __init setup_ioapic_ack(char *s)
 {
 if ( !strcmp(s, "old") )
 {
-ioapic_ack_new = 0;
-ioapic_ack_forced = 1;
+ioapic_ack_new = false;
+ioapic_ack_forced = true;
 }
 else if ( !strcmp(s, "new") )
 {
-ioapic_ack_new = 1;
-ioapic_ack_forced = 1;
+ioapic_ack_new = true;
+ioapic_ack_forced = true;
 }
 else
 printk("Unknown ioapic_ack value specified: '%s'\n", s);
 }
 custom_param("ioapic_ack", setup_ioapic_ack);
 
-static bool_t io_apic_level_ack_pending(unsigned int irq)
+static bool io_apic_level_ack_pending(unsigned int irq)
 {
 struct irq_pin_list *entry;
 unsigned long flags;
@@ -2498,7 +2498,7 @@ void dump_ioapic_irq_info(void)
 sta

[Xen-devel] [PATCH 16/18] x86/numa.c: use plain bool

2017-06-30 Thread Wei Liu
Signed-off-by: Wei Liu 
---
 xen/arch/x86/numa.c| 10 +-
 xen/include/asm-x86/numa.h |  2 +-
 2 files changed, 6 insertions(+), 6 deletions(-)

diff --git a/xen/arch/x86/numa.c b/xen/arch/x86/numa.c
index 6f4d438690..d45196fafc 100644
--- a/xen/arch/x86/numa.c
+++ b/xen/arch/x86/numa.c
@@ -49,7 +49,7 @@ cpumask_t node_to_cpumask[MAX_NUMNODES] __read_mostly;
 
 nodemask_t __read_mostly node_online_map = { { [0] = 1UL } };
 
-bool_t numa_off = 0;
+bool numa_off;
 s8 acpi_numa = 0;
 
 int srat_disabled(void)
@@ -302,13 +302,13 @@ void numa_set_node(int cpu, nodeid_t node)
 static __init int numa_setup(char *opt) 
 { 
 if ( !strncmp(opt,"off",3) )
-numa_off = 1;
+numa_off = true;
 if ( !strncmp(opt,"on",2) )
-numa_off = 0;
+numa_off = false;
 #ifdef CONFIG_NUMA_EMU
 if ( !strncmp(opt, "fake=", 5) )
 {
-numa_off = 0;
+numa_off = false;
 numa_fake = simple_strtoul(opt+5,NULL,0);
 if ( numa_fake >= MAX_NUMNODES )
 numa_fake = MAX_NUMNODES;
@@ -317,7 +317,7 @@ static __init int numa_setup(char *opt)
 #ifdef CONFIG_ACPI_NUMA
 if ( !strncmp(opt,"noacpi",6) )
 {
-numa_off = 0;
+numa_off = false;
 acpi_numa = -1;
 }
 #endif
diff --git a/xen/include/asm-x86/numa.h b/xen/include/asm-x86/numa.h
index 24792381b4..bada2c0bb9 100644
--- a/xen/include/asm-x86/numa.h
+++ b/xen/include/asm-x86/numa.h
@@ -30,7 +30,7 @@ extern nodeid_t pxm_to_node(unsigned int pxm);
 
 extern void numa_add_cpu(int cpu);
 extern void numa_init_array(void);
-extern bool_t numa_off;
+extern bool numa_off;
 
 
 extern int srat_disabled(void);
-- 
2.11.0


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


[Xen-devel] [PATCH 12/18] x86/srat.c: use plain bool

2017-06-30 Thread Wei Liu
Signed-off-by: Wei Liu 
---
 xen/arch/x86/srat.c | 10 +-
 1 file changed, 5 insertions(+), 5 deletions(-)

diff --git a/xen/arch/x86/srat.c b/xen/arch/x86/srat.c
index d86783eddd..cd1283e58c 100644
--- a/xen/arch/x86/srat.c
+++ b/xen/arch/x86/srat.c
@@ -41,7 +41,7 @@ static struct node node_memblk_range[NR_NODE_MEMBLKS];
 static nodeid_t memblk_nodeid[NR_NODE_MEMBLKS];
 static __initdata DECLARE_BITMAP(memblk_hotplug, NR_NODE_MEMBLKS);
 
-static inline bool_t node_found(unsigned idx, unsigned pxm)
+static inline bool node_found(unsigned idx, unsigned pxm)
 {
return ((pxm2node[idx].pxm == pxm) &&
(pxm2node[idx].node != NUMA_NO_NODE));
@@ -65,7 +65,7 @@ nodeid_t setup_node(unsigned pxm)
 {
nodeid_t node;
unsigned idx;
-   static bool_t warned;
+   static bool warned;
static unsigned nodes_found;
 
BUILD_BUG_ON(MAX_NUMNODES >= NUMA_NO_NODE);
@@ -88,7 +88,7 @@ nodeid_t setup_node(unsigned pxm)
if (!warned) {
printk(KERN_WARNING "SRAT: Too many proximity domains (%#x)\n",
   pxm);
-   warned = 1;
+   warned = true;
}
 
return NUMA_NO_NODE;
@@ -311,8 +311,8 @@ acpi_numa_memory_affinity_init(const struct 
acpi_srat_mem_affinity *ma)
if (i < 0)
/* everything fine */;
else if (memblk_nodeid[i] == node) {
-   bool_t mismatch = !(ma->flags & ACPI_SRAT_MEM_HOT_PLUGGABLE) !=
- !test_bit(i, memblk_hotplug);
+   bool mismatch = !(ma->flags & ACPI_SRAT_MEM_HOT_PLUGGABLE) !=
+   !test_bit(i, memblk_hotplug);
 
printk("%sSRAT: PXM %u (%"PRIx64"-%"PRIx64") overlaps with 
itself (%"PRIx64"-%"PRIx64")\n",
   mismatch ? KERN_ERR : KERN_WARNING, pxm, start, end,
-- 
2.11.0


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


[Xen-devel] [PATCH 18/18] x86/psr.c: use plain bool

2017-06-30 Thread Wei Liu
Signed-off-by: Wei Liu 
---
 xen/arch/x86/psr.c | 14 +++---
 1 file changed, 7 insertions(+), 7 deletions(-)

diff --git a/xen/arch/x86/psr.c b/xen/arch/x86/psr.c
index 0b5073c41f..381f9a046d 100644
--- a/xen/arch/x86/psr.c
+++ b/xen/arch/x86/psr.c
@@ -270,7 +270,7 @@ static struct psr_cat_socket_info 
*get_cat_socket_info(unsigned int socket)
 return cat_socket_info + socket;
 }
 
-static inline bool_t cdp_is_enabled(unsigned int socket)
+static inline bool cdp_is_enabled(unsigned int socket)
 {
 return cdp_socket_enable && test_bit(socket, cdp_socket_enable);
 }
@@ -297,7 +297,7 @@ int psr_get_l3_cbm(struct domain *d, unsigned int socket,
uint64_t *cbm, enum cbm_type type)
 {
 struct psr_cat_socket_info *info = get_cat_socket_info(socket);
-bool_t cdp_enabled = cdp_is_enabled(socket);
+bool cdp_enabled = cdp_is_enabled(socket);
 
 if ( IS_ERR(info) )
 return PTR_ERR(info);
@@ -331,7 +331,7 @@ int psr_get_l3_cbm(struct domain *d, unsigned int socket,
 return 0;
 }
 
-static bool_t psr_check_cbm(unsigned int cbm_len, uint64_t cbm)
+static bool psr_check_cbm(unsigned int cbm_len, uint64_t cbm)
 {
 unsigned int first_bit, zero_bit;
 
@@ -357,7 +357,7 @@ static bool_t psr_check_cbm(unsigned int cbm_len, uint64_t 
cbm)
 struct cos_cbm_info
 {
 unsigned int cos;
-bool_t cdp;
+bool cdp;
 uint64_t cbm_code;
 uint64_t cbm_data;
 };
@@ -376,7 +376,7 @@ static void do_write_l3_cbm(void *data)
 }
 
 static int write_l3_cbm(unsigned int socket, unsigned int cos,
-uint64_t cbm_code, uint64_t cbm_data, bool_t cdp)
+uint64_t cbm_code, uint64_t cbm_data, bool cdp)
 {
 struct cos_cbm_info info =
 {
@@ -401,7 +401,7 @@ static int write_l3_cbm(unsigned int socket, unsigned int 
cos,
 }
 
 static int find_cos(struct psr_cat_cbm *map, unsigned int cos_max,
-uint64_t cbm_code, uint64_t cbm_data, bool_t cdp_enabled)
+uint64_t cbm_code, uint64_t cbm_data, bool cdp_enabled)
 {
 unsigned int cos;
 
@@ -440,7 +440,7 @@ int psr_set_l3_cbm(struct domain *d, unsigned int socket,
 unsigned int old_cos, cos_max;
 int cos, ret;
 uint64_t cbm_data, cbm_code;
-bool_t cdp_enabled = cdp_is_enabled(socket);
+bool cdp_enabled = cdp_is_enabled(socket);
 struct psr_cat_cbm *map;
 struct psr_cat_socket_info *info = get_cat_socket_info(socket);
 
-- 
2.11.0


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


[Xen-devel] [PATCH 15/18] x86/mpparse.c: use plain bool

2017-06-30 Thread Wei Liu
Signed-off-by: Wei Liu 
---
 xen/arch/x86/acpi/boot.c  |  4 ++--
 xen/arch/x86/genapic/bigsmp.c |  4 ++--
 xen/arch/x86/io_apic.c|  2 +-
 xen/arch/x86/mpparse.c| 25 +++--
 xen/include/asm-x86/mpspec.h  |  6 +++---
 5 files changed, 19 insertions(+), 22 deletions(-)

diff --git a/xen/arch/x86/acpi/boot.c b/xen/arch/x86/acpi/boot.c
index 17ba3c39ac..004cb320ea 100644
--- a/xen/arch/x86/acpi/boot.c
+++ b/xen/arch/x86/acpi/boot.c
@@ -644,7 +644,7 @@ static void __init acpi_process_madt(void)
if (!error) {
acpi_ioapic = true;
 
-   smp_found_config = 1;
+   smp_found_config = true;
clustered_apic_check();
}
}
@@ -672,7 +672,7 @@ static void __init acpi_process_madt(void)
  * side effects of acpi_boot_init:
  * acpi_lapic = true if LAPIC found
  * acpi_ioapic = true if IOAPIC found
- * if (acpi_lapic && acpi_ioapic) smp_found_config = 1;
+ * if (acpi_lapic && acpi_ioapic) smp_found_config = true;
  * ...
  *
  * return value: (currently ignored)
diff --git a/xen/arch/x86/genapic/bigsmp.c b/xen/arch/x86/genapic/bigsmp.c
index c250c8ee24..294902ba85 100644
--- a/xen/arch/x86/genapic/bigsmp.c
+++ b/xen/arch/x86/genapic/bigsmp.c
@@ -14,7 +14,7 @@
 static __init int force_bigsmp(struct dmi_system_id *d)
 {
printk(KERN_NOTICE "%s detected: force use of apic=bigsmp\n", d->ident);
-   def_to_bigsmp = 1;
+   def_to_bigsmp = true;
return 0;
 }
 
@@ -36,7 +36,7 @@ static __init int probe_bigsmp(void)
 */
if (acpi_gbl_FADT.flags &
(ACPI_FADT_APIC_CLUSTER | ACPI_FADT_APIC_PHYSICAL))
-   def_to_bigsmp = 1;
+   def_to_bigsmp = true;
else if (!def_to_bigsmp)
dmi_check_system(bigsmp_dmi_table);
return def_to_bigsmp;
diff --git a/xen/arch/x86/io_apic.c b/xen/arch/x86/io_apic.c
index 29958dd475..2838f6bd99 100644
--- a/xen/arch/x86/io_apic.c
+++ b/xen/arch/x86/io_apic.c
@@ -2531,7 +2531,7 @@ void __init init_ioapic_mappings(void)
 {
 printk(KERN_ERR "WARNING: bogus zero IO-APIC address "
"found in MPTABLE, disabling IO/APIC support!\n");
-smp_found_config = 0;
+smp_found_config = false;
 skip_ioapic_setup = true;
 goto fake_ioapic_page;
 }
diff --git a/xen/arch/x86/mpparse.c b/xen/arch/x86/mpparse.c
index efccde28c9..a1a0738a19 100644
--- a/xen/arch/x86/mpparse.c
+++ b/xen/arch/x86/mpparse.c
@@ -34,7 +34,7 @@
 #include 
 
 /* Have we found an MP table */
-bool_t __initdata smp_found_config;
+bool __initdata smp_found_config;
 
 /*
  * Various Linux-internal data structures created from the
@@ -52,8 +52,8 @@ struct mpc_config_intsrc __read_mostly 
mp_irqs[MAX_IRQ_SOURCES];
 /* MP IRQ source entries */
 int __read_mostly mp_irq_entries;
 
-bool_t __read_mostly pic_mode;
-bool_t __read_mostly def_to_bigsmp = 0;
+bool __read_mostly pic_mode;
+bool __read_mostly def_to_bigsmp;
 unsigned long __read_mostly mp_lapic_addr;
 
 /* Processor that is doing the boot up */
@@ -119,7 +119,7 @@ static int __init mpf_checksum(unsigned char *mp, int len)
 
 /* Return xen's logical cpu_id of the new added cpu or <0 if error */
 static int MP_processor_info_x(struct mpc_config_processor *m,
-  u32 apicid, bool_t hotplug)
+  u32 apicid, bool hotplug)
 {
int ver, cpu = 0;

@@ -178,7 +178,7 @@ static int MP_processor_info_x(struct mpc_config_processor 
*m,
 * No need for processor or APIC checks: physical delivery
 * (bigsmp) mode should always work.
 */
-   def_to_bigsmp = 1;
+   def_to_bigsmp = true;
}
 
return cpu;
@@ -591,10 +591,10 @@ void __init get_smp_config (void)
printk(KERN_INFO "Intel MultiProcessor Specification v1.%d\n", 
mpf->mpf_specification);
if (mpf->mpf_feature2 & (1<<7)) {
printk(KERN_INFO "IMCR and PIC compatibility mode.\n");
-   pic_mode = 1;
+   pic_mode = true;
} else {
printk(KERN_INFO "Virtual Wire compatibility mode.\n");
-   pic_mode = 0;
+   pic_mode = false;
}
 
/*
@@ -613,7 +613,7 @@ void __init get_smp_config (void)
 */
if (!smp_read_mpc((void *)(unsigned long)mpf->mpf_physptr)) {
efi_unmap_mpf();
-   smp_found_config = 0;
+   smp_found_config = false;
printk(KERN_ERR "BIOS bug, MP table errors 
detected!...\n");
printk(KERN_ERR "... disabling SMP support. (tell your 
hw vendor)\n");
return;
@@ -664,7 

[Xen-devel] [PATCH 11/18] x86/xstate.c: use plain bool

2017-06-30 Thread Wei Liu
Signed-off-by: Wei Liu 
---
 xen/arch/x86/xstate.c| 30 +++---
 xen/include/asm-x86/xstate.h |  6 +++---
 2 files changed, 18 insertions(+), 18 deletions(-)

diff --git a/xen/arch/x86/xstate.c b/xen/arch/x86/xstate.c
index c2a722c60e..845208c189 100644
--- a/xen/arch/x86/xstate.c
+++ b/xen/arch/x86/xstate.c
@@ -37,7 +37,7 @@ static DEFINE_PER_CPU(uint64_t, xcr0);
 /* Because XCR0 is cached for each CPU, xsetbv() is not exposed. Users should 
  * use set_xcr0() instead.
  */
-static inline bool_t xsetbv(u32 index, u64 xfeatures)
+static inline bool xsetbv(u32 index, u64 xfeatures)
 {
 u32 hi = xfeatures >> 32;
 u32 lo = (u32)xfeatures;
@@ -54,12 +54,12 @@ static inline bool_t xsetbv(u32 index, u64 xfeatures)
 return lo != 0;
 }
 
-bool_t set_xcr0(u64 xfeatures)
+bool set_xcr0(u64 xfeatures)
 {
 if ( !xsetbv(XCR_XFEATURE_ENABLED_MASK, xfeatures) )
-return 0;
+return false;
 this_cpu(xcr0) = xfeatures;
-return 1;
+return true;
 }
 
 uint64_t get_xcr0(void)
@@ -86,7 +86,7 @@ uint64_t get_msr_xss(void)
 return this_cpu(xss);
 }
 
-static int setup_xstate_features(bool_t bsp)
+static int setup_xstate_features(bool bsp)
 {
 unsigned int leaf, eax, ebx, ecx, edx;
 
@@ -482,10 +482,10 @@ void xrstor(struct vcpu *v, uint64_t mask)
 }
 }
 
-bool_t xsave_enabled(const struct vcpu *v)
+bool xsave_enabled(const struct vcpu *v)
 {
 if ( !cpu_has_xsave )
-return 0;
+return false;
 
 ASSERT(xsave_cntxt_size >= XSTATE_AREA_MIN_SIZE);
 ASSERT(v->arch.xsave_area);
@@ -551,7 +551,7 @@ static unsigned int _xstate_ctxt_size(u64 xcr0)
 {
 u64 act_xcr0 = get_xcr0();
 u32 eax, ebx = 0, ecx, edx;
-bool_t ok = set_xcr0(xcr0);
+bool ok = set_xcr0(xcr0);
 
 ASSERT(ok);
 cpuid_count(XSTATE_CPUID, 0, &eax, &ebx, &ecx, &edx);
@@ -577,10 +577,10 @@ unsigned int xstate_ctxt_size(u64 xcr0)
 /* Collect the information of processor's extended state */
 void xstate_init(struct cpuinfo_x86 *c)
 {
-static bool_t __initdata use_xsave = 1;
+static bool __initdata use_xsave = true;
 boolean_param("xsave", use_xsave);
 
-bool_t bsp = c == &boot_cpu_data;
+bool bsp = c == &boot_cpu_data;
 u32 eax, ebx, ecx, edx;
 u64 feature_mask;
 
@@ -645,25 +645,25 @@ void xstate_init(struct cpuinfo_x86 *c)
 BUG();
 }
 
-static bool_t valid_xcr0(u64 xcr0)
+static bool valid_xcr0(u64 xcr0)
 {
 /* FP must be unconditionally set. */
 if ( !(xcr0 & XSTATE_FP) )
-return 0;
+return false;
 
 /* YMM depends on SSE. */
 if ( (xcr0 & XSTATE_YMM) && !(xcr0 & XSTATE_SSE) )
-return 0;
+return false;
 
 if ( xcr0 & (XSTATE_OPMASK | XSTATE_ZMM | XSTATE_HI_ZMM) )
 {
 /* OPMASK, ZMM, and HI_ZMM require YMM. */
 if ( !(xcr0 & XSTATE_YMM) )
-return 0;
+return false;
 
 /* OPMASK, ZMM, and HI_ZMM must be the same. */
 if ( ~xcr0 & (XSTATE_OPMASK | XSTATE_ZMM | XSTATE_HI_ZMM) )
-return 0;
+return false;
 }
 
 /* BNDREGS and BNDCSR must be the same. */
diff --git a/xen/include/asm-x86/xstate.h b/xen/include/asm-x86/xstate.h
index b31ad75bdb..d36f422b59 100644
--- a/xen/include/asm-x86/xstate.h
+++ b/xen/include/asm-x86/xstate.h
@@ -107,7 +107,7 @@ struct xstate_bndcsr {
 };
 
 /* extended state operations */
-bool_t __must_check set_xcr0(u64 xfeatures);
+bool __must_check set_xcr0(u64 xfeatures);
 uint64_t get_xcr0(void);
 void set_msr_xss(u64 xss);
 uint64_t get_msr_xss(void);
@@ -115,7 +115,7 @@ uint64_t read_bndcfgu(void);
 void xsave(struct vcpu *v, uint64_t mask);
 void xrstor(struct vcpu *v, uint64_t mask);
 void xstate_set_init(uint64_t mask);
-bool_t xsave_enabled(const struct vcpu *v);
+bool xsave_enabled(const struct vcpu *v);
 int __must_check validate_xstate(u64 xcr0, u64 xcr0_accum,
  const struct xsave_hdr *);
 int __must_check handle_xsetbv(u32 index, u64 new_bv);
@@ -128,7 +128,7 @@ int xstate_alloc_save_area(struct vcpu *v);
 void xstate_init(struct cpuinfo_x86 *c);
 unsigned int xstate_ctxt_size(u64 xcr0);
 
-static inline bool_t xstate_all(const struct vcpu *v)
+static inline bool xstate_all(const struct vcpu *v)
 {
 /*
  * XSTATE_FP_SSE may be excluded, because the offsets of XSTATE_FP_SSE
-- 
2.11.0


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


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

2017-06-30 Thread Roger Pau Monne
On Fri, Jun 23, 2017 at 03:45:45PM +0100, Ian Jackson wrote:
> Roger Pau Monne writes ("[PATCH v3 4/8] osstest: add a FreeBSD host install 
> recipe"):
> > +sub setup_netboot_installer () {
> > +my $image = "$path_prefix/install.img";
> > +my $pxeimg = target_tftp_prefix($ho) . "--freebsd.img";
> > +my $hash = `sha256sum $image | head -c 16` or die $!;
> 
> You should do this `  -' stripping in Perl.  That way, also, you won't
> lose the exit status from sha256sum as you do here.

I've added a pre-patch that introduces a sha256file helper in order to
calculate the hash of a file.

> > +my $tftp_freebsd = 
> > "$ho->{Tftp}{Path}/$ho->{Tftp}{TmpDir}/freebsd-images/";
> > +my $script = <<'END';
> > +basedir=$0
> > +imagepath=$1
> > +sharedpath=$2
> > +targetpath=$3
> 
> Please pass a dummy argument to the script (I usually use `x')
> and shift all these arguments along.  Passing a real argument as $0 is
> IMO strange.

I agree, I was surprised to find out I could do it like that.

> > +cd $basedir
> > +if [ ! -f $sharedpath ]; then
> > +mkdir -p `dirname $sharedpath`
> > +cp $imagepath $sharedpath
> 
> Please use the copy-to-tempfile-and-rename pattern.
> 
> AFAICT your filename pattern for the per-hash filename is
>$tftp_freebsd/$r{arch}/$hash/install.img
> 
> Is there some reason why this needs
>  - to be qualified with $r{arch}
>  - to have a bunch of per-hash directories containing one file each
> ?
> 
> Why not
>$tftp_freebsd/by-hash/$hash.img
> ?

Yes, I've changed the path now to the suggested one.

> > +# Dir format from basedir is $arch/$hash/install.img
> > +for hashdir in `find -mindepth 2 -maxdepth 2 -type d`; do
> 
> 1. use xargs or -exec -rm
> 2. use find -links
> 3. add -ctime +7 or something, so we don't delete things which
>have just been added (or used)

Done:

find `dirname $sharedpath` -links 1 -ctime +7 -delete

> > +for nic in \$nics; do
> > +addr=`ifconfig \$nic inet|grep inet|awk {'print \$2'}`
> > +if [ "\$addr" = "$ho->{Ip}" ]; then
> > +echo \$nic
> > +exit 0
> > +fi
> > +done
> > +exit 1
> > +END
> 
> Is it likely that the disk or network device name, for a particular
> device, will change, for example across versions of FreeBSD ?

I don't think it happens usually, but I guess the driver name could
change, and in turn make the device name change. As I said I think
this is mostly stable, so that users don't get nasty surprises.

> > +logm("Uploading the install sets to the system");
> > +target_cmd_root($ho, < > +mkdir -p $target_sets
> 
> Missing set -e.
> 
> > +logm("Creating the installer script");
> > +target_putfilecontents_root_stash($ho, 10, < > +set -a
> > +BSDINSTALL_DISTDIR="$target_sets"
> > +ZFSBOOT_DISKS="$disk"
> > +DISTRIBUTIONS="@sets"
> > +nonInteractive=1
> > +
> > +#!/bin/sh
> > +set -ex
> 
> There's a #! halfway through this script.

Yes, that's intended, it's the format of the install script. This
first part contains variables (ie: input data) used by the installer.
The second part is automatically executed chrooted into the root dir
of the newly installed system once done.

https://www.freebsd.org/cgi/man.cgi?query=bsdinstall

See the SCRIPTING section.

> > +# Setup serial console
> > +printf "%s" "-h -S$c{Baud}" >> /boot.config
> 
> Are you deliberately leaving /boot.config with no final newline ?

That's what I've usually done, but it doesn't matter.

> > +cat << ENDBOOT >> /boot/loader.conf
> > +boot_serial="YES"
> > +comconsole_speed="$c{Baud}"
> > +console="comconsole"
> > +boot_verbose="YES"
> > +beastie_disable="YES"
> 
> :-) re beastie.

It just consumes serial log space and has a nasty countdown.

Thanks, Roger.

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


Re: [Xen-devel] [PATCH] mini-os: link to libgcc.a to fix build with gcc7

2017-06-30 Thread Olaf Hering
On Fri, Jun 30, Olaf Hering wrote:

> On Fri, Jun 30, Wei Liu wrote:
> 
> > On second thought I don't think we want to make this worse. So the
> > change in this patch should be conditional on gcc.
> 
> How whould I check for gcc in the Makefile?
> In xen.git I see a conditional for clang. I dont have a clang at hand,
> perhaps it knows about "-print-libgcc-file-name"?

Mine works fine:

 $  gcc -print-libgcc-file-name
/usr/lib64/gcc/x86_64-suse-linux/7/libgcc.a
 $  clang-3.8 -print-libgcc-file-name
/usr/bin/../lib64/gcc/x86_64-suse-linux/7/libgcc.a


Olaf


signature.asc
Description: PGP signature
___
Xen-devel mailing list
Xen-devel@lists.xen.org
https://lists.xen.org/xen-devel


[Xen-devel] [PATCH 00/18] x86: more bool_t to bool cleanup

2017-06-30 Thread Wei Liu
Seeing that bool_t keeps creeping back in new patches I think the only solution
is to get rid of bool_t once and for all, as soon as possible.

Wei Liu (18):
  x86/acpi: use plain bool
  x86/apic.c: use plain bool
  x86/debug.c: use plain bool
  x86/dmi.c: use plain bool
  x86/domctl: use plain bool
  x86/hpet.c: use plain bool
  x86/e820.c: use plan bool
  x86/i387.c: use plain bool
  x86/i8259.c: use plain bool
  x86/monitor.c: use plain bool
  x86/xstate.c: use plain bool
  x86/srat.c: use plain bool
  x86/smpboot.c: use plain bool
  x86/io_apic.c: use plain bool
  x86/mpparse.c: use plain bool
  x86/numa.c: use plain bool
  x86/msi.c: use plain bool
  x86/psr.c: use plain bool

 xen/arch/x86/acpi/boot.c| 30 ++---
 xen/arch/x86/acpi/cpu_idle.c| 19 ++-
 xen/arch/x86/acpi/cpufreq/cpufreq.c |  2 +-
 xen/arch/x86/apic.c | 38 ++---
 xen/arch/x86/debug.c|  4 ++--
 xen/arch/x86/dmi_scan.c |  8 
 xen/arch/x86/domctl.c   | 38 ++---
 xen/arch/x86/e820.c |  2 +-
 xen/arch/x86/genapic/bigsmp.c   |  4 ++--
 xen/arch/x86/hpet.c |  2 +-
 xen/arch/x86/i387.c | 10 +-
 xen/arch/x86/i8259.c| 10 +-
 xen/arch/x86/io_apic.c  | 36 +--
 xen/arch/x86/monitor.c  | 20 +--
 xen/arch/x86/mpparse.c  | 25 +++-
 xen/arch/x86/msi.c  | 32 +++
 xen/arch/x86/numa.c | 10 +-
 xen/arch/x86/psr.c  | 14 +++---
 xen/arch/x86/smpboot.c  |  5 +++--
 xen/arch/x86/srat.c | 10 +-
 xen/arch/x86/time.c |  2 +-
 xen/arch/x86/xstate.c   | 30 ++---
 xen/include/asm-x86/acpi.h  |  5 ++---
 xen/include/asm-x86/apic.h  |  4 ++--
 xen/include/asm-x86/cpuidle.h   |  2 +-
 xen/include/asm-x86/io_apic.h   |  6 +++---
 xen/include/asm-x86/irq.h   |  2 +-
 xen/include/asm-x86/monitor.h   |  2 +-
 xen/include/asm-x86/mpspec.h|  6 +++---
 xen/include/asm-x86/msi.h   |  6 +++---
 xen/include/asm-x86/numa.h  |  2 +-
 xen/include/asm-x86/softirq.h   |  2 +-
 xen/include/asm-x86/time.h  |  2 +-
 xen/include/asm-x86/xstate.h|  6 +++---
 xen/include/xen/dmi.h   |  2 +-
 35 files changed, 198 insertions(+), 200 deletions(-)

-- 
2.11.0


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


[Xen-devel] [PATCH 07/18] x86/e820.c: use plan bool

2017-06-30 Thread Wei Liu
Note that e820_mtrr_clip remains s8 although the command line
parameter is bool, because it is a tristate variable.

Signed-off-by: Wei Liu 
---
 xen/arch/x86/e820.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/xen/arch/x86/e820.c b/xen/arch/x86/e820.c
index bc1544a514..7c572bade2 100644
--- a/xen/arch/x86/e820.c
+++ b/xen/arch/x86/e820.c
@@ -29,7 +29,7 @@ static s8 __initdata e820_mtrr_clip = -1;
 boolean_param("e820-mtrr-clip", e820_mtrr_clip);
 
 /* opt_e820_verbose: Be verbose about clipping, the original e820, &c */
-static bool_t __initdata e820_verbose;
+static bool __initdata e820_verbose;
 boolean_param("e820-verbose", e820_verbose);
 
 struct e820map e820;
-- 
2.11.0


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


[Xen-devel] [PATCH 06/18] x86/hpet.c: use plain bool

2017-06-30 Thread Wei Liu
Signed-off-by: Wei Liu 
---
 xen/arch/x86/hpet.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/xen/arch/x86/hpet.c b/xen/arch/x86/hpet.c
index 7e8b438c0f..46f4c428a1 100644
--- a/xen/arch/x86/hpet.c
+++ b/xen/arch/x86/hpet.c
@@ -58,7 +58,7 @@ u8 __initdata hpet_flags;
  * if RTC interrupts are enabled. Enable this option if want to always enable
  * legacy hpet broadcast for deep C state
  */
-static bool_t __initdata force_hpet_broadcast;
+static bool __initdata force_hpet_broadcast;
 boolean_param("hpetbroadcast", force_hpet_broadcast);
 
 /*
-- 
2.11.0


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


[Xen-devel] [PATCH 03/18] x86/debug.c: use plain bool

2017-06-30 Thread Wei Liu
Signed-off-by: Wei Liu 
---
 xen/arch/x86/debug.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/xen/arch/x86/debug.c b/xen/arch/x86/debug.c
index 2070077ec5..a5d85a92f9 100644
--- a/xen/arch/x86/debug.c
+++ b/xen/arch/x86/debug.c
@@ -156,7 +156,7 @@ dbg_pv_va2mfn(dbgva_t vaddr, struct domain *dp, uint64_t 
pgd3val)
 /* Returns: number of bytes remaining to be copied */
 unsigned int dbg_rw_guest_mem(struct domain *dp, void * __user gaddr,
   void * __user buf, unsigned int len,
-  bool_t toaddr, uint64_t pgd3)
+  bool toaddr, uint64_t pgd3)
 {
 while ( len > 0 )
 {
@@ -207,7 +207,7 @@ unsigned int dbg_rw_guest_mem(struct domain *dp, void * 
__user gaddr,
  * Returns: number of bytes remaining to be copied. 
  */
 unsigned int dbg_rw_mem(void * __user addr, void * __user buf,
-unsigned int len, domid_t domid, bool_t toaddr,
+unsigned int len, domid_t domid, bool toaddr,
 uint64_t pgd3)
 {
 DBGP2("gmem:addr:%lx buf:%p len:$%u domid:%d toaddr:%x\n",
-- 
2.11.0


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


[Xen-devel] [PATCH 04/18] x86/dmi.c: use plain bool

2017-06-30 Thread Wei Liu
Signed-off-by: Wei Liu 
---
 xen/arch/x86/dmi_scan.c | 8 
 xen/include/xen/dmi.h   | 2 +-
 2 files changed, 5 insertions(+), 5 deletions(-)

diff --git a/xen/arch/x86/dmi_scan.c b/xen/arch/x86/dmi_scan.c
index 8564a77ea0..fcdf2d3952 100644
--- a/xen/arch/x86/dmi_scan.c
+++ b/xen/arch/x86/dmi_scan.c
@@ -183,8 +183,8 @@ static int __init dmi_table(paddr_t base, u32 len, int num,
 }
 
 
-static inline bool_t __init dmi_checksum(const void __iomem *buf,
-unsigned int len)
+static inline bool __init dmi_checksum(const void __iomem *buf,
+   unsigned int len)
 {
u8 sum = 0;
const u8 *p = buf;
@@ -753,10 +753,10 @@ fail: d++;
  * On return, year, month and day are guaranteed to be in the
  * range of [0,], [0,12] and [0,31] respectively.
  */
-bool_t __init dmi_get_date(int field, int *yearp, int *monthp, int *dayp)
+bool __init dmi_get_date(int field, int *yearp, int *monthp, int *dayp)
 {
int year = 0, month = 0, day = 0;
-   bool_t exists;
+   bool exists;
const char *s, *e, *y;
 
s = field < DMI_STRING_MAX ? dmi_ident[field] : NULL;
diff --git a/xen/include/xen/dmi.h b/xen/include/xen/dmi.h
index df26d4b3e3..eba2c27b2f 100644
--- a/xen/include/xen/dmi.h
+++ b/xen/include/xen/dmi.h
@@ -36,7 +36,7 @@ extern int dmi_check_system(struct dmi_system_id *list);
 extern void dmi_scan_machine(void);
 extern const char *dmi_get_table(paddr_t *base, u32 *len);
 extern void dmi_efi_get_table(const void *smbios, const void *smbios3);
-bool_t dmi_get_date(int field, int *yearp, int *monthp, int *dayp);
+bool dmi_get_date(int field, int *yearp, int *monthp, int *dayp);
 extern void dmi_end_boot(void);
 
 #endif /* __DMI_H__ */
-- 
2.11.0


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


[Xen-devel] [PATCH 08/18] x86/i387.c: use plain bool

2017-06-30 Thread Wei Liu
Signed-off-by: Wei Liu 
---
 xen/arch/x86/i387.c | 10 +-
 1 file changed, 5 insertions(+), 5 deletions(-)

diff --git a/xen/arch/x86/i387.c b/xen/arch/x86/i387.c
index 9a172db5dc..88452522ad 100644
--- a/xen/arch/x86/i387.c
+++ b/xen/arch/x86/i387.c
@@ -22,7 +22,7 @@
 /* Restore x87 extended state */
 static inline void fpu_xrstor(struct vcpu *v, uint64_t mask)
 {
-bool_t ok;
+bool ok;
 
 ASSERT(v->arch.xsave_area);
 /*
@@ -135,7 +135,7 @@ static inline uint64_t vcpu_xsave_mask(const struct vcpu *v)
 /* Save x87 extended state */
 static inline void fpu_xsave(struct vcpu *v)
 {
-bool_t ok;
+bool ok;
 uint64_t mask = vcpu_xsave_mask(v);
 
 ASSERT(mask);
@@ -260,10 +260,10 @@ void vcpu_restore_fpu_lazy(struct vcpu *v)
  * On each context switch, save the necessary FPU info of VCPU being switch 
  * out. It dispatches saving operation based on CPU's capability.
  */
-static bool_t _vcpu_save_fpu(struct vcpu *v)
+static bool _vcpu_save_fpu(struct vcpu *v)
 {
 if ( !v->fpu_dirtied && !v->arch.nonlazy_xstate_used )
-return 0;
+return false;
 
 ASSERT(!is_idle_vcpu(v));
 
@@ -277,7 +277,7 @@ static bool_t _vcpu_save_fpu(struct vcpu *v)
 
 v->fpu_dirtied = 0;
 
-return 1;
+return true;
 }
 
 void vcpu_save_fpu(struct vcpu *v)
-- 
2.11.0


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


[Xen-devel] [PATCH 05/18] x86/domctl: use plain bool

2017-06-30 Thread Wei Liu
Signed-off-by: Wei Liu 
---
 xen/arch/x86/domctl.c | 38 +++---
 1 file changed, 19 insertions(+), 19 deletions(-)

diff --git a/xen/arch/x86/domctl.c b/xen/arch/x86/domctl.c
index f40e989fd8..7fa58b49af 100644
--- a/xen/arch/x86/domctl.c
+++ b/xen/arch/x86/domctl.c
@@ -318,7 +318,7 @@ long arch_do_domctl(
 struct vcpu *curr = current;
 struct domain *currd = curr->domain;
 long ret = 0;
-bool_t copyback = 0;
+bool copyback = false;
 unsigned long i;
 
 switch ( domctl->cmd )
@@ -330,7 +330,7 @@ long arch_do_domctl(
 if ( ret == -ERESTART )
 return hypercall_create_continuation(__HYPERVISOR_arch_1,
  "h", u_domctl);
-copyback = 1;
+copyback = true;
 break;
 
 case XEN_DOMCTL_ioport_permission:
@@ -405,7 +405,7 @@ long arch_do_domctl(
 spin_unlock(&d->page_alloc_lock);
 
 domctl->u.getmemlist.num_pfns = i;
-copyback = 1;
+copyback = true;
 break;
 }
 
@@ -576,7 +576,7 @@ long arch_do_domctl(
 ret = -EFAULT;
 
 gethvmcontext_out:
-copyback = 1;
+copyback = true;
 xfree(c.data);
 break;
 }
@@ -611,7 +611,7 @@ long arch_do_domctl(
 case XEN_DOMCTL_get_address_size:
 domctl->u.address_size.size = is_pv_32bit_domain(d) ? 32 :
   BITS_PER_LONG;
-copyback = 1;
+copyback = true;
 break;
 
 case XEN_DOMCTL_set_machine_address_size:
@@ -623,7 +623,7 @@ long arch_do_domctl(
 
 case XEN_DOMCTL_get_machine_address_size:
 domctl->u.address_size.size = d->arch.physaddr_bitsize;
-copyback = 1;
+copyback = true;
 break;
 
 case XEN_DOMCTL_sendtrigger:
@@ -874,7 +874,7 @@ long arch_do_domctl(
 
 ret = 0;
 vcpu_unpause(v);
-copyback = 1;
+copyback = true;
 }
 else
 {
@@ -959,7 +959,7 @@ long arch_do_domctl(
  &domctl->u.tsc_info.gtsc_khz,
  &domctl->u.tsc_info.incarnation);
 domain_unpause(d);
-copyback = 1;
+copyback = true;
 }
 break;
 
@@ -1003,7 +1003,7 @@ long arch_do_domctl(
 domctl->u.gdbsx_guest_memio.remain = domctl->u.gdbsx_guest_memio.len;
 ret = gdbsx_guest_mem_io(domctl->domain, &domctl->u.gdbsx_guest_memio);
 if ( !ret )
-   copyback = 1;
+   copyback = true;
 break;
 
 case XEN_DOMCTL_gdbsx_pausevcpu:
@@ -1060,7 +1060,7 @@ long arch_do_domctl(
 }
 }
 }
-copyback = 1;
+copyback = true;
 break;
 }
 
@@ -1220,7 +1220,7 @@ long arch_do_domctl(
 
 vcpuextstate_out:
 if ( domctl->cmd == XEN_DOMCTL_getvcpuextstate )
-copyback = 1;
+copyback = true;
 break;
 }
 
@@ -1238,7 +1238,7 @@ long arch_do_domctl(
   &domctl->u.audit_p2m.orphans,
   &domctl->u.audit_p2m.m2p_bad,
   &domctl->u.audit_p2m.p2m_bad);
-copyback = 1;
+copyback = true;
 }
 break;
 #endif /* P2M_AUDIT */
@@ -1282,7 +1282,7 @@ long arch_do_domctl(
 
 if ( domctl->cmd == XEN_DOMCTL_get_vcpu_msrs )
 {
-ret = 0; copyback = 1;
+ret = 0; copyback = true;
 
 /* NULL guest handle is a request for max size. */
 if ( guest_handle_is_null(vmsrs->msrs) )
@@ -1379,7 +1379,7 @@ long arch_do_domctl(
 else
 {
 vmsrs->msr_count = i;
-copyback = 1;
+copyback = true;
 }
 }
 break;
@@ -1407,7 +1407,7 @@ long arch_do_domctl(
 
 case XEN_DOMCTL_PSR_CMT_OP_QUERY_RMID:
 domctl->u.psr_cmt_op.data = d->arch.psr_rmid;
-copyback = 1;
+copyback = true;
 break;
 
 default:
@@ -1441,21 +1441,21 @@ long arch_do_domctl(
 ret = psr_get_l3_cbm(d, domctl->u.psr_cat_op.target,
  &domctl->u.psr_cat_op.data,
  PSR_CBM_TYPE_L3);
-copyback = 1;
+copyback = true;
 break;
 
 case XEN_DOMCTL_PSR_CAT_OP_GET_L3_CODE:
 ret = psr_get_l3_cbm(d, domctl->u.psr_cat_op.target,
  &domctl->u.psr_cat_op.data,
  PSR_CBM_TYPE_L3_CODE);
-copyback = 1;
+copyback = true;
 break;
 
 case XEN_DOMCTL_PSR_CAT_OP_GET_L3_DATA:
 ret = psr_get_l3_cbm(d, domctl->u.psr_cat_op.target,
  &domctl->u.psr_cat_op.data,
  PSR_CBM_TYPE_L3_DATA);
-copyback = 1;
+co

[Xen-devel] [PATCH 09/18] x86/i8259.c: use plain bool

2017-06-30 Thread Wei Liu
Signed-off-by: Wei Liu 
---
 xen/arch/x86/i8259.c  | 10 +-
 xen/include/asm-x86/irq.h |  2 +-
 2 files changed, 6 insertions(+), 6 deletions(-)

diff --git a/xen/arch/x86/i8259.c b/xen/arch/x86/i8259.c
index 07465aace8..166ca1a3e1 100644
--- a/xen/arch/x86/i8259.c
+++ b/xen/arch/x86/i8259.c
@@ -32,9 +32,9 @@
 
 static DEFINE_SPINLOCK(i8259A_lock);
 
-static bool_t _mask_and_ack_8259A_irq(unsigned int irq);
+static bool _mask_and_ack_8259A_irq(unsigned int irq);
 
-bool_t bogus_8259A_irq(unsigned int irq)
+bool bogus_8259A_irq(unsigned int irq)
 {
 return _mask_and_ack_8259A_irq(irq);
 }
@@ -193,11 +193,11 @@ static inline int i8259A_irq_real(unsigned int irq)
  * to the two 8259s is important!  Return a boolean
  * indicating whether the irq was genuine or spurious.
  */
-static bool_t _mask_and_ack_8259A_irq(unsigned int irq)
+static bool _mask_and_ack_8259A_irq(unsigned int irq)
 {
 unsigned int irqmask = 1 << irq;
 unsigned long flags;
-bool_t is_real_irq = 1; /* Assume real unless spurious */
+bool is_real_irq = true; /* Assume real unless spurious */
 
 spin_lock_irqsave(&i8259A_lock, flags);
 
@@ -218,7 +218,7 @@ static bool_t _mask_and_ack_8259A_irq(unsigned int irq)
  */
 if ((cached_irq_mask & irqmask) && !i8259A_irq_real(irq)) {
 static int spurious_irq_mask;
-is_real_irq = 0;
+is_real_irq = false;
 /* Report spurious IRQ, once per IRQ line. */
 if (!(spurious_irq_mask & irqmask)) {
 printk("spurious 8259A interrupt: IRQ%d.\n", irq);
diff --git a/xen/include/asm-x86/irq.h b/xen/include/asm-x86/irq.h
index 240c3e8bf2..38edc053f8 100644
--- a/xen/include/asm-x86/irq.h
+++ b/xen/include/asm-x86/irq.h
@@ -108,7 +108,7 @@ void mask_8259A(void);
 void unmask_8259A(void);
 void init_8259A(int aeoi);
 void make_8259A_irq(unsigned int irq);
-bool_t bogus_8259A_irq(unsigned int irq);
+bool bogus_8259A_irq(unsigned int irq);
 int i8259A_suspend(void);
 int i8259A_resume(void);
 
-- 
2.11.0


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


[Xen-devel] [xen-4.9-testing test] 111196: tolerable FAIL - PUSHED

2017-06-30 Thread osstest service owner
flight 96 xen-4.9-testing real [real]
http://logs.test-lab.xenproject.org/osstest/logs/96/

Failures :-/ but no regressions.

Tests which are failing intermittently (not blocking):
 test-amd64-amd64-xl-qemuu-win7-amd64 16 guest-localmigrate/x10 fail in 62 
pass in 96
 test-armhf-armhf-xl-credit2  16 guest-start/debian.repeat  fail pass in 62
 test-amd64-i386-xl-qemut-stubdom-debianhvm-amd64-xsm 17 guest-stop fail pass 
in 62

Regressions which are regarded as allowable (not blocking):
 test-amd64-amd64-xl-qemuu-win7-amd64 17 guest-stop   fail REGR. vs. 31
 test-armhf-armhf-xl-rtds16 guest-start/debian.repeat fail REGR. vs. 31

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

version targeted for testing:
 xen  0fada059a7948153976cc152e36633dee3d5b273
baseline version:
 xen  c30bf55594a53fae8aae08aabf16fc192faad7da

Last test of basis   31  2017-06-28 03:19:29 Z 

[Xen-devel] [PATCH 02/18] x86/apic.c: use plain bool

2017-06-30 Thread Wei Liu
Signed-off-by: Wei Liu 
---
 xen/arch/x86/apic.c| 30 +++---
 xen/include/asm-x86/apic.h |  4 ++--
 2 files changed, 17 insertions(+), 17 deletions(-)

diff --git a/xen/arch/x86/apic.c b/xen/arch/x86/apic.c
index 8c6c2f5819..28a1ef8a58 100644
--- a/xen/arch/x86/apic.c
+++ b/xen/arch/x86/apic.c
@@ -37,8 +37,8 @@
 #include 
 #include 
 
-static bool_t tdt_enabled __read_mostly;
-static bool_t tdt_enable __initdata = 1;
+static bool tdt_enabled __read_mostly;
+static bool tdt_enable __initdata = true;
 boolean_param("tdt", tdt_enable);
 
 static struct {
@@ -70,7 +70,7 @@ static s8 __initdata enable_local_apic; /* -1=force-disable, 
+1=force-enable */
  */
 u8 __read_mostly apic_verbosity;
 
-static bool_t __initdata opt_x2apic = 1;
+static bool __initdata opt_x2apic = true;
 boolean_param("x2apic", opt_x2apic);
 
 /*
@@ -79,8 +79,8 @@ boolean_param("x2apic", opt_x2apic);
  */
 static enum apic_mode apic_boot_mode = APIC_MODE_INVALID;
 
-bool_t __read_mostly x2apic_enabled = 0;
-bool_t __read_mostly directed_eoi_enabled = 0;
+bool __read_mostly x2apic_enabled = false;
+bool __read_mostly directed_eoi_enabled = false;
 
 static int modern_apic(void)
 {
@@ -130,9 +130,9 @@ void __init apic_intr_init(void)
 }
 
 /* Using APIC to generate smp_local_timer_interrupt? */
-static bool_t __read_mostly using_apic_timer;
+static bool __read_mostly using_apic_timer;
 
-static bool_t __read_mostly enabled_via_apicbase;
+static bool __read_mostly enabled_via_apicbase;
 
 int get_physical_broadcast(void)
 {
@@ -387,7 +387,7 @@ int __init verify_local_APIC(void)
 else
 {
 ioapic_ack_new = 0;
-directed_eoi_enabled = 1;
+directed_eoi_enabled = true;
 printk("Enabled directed EOI with ioapic_ack_old on!\n");
 }
 }
@@ -839,7 +839,7 @@ static int __init detect_init_APIC (void)
 msr_content &= ~MSR_IA32_APICBASE_BASE;
 msr_content |= MSR_IA32_APICBASE_ENABLE | APIC_DEFAULT_PHYS_BASE;
 wrmsrl(MSR_IA32_APICBASE, msr_content);
-enabled_via_apicbase = 1;
+enabled_via_apicbase = true;
 }
 }
 /*
@@ -945,7 +945,7 @@ void __init x2apic_bsp_setup(void)
 
 if ( !x2apic_enabled )
 {
-x2apic_enabled = 1;
+x2apic_enabled = true;
 __enable_x2apic();
 }
 
@@ -1176,7 +1176,7 @@ void __init setup_boot_APIC_clock(void)
 {
 unsigned long flags;
 apic_printk(APIC_VERBOSE, "Using local APIC timer interrupts.\n");
-using_apic_timer = 1;
+using_apic_timer = true;
 
 local_irq_save(flags);
 
@@ -1185,7 +1185,7 @@ void __init setup_boot_APIC_clock(void)
 if ( tdt_enable && boot_cpu_has(X86_FEATURE_TSC_DEADLINE) )
 {
 printk(KERN_DEBUG "TSC deadline timer enabled\n");
-tdt_enabled = 1;
+tdt_enabled = true;
 }
 
 setup_APIC_timer();
@@ -1258,12 +1258,12 @@ void apic_timer_interrupt(struct cpu_user_regs * regs)
 raise_softirq(TIMER_SOFTIRQ);
 }
 
-static DEFINE_PER_CPU(bool_t, state_dump_pending);
+static DEFINE_PER_CPU(bool, state_dump_pending);
 
 void smp_send_state_dump(unsigned int cpu)
 {
 /* We overload the spurious interrupt handler to handle the dump. */
-per_cpu(state_dump_pending, cpu) = 1;
+per_cpu(state_dump_pending, cpu) = true;
 send_IPI_mask(cpumask_of(cpu), SPURIOUS_APIC_VECTOR);
 }
 
@@ -1280,7 +1280,7 @@ void spurious_interrupt(struct cpu_user_regs *regs)
 if (apic_isr_read(SPURIOUS_APIC_VECTOR)) {
 ack_APIC_irq();
 if (this_cpu(state_dump_pending)) {
-this_cpu(state_dump_pending) = 0;
+this_cpu(state_dump_pending) = false;
 dump_execstate(regs);
 goto out;
 }
diff --git a/xen/include/asm-x86/apic.h b/xen/include/asm-x86/apic.h
index ea675b7f0a..9d7ec93042 100644
--- a/xen/include/asm-x86/apic.h
+++ b/xen/include/asm-x86/apic.h
@@ -29,8 +29,8 @@ enum apic_mode {
 };
 
 extern u8 apic_verbosity;
-extern bool_t x2apic_enabled;
-extern bool_t directed_eoi_enabled;
+extern bool x2apic_enabled;
+extern bool directed_eoi_enabled;
 
 void check_x2apic_preenabled(void);
 void x2apic_bsp_setup(void);
-- 
2.11.0


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


Re: [Xen-devel] [PATCH] mini-os: link to libgcc.a to fix build with gcc7

2017-06-30 Thread Olaf Hering
On Fri, Jun 30, Wei Liu wrote:

> On second thought I don't think we want to make this worse. So the
> change in this patch should be conditional on gcc.

How whould I check for gcc in the Makefile?
In xen.git I see a conditional for clang. I dont have a clang at hand,
perhaps it knows about "-print-libgcc-file-name"?

Olaf


signature.asc
Description: PGP signature
___
Xen-devel mailing list
Xen-devel@lists.xen.org
https://lists.xen.org/xen-devel


[Xen-devel] offtopic: handling patches

2017-06-30 Thread Marek Marczykowski-Górecki
Hi,

How you guys handle patches with emails? I know git am and git
format-patch/send-email, but those tools are quite limited, especially
when handling patch series, subsequent versions etc.
What I miss there:
 - patch versioning (git notes could be used, but it doesn't survive git
   commit --amend, nor git rebase)
 - keeping/versioning cover email
 - collecting Cc: from all patches in series into cover email
 - adding Reviewed-by, Acked-by etc tags

I can't believe you all do this all manually ;)
Is there any commonly available tool I can't find, or everyone have own
scripts?

-- 
Best Regards,
Marek Marczykowski-Górecki
Invisible Things Lab
A: Because it messes up the order in which people normally read text.
Q: Why is top-posting such a bad thing?


signature.asc
Description: PGP signature
___
Xen-devel mailing list
Xen-devel@lists.xen.org
https://lists.xen.org/xen-devel


Re: [Xen-devel] [OSSTEST PATCH v11 20/20] Introduce flight for stable branches of OpenStack

2017-06-30 Thread Anthony PERARD
On Fri, Jun 23, 2017 at 06:00:29PM +0100, Ian Jackson wrote:
> Anthony PERARD writes ("[OSSTEST PATCH v11 20/20] Introduce flight for stable 
> branches of OpenStack"):
> > OpenStack have many different repo which should be in sync, so this
> > patch should grab the revisions of the stable branch of every OpenStack
> > tree. Tempest does not have stable branch and should be able to test any
> > OpenStack version.
> ...
> > +openstack-*-*)
> > +   os_tree="${branch#openstack-}"
> > +   os_tree="${os_tree%-*}"
> > +   branchcore="${branch##*-}"
> > +   eval repo_tree_rev_fetch_git "openstack-$os_tree" \
> > +   "\$TREE_OPENSTACK_${os_tree^^}" "stable/$branchcore" \
> > +"\$LOCALREV_OPENSTACK_${os_tree^^}"
> 
> From your previous email:
> 
>   I think this patch is confusing because I originally try to use osstest
>   scripts to find which commit to use for every trees and so have add the
>   necessary into ./ap-fetch-version. But I could not make that works
>   without duplicating some functions and so went with writing
>   'origin/stable/ocata' into REVISION_*.
> 
> I think I am indeed still confused by some of it.
> 
> For example:
> 
> > +openstack_rev() {
> > +local os_tree="$1"
> > +local os_branch
> > +
> > +if eval [ "x\$REVISION_OPENSTACK_${os_tree^^}" = x ]; then
> > +case "$branch" in
> > +openstack-*-*)
> > +os_branch="openstack-$os_tree-${branch##*-}"
> > +os_git_branch="origin/stable/${branch##*-}"
> > +;;
> > +*)
> > +os_branch="openstack-$os_tree"
> > +os_git_branch="origin/master"
> > +;;
> > +esac
> > +
> > +# Use latest version, even for other openstack
> > +# trees so branch openstack-nova-ocata should have
> > +# other trees like openstack-neutron have the
> > +# revision of the same branch fetch at the same
> > +# time
> > +if [ "$branch" != "$os_branch" ]; then
> > +eval "export 
> > REVISION_OPENSTACK_${os_tree^^}=$os_git_branch"
> > +return
> > +fi
> > +determine_version "REVISION_OPENSTACK_${os_tree^^}" \
> > +"$os_branch" "OPENSTACK_${os_tree^^}"
> > +eval "export REVISION_OPENSTACK_${os_tree^^}"
> > +fi
> > +}
> > +for os_tree in cinder devstack glance keystone neutron nova requirements; 
> > do
> > +openstack_rev "$os_tree"
> > +done
> 
> I wonder if this full generality is really necessary ?  If you don't
> intend branches like   openstack-ocata-neutron   then it would be
> sufficient to call one function for nova and another for the other
> trees.

I'll see what I can do.

> And, frankly, I don't think we could have branches like
> `openstack-ocata-neutron'.  That would be too many branches.

Yes, it was to keep a door open.

> So perhaps the branch `openstack-ocata-nova' should be called
> `openstack-ocata' ?

Yes, I think that would be enough. You mean "openstack-$version" right?
(Or with other words "openstack-$release_name".)

> Also, right now I think it's clear that we're not intending to add
> openstack jobs to existing branches' flights.  But if we were to do
> that in the future, we would want all the subtrees to be tracked.
> 
> Maybe we should have a way for cr-daily-branch to fetch, and push,
> multiple trees.  We could call ap-fetch-version on every tree,
> and set the appropriate variable (with determine_version, as you have
> above).  And then set a variable to call ap-push multiple times, if we
> get a pass.

Yes, I first do the work to have the branches been properly setup to
test openstack of a release, then later I can look into pushing multiple
branches.

-- 
Anthony PERARD

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


Re: [Xen-devel] [OSSTEST PATCH v11 16/20] ts-openstack-tempest: Update list of skipped tests

2017-06-30 Thread Ian Jackson
Anthony PERARD writes ("Re: [OSSTEST PATCH v11 16/20] ts-openstack-tempest: 
Update list of skipped tests"):
> On Fri, Jun 23, 2017 at 04:38:05PM +0100, Ian Jackson wrote:
> > Aha.  Well, if the stable branch is stable then the set of tests to
> > skip there is probably stable too ?  And on master it's built-in ?  So
> > this actually won't be a problem - in the sense that this will be
> > approximately the last necessary update to the list of tests to skip ?
> 
> The built-in list is to be consume by the CI, it is not used
> automatically. It a bash script to be sourced. I have not yet try to
> have osstest use it. That will be for later.

Hah.

> Right now, tempest print on stdout something much simpler, lines liked
> this:
> {1} 
> tempest.scenario.test_minimum_basic.TestMinimumBasicScenario.test_minimum_basic_scenario
>  [71.009969s] ... ok
> Followed by summary of all test, and the output of failed tests.
> 
> But it can be told to print subunit v2, which can be pipped to a different
> program to transform into want we want, including simple cvs, subunit v1, and
> other.
> 
> I thing we could try to parse subunit v1, grab the start and finish time
> of a test, the result, and the output of the tests. And have all that as
> subunit. During my manual tests, `tempest run --subunit ... | subunit-2to1`
> only print the stuff about a tests once it is finish, so I guess we'll
> have to rewrite substep_start() (or another function) to take time as
> parameter.

That sounds quite good really.

I guess you don't want to write a parser for subunit v2 but if there
is one in Perl already in some package in Debian we could use it.  Or
subunit-2to1 is fine.

Ian.

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


[Xen-devel] [OSSTEST PATCH 08/17] step logfiles: Standalone mode: Do not print uninformative $script value

2017-06-30 Thread Ian Jackson
Right now, this is sometimes wrong; even if it were right, it's not
going to be interesting in the transcript since the actual script name
is obvious from context.

Now this function does not care if $script is undef.

While we're here, fix the prototype (which is mostly commentary here,
as it is not used for method calls).

Signed-off-by: Ian Jackson 
---
 Osstest/JobDB/Standalone.pm | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/Osstest/JobDB/Standalone.pm b/Osstest/JobDB/Standalone.pm
index 4842e69..af93196 100644
--- a/Osstest/JobDB/Standalone.pm
+++ b/Osstest/JobDB/Standalone.pm
@@ -88,9 +88,9 @@ sub current_flight ($) {
 
 sub job_ensure_started ($) { }
 
-sub step_start ($$) {
+sub step_start ($$;$) {
 my ($jd,$testid,$script) = @_;
-logm("== $flight.$job step $testid running $script ==");
+logm("== $flight.$job step $testid running ==");
 }
 
 sub step_finish ($$) { #method
-- 
2.1.4


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


[Xen-devel] [OSSTEST PATCH 06/17] db updates: Make all INSERTs (except into steps) name columns explicitly

2017-06-30 Thread Ian Jackson
This makes the code more robust against schema updates.  Specifically,
if any columns were to be deleted, these runes would break.  (Also if
any column was inserted other than after the existing columns,
although this is not something Postgres can currently do AIUI.)

Affected tables are:
  flights_harness_touched
  jobs
  resources
  runvars
  steps

Signed-off-by: Ian Jackson 
---
 Osstest/JobDB/Executive.pm |  4 +++-
 Osstest/TestSupport.pm | 12 +---
 cs-adjust-flight   |  7 ---
 cs-bisection-step  |  3 ++-
 mg-allocate|  2 +-
 mg-hosts   |  1 +
 tcl/JobDB-Executive.tcl|  4 +++-
 7 files changed, 23 insertions(+), 10 deletions(-)

diff --git a/Osstest/JobDB/Executive.pm b/Osstest/JobDB/Executive.pm
index 45aabd4..0d1b3be 100644
--- a/Osstest/JobDB/Executive.pm
+++ b/Osstest/JobDB/Executive.pm
@@ -191,7 +191,9 @@ END
 
 if (!$already) {
 $dbh_tests->do(prepare
 ("DELETE FROM runvars WHERE flight = ? AND job = ? AND name = ?");
 our $runvar_insert_q = $dbh_tests->prepare
-("INSERT INTO runvars VALUES (?, ?, ?, ?, 'f')");
+("INSERT INTO runvars (flight, job, name, val, synth)".
+ " VALUES (?, ?, ?, ?, 'f')");
 
 sub runvar_set ($$$;$) {
 my ($job, $name, $val, $xwhat) = @_;
diff --git a/cs-bisection-step b/cs-bisection-step
index 76f5010..13ccd7a 100755
--- a/cs-bisection-step
+++ b/cs-bisection-step
@@ -1255,7 +1255,8 @@ END
 " from $copyflight)\n";
 
 $dbh_tests->do(

[Xen-devel] [OSSTEST PATCH 02/17] schema updates: Fix typo in developer doc

2017-06-30 Thread Ian Jackson
Signed-off-by: Ian Jackson 
---
 schema/README.updates | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/schema/README.updates b/schema/README.updates
index 25bc11a..c5abc36 100644
--- a/schema/README.updates
+++ b/schema/README.updates
@@ -109,7 +109,7 @@ on it.  There are typically two schema changes:
 5. Commit: code to populate new column; changing `add' to status
Needed and `constraint' to status Ready.
 
-6. Optionally commit: code which read new column, but which tolerates
+6. Optionally commit: code which reads new column, but which tolerates
it containing NULL/DEFAULT.  (`add' is already Needed.)
 
 7. If necessary commit: idempotent utility script to populate missing
-- 
2.1.4


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


[Xen-devel] [OSSTEST PATCH 15/17] step logfiles: sg-run-job: Break out step-log-leafname

2017-06-30 Thread Ian Jackson
No functional change.

Signed-off-by: Ian Jackson 
---
 tcl/JobDB-Executive.tcl | 6 +-
 1 file changed, 5 insertions(+), 1 deletion(-)

diff --git a/tcl/JobDB-Executive.tcl b/tcl/JobDB-Executive.tcl
index 414a77e..ed636e4 100644
--- a/tcl/JobDB-Executive.tcl
+++ b/tcl/JobDB-Executive.tcl
@@ -437,12 +437,16 @@ proc preserve-task {seconds} {
 exec setsid sleep $seconds > /dev/null < /dev/null 2> /dev/null &
 }
 
+proc step-log-leafname {stepno ts} {
+return $stepno.$ts.log
+}
+
 proc step-log-filename {flight job stepno ts} {
 global c
 set logdir $c(Logs)/$flight/$job
 file mkdir $c(Logs)/$flight
 file mkdir $logdir
-return $logdir/$stepno.$ts.log
+return $logdir/[step-log-leafname $stepno $ts]
 }
 
 }; # namespace eval jobdb
-- 
2.1.4


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


[Xen-devel] [OSSTEST PATCH 13/17] step logfiles: Honour new logfile column

2017-06-30 Thread Ian Jackson
There are the following places in the tree where we construct the
logfile name from stepno and step:
 * tcl/JobDB-Executivemain decision about logfile name  } OK
 * JobDB::Executive   final fallback for new steps  } keep
 * steps-logfile-constraint.sql   default for old data  }
 * sg-report-flight (twice)   } both read stepno and step from the db;
 * determine-failure-reasons  }  here we teach them to try logfile first

Now substep logs will have correct links in the job output, as soon as
the logfile column has the right data.

This is part of a "Populate-then-rely" schema change, as described in
schema/README.updates.  Specifically, this is the step:

6. Optionally commit: code which reads new column, but which tolerates
   it containing NULL/DEFAULT.  (`add' is already Needed.)

Signed-off-by: Ian Jackson 
---
 determine-failure-reasons | 2 +-
 sg-report-flight  | 5 +++--
 2 files changed, 4 insertions(+), 3 deletions(-)

diff --git a/determine-failure-reasons b/determine-failure-reasons
index a3b2100..89c67e6 100755
--- a/determine-failure-reasons
+++ b/determine-failure-reasons
@@ -52,7 +52,7 @@ sub gethosts ($) {
 }
 
 while (my $step= $stepsq->fetchrow_hashref) {
-my $logfile = "$step->{stepno}.$step->{step}.log";
+my $logfile = $step->{logfile} // "$step->{stepno}.$step->{step}.log";
 $step->{Log}= "$c{Logs}/$step->{flight}/$step->{job}/".$logfile;
 
 if (!stat $step->{Log}) {
diff --git a/sg-report-flight b/sg-report-flight
index ec30ed0..4e3560e 100755
--- a/sg-report-flight
+++ b/sg-report-flight
@@ -1001,7 +1001,8 @@ END
 printf H "%s", show_abs_time $step->{started};
 
 my $st= $step->{status};
-my $logfilename= "$step->{stepno}.$step->{step}.log";
+my $logfilename= $step->{logfile}
+   // "$step->{stepno}.$step->{step}.log";
 printf H "%s",
(html_status2_colour_priority($st))[0],
 encode_entities(uri_escape($logfilename)),
@@ -1167,7 +1168,7 @@ END
: ('#00',250);
}
my $ch = "bgcolor=\"$bgc\"";
-   my $logfilename= "$s->{stepno}.$s->{step}.log";
+   my $logfilename= $s->{logfile} // "$s->{stepno}.$s->{step}.log";
my $h = "{job}).
"/".encode_entities($logfilename)."\">";
#print H "[$s->{stepno}] ";
-- 
2.1.4


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


[Xen-devel] [OSSTEST PATCH 07/17] step logfiles: Break out $logfilename in two places

2017-06-30 Thread Ian Jackson
No functional change.

Signed-off-by: Ian Jackson 
---
 determine-failure-reasons | 4 ++--
 sg-report-flight  | 3 ++-
 2 files changed, 4 insertions(+), 3 deletions(-)

diff --git a/determine-failure-reasons b/determine-failure-reasons
index ecff332..a3b2100 100755
--- a/determine-failure-reasons
+++ b/determine-failure-reasons
@@ -52,8 +52,8 @@ sub gethosts ($) {
 }
 
 while (my $step= $stepsq->fetchrow_hashref) {
-$step->{Log}= "$c{Logs}/$step->{flight}/$step->{job}/".
-"$step->{stepno}.$step->{step}.log";
+my $logfile = "$step->{stepno}.$step->{step}.log";
+$step->{Log}= "$c{Logs}/$step->{flight}/$step->{job}/".$logfile;
 
 if (!stat $step->{Log}) {
 die "$step->{Log} $!" unless $!==&ENOENT;
diff --git a/sg-report-flight b/sg-report-flight
index fd8a68b..ec30ed0 100755
--- a/sg-report-flight
+++ b/sg-report-flight
@@ -1167,8 +1167,9 @@ END
: ('#00',250);
}
my $ch = "bgcolor=\"$bgc\"";
+   my $logfilename= "$s->{stepno}.$s->{step}.log";
my $h = "{job}).
-   "/$s->{stepno}.".encode_entities($s->{step}).".log\">";
+   "/".encode_entities($logfilename)."\">";
#print H "[$s->{stepno}] ";
$h .= encode_entities($sum_core);
$h .= "";
-- 
2.1.4


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


[Xen-devel] [OSSTEST PATCH 14/17] step logfiles: Make substep_* take $logfile, not $script

2017-06-30 Thread Ian Jackson
The $script parameter was used by Standalone to print a message, but
this is no longer done.

It is used by Executive as the value for the "step" column in the
steps table, which shows up as "script" in the output from
sg-report-flight.  But, when running under sg-run-job,
JobDB::Executive already has a better source of the script name: the
parent step (as reported in OSSTEST_TESTID).  When not running under
sg-run-job the use of $0 is good enough.

Finally, it is used by Executive as a logfile name.  But when running
under sg-run-job, JobDB::Executive gets the right logfile name anyway
(as above); and when not running under sg-run-job there is no default
logfile.

Conversely, substeps might organise their own logfile.

So abolish $script from the TestSupport substep API.  Replace it in
substep_start and substep_eval with a $logfile parameter.

Update all call sites to no longer pass $script.  None make their own
logfiles, so none pass the new parameter $logfile.

Signed-off-by: Ian Jackson 
---
 Osstest/TestSupport.pm | 10 +-
 ts-examine-serial-post |  2 +-
 ts-xtf-run |  2 +-
 3 files changed, 7 insertions(+), 7 deletions(-)

diff --git a/Osstest/TestSupport.pm b/Osstest/TestSupport.pm
index a05dd97..6e19b28 100644
--- a/Osstest/TestSupport.pm
+++ b/Osstest/TestSupport.pm
@@ -246,9 +246,9 @@ sub complete_testid ($) {
 }
 
 sub substep_start ($;$) {
-my ($testid,$script) = @_;
+my ($testid,$logfile) = @_;
 complete_testid(\$testid);
-$mjobdb->step_start($testid,undef,$script);
+$mjobdb->step_start($testid,$logfile);
 }
 
 sub substep_finish ($$) {
@@ -258,10 +258,10 @@ sub substep_finish ($$) {
 }
 
 sub substep_eval ($$;$) {
-# substep_eval(TESTID, [SCRIPTNAME], sub { ... });
+# substep_eval(TESTID, [LOGFILE], sub { ... });
 my $fn = pop @_;
-my ($testid,$script) = @_;
-substep_start($testid,$script);
+my ($testid,$logfile) = @_;
+substep_start($testid,$logfile);
 eval { $fn->(); };
 if (length $@) {
logm("substep ($testid) failed: $@");
diff --git a/ts-examine-serial-post b/ts-examine-serial-post
index 2d5c103..77d8e5d 100755
--- a/ts-examine-serial-post
+++ b/ts-examine-serial-post
@@ -44,7 +44,7 @@ sub cookies () {
my $key = $1;
my $substep = "examine-serial/$key";
my $ci = { K => $key, C => $r{$rv}, Substep => $substep };
-   substep_start($ci->{Substep}, 'ts-examine-serial-post');
+   substep_start($ci->{Substep});
push @cookies, $ci;
 }
 }
diff --git a/ts-xtf-run b/ts-xtf-run
index cef45c8..5b136a6 100755
--- a/ts-xtf-run
+++ b/ts-xtf-run
@@ -62,7 +62,7 @@ sub do_one_test ($) {
 my $ret;
 my $osstest_result;
 
-substep_start($tid, $cmd);
+substep_start($tid);
 
 if (!eval {
 $output = target_cmd_output_root($ho, 

[Xen-devel] [OSSTEST PATCH 17/17] step logfiles: Rely on new logfile column

2017-06-30 Thread Ian Jackson
These are the three places which read logfile from the db, but had a
fallback to a computation involving stepno and step.

But, after steps-logfile-constraint, the logfile column is NOT NULL
(and populated with computed default data if need be) so this is not
needed any more

This is part of a "Populate-then-rely" schema change, as
described in schema/README.updates.  Specifically, the step:
10. Optionally commit: code which relies on new column, and does not
   necessarily tolerate NULL/DEFAULT; changing `constraint' to Needed.

Signed-off-by: Ian Jackson 
---
 determine-failure-reasons   | 2 +-
 schema/steps-logfile-constraint.sql | 2 +-
 sg-report-flight| 5 ++---
 3 files changed, 4 insertions(+), 5 deletions(-)

diff --git a/determine-failure-reasons b/determine-failure-reasons
index 89c67e6..42791c3 100755
--- a/determine-failure-reasons
+++ b/determine-failure-reasons
@@ -52,7 +52,7 @@ sub gethosts ($) {
 }
 
 while (my $step= $stepsq->fetchrow_hashref) {
-my $logfile = $step->{logfile} // "$step->{stepno}.$step->{step}.log";
+my $logfile = $step->{logfile};
 $step->{Log}= "$c{Logs}/$step->{flight}/$step->{job}/".$logfile;
 
 if (!stat $step->{Log}) {
diff --git a/schema/steps-logfile-constraint.sql 
b/schema/steps-logfile-constraint.sql
index 462941e..b261fd0 100644
--- a/schema/steps-logfile-constraint.sql
+++ b/schema/steps-logfile-constraint.sql
@@ -1,4 +1,4 @@
--- ##OSSTEST## 004 Ready
+-- ##OSSTEST## 004 Needed
 --
 -- Previously, the logfile name was inferred from "stepno" and
 -- "testid".  Newer code will need it to be set explicitly.
diff --git a/sg-report-flight b/sg-report-flight
index 4e3560e..135f0d4 100755
--- a/sg-report-flight
+++ b/sg-report-flight
@@ -1001,8 +1001,7 @@ END
 printf H "%s", show_abs_time $step->{started};
 
 my $st= $step->{status};
-my $logfilename= $step->{logfile}
-   // "$step->{stepno}.$step->{step}.log";
+my $logfilename= $step->{logfile};
 printf H "%s",
(html_status2_colour_priority($st))[0],
 encode_entities(uri_escape($logfilename)),
@@ -1168,7 +1167,7 @@ END
: ('#00',250);
}
my $ch = "bgcolor=\"$bgc\"";
-   my $logfilename= $s->{logfile} // "$s->{stepno}.$s->{step}.log";
+   my $logfilename= $s->{logfile};
my $h = "{job}).
"/".encode_entities($logfilename)."\">";
#print H "[$s->{stepno}] ";
-- 
2.1.4


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


[Xen-devel] [OSSTEST PATCH 11/17] substep logfiles: Populate new logfile column, at all, for substeps

2017-06-30 Thread Ian Jackson
For now we populate it with the sometimes-wrong value based on
$script.  In detail:

* Add a parameter $logfile to $mjobdb->step_start, which currently
  always gets passed undef.

* In JobDB::Executive::step_start, try to use it as the value for the
  new logfile column.  But, if it is not set (which is currently
  always the case), default it to ".

[Xen-devel] [OSSTEST PATCH 05/17] schema updates: Be willing to apply Ready changes

2017-06-30 Thread Ian Jackson
If the oldest code declares itself Ready for this change, or
(implausibly) Needed, then it is OK to push.

Signed-off-by: Ian Jackson 
---
 mg-schema-update | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/mg-schema-update b/mg-schema-update
index 43f313a..44e4283 100755
--- a/mg-schema-update
+++ b/mg-schema-update
@@ -102,7 +102,7 @@ sub getstate () {
if (!$there) {
$out->{Todo} = 1;
$out->{Msg} = "would break any old code";
-   } elsif ($tst =~ m/Harmless|Preparatory/) {
+   } elsif ($tst =~ m/Harmless|Preparatory|Ready|Needed/) {
$out->{Todo} = 2;
$out->{Msg} = "specified revision can cope";
} else {
-- 
2.1.4


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


[Xen-devel] [OSSTEST PATCH 16/17] step logfiles: Populate logfile column with logfile name

2017-06-30 Thread Ian Jackson
This is part of a "Populate-then-rely" schema change, as described in
schema/README.updates.  Specifically, this is the final part of the
step:

5. Commit: code to populate new column; changing `add' to status
   Needed and `constraint' to status Ready.

Signed-off-by: Ian Jackson 
---
 schema/steps-logfile-constraint.sql | 2 +-
 tcl/JobDB-Executive.tcl | 5 +++--
 2 files changed, 4 insertions(+), 3 deletions(-)

diff --git a/schema/steps-logfile-constraint.sql 
b/schema/steps-logfile-constraint.sql
index 100bb31..462941e 100644
--- a/schema/steps-logfile-constraint.sql
+++ b/schema/steps-logfile-constraint.sql
@@ -1,4 +1,4 @@
--- ##OSSTEST## 004 Unfinished
+-- ##OSSTEST## 004 Ready
 --
 -- Previously, the logfile name was inferred from "stepno" and
 -- "testid".  Newer code will need it to be set explicitly.
diff --git a/tcl/JobDB-Executive.tcl b/tcl/JobDB-Executive.tcl
index ed636e4..0734018 100644
--- a/tcl/JobDB-Executive.tcl
+++ b/tcl/JobDB-Executive.tcl
@@ -281,12 +281,13 @@ proc spawn-step-begin {flight job ts stepnovar} {
} else {
set stepno 1
}
+   set logfile [step-log-leafname $stepno $ts]
db-execute "
INSERT INTO steps (flight, job, stepno,
-   step, status,
+   step, logfile, status,
testid)
VALUES ([pg_quote $flight], [pg_quote $job], $stepno,
-   [pg_quote $ts], 'running',
+   [pg_quote $ts], [pg_quote $logfile], 'running',
'STARTING')
"
} emsg]} {
-- 
2.1.4


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


[Xen-devel] [OSSTEST PATCH 10/17] step logfiles: Provide new column

2017-06-30 Thread Ian Jackson
We will write things into it, and use it, soon.

This is the start of a "Populate-then-rely" schema change, as
described in schema/README.updates.  Specifically, the steps:
1. Commit: new schema update `add', status Preparatory
2. Commit: new schema update `constraint', status Unfinished

Signed-off-by: Ian Jackson 
---
 schema/steps-logfile-add.sql|  8 
 schema/steps-logfile-constraint.sql | 10 ++
 2 files changed, 18 insertions(+)
 create mode 100644 schema/steps-logfile-add.sql
 create mode 100644 schema/steps-logfile-constraint.sql

diff --git a/schema/steps-logfile-add.sql b/schema/steps-logfile-add.sql
new file mode 100644
index 000..5e37b10
--- /dev/null
+++ b/schema/steps-logfile-add.sql
@@ -0,0 +1,8 @@
+-- ##OSSTEST## 003 Preparatory
+--
+-- Previously, the logfile name was inferred from "stepno" and
+-- "testid".  We want to be able to set it explicitly for substeps.
+--
+-- This change is compatible with old code.
+
+ALTER TABLE steps ADD COLUMN logfile TEXT;
diff --git a/schema/steps-logfile-constraint.sql 
b/schema/steps-logfile-constraint.sql
new file mode 100644
index 000..100bb31
--- /dev/null
+++ b/schema/steps-logfile-constraint.sql
@@ -0,0 +1,10 @@
+-- ##OSSTEST## 004 Unfinished
+--
+-- Previously, the logfile name was inferred from "stepno" and
+-- "testid".  Newer code will need it to be set explicitly.
+
+UPDATE steps
+   SET logfile = stepno || '.' || step || '.log'
+ WHERE logfile is null;
+
+ALTER TABLE steps ALTER COLUMN logfile SET NOT NULL;
-- 
2.1.4


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


[Xen-devel] [OSSTEST PATCH 00/17] Fix substep (eg XTF) logfile links

2017-06-30 Thread Ian Jackson
It kept irritating me that the links to the substeps of xtf-run do not
work.  To fix this, it is necessary for the database to contain the
right information - ie, a schema change.

After this series, substep logfile names are recorded and reported
properly, and you can click on them.

At some point in the future, when enough browsers honour `#line=', it
might be worth adding that - that would be another column, probably.
For now, the links for each step just go to the top of the logfile.


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


Re: [Xen-devel] [PATCH 2/2] tools: utility to dump guest grant table info

2017-06-30 Thread Konrad Rzeszutek Wilk
On Fri, Jun 30, 2017 at 03:21:31PM +0800, Dongli Zhang wrote:
> As both xen-netfront and xen-blkfront support multi-queue, they would
> consume a lot of grant table references when there are many paravirtual
> devices and vcpus assigned to guest. Guest domU might panic or hang due to
> grant allocation failure when nr_grant_frames in guest has reached its max
> value.
> 
> This utility would help the administrators to monitor the guest grant table
> frame usage on dom0 side so that it is not required to debug on guest
> kernel side for crash/hang analysis anymore.
> 
> Signed-off-by: Dongli Zhang 
> ---
>  tools/misc/Makefile   |  4 
>  tools/misc/xen-gnttab-query.c | 45 
> +++

Would this be better name 'xen-diag' or such? And in the future
more diagnostic pieces could be added in? For example I can see
parts of xen-hptool moving in there.

>  2 files changed, 49 insertions(+)
>  create mode 100644 tools/misc/xen-gnttab-query.c
> 
> diff --git a/tools/misc/Makefile b/tools/misc/Makefile
> index 8152f7b..d081b4b 100644
> --- a/tools/misc/Makefile
> +++ b/tools/misc/Makefile
> @@ -31,6 +31,7 @@ INSTALL_SBIN   += xenperf
>  INSTALL_SBIN   += xenpm
>  INSTALL_SBIN   += xenwatchdogd
>  INSTALL_SBIN   += xen-livepatch
> +INSTALL_SBIN   += xen-gnttab-query
>  INSTALL_SBIN += $(INSTALL_SBIN-y)
>  
>  # Everything to be installed in a private bin/
> @@ -108,4 +109,7 @@ xen-lowmemd: xen-lowmemd.o
>  xencov: xencov.o
>   $(CC) $(LDFLAGS) -o $@ $< $(LDLIBS_libxenctrl) $(APPEND_LDFLAGS)
>  
> +xen-gnttab-query: xen-gnttab-query.o
> + $(CC) $(LDFLAGS) -o $@ $< $(LDLIBS_libxenctrl) $(APPEND_LDFLAGS)
> +
>  -include $(DEPS)
> diff --git a/tools/misc/xen-gnttab-query.c b/tools/misc/xen-gnttab-query.c
> new file mode 100644
> index 000..3f93a6c
> --- /dev/null
> +++ b/tools/misc/xen-gnttab-query.c
> @@ -0,0 +1,45 @@

Please add Oracle's copyright (see the xen-livepatch.c for example).


> +#include 
> +#include 
> +#include 
> +#include 
> +
> +void show_help(void)
> +{
> +fprintf(stderr,
> +"xen-gnttab-query: query grant table info\n"
> +"Usage: xen-gnttab-query [domid (default 0)]\n");
> +}
> +
> +int main(int argc, char *argv[])
> +{
> +xc_interface *xch;
> +int domid, rc, c;
> +struct gnttab_query_size query;
> +
> +while ( (c = getopt(argc, argv, "h")) != -1 )
> +{
> +switch ( c )
> +{
> +case 'h':
> +show_help();
> +return 0;
> +}
> +}
> +
> +domid = (argc > 1) ? strtol(argv[1], NULL, 10) : 0;
> +
> +xch = xc_interface_open(0, 0, 0);
> +if ( !xch )
> +errx(1, "failed to open control interface");
> +
> +query.dom = domid;
> +rc = xc_gnttab_query_size(xch, &query);
> +
> +if ( rc == 0 && (query.status == GNTST_okay) )
> +printf("domid=%d: nr_frames=%d, max_nr_frames=%d\n",
> +   query.dom, query.nr_frames, query.max_nr_frames);
> +
> +xc_interface_close(xch);
> +
> +return 0;
> +}
> -- 
> 2.7.4
> 
> 
> ___
> Xen-devel mailing list
> Xen-devel@lists.xen.org
> https://lists.xen.org/xen-devel

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


[Xen-devel] [OSSTEST PATCH 09/17] substep logfiles: Move defaulting of $script into Executive

2017-06-30 Thread Ian Jackson
We are going to want to default this here in a more sophisticated way,
but we can't do that if it's already been defaulted from $0 earlier.

The other consumer of this default was in JobDB/Standalone, but we
have just changed that to ignore it.  So, no functional change.

Signed-off-by: Ian Jackson 
---
 Osstest/JobDB/Executive.pm | 4 
 Osstest/TestSupport.pm | 4 
 2 files changed, 4 insertions(+), 4 deletions(-)

diff --git a/Osstest/JobDB/Executive.pm b/Osstest/JobDB/Executive.pm
index 0d1b3be..fbbb5ac 100644
--- a/Osstest/JobDB/Executive.pm
+++ b/Osstest/JobDB/Executive.pm
@@ -252,6 +252,10 @@ END
 INSERT INTO steps (flight,job,stepno, step,status, testid,started)
 VALUES (?,?,?, ?,'running', ?,?)
 END
+if (!defined $script) {
+   $script = $0;
+   $script =~ s{^.*/}{};
+}
 my $stepno;
 db_retry($flight,[qw(running)], $dbh_tests,[qw(flights)],sub {
$snq->execute($flight,$job);
diff --git a/Osstest/TestSupport.pm b/Osstest/TestSupport.pm
index f10d56e..5a951e5 100644
--- a/Osstest/TestSupport.pm
+++ b/Osstest/TestSupport.pm
@@ -248,10 +248,6 @@ sub complete_testid ($) {
 sub substep_start ($;$) {
 my ($testid,$script) = @_;
 complete_testid(\$testid);
-if (!defined $script) {
-   $script = $0;
-   $script =~ s{^.*/}{};
-}
 $mjobdb->step_start($testid,$script);
 }
 
-- 
2.1.4


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


[Xen-devel] [OSSTEST PATCH 12/17] substep logfiles: Set logfile and step columns correctly for substeps

2017-06-30 Thread Ian Jackson
If we are running under sg-run-job, OSSTEST_TESTID will be set to the
testid of the parent step (ie, the step created by sg-run-job which
relates to the execution of the whole script).

Unless the caller has specified otherwise, the log and script are
the same as for the parent step.

Signed-off-by: Ian Jackson 
---
 Osstest/JobDB/Executive.pm | 13 +
 1 file changed, 13 insertions(+)

diff --git a/Osstest/JobDB/Executive.pm b/Osstest/JobDB/Executive.pm
index e1e2052..a7a6696 100644
--- a/Osstest/JobDB/Executive.pm
+++ b/Osstest/JobDB/Executive.pm
@@ -254,6 +254,19 @@ END
status,testid,started)
 VALUES (?,?,?,?, ?, 'running',?,?)
 END
+my $parent_testid = $ENV{OSSTEST_TESTID};
+if ((!defined $logfile || !defined $script) && defined $parent_testid) {
+   my $parentq = $dbh_tests->prepare(fetchrow_hashref();
+   $logfile //= $row->{logfile};
+   $script //= $row->{script};
+   });
+}
 if (!defined $script) {
$script = $0;
$script =~ s{^.*/}{};
-- 
2.1.4


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


[Xen-devel] [OSSTEST PATCH 01/17] Developer docs: A rune for flight comparision

2017-06-30 Thread Ian Jackson
Something like this rune can be useful for comparing testids of
different flights.

Signed-off-by: Ian Jackson 
---
 NOTES.flight-comparison | 22 ++
 1 file changed, 22 insertions(+)
 create mode 100644 NOTES.flight-comparison

diff --git a/NOTES.flight-comparison b/NOTES.flight-comparison
new file mode 100644
index 000..ea290f8
--- /dev/null
+++ b/NOTES.flight-comparison
@@ -0,0 +1,22 @@
+select
+  l.job, l.stepno, l.testid, l.status,
+  r.job, r.stepno, r.testid, r.status
+from
+  (select * from steps where flight=110909) l
+  full outer join
+  (select * from steps where flight=110951) r
+on
+  regexp_replace(l.testid,'\([0-9]*\)$','') =
+  regexp_replace(r.testid,'\([0-9]*\)$','')
+  and
+  l.job=r.job
+  and
+  (l.stepno=r.stepno or l.stepno+1=r.stepno)
+where
+  coalesce(r.testid,'') != 'syslog-server'
+  and
+  (l.testid is null or r.testid is null or l.status!=r.status)
+order by
+  coalesce(l.job, r.job),
+  l.stepno, r.stepno,
+  l.testid, r.testid;
-- 
2.1.4


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


[Xen-devel] [OSSTEST PATCH 03/17] schema updates: Document how to remove a used column

2017-06-30 Thread Ian Jackson
Signed-off-by: Ian Jackson 
---
 schema/README.updates | 26 ++
 1 file changed, 26 insertions(+)

diff --git a/schema/README.updates b/schema/README.updates
index c5abc36..ca1d37e 100644
--- a/schema/README.updates
+++ b/schema/README.updates
@@ -147,6 +147,32 @@ finish is needed', this will usually involve passing an 
appropriate
 `-o' option.
 
 
+Update order for Cleanup
+
+
+This is for when we want to get rid of some old information in the
+database.  Sometimes the information will have been replaced eg via
+a Populate-then-Rely change, as described above.
+
+There are typically two schema changes:
+
+* To allow the new information to be left blank (eg for the column to
+  be NULL).  Call this `unconstrain'; it is an `Explicit conditional'
+  change.
+
+* To drop the information entirely.  I will call this `drop'.
+  It is `Code first'.
+
+1. Commit: new schema updates `unconstrain', status `Unfinished'
+   and `drop', status `Unfinished'.
+
+2. Commit code which tolerates the information being missing;
+   changing `unconstrain' to Ready.
+
+3. Commit code which no longer writes the information; changing
+   `unconstrain' to Needed and `drop' to Ready.
+
+
 Statuses and rules for push and db update
 -
 
-- 
2.1.4


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


[Xen-devel] [OSSTEST PATCH 04/17] schema updates: mg-schema-test-database: Cope with applied updates

2017-06-30 Thread Ian Jackson
The schema_updates table contents are written by the call to
mg-schema-update.  Trying to copy the contents from the source db
correctly fails with duplicate key errors.  So don't do that.

Signed-off-by: Ian Jackson 
---
 mg-schema-test-database | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/mg-schema-test-database b/mg-schema-test-database
index 0517ca3..641aadb 100755
--- a/mg-schema-test-database
+++ b/mg-schema-test-database
@@ -467,6 +467,9 @@ END
 END
 
for table in $tables; do
+   case $table in
+   schema_updates) continue ;;
+   esac
case " $ftables " in
*" $table "*)   condition="flight >= $minflight" ;;
*)  condition="1=1" ;;
-- 
2.1.4


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


Re: [Xen-devel] [OSSTEST PATCH v11 16/20] ts-openstack-tempest: Update list of skipped tests

2017-06-30 Thread Anthony PERARD
On Fri, Jun 23, 2017 at 04:38:05PM +0100, Ian Jackson wrote:
> Anthony PERARD writes ("Re: [OSSTEST PATCH v11 16/20] ts-openstack-tempest: 
> Update list of skipped tests"):
> > On Fri, Jun 23, 2017 at 02:47:37PM +0100, Ian Jackson wrote:
> > > Again, does this not mean we're going to suffer a maintenance burden
> > > as tempest grows new inapplicable tests ?
> > 
> > That exactly what is happening with the OpenStack CI loop, from time to
> > time, there are new tests, that can fail, and diffenrent ways to fix
> > this (fix the bug, fix a configuration, or just skip the tests).
> > 
> > Recently, we've actually push the list of tests to skip into nova.git,
> > but I think it is only available in master.
> 
> Aha.  Well, if the stable branch is stable then the set of tests to
> skip there is probably stable too ?  And on master it's built-in ?  So
> this actually won't be a problem - in the sense that this will be
> approximately the last necessary update to the list of tests to skip ?

The built-in list is to be consume by the CI, it is not used
automatically. It a bash script to be sourced. I have not yet try to
have osstest use it. That will be for later.

> > > Which makes me think: maybe the tempest tests want to be substeps
> > > anyway.  Is that possible ?  (Does tempest speak subunit or
> > > something ?)
> > 
> > I think it is subunit, yes. And I've got the command that is been run by
> > tempest (as it's printed on stdout).
> > 
> > running=OS_STDOUT_CAPTURE=${OS_STDOUT_CAPTURE:-1} \
> > OS_STDERR_CAPTURE=${OS_STDERR_CAPTURE:-1} \
> > OS_TEST_TIMEOUT=${OS_TEST_TIMEOUT:-500} \
> > OS_TEST_LOCK_PATH=${OS_TEST_LOCK_PATH:-${TMPDIR:-'/tmp'}} \
> > ${PYTHON:-python} -m subunit.run discover -t ${OS_TOP_LEVEL:-./} 
> > ${OS_TEST_PATH:-./tempest/test_discover} --list
> > 
> > then several:
> > running=OS_STDOUT_CAPTURE=${OS_STDOUT_CAPTURE:-1} \
> > OS_STDERR_CAPTURE=${OS_STDERR_CAPTURE:-1} \
> > OS_TEST_TIMEOUT=${OS_TEST_TIMEOUT:-500} \
> > OS_TEST_LOCK_PATH=${OS_TEST_LOCK_PATH:-${TMPDIR:-'/tmp'}} \
> > ${PYTHON:-python} -m subunit.run discover -t ${OS_TOP_LEVEL:-./} 
> > ${OS_TEST_PATH:-./tempest/test_discover}  --load-list /tmp/tmpzSNsrB
> 
> It would be really good to have those individual subunit results as
> substeps.  There is no subunit parser in osstest yet but we could have
> one.
> 
> What version of subunit does it print out ?  The subunit v1 protocol
> is lovely and simple but there is a Second System :-/.

Right now, tempest print on stdout something much simpler, lines liked
this:
{1} 
tempest.scenario.test_minimum_basic.TestMinimumBasicScenario.test_minimum_basic_scenario
 [71.009969s] ... ok
Followed by summary of all test, and the output of failed tests.

But it can be told to print subunit v2, which can be pipped to a different
program to transform into want we want, including simple cvs, subunit v1, and
other.

I thing we could try to parse subunit v1, grab the start and finish time
of a test, the result, and the output of the tests. And have all that as
subunit. During my manual tests, `tempest run --subunit ... | subunit-2to1`
only print the stuff about a tests once it is finish, so I guess we'll
have to rewrite substep_start() (or another function) to take time as
parameter.

> I guess that tempest doesn't stop on the first failed test ?  So
> perhaps we could just tolerate the failed-but-not-skipped tests ?

It does not, it run everything, no matter how many test fails.

-- 
Anthony PERARD

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


[Xen-devel] [PATCH 2/4] xen/mapcache: add an ability to create dummy mappings

2017-06-30 Thread Igor Druzhinin
Dummys are simple anonymous mappings that are placed instead
of regular foreign mappings in certain situations when we need
to postpone the actual mapping but still have to give a
memory region to QEMU to play with.

This is planned to be used for restore on Xen.

Signed-off-by: Igor Druzhinin 
---
 hw/i386/xen/xen-mapcache.c | 36 
 1 file changed, 28 insertions(+), 8 deletions(-)

diff --git a/hw/i386/xen/xen-mapcache.c b/hw/i386/xen/xen-mapcache.c
index e60156c..05050de 100644
--- a/hw/i386/xen/xen-mapcache.c
+++ b/hw/i386/xen/xen-mapcache.c
@@ -150,7 +150,8 @@ void xen_map_cache_init(phys_offset_to_gaddr_t f, void 
*opaque)
 
 static void xen_remap_bucket(MapCacheEntry *entry,
  hwaddr size,
- hwaddr address_index)
+ hwaddr address_index,
+ bool dummy)
 {
 uint8_t *vaddr_base;
 xen_pfn_t *pfns;
@@ -177,11 +178,25 @@ static void xen_remap_bucket(MapCacheEntry *entry,
 pfns[i] = (address_index << (MCACHE_BUCKET_SHIFT-XC_PAGE_SHIFT)) + i;
 }
 
-vaddr_base = xenforeignmemory_map(xen_fmem, xen_domid, 
PROT_READ|PROT_WRITE,
-  nb_pfn, pfns, err);
-if (vaddr_base == NULL) {
-perror("xenforeignmemory_map");
-exit(-1);
+if (!dummy) {
+vaddr_base = xenforeignmemory_map(xen_fmem, xen_domid,
+   PROT_READ|PROT_WRITE,
+   nb_pfn, pfns, err);
+if (vaddr_base == NULL) {
+perror("xenforeignmemory_map");
+exit(-1);
+}
+} else {
+/*
+ * We create dummy mappings where we are unable to create a foreign
+ * mapping immediately due to certain circumstances (i.e. on resume 
now)
+ */
+vaddr_base = mmap(NULL, size, PROT_READ|PROT_WRITE,
+  MAP_ANON|MAP_SHARED, -1, 0);
+if (vaddr_base == NULL) {
+perror("mmap");
+exit(-1);
+}
 }
 
 entry->vaddr_base = vaddr_base;
@@ -211,6 +226,7 @@ static uint8_t *xen_map_cache_unlocked(hwaddr phys_addr, 
hwaddr size,
 hwaddr cache_size = size;
 hwaddr test_bit_size;
 bool translated = false;
+bool dummy = false;
 
 tryagain:
 address_index  = phys_addr >> MCACHE_BUCKET_SHIFT;
@@ -262,14 +278,14 @@ tryagain:
 if (!entry) {
 entry = g_malloc0(sizeof (MapCacheEntry));
 pentry->next = entry;
-xen_remap_bucket(entry, cache_size, address_index);
+xen_remap_bucket(entry, cache_size, address_index, dummy);
 } else if (!entry->lock) {
 if (!entry->vaddr_base || entry->paddr_index != address_index ||
 entry->size != cache_size ||
 !test_bits(address_offset >> XC_PAGE_SHIFT,
 test_bit_size >> XC_PAGE_SHIFT,
 entry->valid_mapping)) {
-xen_remap_bucket(entry, cache_size, address_index);
+xen_remap_bucket(entry, cache_size, address_index, dummy);
 }
 }
 
@@ -282,6 +298,10 @@ tryagain:
 translated = true;
 goto tryagain;
 }
+if (!dummy && runstate_check(RUN_STATE_INMIGRATE)) {
+dummy = true;
+goto tryagain;
+}
 trace_xen_map_cache_return(NULL);
 return NULL;
 }
-- 
2.7.4


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


[Xen-devel] [PATCH 4/4] xen: don't use xenstore to save/restore physmap anymore

2017-06-30 Thread Igor Druzhinin
If we have a system with xenforeignmemory_map2() implemented
we don't need to save/restore physmap on suspend/restore
anymore. In case we resume a VM without physmap - try to
recreate the physmap during memory region restore phase and
remap map cache entries accordingly. The old code is left
for compatibility reasons.

Signed-off-by: Igor Druzhinin 
---
 hw/i386/xen/xen-hvm.c   | 45 ++---
 include/hw/xen/xen_common.h |  1 +
 2 files changed, 35 insertions(+), 11 deletions(-)

diff --git a/hw/i386/xen/xen-hvm.c b/hw/i386/xen/xen-hvm.c
index d259cf7..1b6a5ce 100644
--- a/hw/i386/xen/xen-hvm.c
+++ b/hw/i386/xen/xen-hvm.c
@@ -305,6 +305,7 @@ static hwaddr xen_phys_offset_to_gaddr(hwaddr start_addr,
 return start_addr;
 }
 
+#ifdef XEN_COMPAT_PHYSMAP
 static int xen_save_physmap(XenIOState *state, XenPhysmap *physmap)
 {
 char path[80], value[17];
@@ -334,6 +335,12 @@ static int xen_save_physmap(XenIOState *state, XenPhysmap 
*physmap)
 }
 return 0;
 }
+#else
+static int xen_save_physmap(XenIOState *state, XenPhysmap *physmap)
+{
+return 0;
+}
+#endif
 
 static int xen_add_to_physmap(XenIOState *state,
   hwaddr start_addr,
@@ -368,6 +375,26 @@ go_physmap:
 DPRINTF("mapping vram to %"HWADDR_PRIx" - %"HWADDR_PRIx"\n",
 start_addr, start_addr + size);
 
+mr_name = memory_region_name(mr);
+
+physmap = g_malloc(sizeof (XenPhysmap));
+
+physmap->start_addr = start_addr;
+physmap->size = size;
+physmap->name = mr_name;
+physmap->phys_offset = phys_offset;
+
+QLIST_INSERT_HEAD(&state->physmap, physmap, list);
+
+if (runstate_check(RUN_STATE_INMIGRATE)) {
+/* Now when we have a physmap entry we can remap a dummy mapping and 
change
+ * it to a real one of guest foreign memory. */
+uint8_t *p = xen_remap_cache_entry(phys_offset, size);
+assert(p && p == memory_region_get_ram_ptr(mr));
+
+return 0;
+}
+
 pfn = phys_offset >> TARGET_PAGE_BITS;
 start_gpfn = start_addr >> TARGET_PAGE_BITS;
 for (i = 0; i < size >> TARGET_PAGE_BITS; i++) {
@@ -382,21 +409,11 @@ go_physmap:
 }
 }
 
-mr_name = memory_region_name(mr);
-
-physmap = g_malloc(sizeof (XenPhysmap));
-
-physmap->start_addr = start_addr;
-physmap->size = size;
-physmap->name = mr_name;
-physmap->phys_offset = phys_offset;
-
-QLIST_INSERT_HEAD(&state->physmap, physmap, list);
-
 xc_domain_pin_memory_cacheattr(xen_xc, xen_domid,
start_addr >> TARGET_PAGE_BITS,
(start_addr + size - 1) >> TARGET_PAGE_BITS,
XEN_DOMCTL_MEM_CACHEATTR_WB);
+
 return xen_save_physmap(state, physmap);
 }
 
@@ -1158,6 +1175,7 @@ static void xen_exit_notifier(Notifier *n, void *data)
 xs_daemon_close(state->xenstore);
 }
 
+#ifdef XEN_COMPAT_PHYSMAP
 static void xen_read_physmap(XenIOState *state)
 {
 XenPhysmap *physmap = NULL;
@@ -1205,6 +1223,11 @@ static void xen_read_physmap(XenIOState *state)
 }
 free(entries);
 }
+#else
+static void xen_read_physmap(XenIOState *state)
+{
+}
+#endif
 
 static void xen_wakeup_notifier(Notifier *notifier, void *data)
 {
diff --git a/include/hw/xen/xen_common.h b/include/hw/xen/xen_common.h
index 70a5cad..c04c5c9 100644
--- a/include/hw/xen/xen_common.h
+++ b/include/hw/xen/xen_common.h
@@ -80,6 +80,7 @@ extern xenforeignmemory_handle *xen_fmem;
 
 #if CONFIG_XEN_CTRL_INTERFACE_VERSION < 41000
 
+#define XEN_COMPAT_PHYSMAP
 #define xenforeignmemory_map2(h, d, a, p, f, ps, ar, e) \
 xenforeignmemory_map(h, d, p, ps, ar, e)
 
-- 
2.7.4


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


[Xen-devel] [PATCH 3/4] xen/mapcache: introduce xen_remap_cache_entry()

2017-06-30 Thread Igor Druzhinin
This new call is trying to update a requested map cache entry
according to the changes in the physmap. The call is searching
for the entry, unmaps it, tries to translate the address and
maps again at the same place. If the mapping is dummy this call
will make it real.

This function makes use of a new xenforeignmemory_map2() call
with extended interface that was recently introduced in
libxenforeignmemory [1].

[1] https://www.mail-archive.com/xen-devel@lists.xen.org/msg113007.html

Signed-off-by: Igor Druzhinin 
---
 configure |  18 
 hw/i386/xen/xen-mapcache.c| 105 +++---
 include/hw/xen/xen_common.h   |   7 +++
 include/sysemu/xen-mapcache.h |   6 +++
 4 files changed, 130 insertions(+), 6 deletions(-)

diff --git a/configure b/configure
index c571ad1..ad6156b 100755
--- a/configure
+++ b/configure
@@ -2021,6 +2021,24 @@ EOF
 # Xen unstable
 elif
 cat > $TMPC <
+int main(void) {
+  xenforeignmemory_handle *xfmem;
+
+  xfmem = xenforeignmemory_open(0, 0);
+  xenforeignmemory_map2(xfmem, 0, 0, 0, 0, 0, 0, 0);
+
+  return 0;
+}
+EOF
+compile_prog "" "$xen_libs -lxendevicemodel $xen_stable_libs"
+  then
+  xen_stable_libs="-lxendevicemodel $xen_stable_libs"
+  xen_ctrl_version=41000
+  xen=yes
+elif
+cat > $TMPC <
diff --git a/hw/i386/xen/xen-mapcache.c b/hw/i386/xen/xen-mapcache.c
index 05050de..5d8d990 100644
--- a/hw/i386/xen/xen-mapcache.c
+++ b/hw/i386/xen/xen-mapcache.c
@@ -149,6 +149,7 @@ void xen_map_cache_init(phys_offset_to_gaddr_t f, void 
*opaque)
 }
 
 static void xen_remap_bucket(MapCacheEntry *entry,
+ void *vaddr,
  hwaddr size,
  hwaddr address_index,
  bool dummy)
@@ -179,11 +180,11 @@ static void xen_remap_bucket(MapCacheEntry *entry,
 }
 
 if (!dummy) {
-vaddr_base = xenforeignmemory_map(xen_fmem, xen_domid,
-   PROT_READ|PROT_WRITE,
+vaddr_base = xenforeignmemory_map2(xen_fmem, xen_domid, vaddr,
+   PROT_READ|PROT_WRITE, 0,
nb_pfn, pfns, err);
 if (vaddr_base == NULL) {
-perror("xenforeignmemory_map");
+perror("xenforeignmemory_map2");
 exit(-1);
 }
 } else {
@@ -191,7 +192,7 @@ static void xen_remap_bucket(MapCacheEntry *entry,
  * We create dummy mappings where we are unable to create a foreign
  * mapping immediately due to certain circumstances (i.e. on resume 
now)
  */
-vaddr_base = mmap(NULL, size, PROT_READ|PROT_WRITE,
+vaddr_base = mmap(vaddr, size, PROT_READ|PROT_WRITE,
   MAP_ANON|MAP_SHARED, -1, 0);
 if (vaddr_base == NULL) {
 perror("mmap");
@@ -278,14 +279,14 @@ tryagain:
 if (!entry) {
 entry = g_malloc0(sizeof (MapCacheEntry));
 pentry->next = entry;
-xen_remap_bucket(entry, cache_size, address_index, dummy);
+xen_remap_bucket(entry, NULL, cache_size, address_index, dummy);
 } else if (!entry->lock) {
 if (!entry->vaddr_base || entry->paddr_index != address_index ||
 entry->size != cache_size ||
 !test_bits(address_offset >> XC_PAGE_SHIFT,
 test_bit_size >> XC_PAGE_SHIFT,
 entry->valid_mapping)) {
-xen_remap_bucket(entry, cache_size, address_index, dummy);
+xen_remap_bucket(entry, NULL, cache_size, address_index, dummy);
 }
 }
 
@@ -482,3 +483,95 @@ void xen_invalidate_map_cache(void)
 
 mapcache_unlock();
 }
+
+static uint8_t *xen_remap_cache_entry_unlocked(hwaddr phys_addr, hwaddr size)
+{
+MapCacheEntry *entry, *pentry = NULL;
+hwaddr address_index;
+hwaddr address_offset;
+hwaddr cache_size = size;
+hwaddr test_bit_size;
+void *vaddr = NULL;
+uint8_t lock;
+
+address_index  = phys_addr >> MCACHE_BUCKET_SHIFT;
+address_offset = phys_addr & (MCACHE_BUCKET_SIZE - 1);
+
+/* test_bit_size is always a multiple of XC_PAGE_SIZE */
+if (size) {
+test_bit_size = size + (phys_addr & (XC_PAGE_SIZE - 1));
+if (test_bit_size % XC_PAGE_SIZE) {
+test_bit_size += XC_PAGE_SIZE - (test_bit_size % XC_PAGE_SIZE);
+}
+cache_size = size + address_offset;
+if (cache_size % MCACHE_BUCKET_SIZE) {
+cache_size += MCACHE_BUCKET_SIZE - (cache_size % 
MCACHE_BUCKET_SIZE);
+}
+} else {
+test_bit_size = XC_PAGE_SIZE;
+cache_size = MCACHE_BUCKET_SIZE;
+}
+
+/* Search for the requested map cache entry to invalidate */
+entry = &mapcache->entry[address_index % mapcache->nr_buckets];
+while (entry && !(entry->paddr_index == address_index && entry->size == 
cache_size)) {
+pentry =

[Xen-devel] [PATCH 1/4] xen: move physmap saving into a separate function

2017-06-30 Thread Igor Druzhinin
Non-functional change.

Signed-off-by: Igor Druzhinin 
---
 hw/i386/xen/xen-hvm.c | 57 ---
 1 file changed, 31 insertions(+), 26 deletions(-)

diff --git a/hw/i386/xen/xen-hvm.c b/hw/i386/xen/xen-hvm.c
index cffa7e2..d259cf7 100644
--- a/hw/i386/xen/xen-hvm.c
+++ b/hw/i386/xen/xen-hvm.c
@@ -305,6 +305,36 @@ static hwaddr xen_phys_offset_to_gaddr(hwaddr start_addr,
 return start_addr;
 }
 
+static int xen_save_physmap(XenIOState *state, XenPhysmap *physmap)
+{
+char path[80], value[17];
+
+snprintf(path, sizeof(path),
+"/local/domain/0/device-model/%d/physmap/%"PRIx64"/start_addr",
+xen_domid, (uint64_t)physmap->phys_offset);
+snprintf(value, sizeof(value), "%"PRIx64, (uint64_t)physmap->start_addr);
+if (!xs_write(state->xenstore, 0, path, value, strlen(value))) {
+return -1;
+}
+snprintf(path, sizeof(path),
+"/local/domain/0/device-model/%d/physmap/%"PRIx64"/size",
+xen_domid, (uint64_t)physmap->phys_offset);
+snprintf(value, sizeof(value), "%"PRIx64, (uint64_t)physmap->size);
+if (!xs_write(state->xenstore, 0, path, value, strlen(value))) {
+return -1;
+}
+if (physmap->name) {
+snprintf(path, sizeof(path),
+"/local/domain/0/device-model/%d/physmap/%"PRIx64"/name",
+xen_domid, (uint64_t)physmap->phys_offset);
+if (!xs_write(state->xenstore, 0, path,
+  physmap->name, strlen(physmap->name))) {
+return -1;
+}
+}
+return 0;
+}
+
 static int xen_add_to_physmap(XenIOState *state,
   hwaddr start_addr,
   ram_addr_t size,
@@ -316,7 +346,6 @@ static int xen_add_to_physmap(XenIOState *state,
 XenPhysmap *physmap = NULL;
 hwaddr pfn, start_gpfn;
 hwaddr phys_offset = memory_region_get_ram_addr(mr);
-char path[80], value[17];
 const char *mr_name;
 
 if (get_physmapping(state, start_addr, size)) {
@@ -368,31 +397,7 @@ go_physmap:
start_addr >> TARGET_PAGE_BITS,
(start_addr + size - 1) >> TARGET_PAGE_BITS,
XEN_DOMCTL_MEM_CACHEATTR_WB);
-
-snprintf(path, sizeof(path),
-"/local/domain/0/device-model/%d/physmap/%"PRIx64"/start_addr",
-xen_domid, (uint64_t)phys_offset);
-snprintf(value, sizeof(value), "%"PRIx64, (uint64_t)start_addr);
-if (!xs_write(state->xenstore, 0, path, value, strlen(value))) {
-return -1;
-}
-snprintf(path, sizeof(path),
-"/local/domain/0/device-model/%d/physmap/%"PRIx64"/size",
-xen_domid, (uint64_t)phys_offset);
-snprintf(value, sizeof(value), "%"PRIx64, (uint64_t)size);
-if (!xs_write(state->xenstore, 0, path, value, strlen(value))) {
-return -1;
-}
-if (mr_name) {
-snprintf(path, sizeof(path),
-"/local/domain/0/device-model/%d/physmap/%"PRIx64"/name",
-xen_domid, (uint64_t)phys_offset);
-if (!xs_write(state->xenstore, 0, path, mr_name, strlen(mr_name))) {
-return -1;
-}
-}
-
-return 0;
+return xen_save_physmap(state, physmap);
 }
 
 static int xen_remove_from_physmap(XenIOState *state,
-- 
2.7.4


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


[Xen-devel] [PATCH 0/4] xen: don't save/restore the physmap on VM save/restore

2017-06-30 Thread Igor Druzhinin
Saving/restoring the physmap to/from xenstore was introduced to
QEMU majorly in order to cover up the VRAM region restore issue.
The sequence of restore operations implies that we should know
the effective guest VRAM address *before* we have the VRAM region
restored (which happens later). Unfortunately, in Xen environment
VRAM memory does actually belong to a guest - not QEMU itself -
which means the position of this region is unknown beforehand and
can't be mapped into QEMU address space immediately.

Previously, recreating xenstore keys, holding the physmap, by the
toolstack helped to get this information in place at the right
moment ready to be consumed by QEMU to map the region properly.
But using xenstore for it has certain disadvantages: toolstack
needs to be aware of these keys and save/restore them accordingly;
accessing xenstore requires extra privileges which hinders QEMU
sandboxing.

The previous attempt to get rid of that was to remember all the
VRAM pointers during QEMU initialization phase and then update
them all at once when an actual foreign mapping is established.
Unfortunately, this approach worked only for VRAM and only for
a predefined set of devices - stdvga and cirrus. QXL and other
possible future devices using a moving emulated MMIO region
would be equally broken.

The new approach leverages xenforeignmemory_map2() call recently
introduced in libxenforeignmemory. It allows to create a dummy
anonymous mapping for QEMU during its initialization and change
it to a real one later during machine state restore.

Igor Druzhinin (4):
  xen: move physmap saving into a separate function
  xen/mapcache: add an ability to create dummy mappings
  xen/mapcache: introduce xen_remap_cache_entry()
  xen: don't use xenstore to save/restore physmap anymore

 configure |  18 ++
 hw/i386/xen/xen-hvm.c | 100 
 hw/i386/xen/xen-mapcache.c| 129 +++---
 include/hw/xen/xen_common.h   |   8 +++
 include/sysemu/xen-mapcache.h |   6 ++
 5 files changed, 217 insertions(+), 44 deletions(-)

-- 
2.7.4


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


[Xen-devel] [PATCH v3 01/16] xen/arm: setup: Remove bogus xenheap_mfn_end in setup_mm for arm64

2017-06-30 Thread Julien Grall
xenheap_mfn_end is storing an MFN and not a physical address. The value will
be reset after the loop. So drop this bogus xenheap_mfn_end.

Signed-off-by: Julien Grall 
---
Changes in v2:
- Update commit message

Changes in v3:
- Don't mention the fact that Xen is not currently using
xenheap_mfn_end.
- Add Stefano's reviewed-by
---
 xen/arch/arm/setup.c | 2 --
 1 file changed, 2 deletions(-)

diff --git a/xen/arch/arm/setup.c b/xen/arch/arm/setup.c
index f00f29a45b..ab4d8e4218 100644
--- a/xen/arch/arm/setup.c
+++ b/xen/arch/arm/setup.c
@@ -654,8 +654,6 @@ static void __init setup_mm(unsigned long dtb_paddr, size_t 
dtb_size)
 if ( e > bank_end )
 e = bank_end;
 
-xenheap_mfn_end = e;
-
 dt_unreserved_regions(s, e, init_boot_pages, 0);
 s = n;
 }
-- 
2.11.0


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


[Xen-devel] [PATCH v3 16/16] xen/arm: lpae: Switch from bool_t to bool

2017-06-30 Thread Julien Grall
We are phasing out the use of bool_t in the hypervisor code.

---
Changes in v3:
- Patch added
---
 xen/include/asm-arm/lpae.h | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/xen/include/asm-arm/lpae.h b/xen/include/asm-arm/lpae.h
index 6fbf7c606c..a62b118630 100644
--- a/xen/include/asm-arm/lpae.h
+++ b/xen/include/asm-arm/lpae.h
@@ -126,7 +126,7 @@ typedef union {
 lpae_walk_t walk;
 } lpae_t;
 
-static inline bool_t lpae_valid(lpae_t pte)
+static inline bool lpae_valid(lpae_t pte)
 {
 return pte.walk.valid;
 }
@@ -136,12 +136,12 @@ static inline bool_t lpae_valid(lpae_t pte)
  * the table bit and therefore these would return the opposite to what
  * you would expect.
  */
-static inline bool_t lpae_table(lpae_t pte)
+static inline bool lpae_table(lpae_t pte)
 {
 return lpae_valid(pte) && pte.walk.table;
 }
 
-static inline bool_t lpae_mapping(lpae_t pte)
+static inline bool lpae_mapping(lpae_t pte)
 {
 return lpae_valid(pte) && !pte.walk.table;
 }
-- 
2.11.0


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


[Xen-devel] [PATCH v3 08/16] xen/arm: create_xen_entries: Use typesafe MFN

2017-06-30 Thread Julien Grall
Add a bit more safety when using create_xen_entries.

Also when destroying/modifying mapping, the MFN is currently not used.
Rather than passing _mfn(0) use INVALID_MFN to stay consistent with the
other usage.

Signed-off-by: Julien Grall 
Reviewed-by: Stefano Stabellini 

---
Changes in v2:
- Add Stefano's reviewed-by
---
 xen/arch/arm/mm.c | 19 ++-
 1 file changed, 10 insertions(+), 9 deletions(-)

diff --git a/xen/arch/arm/mm.c b/xen/arch/arm/mm.c
index 1e9e342fd3..c732771444 100644
--- a/xen/arch/arm/mm.c
+++ b/xen/arch/arm/mm.c
@@ -980,7 +980,7 @@ enum xenmap_operation {
 
 static int create_xen_entries(enum xenmap_operation op,
   unsigned long virt,
-  unsigned long mfn,
+  mfn_t mfn,
   unsigned long nr_mfns,
   unsigned int ai)
 {
@@ -989,7 +989,7 @@ static int create_xen_entries(enum xenmap_operation op,
 lpae_t pte;
 lpae_t *third = NULL;
 
-for(; addr < addr_end; addr += PAGE_SIZE, mfn++)
+for(; addr < addr_end; addr += PAGE_SIZE, mfn = mfn_add(mfn, 1))
 {
 if ( !xen_second[second_linear_offset(addr)].pt.valid ||
  !xen_second[second_linear_offset(addr)].pt.table )
@@ -1010,13 +1010,13 @@ static int create_xen_entries(enum xenmap_operation op,
 case RESERVE:
 if ( third[third_table_offset(addr)].pt.valid )
 {
-printk("create_xen_entries: trying to replace an existing 
mapping addr=%lx mfn=%lx\n",
-   addr, mfn);
+printk("create_xen_entries: trying to replace an existing 
mapping addr=%lx mfn=%"PRI_mfn"\n",
+   addr, mfn_x(mfn));
 return -EINVAL;
 }
 if ( op == RESERVE )
 break;
-pte = mfn_to_xen_entry(_mfn(mfn), ai);
+pte = mfn_to_xen_entry(mfn, ai);
 pte.pt.table = 1;
 write_pte(&third[third_table_offset(addr)], pte);
 break;
@@ -1061,24 +1061,25 @@ int map_pages_to_xen(unsigned long virt,
  unsigned long nr_mfns,
  unsigned int flags)
 {
-return create_xen_entries(INSERT, virt, mfn, nr_mfns, flags);
+return create_xen_entries(INSERT, virt, _mfn(mfn), nr_mfns, flags);
 }
 
 int populate_pt_range(unsigned long virt, unsigned long mfn,
   unsigned long nr_mfns)
 {
-return create_xen_entries(RESERVE, virt, mfn, nr_mfns, 0);
+return create_xen_entries(RESERVE, virt, _mfn(mfn), nr_mfns, 0);
 }
 
 int destroy_xen_mappings(unsigned long v, unsigned long e)
 {
-return create_xen_entries(REMOVE, v, 0, (e - v) >> PAGE_SHIFT, 0);
+return create_xen_entries(REMOVE, v, INVALID_MFN, (e - v) >> PAGE_SHIFT, 
0);
 }
 
 int modify_xen_mappings(unsigned long s, unsigned long e, unsigned int flags)
 {
 ASSERT((flags & (PTE_NX | PTE_RO)) == flags);
-return create_xen_entries(MODIFY, s, 0, (e - s) >> PAGE_SHIFT, flags);
+return create_xen_entries(MODIFY, s, INVALID_MFN, (e - s) >> PAGE_SHIFT,
+  flags);
 }
 
 enum mg { mg_clear, mg_ro, mg_rw, mg_rx };
-- 
2.11.0


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


[Xen-devel] [PATCH v3 10/16] xen/arm: lpae: Fix comments coding style

2017-06-30 Thread Julien Grall
Also adding one missing full stop + fix description

Signed-off-by: Julien Grall 
Reviewed-by: Stefano Stabellini 
---

Cc: prosku...@sec.in.tum.de

I haven't retained Stefano's reviewed-by because of the description
update.

   Changes in v2:
- Fix description regarding x86 page-table

Changes in v3:
- Add Stefano's reviewed-by
---
 xen/include/asm-arm/lpae.h | 49 ++
 1 file changed, 32 insertions(+), 17 deletions(-)

diff --git a/xen/include/asm-arm/lpae.h b/xen/include/asm-arm/lpae.h
index ad8c571ea5..aa85cb8112 100644
--- a/xen/include/asm-arm/lpae.h
+++ b/xen/include/asm-arm/lpae.h
@@ -3,10 +3,12 @@
 
 #ifndef __ASSEMBLY__
 
-/* WARNING!  Unlike the Intel pagetable code, where l1 is the lowest
- * level and l4 is the root of the trie, the ARM pagetables follow ARM's
- * documentation: the levels are called first, second &c in the order
- * that the MMU walks them (i.e. "first" is the root of the trie). */
+/*
+ * WARNING!  Unlike the x86 pagetable code, where l1 is the lowest level and
+ * l4 is the root of the trie, the ARM pagetables follow ARM's documentation:
+ * the levels are called first, second &c in the order that the MMU walks them
+ * (i.e. "first" is the root of the trie).
+ */
 
 /**
  * ARMv7-A LPAE pagetables: 3-level trie, mapping 40-bit input to
@@ -17,15 +19,18 @@
  * different place from those in leaf nodes seems to be to allow linear
  * pagetable tricks.  If we're not doing that then the set of permission
  * bits that's not in use in a given node type can be used as
- * extra software-defined bits. */
+ * extra software-defined bits.
+ */
 
 typedef struct __packed {
 /* These are used in all kinds of entry. */
 unsigned long valid:1;  /* Valid mapping */
 unsigned long table:1;  /* == 1 in 4k map entries too */
 
-/* These ten bits are only used in Block entries and are ignored
- * in Table entries. */
+/*
+ * These ten bits are only used in Block entries and are ignored
+ * in Table entries.
+ */
 unsigned long ai:3; /* Attribute Index */
 unsigned long ns:1; /* Not-Secure */
 unsigned long user:1;   /* User-visible */
@@ -38,30 +43,38 @@ typedef struct __packed {
 unsigned long long base:36; /* Base address of block or next table */
 unsigned long sbz:4;/* Must be zero */
 
-/* These seven bits are only used in Block entries and are ignored
- * in Table entries. */
+/*
+ * These seven bits are only used in Block entries and are ignored
+ * in Table entries.
+ */
 unsigned long contig:1; /* In a block of 16 contiguous entries */
 unsigned long pxn:1;/* Privileged-XN */
 unsigned long xn:1; /* eXecute-Never */
 unsigned long avail:4;  /* Ignored by hardware */
 
-/* These 5 bits are only used in Table entries and are ignored in
- * Block entries */
+/*
+ * These 5 bits are only used in Table entries and are ignored in
+ * Block entries.
+ */
 unsigned long pxnt:1;   /* Privileged-XN */
 unsigned long xnt:1;/* eXecute-Never */
 unsigned long apt:2;/* Access Permissions */
 unsigned long nst:1;/* Not-Secure */
 } lpae_pt_t;
 
-/* The p2m tables have almost the same layout, but some of the permission
- * and cache-control bits are laid out differently (or missing) */
+/*
+ * The p2m tables have almost the same layout, but some of the permission
+ * and cache-control bits are laid out differently (or missing).
+ */
 typedef struct __packed {
 /* These are used in all kinds of entry. */
 unsigned long valid:1;  /* Valid mapping */
 unsigned long table:1;  /* == 1 in 4k map entries too */
 
-/* These ten bits are only used in Block entries and are ignored
- * in Table entries. */
+/*
+ * These ten bits are only used in Block entries and are ignored
+ * in Table entries.
+ */
 unsigned long mattr:4;  /* Memory Attributes */
 unsigned long read:1;   /* Read access */
 unsigned long write:1;  /* Write access */
@@ -73,8 +86,10 @@ typedef struct __packed {
 unsigned long long base:36; /* Base address of block or next table */
 unsigned long sbz3:4;
 
-/* These seven bits are only used in Block entries and are ignored
- * in Table entries. */
+/*
+ * These seven bits are only used in Block entries and are ignored
+ * in Table entries.
+ */
 unsigned long contig:1; /* In a block of 16 contiguous entries */
 unsigned long sbz2:1;
 unsigned long xn:1; /* eXecute-Never */
-- 
2.11.0


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


[Xen-devel] [PATCH v3 03/16] xen/arm: p2m: Redefine mfn_to_page and page_to_mfn to use typesafe

2017-06-30 Thread Julien Grall
The file xen/arch/arm/p2m.c is using typesafe MFN in most of the place.
This requires caller to mfn_to_page and page_to_mfn to use _mfn/mfn_x.

To avoid extra _mfn/mfn_x, re-define mfn_to_page and page_to_mfn within
xen/arch/arm/p2m.c to handle typesafe MFN.

Signed-off-by: Julien Grall 
---
The idea behind redefining locally mfn_to_page and page_to_mfn is
splitting the introduction of typesafe MFN in smaller series and
between multiple people. We know the file is typesafe ready and if
we decide to make the main helper typesafe, we would just need to
drop the definition at the top of the file.

Changes in v3:
- Use __page_to_mfn(...) rather than mfn_x(page_to_mfn(...))
---
 xen/arch/arm/p2m.c | 20 +---
 1 file changed, 13 insertions(+), 7 deletions(-)

diff --git a/xen/arch/arm/p2m.c b/xen/arch/arm/p2m.c
index 05eb584e89..3e20a1ec82 100644
--- a/xen/arch/arm/p2m.c
+++ b/xen/arch/arm/p2m.c
@@ -38,6 +38,12 @@ static unsigned int __read_mostly max_vmid = MAX_VMID_8_BIT;
 
 #define P2M_ROOT_PAGES(1root, page_to_mfn(p2m->root));
+   p2m->root, __page_to_mfn(p2m->root));
 
 dump_pt_walk(page_to_maddr(p2m->root), addr,
  P2M_ROOT_LEVEL, P2M_ROOT_PAGES);
@@ -591,7 +597,7 @@ static int p2m_create_table(struct p2m_domain *p2m, lpae_t 
*entry)
  * The access value does not matter because the hardware will ignore
  * the permission fields for table entry.
  */
-pte = mfn_to_p2m_entry(_mfn(page_to_mfn(page)), p2m_invalid,
+pte = mfn_to_p2m_entry(page_to_mfn(page), p2m_invalid,
p2m->default_access);
 
 p2m_write_pte(entry, pte, p2m->clean_pte);
@@ -650,9 +656,9 @@ static void p2m_put_l3_page(const lpae_t pte)
  */
 if ( p2m_is_foreign(pte.p2m.type) )
 {
-unsigned long mfn = pte.p2m.base;
+mfn_t mfn = _mfn(pte.p2m.base);
 
-ASSERT(mfn_valid(_mfn(mfn)));
+ASSERT(mfn_valid(mfn));
 put_page(mfn_to_page(mfn));
 }
 }
@@ -702,7 +708,7 @@ static void p2m_free_entry(struct p2m_domain *p2m,
 mfn = _mfn(entry.p2m.base);
 ASSERT(mfn_valid(mfn));
 
-pg = mfn_to_page(mfn_x(mfn));
+pg = mfn_to_page(mfn);
 
 page_list_del(pg, &p2m->pages);
 free_domheap_page(pg);
@@ -780,7 +786,7 @@ static bool p2m_split_superpage(struct p2m_domain *p2m, 
lpae_t *entry,
 
 unmap_domain_page(table);
 
-pte = mfn_to_p2m_entry(_mfn(page_to_mfn(page)), p2m_invalid,
+pte = mfn_to_p2m_entry(page_to_mfn(page), p2m_invalid,
p2m->default_access);
 
 /*
@@ -1442,7 +1448,7 @@ struct page_info *get_page_from_gva(struct vcpu *v, 
vaddr_t va,
 if ( !mfn_valid(maddr_to_mfn(maddr)) )
 goto err;
 
-page = mfn_to_page(mfn_x(maddr_to_mfn(maddr)));
+page = mfn_to_page(maddr_to_mfn(maddr));
 ASSERT(page);
 
 if ( unlikely(!get_page(page, d)) )
-- 
2.11.0


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


[Xen-devel] [PATCH v3 00/16] xen/arm: Clean-up memory subsystems

2017-06-30 Thread Julien Grall
Hi all,

This series, clean-up a bit the memory subsystems to ease further changes.

Cheers,

Julien Grall (16):
  xen/arm: setup: Remove bogus xenheap_mfn_end in setup_mm for arm64
  xen/arm: mm: Use typesafe mfn for xenheap_mfn_*
  xen/arm: p2m: Redefine mfn_to_page and page_to_mfn to use typesafe
  xen/arm: mm: Redefine virt_to_mfn to support typesafe
  xen/arm: domain_build: Redefine virt_to_mfn to support typesafe
  xen/arm: alternative: Redefine virt_to_mfn to support typesafe
  xen/arm: livepatch: Redefine virt_to_mfn to support typesafe
  xen/arm: create_xen_entries: Use typesafe MFN
  xen/arm: Move LPAE definition in a separate header
  xen/arm: lpae: Fix comments coding style
  xen/arm: p2m: Rename p2m_valid, p2m_table, p2m_mapping and
p2m_is_superpage
  xen/arm: p2m: Move lpae_* helpers in lpae.h
  xen/arm: mm: Use lpae_valid and lpae_table in create_xen_entries
  xen/arm: mm: Introduce temporary variable in create_xen_entries
  xen/arm: mm: Use __func__ rather than plain name in format string
  xen/arm: lpae: Switch from bool_t to bool

 xen/arch/arm/alternative.c  |   6 +-
 xen/arch/arm/domain_build.c |   6 +-
 xen/arch/arm/livepatch.c|   6 +-
 xen/arch/arm/mm.c   |  84 +-
 xen/arch/arm/p2m.c  |  72 ++-
 xen/arch/arm/setup.c|  20 ++---
 xen/include/asm-arm/lpae.h  | 209 
 xen/include/asm-arm/mm.h|  14 +--
 xen/include/asm-arm/page.h  | 152 +---
 9 files changed, 315 insertions(+), 254 deletions(-)
 create mode 100644 xen/include/asm-arm/lpae.h

-- 
2.11.0


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


[Xen-devel] [PATCH v3 13/16] xen/arm: mm: Use lpae_valid and lpae_table in create_xen_entries

2017-06-30 Thread Julien Grall
This newly introduced lpae_valid and lpae_table helpers will recude the
code and make more readable.

Signed-off-by: Julien Grall 
Reviewed-by: Stefano Stabellini 
---

Changes in v2:
- Patch added

Changes in v3:
- Add Stefano's reviewed-by
---
 xen/arch/arm/mm.c | 9 -
 1 file changed, 4 insertions(+), 5 deletions(-)

diff --git a/xen/arch/arm/mm.c b/xen/arch/arm/mm.c
index c732771444..21b3df395f 100644
--- a/xen/arch/arm/mm.c
+++ b/xen/arch/arm/mm.c
@@ -991,8 +991,7 @@ static int create_xen_entries(enum xenmap_operation op,
 
 for(; addr < addr_end; addr += PAGE_SIZE, mfn = mfn_add(mfn, 1))
 {
-if ( !xen_second[second_linear_offset(addr)].pt.valid ||
- !xen_second[second_linear_offset(addr)].pt.table )
+if ( !lpae_table(xen_second[second_linear_offset(addr)]) )
 {
 rc = create_xen_table(&xen_second[second_linear_offset(addr)]);
 if ( rc < 0 ) {
@@ -1001,14 +1000,14 @@ static int create_xen_entries(enum xenmap_operation op,
 }
 }
 
-BUG_ON(!xen_second[second_linear_offset(addr)].pt.valid);
+BUG_ON(!lpae_valid(xen_second[second_linear_offset(addr)]));
 
 third = mfn_to_virt(xen_second[second_linear_offset(addr)].pt.base);
 
 switch ( op ) {
 case INSERT:
 case RESERVE:
-if ( third[third_table_offset(addr)].pt.valid )
+if ( lpae_valid(third[third_table_offset(addr)]) )
 {
 printk("create_xen_entries: trying to replace an existing 
mapping addr=%lx mfn=%"PRI_mfn"\n",
addr, mfn_x(mfn));
@@ -1022,7 +1021,7 @@ static int create_xen_entries(enum xenmap_operation op,
 break;
 case MODIFY:
 case REMOVE:
-if ( !third[third_table_offset(addr)].pt.valid )
+if ( !lpae_valid(third[third_table_offset(addr)]) )
 {
 printk("create_xen_entries: trying to %s a non-existing 
mapping addr=%lx\n",
op == REMOVE ? "remove" : "modify", addr);
-- 
2.11.0


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


[Xen-devel] [PATCH v3 12/16] xen/arm: p2m: Move lpae_* helpers in lpae.h

2017-06-30 Thread Julien Grall
lpae_* helpers can work on any LPAE translation tables. Move them in
lpae.h to allow other part of Xen to use them.

Signed-off-by: Julien Grall 
Reviewed-by: Stefano Stabellini 
---

Cc: prosku...@sec.in.tum.de

Changes in v2:
- Patch added

Changes in v3:
- Add Stefano's reviewed-by
---
 xen/arch/arm/p2m.c | 23 ---
 xen/include/asm-arm/lpae.h | 25 +
 2 files changed, 25 insertions(+), 23 deletions(-)

diff --git a/xen/arch/arm/p2m.c b/xen/arch/arm/p2m.c
index 381df1f237..9b7a580a87 100644
--- a/xen/arch/arm/p2m.c
+++ b/xen/arch/arm/p2m.c
@@ -52,29 +52,6 @@ static const paddr_t level_masks[] =
 static const uint8_t level_orders[] =
 { ZEROETH_ORDER, FIRST_ORDER, SECOND_ORDER, THIRD_ORDER };
 
-static inline bool_t lpae_valid(lpae_t pte)
-{
-return pte.walk.valid;
-}
-/*
- * These two can only be used on L0..L2 ptes because L3 mappings set
- * the table bit and therefore these would return the opposite to what
- * you would expect.
- */
-static inline bool_t lpae_table(lpae_t pte)
-{
-return lpae_valid(pte) && pte.walk.table;
-}
-static inline bool_t lpae_mapping(lpae_t pte)
-{
-return lpae_valid(pte) && !pte.walk.table;
-}
-
-static inline bool lpae_is_superpage(lpae_t pte, unsigned int level)
-{
-return (level < 3) && lpae_mapping(pte);
-}
-
 static void p2m_flush_tlb(struct p2m_domain *p2m);
 
 /* Unlock the flush and do a P2M TLB flush if necessary */
diff --git a/xen/include/asm-arm/lpae.h b/xen/include/asm-arm/lpae.h
index aa85cb8112..6fbf7c606c 100644
--- a/xen/include/asm-arm/lpae.h
+++ b/xen/include/asm-arm/lpae.h
@@ -126,6 +126,31 @@ typedef union {
 lpae_walk_t walk;
 } lpae_t;
 
+static inline bool_t lpae_valid(lpae_t pte)
+{
+return pte.walk.valid;
+}
+
+/*
+ * These two can only be used on L0..L2 ptes because L3 mappings set
+ * the table bit and therefore these would return the opposite to what
+ * you would expect.
+ */
+static inline bool_t lpae_table(lpae_t pte)
+{
+return lpae_valid(pte) && pte.walk.table;
+}
+
+static inline bool_t lpae_mapping(lpae_t pte)
+{
+return lpae_valid(pte) && !pte.walk.table;
+}
+
+static inline bool lpae_is_superpage(lpae_t pte, unsigned int level)
+{
+return (level < 3) && lpae_mapping(pte);
+}
+
 #endif /* __ASSEMBLY__ */
 
 /*
-- 
2.11.0


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


[Xen-devel] [PATCH v3 09/16] xen/arm: Move LPAE definition in a separate header

2017-06-30 Thread Julien Grall
page.h is getting bigger. Move out every LPAE definitions in a separate
header. There is no functional changes.

Signed-off-by: Julien Grall 
Reviewed-by: Stefano Stabellini 

---

Cc: prosku...@sec.in.tum.de

Changes in v2:
- Move comment after the #endif rather than before
- Add Stefano's reviewed-by
---
 xen/include/asm-arm/lpae.h | 169 +
 xen/include/asm-arm/page.h | 152 +---
 2 files changed, 170 insertions(+), 151 deletions(-)
 create mode 100644 xen/include/asm-arm/lpae.h

diff --git a/xen/include/asm-arm/lpae.h b/xen/include/asm-arm/lpae.h
new file mode 100644
index 00..ad8c571ea5
--- /dev/null
+++ b/xen/include/asm-arm/lpae.h
@@ -0,0 +1,169 @@
+#ifndef __ARM_LPAE_H__
+#define __ARM_LPAE_H__
+
+#ifndef __ASSEMBLY__
+
+/* WARNING!  Unlike the Intel pagetable code, where l1 is the lowest
+ * level and l4 is the root of the trie, the ARM pagetables follow ARM's
+ * documentation: the levels are called first, second &c in the order
+ * that the MMU walks them (i.e. "first" is the root of the trie). */
+
+/**
+ * ARMv7-A LPAE pagetables: 3-level trie, mapping 40-bit input to
+ * 40-bit output addresses.  Tables at all levels have 512 64-bit entries
+ * (i.e. are 4Kb long).
+ *
+ * The bit-shuffling that has the permission bits in branch nodes in a
+ * different place from those in leaf nodes seems to be to allow linear
+ * pagetable tricks.  If we're not doing that then the set of permission
+ * bits that's not in use in a given node type can be used as
+ * extra software-defined bits. */
+
+typedef struct __packed {
+/* These are used in all kinds of entry. */
+unsigned long valid:1;  /* Valid mapping */
+unsigned long table:1;  /* == 1 in 4k map entries too */
+
+/* These ten bits are only used in Block entries and are ignored
+ * in Table entries. */
+unsigned long ai:3; /* Attribute Index */
+unsigned long ns:1; /* Not-Secure */
+unsigned long user:1;   /* User-visible */
+unsigned long ro:1; /* Read-Only */
+unsigned long sh:2; /* Shareability */
+unsigned long af:1; /* Access Flag */
+unsigned long ng:1; /* Not-Global */
+
+/* The base address must be appropriately aligned for Block entries */
+unsigned long long base:36; /* Base address of block or next table */
+unsigned long sbz:4;/* Must be zero */
+
+/* These seven bits are only used in Block entries and are ignored
+ * in Table entries. */
+unsigned long contig:1; /* In a block of 16 contiguous entries */
+unsigned long pxn:1;/* Privileged-XN */
+unsigned long xn:1; /* eXecute-Never */
+unsigned long avail:4;  /* Ignored by hardware */
+
+/* These 5 bits are only used in Table entries and are ignored in
+ * Block entries */
+unsigned long pxnt:1;   /* Privileged-XN */
+unsigned long xnt:1;/* eXecute-Never */
+unsigned long apt:2;/* Access Permissions */
+unsigned long nst:1;/* Not-Secure */
+} lpae_pt_t;
+
+/* The p2m tables have almost the same layout, but some of the permission
+ * and cache-control bits are laid out differently (or missing) */
+typedef struct __packed {
+/* These are used in all kinds of entry. */
+unsigned long valid:1;  /* Valid mapping */
+unsigned long table:1;  /* == 1 in 4k map entries too */
+
+/* These ten bits are only used in Block entries and are ignored
+ * in Table entries. */
+unsigned long mattr:4;  /* Memory Attributes */
+unsigned long read:1;   /* Read access */
+unsigned long write:1;  /* Write access */
+unsigned long sh:2; /* Shareability */
+unsigned long af:1; /* Access Flag */
+unsigned long sbz4:1;
+
+/* The base address must be appropriately aligned for Block entries */
+unsigned long long base:36; /* Base address of block or next table */
+unsigned long sbz3:4;
+
+/* These seven bits are only used in Block entries and are ignored
+ * in Table entries. */
+unsigned long contig:1; /* In a block of 16 contiguous entries */
+unsigned long sbz2:1;
+unsigned long xn:1; /* eXecute-Never */
+unsigned long type:4;   /* Ignore by hardware. Used to store p2m types 
*/
+
+unsigned long sbz1:5;
+} lpae_p2m_t;
+
+/* Permission mask: xn, write, read */
+#define P2M_PERM_MASK (0x004000C0ULL)
+#define P2M_CLEAR_PERM(pte) ((pte).bits & ~P2M_PERM_MASK)
+
+/*
+ * Walk is the common bits of p2m and pt entries which are needed to
+ * simply walk the table (e.g. for debug).
+ */
+typedef struct __packed {
+/* These are used in all kinds of entry. */
+unsigned long valid:1;  /* Valid mapping */
+unsigned long table:1;  /* == 1 in 4k map entries too */
+

[Xen-devel] [PATCH v3 06/16] xen/arm: alternative: Redefine virt_to_mfn to support typesafe

2017-06-30 Thread Julien Grall
The file xen/arch/arm/alternative.c is using typesafe MFN in most of
the place. The only caller to virt_to_mfn is using with _mfn(...).

To avoid extra _mfn(...), re-define virt_to_mfn within
xen/arch/arm/alternative.c to handle typesafe MFN.

Signed-off-by: Julien Grall 
Reviewed-by: Stefano Stabelllini 
---
Changes in v2:
- Add Stefano's reviewed-by
---
 xen/arch/arm/alternative.c | 6 +-
 1 file changed, 5 insertions(+), 1 deletion(-)

diff --git a/xen/arch/arm/alternative.c b/xen/arch/arm/alternative.c
index 4d7e5b6155..a3bcda3117 100644
--- a/xen/arch/arm/alternative.c
+++ b/xen/arch/arm/alternative.c
@@ -32,6 +32,10 @@
 #include 
 #include 
 
+/* Override macros from asm/page.h to make them work with mfn_t */
+#undef virt_to_mfn
+#define virt_to_mfn(va) _mfn(__virt_to_mfn(va))
+
 extern const struct alt_instr __alt_instructions[], __alt_instructions_end[];
 
 struct alt_region {
@@ -154,7 +158,7 @@ static int __apply_alternatives_multi_stop(void *unused)
 {
 int ret;
 struct alt_region region;
-mfn_t xen_mfn = _mfn(virt_to_mfn(_start));
+mfn_t xen_mfn = virt_to_mfn(_start);
 paddr_t xen_size = _end - _start;
 unsigned int xen_order = get_order_from_bytes(xen_size);
 void *xenmap;
-- 
2.11.0


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


[Xen-devel] [PATCH v3 14/16] xen/arm: mm: Introduce temporary variable in create_xen_entries

2017-06-30 Thread Julien Grall
This is improving the code readability and avoid to dereference the
table every single time we need to access the entry.

Signed-off-by: Julien Grall 
Reviewed-by: Stefano Stabellini 
---
Changes in v2:
- Patch added

Changes in v3:
- Add Stefano's reviewed-by
---
 xen/arch/arm/mm.c | 22 --
 1 file changed, 12 insertions(+), 10 deletions(-)

diff --git a/xen/arch/arm/mm.c b/xen/arch/arm/mm.c
index 21b3df395f..ea4a35ed7a 100644
--- a/xen/arch/arm/mm.c
+++ b/xen/arch/arm/mm.c
@@ -986,28 +986,30 @@ static int create_xen_entries(enum xenmap_operation op,
 {
 int rc;
 unsigned long addr = virt, addr_end = addr + nr_mfns * PAGE_SIZE;
-lpae_t pte;
+lpae_t pte, *entry;
 lpae_t *third = NULL;
 
 for(; addr < addr_end; addr += PAGE_SIZE, mfn = mfn_add(mfn, 1))
 {
-if ( !lpae_table(xen_second[second_linear_offset(addr)]) )
+entry = &xen_second[second_linear_offset(addr)];
+if ( !lpae_table(*entry) )
 {
-rc = create_xen_table(&xen_second[second_linear_offset(addr)]);
+rc = create_xen_table(entry);
 if ( rc < 0 ) {
 printk("create_xen_entries: L2 failed\n");
 goto out;
 }
 }
 
-BUG_ON(!lpae_valid(xen_second[second_linear_offset(addr)]));
+BUG_ON(!lpae_valid(*entry));
 
-third = mfn_to_virt(xen_second[second_linear_offset(addr)].pt.base);
+third = mfn_to_virt(entry->pt.base);
+entry = &third[third_table_offset(addr)];
 
 switch ( op ) {
 case INSERT:
 case RESERVE:
-if ( lpae_valid(third[third_table_offset(addr)]) )
+if ( lpae_valid(*entry) )
 {
 printk("create_xen_entries: trying to replace an existing 
mapping addr=%lx mfn=%"PRI_mfn"\n",
addr, mfn_x(mfn));
@@ -1017,11 +1019,11 @@ static int create_xen_entries(enum xenmap_operation op,
 break;
 pte = mfn_to_xen_entry(mfn, ai);
 pte.pt.table = 1;
-write_pte(&third[third_table_offset(addr)], pte);
+write_pte(entry, pte);
 break;
 case MODIFY:
 case REMOVE:
-if ( !lpae_valid(third[third_table_offset(addr)]) )
+if ( !lpae_valid(*entry) )
 {
 printk("create_xen_entries: trying to %s a non-existing 
mapping addr=%lx\n",
op == REMOVE ? "remove" : "modify", addr);
@@ -1031,7 +1033,7 @@ static int create_xen_entries(enum xenmap_operation op,
 pte.bits = 0;
 else
 {
-pte = third[third_table_offset(addr)];
+pte = *entry;
 pte.pt.ro = PTE_RO_MASK(ai);
 pte.pt.xn = PTE_NX_MASK(ai);
 if ( !pte.pt.ro && !pte.pt.xn )
@@ -1041,7 +1043,7 @@ static int create_xen_entries(enum xenmap_operation op,
 return -EINVAL;
 }
 }
-write_pte(&third[third_table_offset(addr)], pte);
+write_pte(entry, pte);
 break;
 default:
 BUG();
-- 
2.11.0


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


[Xen-devel] [PATCH v3 11/16] xen/arm: p2m: Rename p2m_valid, p2m_table, p2m_mapping and p2m_is_superpage

2017-06-30 Thread Julien Grall
The helpers p2m_valid, p2m_table, p2m_mapping and p2m_is_superpage are
not specific to the stage-2 translation tables. They can also work on
any LPAE translation tables. So rename then to lpae_* and use pte.walk
to look for the value of the field.

Signed-off-by: Julien Grall 
Reviewed-by: Stefano Stabellini 
---

Cc: prosku...@sec.in.tum.de

s/bool_t/bool/ will be done in a separate patch

Changes in v2:
- Patch added

Changes in v3:
- Add Stefano's reviewed-by
---
 xen/arch/arm/p2m.c | 45 +++--
 1 file changed, 23 insertions(+), 22 deletions(-)

diff --git a/xen/arch/arm/p2m.c b/xen/arch/arm/p2m.c
index 3e20a1ec82..381df1f237 100644
--- a/xen/arch/arm/p2m.c
+++ b/xen/arch/arm/p2m.c
@@ -52,27 +52,27 @@ static const paddr_t level_masks[] =
 static const uint8_t level_orders[] =
 { ZEROETH_ORDER, FIRST_ORDER, SECOND_ORDER, THIRD_ORDER };
 
-static inline bool_t p2m_valid(lpae_t pte)
+static inline bool_t lpae_valid(lpae_t pte)
 {
-return pte.p2m.valid;
+return pte.walk.valid;
 }
 /*
  * These two can only be used on L0..L2 ptes because L3 mappings set
  * the table bit and therefore these would return the opposite to what
  * you would expect.
  */
-static inline bool_t p2m_table(lpae_t pte)
+static inline bool_t lpae_table(lpae_t pte)
 {
-return p2m_valid(pte) && pte.p2m.table;
+return lpae_valid(pte) && pte.walk.table;
 }
-static inline bool_t p2m_mapping(lpae_t pte)
+static inline bool_t lpae_mapping(lpae_t pte)
 {
-return p2m_valid(pte) && !pte.p2m.table;
+return lpae_valid(pte) && !pte.walk.table;
 }
 
-static inline bool p2m_is_superpage(lpae_t pte, unsigned int level)
+static inline bool lpae_is_superpage(lpae_t pte, unsigned int level)
 {
-return (level < 3) && p2m_mapping(pte);
+return (level < 3) && lpae_mapping(pte);
 }
 
 static void p2m_flush_tlb(struct p2m_domain *p2m);
@@ -281,7 +281,7 @@ static int p2m_next_level(struct p2m_domain *p2m, bool 
read_only,
 
 entry = *table + offset;
 
-if ( !p2m_valid(*entry) )
+if ( !lpae_valid(*entry) )
 {
 if ( read_only )
 return GUEST_TABLE_MAP_FAILED;
@@ -292,7 +292,7 @@ static int p2m_next_level(struct p2m_domain *p2m, bool 
read_only,
 }
 
 /* The function p2m_next_level is never called at the 3rd level */
-if ( p2m_mapping(*entry) )
+if ( lpae_mapping(*entry) )
 return GUEST_TABLE_SUPER_PAGE;
 
 mfn = _mfn(entry->p2m.base);
@@ -372,7 +372,7 @@ mfn_t p2m_get_entry(struct p2m_domain *p2m, gfn_t gfn,
 
 entry = table[offsets[level]];
 
-if ( p2m_valid(entry) )
+if ( lpae_valid(entry) )
 {
 *t = entry.p2m.type;
 
@@ -577,7 +577,7 @@ static int p2m_create_table(struct p2m_domain *p2m, lpae_t 
*entry)
 lpae_t *p;
 lpae_t pte;
 
-ASSERT(!p2m_valid(*entry));
+ASSERT(!lpae_valid(*entry));
 
 page = alloc_domheap_page(NULL, 0);
 if ( page == NULL )
@@ -645,7 +645,7 @@ enum p2m_operation {
  */
 static void p2m_put_l3_page(const lpae_t pte)
 {
-ASSERT(p2m_valid(pte));
+ASSERT(lpae_valid(pte));
 
 /*
  * TODO: Handle other p2m types
@@ -673,11 +673,11 @@ static void p2m_free_entry(struct p2m_domain *p2m,
 struct page_info *pg;
 
 /* Nothing to do if the entry is invalid. */
-if ( !p2m_valid(entry) )
+if ( !lpae_valid(entry) )
 return;
 
 /* Nothing to do but updating the stats if the entry is a super-page. */
-if ( p2m_is_superpage(entry, level) )
+if ( lpae_is_superpage(entry, level) )
 {
 p2m->stats.mappings[level]--;
 return;
@@ -733,7 +733,7 @@ static bool p2m_split_superpage(struct p2m_domain *p2m, 
lpae_t *entry,
  * a superpage.
  */
 ASSERT(level < target);
-ASSERT(p2m_is_superpage(*entry, level));
+ASSERT(lpae_is_superpage(*entry, level));
 
 page = alloc_domheap_page(NULL, 0);
 if ( !page )
@@ -870,7 +870,7 @@ static int __p2m_set_entry(struct p2m_domain *p2m,
 /* We need to split the original page. */
 lpae_t split_pte = *entry;
 
-ASSERT(p2m_is_superpage(*entry, level));
+ASSERT(lpae_is_superpage(*entry, level));
 
 if ( !p2m_split_superpage(p2m, &split_pte, level, target, offsets) )
 {
@@ -944,12 +944,12 @@ static int __p2m_set_entry(struct p2m_domain *p2m,
  * sequence when updating the translation table (D4.7.1 in ARM DDI
  * 0487A.j).
  */
-if ( p2m_valid(orig_pte) )
+if ( lpae_valid(orig_pte) )
 p2m_remove_pte(entry, p2m->clean_pte);
 
 if ( mfn_eq(smfn, INVALID_MFN) )
 /* Flush can be deferred if the entry is removed */
-p2m->need_flush |= !!p2m_valid(orig_pte);
+p2m->need_flush |= !!lpae_valid(orig_pte);
 else
 {
 lpae_t pte = mfn_to_p2m_entry(smfn, t, a);
@@ -964,7 +964,7 @@ static int __p2m_set_entry(struct p2m_domain *p2m,
  * Although, it could be defered when only the permissions are
  * changed 

  1   2   3   >