[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Xen-devel] CONFIG_SCRUB_DEBUG=y + arm64 + livepatch = Xen BUG at page_alloc.c:738



On Wed, Sep 13, 2017 at 02:49:41PM -0400, Boris Ostrovsky wrote:
> On 09/13/2017 02:25 PM, Julien Grall wrote:
> > Hi,
> > 
> > On 09/13/2017 07:05 PM, Boris Ostrovsky wrote:
> >> On 09/13/2017 11:32 AM, Konrad Rzeszutek Wilk wrote:
> >> Well, that's not a fix. This eliminates the case that something in
> >> ARM-specific code (which I haven't tested) accidentally clears
> >> _PGC_need_scrub.
> >>
> >> OK, I think I know what the problem is. You are using
> >> CONFIG_SEPARATE_XENHEAP, are you?
> > 
> > It seems the bug appear on Arm64, so CONFIG_SEPARATE_XENHEAP is not set.
> > 
> > Note that Arm32 is using separate heap.
> 
> 
> For separate heap we will need
> 
> 
> diff --git a/xen/common/page_alloc.c b/xen/common/page_alloc.c
> index b5243fc..9f62ea2 100644
> --- a/xen/common/page_alloc.c
> +++ b/xen/common/page_alloc.c
> @@ -2059,7 +2059,7 @@ void free_xenheap_pages(void *v, unsigned int order)
> 
>      memguard_guard_range(v, 1 << (order + PAGE_SHIFT));
> 
> -    free_heap_pages(virt_to_page(v), order, false);
> +    free_heap_pages(virt_to_page(v), order, scrub_debug);
>  }
> 
>  #else
> 
> 
> If that doesn't help then there are two cases where free_heap_pages is
> called with 'false' --- one in alloc_domheap_pages() and the other in
> online_page().
> 
> Setting one and then the other would further narrow it down.

It went further. See the serial log:

root@linaro-developer:~# xl info
host                   : linaro-developer
release                : 4.12.0-linaro-hikey960+
version                : #3 SMP PREEMPT Mon Jul 17 13:26:13 EDT 2017
machine                : aarch64
nr_cpus                : 8
max_cpu_id             : 7
nr_nodes               : 1
cores_per_socket       : 1
threads_per_core       : 1
cpu_mhz                : 1
hw_caps                : 
00000000:00000000:00000000:00000000:00000000:00000000:00000000:00000000
virt_caps              :
total_memory           : 2262
free_memory            : 712
sharing_freed_memory   : 0
sharing_used_memory    : 0
outstanding_claims     : 0
free_cpus              : 0
xen_major              : 4
xen_minor              : 10
xen_extra              : -unstable
xen_version            : 4.10-unstable
xen_caps               : xen-3.0-aarch64 xen-3.0-armv7l 
xen_scheduler          : credit
xen_pagesize           : 4096
platform_params        : virt_start=0x200000
xen_changeset          : Mon Jun 19 17:11:06 2017 -0400 git:b819b1ec24-dirty
xen_commandline        : loglvl=all console=dtuart dtuart=/soc/serial@fff32000 
efi=no-rs dom0_mem=1500M
cc_compiler            : gcc (Debian 6.3.0-18) 6.3.0 20170516
cc_compile_by          : root
cc_compile_domain      : 
cc_compile_date        : Wed Sep 13 20:42:42 UTC 2017
build_id               : 48fbef3c27a9d845faba3aea7e7d24063997815c
xend_config_format     : 4
root@linaro-developer:~# cd /home/xen.git
root@linaro-developer:/home/xen.git# git diff .
diff --git a/xen/common/page_alloc.c b/xen/common/page_alloc.c
index b5243fca3c..9f62ea257d 100644
--- a/xen/common/page_alloc.c
+++ b/xen/common/page_alloc.c
@@ -2059,7 +2059,7 @@ void free_xenheap_pages(void *v, unsigned int 
order)
 
     memguard_guard_range(v, 1 << (order + PAGE_SHIFT));
 
-    free_heap_pages(virt_to_page(v), order, false);
+    free_heap_pages(virt_to_page(v), order, scrub_debug);
 }
 
 #else
root@linaro-developer:/home/xen.git# /rcd /root
root@linaro-developer:~# ./livepatch_test.pl
Have 37 test-cases
Executing: '(set -e;cd /root/test/livepatch;xen-livepatch list)' .. ID          
                           | status
----------------------------------------+------------
Executing: '(set -e;cd /root/test/livepatch;xen-livepatch list)' .. ID          
                           | status
----------------------------------------+------------
Executing: '(set -e;cd /root/test/livepatch;xl info)' ..host                   
: linaro-developer
release                : 4.12.0-linaro-hikey960+
version                : #3 SMP PREEMPT Mon Jul 17 13:26:13 EDT 2017
machine                : aarch64
nr_cpus                : 8
max_cpu_id             : 7
nr_nodes               : 1
cores_per_socket       : 1
threads_per_core       : 1
cpu_mhz                : 1
hw_caps                : 
00000000:00000000:00000000:00000000:00000000:00000000:00000000:00000000
virt_caps              :
total_memory           : 2262
free_memory            : 712
sharing_freed_memory   : 0
sharing_used_memory    : 0
outstanding_claims     : 0
free_cpus              : 0
xen_major              : 4
xen_minor              : 10
xen_extra              : -unstable
xen_version            : 4.10-unstable
xen_caps               : xen-3.0-aarch64 xen-3.0-armv7l 
xen_scheduler          : credit
xen_pagesize           : 4096
platform_params        : virt_start=0x200000
xen_changeset          : Mon Jun 19 17:11:06 2017 -0400 git:b819b1ec24-dirty
xen_commandline        : loglvl=all console=dtuart dtuart=/soc/serial@fff32000 
efi=no-rs dom0_mem=1500M
cc_compiler            : gcc (Debian 6.3.0-18) 6.3.0 20170516
cc_compile_by          : root
cc_compile_domain      : 
cc_compile_date        : Wed Sep 13 20:42:42 UTC 2017
build_id               : 48fbef3c27a9d845faba3aea7e7d24063997815c
xend_config_format     : 4
Executing: '(set -e;cd /root/test/livepatch;xl info)' ..host                   
: linaro-developer
release                : 4.12.0-linaro-hikey960+
version                : #3 SMP PREEMPT Mon Jul 17 13:26:13 EDT 2017
machine                : aarch64
nr_cpus                : 8
max_cpu_id             : 7
nr_nodes               : 1
cores_per_socket       : 1
threads_per_core       : 1
cpu_mhz                : 1
hw_caps                : 
00000000:00000000:00000000:00000000:00000000:00000000:00000000:00000000
virt_caps              :
total_memory           : 2262
free_memory            : 712
sharing_freed_memory   : 0
sharing_used_memory    : 0
outstanding_claims     : 0
free_cpus              : 0
xen_major              : 4
xen_minor              : 10
xen_extra              : -unstable
xen_version            : 4.10-unstable
xen_caps               : xen-3.0-aarch64 xen-3.0-armv7l 
xen_scheduler          : credit
xen_pagesize           : 4096
platform_params        : virt_start=0x200000
xen_changeset          : Mon Jun 19 17:11:06 2017 -0400 git:b819b1ec24-dirty
xen_commandline        : loglvl=all console=dtuart dtuart=/soc/serial@fff32000 
efi=no-rs dom0_mem=1500M
cc_compiler            : gcc (Debian 6.3.0-18) 6.3.0 20170516
cc_compile_by          : root
cc_compile_domain      : 
cc_compile_date        : Wed Sep 13 20:42:42 UTC 2017
build_id               : 48fbef3c27a9d845faba3aea7e7d24063997815c
xend_config_format     : 4
Executing: '(set -e;cd /root/test/livepatch;xen-livepatch revert 
xen_hello_world)' ..Failed to get status of xen_hello_world.
Error 2: No such file or directory
Executing: '(set -e;cd /root/test/livepatch;xen-livepatch load 
xen_hello_world.livepatch)' ..Uploading xen_hello_world.livepatch... (XEN) 
livepatch.c:422: livepatch: xen_hello_world: Loaded .note.gnu.build-id at 
0000000000a04000
(XEN) livepatch.c:422: livepatch: xen_hello_world: Loaded .text at 
0000000000a02000
(XEN) livepatch.c:422: livepatch: xen_hello_world: Loaded .rodata at 
0000000000a04028
(XEN) livepatch.c:422: livepatch: xen_hello_world: Loaded .altinstructions at 
0000000000a04054
(XEN) livepatch.c:422: livepatch: xen_hello_world: Loaded .altinstr_replacement 
at 0000000000a04060
(XEN) livepatch.c:422: livepatch: xen_hello_world: Loaded .rodata.str1.8 at 
0000000000a04068
(XEN) livepatch.c:422: livepatch: xen_hello_world: Loaded .rodata.str at 
0000000000a040e8
(XEN) livepatch.c:422: livepatch: xen_hello_world: Loaded .bug_frames.1 at 
0000000000a040fc
(XEN) livepatch.c:422: livepatch: xen_hello_world: Loaded .livepatch.depends at 
0000000000a04110
(XEN) livepatch.c:422: livepatch: xen_hello_world: Loaded .livepatch.funcs at 
0000000000a04138
(XEN) livepatch.c:422: livepatch: xen_hello_world: Loaded .livepatch.hooks.load 
at 0000000000a03000
(XEN) livepatch.c:422: livepatch: xen_hello_world: Loaded 
.livepatch.hooks.unload at 0000000000a03010
(XEN) livepatch_elf.c:343: livepatch: xen_hello_world: Symbol resolved:  => 
0xa02000 (.text)
(XEN) livepatch_elf.c:343: livepatch: xen_hello_world: Symbol resolved:  => 
0xa04028 (.rodata)
(XEN) livepatch_elf.c:343: livepatch: xen_hello_world: Symbol resolved:  => 
0xa04060 (.altinstr_replacement)
(XEN) livepatch_elf.c:343: livepatch: xen_hello_world: Symbol resolved:  => 
0xa04068 (.rodata.str1.8)
(XEN) livepatch_elf.c:343: livepatch: xen_hello_world: Symbol resolved:  => 
0xa03028 (.bss)
(XEN) livepatch_elf.c:343: livepatch: xen_hello_world: Symbol resolved: $x => 
0xa02000 (.text)
(XEN) livepatch_elf.c:343: livepatch: xen_hello_world: Symbol resolved: $d => 
0xa04054 (.altinstructions)
(XEN) livepatch_elf.c:343: livepatch: xen_hello_world: Symbol resolved: $x => 
0xa04060 (.altinstr_replacement)
(XEN) livepatch_elf.c:343: livepatch: xen_hello_world: Symbol resolved: $d => 
0xa04068 (.rodata.str1.8)
(XEN) livepatch_elf.c:343: livepatch: xen_hello_world: Symbol resolved: $x => 
0xa02010 (.text)
(XEN) livepatch_elf.c:343: livepatch: xen_hello_world: Symbol resolved: 
apply_hook => 0xa02010 (.text)
(XEN) livepatch_elf.c:343: livepatch: xen_hello_world: Symbol resolved: 
revert_hook => 0xa0202c (.text)
(XEN) livepatch_elf.c:343: livepatch: xen_hello_world: Symbol resolved: hi_func 
=> 0xa02048 (.text)
(XEN) livepatch_elf.c:343: livepatch: xen_hello_world: Symbol resolved: 
check_fnc => 0xa0207c (.text)
(XEN) livepatch_elf.c:343: livepatch: xen_hello_world: Symbol resolved: $d => 
0xa040fc (.bug_frames.1)
(XEN) livepatch_elf.c:343: livepatch: xen_hello_world: Symbol resolved: $d => 
0xa04028 (.rodata)
(XEN) livepatch_elf.c:343: livepatch: xen_hello_world: Symbol resolved: 
__func__.7462 => 0xa04028 (.rodata)
(XEN) livepatch_elf.c:343: livepatch: xen_hello_world: Symbol resolved: 
__func__.7466 => 0xa04030 (.rodata)
(XEN) livepatch_elf.c:343: livepatch: xen_hello_world: Symbol resolved: 
hello_world_patch_this_fnc => 0xa04040 (.rodata)
(XEN) livepatch_elf.c:343: livepatch: xen_hello_world: Symbol resolved: $d => 
0xa03028 (.bss)
(XEN) livepatch_elf.c:343: livepatch: xen_hello_world: Symbol resolved: cnt => 
0xa03028 (.bss)
(XEN) livepatch_elf.c:343: livepatch: xen_hello_world: Symbol resolved: $d => 
0xa04110 (.livepatch.depends)
(XEN) livepatch_elf.c:343: livepatch: xen_hello_world: Symbol resolved: $d => 
0xa04138 (.livepatch.funcs)
(XEN) livepatch_elf.c:343: livepatch: xen_hello_world: Symbol resolved: $d => 
0xa03000 (.livepatch.hooks.load)
(XEN) livepatch_elf.c:343: livepatch: xen_hello_world: Symbol resolved: $d => 
0xa03010 (.livepatch.hooks.unload)
(XEN) livepatch_elf.c:343: livepatch: xen_hello_world: Symbol resolved: $d => 
0xa04078 (.rodata.str1.8)
(XEN) livepatch_elf.c:343: livepatch: xen_hello_world: Symbol resolved: .L21 
=> 0xa040e8 (.rodata.str)
(XEN) livepatch_elf.c:343: livepatch: xen_hello_world: Symbol resolved: .L31 
=> 0xa040fa (.rodata.str)
(XEN) livepatch_elf.c:343: livepatch: xen_hello_world: Symbol resolved:  => 
0xa04000 (.note.gnu.build-id)
(XEN) livepatch_elf.c:343: livepatch: xen_hello_world: Symbol resolved:  => 
0xa04054 (.altinstructions)
(XEN) livepatch_elf.c:343: livepatch: xen_hello_world: Symbol resolved:  => 
0xa040e8 (.rodata.str)
(XEN) livepatch_elf.c:343: livepatch: xen_hello_world: Symbol resolved:  => 
0xa040fc (.bug_frames.1)
(XEN) livepatch_elf.c:343: livepatch: xen_hello_world: Symbol resolved:  => 
0xa04110 (.livepatch.depends)
(XEN) livepatch_elf.c:343: livepatch: xen_hello_world: Symbol resolved:  => 
0xa04138 (.livepatch.funcs)
(XEN) livepatch_elf.c:343: livepatch: xen_hello_world: Symbol resolved:  => 
0xa03000 (.livepatch.hooks.load)
(XEN) livepatch_elf.c:343: livepatch: xen_hello_world: Symbol resolved:  => 
0xa03010 (.livepatch.hooks.unload)
(XEN) livepatch_elf.c:343: livepatch: xen_hello_world: Symbol resolved: 
livepatch_load_data_hi_func => 0xa03000 (.livepatch.hooks.load)
(XEN) livepatch_elf.c:343: livepatch: xen_hello_world: Symbol resolved: 
xen_hello_world => 0xa02000 (.text)
(XEN) livepatch_elf.c:314: livepatch: xen_hello_world: Undefined symbol 
resolved: xen_extra_version => 0x23aac8
(XEN) livepatch_elf.c:343: livepatch: xen_hello_world: Symbol resolved: 
livepatch_unload_data_check_fnc => 0xa03010 (.livepatch.hooks.unload)
(XEN) livepatch_elf.c:343: livepatch: xen_hello_world: Symbol resolved: 
livepatch_load_data_apply_hook => 0xa03008 (.livepatch.hooks.load)
(XEN) livepatch_elf.c:343: livepatch: xen_hello_world: Symbol resolved: 
livepatch_unload_data_revert_hook => 0xa03020 (.livepatch.hooks.unload)
(XEN) livepatch_elf.c:314: livepatch: xen_hello_world: Undefined symbol 
resolved: printk => 0x248a7c
(XEN) livepatch_elf.c:343: livepatch: xen_hello_world: Symbol resolved: 
livepatch_xen_hello_world => 0xa04138 (.livepatch.funcs)
(XEN) livepatch_elf.c:343: livepatch: xen_hello_world: Symbol resolved: 
livepatch_unload_data_hi_func => 0xa03018 (.livepatch.hooks.unload)
(XEN) alternatives: Patching with alt table 0000000000a04054 -> 0000000000a04060
(XEN) livepatch.c:845: livepatch: xen_hello_world: new local symbol apply_hook
(XEN) livepatch.c:845: livepatch: xen_hello_world: new local symbol revert_hook
(XEN) livepatch.c:845: livepatch: xen_hello_world: new local symbol hi_func
(XEN) livepatch.c:845: livepatch: xen_hello_world: new local symbol check_fnc
(XEN) livepatch.c:845: livepatch: xen_hello_world: new local symbol 
__func__.7462
(XEN) livepatch.c:845: livepatch: xen_hello_world: new local symbol 
__func__.7466
(XEN) livepatch.c:845: livepatch: xen_hello_world: new local symbol 
hello_world_patch_this_fnc
(XEN) livepatch.c:845: livepatch: xen_hello_world: new local symbol cnt
(XEN) livepatch.c:845: livepatch: xen_hello_world: new local symbol 
livepatch_load_data_hi_func
(XEN) livepatch.c:852: livepatch: xen_hello_world: overriding global symbol 
xen_hello_world
(XEN) livepatch.c:845: livepatch: xen_hello_world: new local symbol 
livepatch_unload_data_check_fnc
(XEN) livepatch.c:845: livepatch: xen_hello_world: new local symbol 
livepatch_load_data_apply_hook
(XEN) livepatch.c:845: livepatch: xen_hello_world: new local symbol 
livepatch_unload_data_revert_hook
(XEN) livepatch.c:845: livepatch: xen_hello_world: new global symbol 
livepatch_xen_hello_world
(XEN) livepatch.c:845: livepatch: xen_hello_world: new local symbol 
livepatch_unload_data_hi_func
completed(XEN) livepatch.c:1343: livepatch: xen_hello_world: timeout is 
30000000ns

(XEN) livepatch.c:1450: livepatch: xen_hello_world: CPU0 - IPIing the other 7 
CPUs
Applying xen_hello_world... (XEN) livepatch: xen_hello_world: Applying 1 
functions
(XEN) hi_func: Hi! (called 1 times)
(XEN) Hook executing.
(XEN) livepatch: xen_hello_world finished APPLY with rc=0
completed
Executing: '(set -e;cd /root/test/livepatch;xen-livepatch load 
xen_hello_world.livepatch)' ..Uploading xen_hello_world.livepatch... failed
Error 17: File exists
Executing: '(set -e;cd /root/test/livepatch;xen-livepatch list)' .. ID          
                           | status
----------------------------------------+------------
xen_hello_world                         | APPLIED
Executing: '(set -e;cd /root/test/livepatch;xl info)' ..host                   
: linaro-developer
release                : 4.12.0-linaro-hikey960+
version                : #3 SMP PREEMPT Mon Jul 17 13:26:13 EDT 2017
machine                : aarch64
nr_cpus                : 8
max_cpu_id             : 7
nr_nodes               : 1
cores_per_socket       : 1
threads_per_core       : 1
cpu_mhz                : 1
hw_caps                : 
00000000:00000000:00000000:00000000:00000000:00000000:00000000:00000000
virt_caps              :
total_memory           : 2262
free_memory            : 712
sharing_freed_memory   : 0
sharing_used_memory    : 0
outstanding_claims     : 0
free_cpus              : 0
xen_major              : 4
xen_minor              : 10
xen_extra              : Hello World
xen_version            : 4.10Hello World
xen_caps               : xen-3.0-aarch64 xen-3.0-armv7l 
xen_scheduler          : credit
xen_pagesize           : 4096
platform_params        : virt_start=0x200000
xen_changeset          : Mon Jun 19 17:11:06 2017 -0400 git:b819b1ec24-dirty
xen_commandline        : loglvl=all console=dtuart dtuart=/soc/serial@fff32000 
efi=no-rs dom0_mem=1500M
cc_compiler            : gcc (Debian 6.3.0-18) 6.3.0 20170516
cc_compile_by          : root
cc_compile_domain      : 
cc_compile_date        : Wed Sep 13 20:42:42 UTC 2017
build_id               : 48fbef3c27a9d845faba3aea7e7d24063997815c
xend_config_format     : 4
Executing: '(set -e;cd /root/test/livepatch;xen-livepatch revert 
xen_hello_world)' ..(XEN) livepatch.c:1343: livepatch: xen_hello_world: timeout 
is 30000000ns
Reverting xen_hello_world... (XEN) livepatch.c:1450: livepatch: 
xen_hello_world: CPU1 - IPIing the other 7 CPUs
(XEN) livepatch: xen_hello_world: Reverting
(XEN) check_fnc: Hi func called 1 times
(XEN) hi_func: Hi! (called 2 times)
(XEN) Hook unloaded.
(XEN) livepatch: xen_hello_world finished REVERT with rc=0
completed
Executing: '(set -e;cd /root/test/livepatch;xl info)' ..host                   
: linaro-developer
release                : 4.12.0-linaro-hikey960+
version                : #3 SMP PREEMPT Mon Jul 17 13:26:13 EDT 2017
machine                : aarch64
nr_cpus                : 8
max_cpu_id             : 7
nr_nodes               : 1
cores_per_socket       : 1
threads_per_core       : 1
cpu_mhz                : 1
hw_caps                : 
00000000:00000000:00000000:00000000:00000000:00000000:00000000:00000000
virt_caps              :
total_memory           : 2262
free_memory            : 712
sharing_freed_memory   : 0
sharing_used_memory    : 0
outstanding_claims     : 0
free_cpus              : 0
xen_major              : 4
xen_minor              : 10
xen_extra              : -unstable
xen_version            : 4.10-unstable
xen_caps               : xen-3.0-aarch64 xen-3.0-armv7l 
xen_scheduler          : credit
xen_pagesize           : 4096
platform_params        : virt_start=0x200000
xen_changeset          : Mon Jun 19 17:11:06 2017 -0400 git:b819b1ec24-dirty
xen_commandline        : loglvl=all console=dtuart dtuart=/soc/serial@fff32000 
efi=no-rs dom0_mem=1500M
cc_compiler            : gcc (Debian 6.3.0-18) 6.3.0 20170516
cc_compile_by          : root
cc_compile_domain      : 
cc_compile_date        : Wed Sep 13 20:42:42 UTC 2017
build_id               : 48fbef3c27a9d845faba3aea7e7d24063997815c
xend_config_format     : 4
Executing: '(set -e;cd /root/test/livepatch;xen-livepatch unload 
xen_hello_world)' ..Unloading xen_hello_world... completed
Executing: '(set -e;cd /root/test/livepatch;xen-livepatch unload 
xen_hello_world)' ..Failed to get status of xen_hello_world.
Error 2: No such file or directory
Executing: '(set -e;cd /root/test/livepatch;xl info)' ..host                   
: linaro-developer
release                : 4.12.0-linaro-hikey960+
version                : #3 SMP PREEMPT Mon Jul 17 13:26:13 EDT 2017
machine                : aarch64
nr_cpus                : 8
max_cpu_id             : 7
nr_nodes               : 1
cores_per_socket       : 1
threads_per_core       : 1
cpu_mhz                : 1
hw_caps                : 
00000000:00000000:00000000:00000000:00000000:00000000:00000000:00000000
virt_caps              :
total_memory           : 2262
free_memory            : 712
sharing_freed_memory   : 0
sharing_used_memory    : 0
outstanding_claims     : 0
free_cpus              : 0
xen_major              : 4
xen_minor              : 10
xen_extra              : -unstable
xen_version            : 4.10-unstable
xen_caps               : xen-3.0-aarch64 xen-3.0-armv7l 
xen_scheduler          : credit
xen_pagesize           : 4096
platform_params        : virt_start=0x200000
xen_changeset          : Mon Jun 19 17:11:06 2017 -0400 git:b819b1ec24-dirty
xen_commandline        : loglvl=all console=dtuart dtuart=/soc/serial@fff32000 
efi=no-rs dom0_mem=1500M
cc_compiler            : gcc (Debian 6.3.0-18) 6.3.0 20170516
cc_compile_by          : root
cc_compile_domain      : 
cc_compile_date        : Wed Sep 13 20:42:42 UTC 2017
build_id               : 48fbef3c27a9d845faba3aea7e7d24063997815c
xend_config_format     : 4
Executing: '(set -e;cd /root/test/livepatch;xen-livepatch load 
xen_hello_world.livepatch)' ..Uploading xen_hello_world.livepatch... (XEN) 
livepatch.c:422: livepatch: xen_hello_world: Loaded .note.gnu.build-id at 
0000000000a04000
(XEN) livepatch.c:422: livepatch: xen_hello_world: Loaded .text at 
0000000000a02000
(XEN) livepatch.c:422: livepatch: xen_hello_world: Loaded .rodata at 
0000000000a04028
(XEN) livepatch.c:422: livepatch: xen_hello_world: Loaded .altinstructions at 
0000000000a04054
(XEN) livepatch.c:422: livepatch: xen_hello_world: Loaded .altinstr_replacement 
at 0000000000a04060
(XEN) livepatch.c:422: livepatch: xen_hello_world: Loaded .rodata.str1.8 at 
0000000000a04068
(XEN) livepatch.c:422: livepatch: xen_hello_world: Loaded .rodata.str at 
0000000000a040e8
(XEN) livepatch.c:422: livepatch: xen_hello_world: Loaded .bug_frames.1 at 
0000000000a040fc
(XEN) livepatch.c:422: livepatch: xen_hello_world: Loaded .livepatch.depends at 
0000000000a04110
(XEN) livepatch.c:422: livepatch: xen_hello_world: Loaded .livepatch.funcs at 
0000000000a04138
(XEN) livepatch.c:422: livepatch: xen_hello_world: Loaded .livepatch.hooks.load 
at 0000000000a03000
(XEN) livepatch.c:422: livepatch: xen_hello_world: Loaded 
.livepatch.hooks.unload at 0000000000a03010
(XEN) livepatch_elf.c:343: livepatch: xen_hello_world: Symbol resolved:  => 
0xa02000 (.text)
(XEN) livepatch_elf.c:343: livepatch: xen_hello_world: Symbol resolved:  => 
0xa04028 (.rodata)
(XEN) livepatch_elf.c:343: livepatch: xen_hello_world: Symbol resolved:  => 
0xa04060 (.altinstr_replacement)
(XEN) livepatch_elf.c:343: livepatch: xen_hello_world: Symbol resolved:  => 
0xa04068 (.rodata.str1.8)
(XEN) livepatch_elf.c:343: livepatch: xen_hello_world: Symbol resolved:  => 
0xa03028 (.bss)
(XEN) livepatch_elf.c:343: livepatch: xen_hello_world: Symbol resolved: $x => 
0xa02000 (.text)
(XEN) livepatch_elf.c:343: livepatch: xen_hello_world: Symbol resolved: $d => 
0xa04054 (.altinstructions)
(XEN) livepatch_elf.c:343: livepatch: xen_hello_world: Symbol resolved: $x => 
0xa04060 (.altinstr_replacement)
(XEN) livepatch_elf.c:343: livepatch: xen_hello_world: Symbol resolved: $d => 
0xa04068 (.rodata.str1.8)
(XEN) livepatch_elf.c:343: livepatch: xen_hello_world: Symbol resolved: $x => 
0xa02010 (.text)
(XEN) livepatch_elf.c:343: livepatch: xen_hello_world: Symbol resolved: 
apply_hook => 0xa02010 (.text)
(XEN) livepatch_elf.c:343: livepatch: xen_hello_world: Symbol resolved: 
revert_hook => 0xa0202c (.text)
(XEN) livepatch_elf.c:343: livepatch: xen_hello_world: Symbol resolved: hi_func 
=> 0xa02048 (.text)
(XEN) livepatch_elf.c:343: livepatch: xen_hello_world: Symbol resolved: 
check_fnc => 0xa0207c (.text)
(XEN) livepatch_elf.c:343: livepatch: xen_hello_world: Symbol resolved: $d => 
0xa040fc (.bug_frames.1)
(XEN) livepatch_elf.c:343: livepatch: xen_hello_world: Symbol resolved: $d => 
0xa04028 (.rodata)
(XEN) livepatch_elf.c:343: livepatch: xen_hello_world: Symbol resolved: 
__func__.7462 => 0xa04028 (.rodata)
(XEN) livepatch_elf.c:343: livepatch: xen_hello_world: Symbol resolved: 
__func__.7466 => 0xa04030 (.rodata)
(XEN) livepatch_elf.c:343: livepatch: xen_hello_world: Symbol resolved: 
hello_world_patch_this_fnc => 0xa04040 (.rodata)
(XEN) livepatch_elf.c:343: livepatch: xen_hello_world: Symbol resolved: $d => 
0xa03028 (.bss)
(XEN) livepatch_elf.c:343: livepatch: xen_hello_world: Symbol resolved: cnt => 
0xa03028 (.bss)
(XEN) livepatch_elf.c:343: livepatch: xen_hello_world: Symbol resolved: $d => 
0xa04110 (.livepatch.depends)
(XEN) livepatch_elf.c:343: livepatch: xen_hello_world: Symbol resolved: $d => 
0xa04138 (.livepatch.funcs)
(XEN) livepatch_elf.c:343: livepatch: xen_hello_world: Symbol resolved: $d => 
0xa03000 (.livepatch.hooks.load)
(XEN) livepatch_elf.c:343: livepatch: xen_hello_world: Symbol resolved: $d => 
0xa03010 (.livepatch.hooks.unload)
(XEN) livepatch_elf.c:343: livepatch: xen_hello_world: Symbol resolved: $d => 
0xa04078 (.rodata.str1.8)
(XEN) livepatch_elf.c:343: livepatch: xen_hello_world: Symbol resolved: .L21 
=> 0xa040e8 (.rodata.str)
(XEN) livepatch_elf.c:343: livepatch: xen_hello_world: Symbol resolved: .L31 
=> 0xa040fa (.rodata.str)
(XEN) livepatch_elf.c:343: livepatch: xen_hello_world: Symbol resolved:  => 
0xa04000 (.note.gnu.build-id)
(XEN) livepatch_elf.c:343: livepatch: xen_hello_world: Symbol resolved:  => 
0xa04054 (.altinstructions)
(XEN) livepatch_elf.c:343: livepatch: xen_hello_world: Symbol resolved:  => 
0xa040e8 (.rodata.str)
(XEN) livepatch_elf.c:343: livepatch: xen_hello_world: Symbol resolved:  => 
0xa040fc (.bug_frames.1)
(XEN) livepatch_elf.c:343: livepatch: xen_hello_world: Symbol resolved:  => 
0xa04110 (.livepatch.depends)
(XEN) livepatch_elf.c:343: livepatch: xen_hello_world: Symbol resolved:  => 
0xa04138 (.livepatch.funcs)
(XEN) livepatch_elf.c:343: livepatch: xen_hello_world: Symbol resolved:  => 
0xa03000 (.livepatch.hooks.load)
(XEN) livepatch_elf.c:343: livepatch: xen_hello_world: Symbol resolved:  => 
0xa03010 (.livepatch.hooks.unload)
(XEN) livepatch_elf.c:343: livepatch: xen_hello_world: Symbol resolved: 
livepatch_load_data_hi_func => 0xa03000 (.livepatch.hooks.load)
(XEN) livepatch_elf.c:343: livepatch: xen_hello_world: Symbol resolved: 
xen_hello_world => 0xa02000 (.text)
(XEN) livepatch_elf.c:314: livepatch: xen_hello_world: Undefined symbol 
resolved: xen_extra_version => 0x23aac8
(XEN) livepatch_elf.c:343: livepatch: xen_hello_world: Symbol resolved: 
livepatch_unload_data_check_fnc => 0xa03010 (.livepatch.hooks.unload)
(XEN) livepatch_elf.c:343: livepatch: xen_hello_world: Symbol resolved: 
livepatch_load_data_apply_hook => 0xa03008 (.livepatch.hooks.load)
(XEN) livepatch_elf.c:343: livepatch: xen_hello_world: Symbol resolved: 
livepatch_unload_data_revert_hook => 0xa03020 (.livepatch.hooks.unload)
(XEN) livepatch_elf.c:314: livepatch: xen_hello_world: Undefined symbol 
resolved: printk => 0x248a7c
(XEN) livepatch_elf.c:343: livepatch: xen_hello_world: Symbol resolved: 
livepatch_xen_hello_world => 0xa04138 (.livepatch.funcs)
(XEN) livepatch_elf.c:343: livepatch: xen_hello_world: Symbol resolved: 
livepatch_unload_data_hi_func => 0xa03018 (.livepatch.hooks.unload)
(XEN) alternatives: Patching with alt table 0000000000a04054 -> 0000000000a04060
(XEN) livepatch.c:845: livepatch: xen_hello_world: new local symbol apply_hook
(XEN) livepatch.c:845: livepatch: xen_hello_world: new local symbol revert_hook
(XEN) livepatch.c:845: livepatch: xen_hello_world: new local symbol hi_func
(XEN) livepatch.c:845: livepatch: xen_hello_world: new local symbol check_fnc
(XEN) livepatch.c:845: livepatch: xen_hello_world: new local symbol 
__func__.7462
(XEN) livepatch.c:845: livepatch: xen_hello_world: new local symbol 
__func__.7466
(XEN) livepatch.c:845: livepatch: xen_hello_world: new local symbol 
hello_world_patch_this_fnc
(XEN) livepatch.c:845: livepatch: xen_hello_world: new local symbol cnt
(XEN) livepatch.c:845: livepatch: xen_hello_world: new local symbol 
livepatch_load_data_hi_func
(XEN) livepatch.c:852: livepatch: xen_hello_world: overriding global symbol 
xen_hello_world
(XEN) livepatch.c:845: livepatch: xen_hello_world: new local symbol 
livepatch_unload_data_check_fnc
(XEN) livepatch.c:845: livepatch: xen_hello_world: new local symbol 
livepatch_load_data_apply_hook
(XEN) livepatch.c:845: livepatch: xen_hello_world: new local symbol 
livepatch_unload_data_revert_hook
(XEN) livepatch.c:845: livepatch: xen_hello_world: new global symbol 
livepatch_xen_hello_world
(XEN) livepatch.c:845: livepatch: xen_hello_world: new local symbol 
livepatch_unload_data_hi_func
completed(XEN) livepatch.c:1343: livepatch: xen_hello_world: timeout is 
30000000ns

(XEN) livepatch.c:1450: livepatch: xen_hello_world: CPU3 - IPIing the other 7 
CPUs
Applying xen_hello_world... (XEN) livepatch: xen_hello_world: Applying 1 
functions
(XEN) hi_func: Hi! (called 1 times)
(XEN) Hook executing.
(XEN) livepatch: xen_hello_world finished APPLY with rc=0
completed
Executing: '(set -e;cd /root/test/livepatch;xl info)' ..host                   
: linaro-developer
release                : 4.12.0-linaro-hikey960+
version                : #3 SMP PREEMPT Mon Jul 17 13:26:13 EDT 2017
machine                : aarch64
nr_cpus                : 8
max_cpu_id             : 7
nr_nodes               : 1
cores_per_socket       : 1
threads_per_core       : 1
cpu_mhz                : 1
hw_caps                : 
00000000:00000000:00000000:00000000:00000000:00000000:00000000:00000000
virt_caps              :
total_memory           : 2262
free_memory            : 712
sharing_freed_memory   : 0
sharing_used_memory    : 0
outstanding_claims     : 0
free_cpus              : 0
xen_major              : 4
xen_minor              : 10
xen_extra              : Hello World
xen_version            : 4.10Hello World
xen_caps               : xen-3.0-aarch64 xen-3.0-armv7l 
xen_scheduler          : credit
xen_pagesize           : 4096
platform_params        : virt_start=0x200000
xen_changeset          : Mon Jun 19 17:11:06 2017 -0400 git:b819b1ec24-dirty
xen_commandline        : loglvl=all console=dtuart dtuart=/soc/serial@fff32000 
efi=no-rs dom0_mem=1500M
cc_compiler            : gcc (Debian 6.3.0-18) 6.3.0 20170516
cc_compile_by          : root
cc_compile_domain      : 
cc_compile_date        : Wed Sep 13 20:42:42 UTC 2017
build_id               : 48fbef3c27a9d845faba3aea7e7d24063997815c
xend_config_format     : 4
Executing: '(set -e;cd /root/test/livepatch;xen-livepatch load 
xen_bye_world.livepatch)' ..Uploading xen_bye_world.livepatch... (XEN) Xen BUG 
at page_alloc.c:738
(XEN) ----[ Xen-4.10Hello World  arm64  debug=y   Not tainted ]----
(XEN) CPU:    0
(XEN) PC:     00000000002200d8 page_alloc.c#alloc_heap_pages+0x5c8/0x6e0
(XEN) LR:     000000000021ff2c
(XEN) SP:     00008000ba1ff9e0
(XEN) CPSR:   00000249 MODE:64-bit EL2h (Hypervisor, handler)
(XEN)      X0: 09010219ffdb2387  X1: 0000800000000000  X2: 00008000b98ab000
(XEN)      X3: 00000000b98ab000  X4: ffffffffffffffff  X5: 0000000000000000
(XEN)      X6: 0000000000000014  X7: 00000000002ebe68  X8: 00000000000017c0
(XEN)      X9: 000000000007ffff X10: 00000000002ebdc8 X11: 0000000000000000
(XEN)     X12: 0000000000000000 X13: 00000008028964c0 X14: 0000000100000000
(XEN)     X15: 000000000000051b X16: 0000000000000023 X17: 0000ffffa3c81088
(XEN)     X18: 0000000000000000 X19: 0000000802896568 X20: 000000000007ffff
(XEN)     X21: 0000000000000000 X22: 0000000802896568 X23: 0000000802896568
(XEN)     X24: 00000008028965a0 X25: 0000000000000000 X26: 0000000000000000
(XEN)     X27: c2c2c2c2c2c2c2c2 X28: 6db6db6db6db6db7  FP: 00008000ba1ff9e0
(XEN) 
(XEN)   VTCR_EL2: 80023558
(XEN)  VTTBR_EL2: 00010000bff38000
(XEN) 
(XEN)  SCTLR_EL2: 30cd183d
(XEN)    HCR_EL2: 000000008038663f
(XEN)  TTBR0_EL2: 00000000bff16000
(XEN) 
(XEN)    ESR_EL2: f2000001
(XEN)  HPFAR_EL2: 0000000000e82b10
(XEN)    FAR_EL2: ffff000008000f00
(XEN) 
(XEN) Xen stack trace from sp=00008000ba1ff9e0:
(XEN)    00008000ba1ffa60 0000000000220294 0000000000000000 0000000000000000
(XEN)    0000000000000000 000000000029be18 0000000000000024 6db6db6db6db6db7
(XEN)    fffffff800000000 0000000000000001 00008000bfe9fdd8 00000000ffffffff
(XEN)    00008000bfe9fdd8 000000000029be18 00008000ba1ffaa0 000000000023c0c8
(XEN)    00008000ba1ffaa0 000000000023c108 0000000000000001 0000000000000002
(XEN)    00008000ba1edfe0 000000000029be18 000000000029c000 000000000000001d
(XEN)    00008000ba1ffaf0 000000000023c244 0000000000000010 0000000000000000
(XEN)    00008000bfe9fdb0 0000000040015000 00008000bfe9ff70 00008000bfe9fde8
(XEN)    0000000000000002 0000000000000005 00008000ba1ffb00 0000000000217850
(XEN)    00008000ba1ffc70 0000000000236bc8 0000000000000000 0000000000000000
(XEN)    0000ffffa3e61004 000000000032ac98 000000000029a1a0 00000000002eb000
(XEN)    0000000000000124 000000000000001d ffff000008a72000 ffff8000ad210000
(XEN)    00008000bff2e110 0000000000000240 0000000000324020 00000000000000a0
(XEN)    0000000000000000 0000000000000000 ffff000008a72000 ffff8000a87e8000
(XEN)    00008000ba1ffbc0 00008000bfe9fee0 0000000000000898 0000000040015000
(XEN)    00008000bfe9f600 00008000bfe9f810 0000000000000014 00008000bfe9f7a0
(XEN)    00008000bfe9f7c0 000000000000000d 5f6579625f6e6578 000000646c726f77
(XEN)    00008000ba1ffc70 000000000023630c 00008000ba1ffeb0 00008000ba1fff30
(XEN)    0000ffffa3e61004 0000000020000145 000000005a000ea1 0000ffffed7449f0
(XEN)    0000000000000124 000000000000001d 00008000ba1ffc70 000000000023637c
(XEN)    0000000000000000 0000ffffa3e61004 00008000ba1ffdd0 000000000025ddfc
(XEN)    00008000ba1ffeb0 00008000ba1fff30 000000005a000ea1 0000000020000145
(XEN)    000000005a000ea1 0000ffffed7449f0 0000000000000124 000000000000001d
(XEN)    ffff000008a72000 ffff8000ad210000 00008000ba1ffd40 00000000002552e8
(XEN)    00008000bff36000 ffff8000baf1bd27 00008000bff360d7 0000000000000000
(XEN)    00004f1d38c5bfd7 0000000000329a10 0000000000329a28 ffffffffffffffff
(XEN)    0000000000000000 0000000010e10018 00008000ba1ffd50 0000000000252418
(XEN)    0000000000000000 0000000f0000001b 0000000000000000 0000ffffa3e63004
(XEN)    000000000000000e 0000000000000898 0000ffffa3e62004 0000000000000000
(XEN)    ffffffffffffffff ffff000000000000 0000000000000000 0000000000100000
(XEN)    4010040140100401 4010000000000000 4010040140100401 4010040140100401
(XEN)    0000aaaaad72a010 0000aaaaad718b50 00008000ba1ffe20 00000000002603f0
(XEN)    0000000000000ea1 00008000ba1ffeb0 00008000ba1ffe70 0000000000252924
(XEN)    0000000000329c00 00000000002ebf80 00008000ba1fffb8 00000000000001c5
(XEN)    ffff8000a5a83d50 0000000000267b9c ffff8000b01ed088 ffff8000afb22400
(XEN)    00008000ba1fffb8 0000000020000145 000000005a000ea1 0000ffffed7449f0
(XEN)    0000000000000124 000000000000001d ffff000008a72000 ffff8000ad210000
(XEN)    000000000032ac98 ffff000008f32500 ffff000008f23f00 0000000000267ba0
(XEN)    ffff000008f0e000 ffff000008f29000 0000ffffa3e61004 0000000000000000
(XEN)    0000000000000000 0000000000000000 0000000000000000 0000000000000000
(XEN) Xen call trace:
(XEN)    [<00000000002200d8>] page_alloc.c#alloc_heap_pages+0x5c8/0x6e0 (PC)
(XEN)    [<000000000021ff2c>] page_alloc.c#alloc_heap_pages+0x41c/0x6e0 (LR)
(XEN)    [<0000000000220294>] alloc_domheap_pages+0xa4/0x150
(XEN)    [<000000000023c108>] vmap.c#vmalloc_type+0xa4/0x1b8
(XEN)    [<000000000023c244>] vmalloc_xen+0x10/0x18
(XEN)    [<0000000000217850>] livepatch_op+0x2c4/0x1518
(XEN)    [<0000000000236bc8>] do_sysctl+0x8ec/0xa30
(XEN)    [<000000000025ddfc>] traps.c#do_trap_hypercall+0x6c/0x164
(XEN)    [<00000000002603f0>] do_trap_guest_sync+0xd50/0x1bd4
(XEN)    [<0000000000267b9c>] entry.o#guest_sync+0x9c/0xcc
(XEN) 
(XEN) 
(XEN) ****************************************
(XEN) Panic on CPU 0:
(XEN) Xen BUG at page_alloc.c:738
(XEN) ****************************************
(XEN) 
(XEN) Reboot in five seconds...
> 
> 
> -boris

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

 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.