* ARM: Adjusting guest memory size through xl mem-{set|max} fails
@ 2017-07-17 12:04 Sergej Proskurin
2017-07-17 13:53 ` Julien Grall
0 siblings, 1 reply; 9+ messages in thread
From: Sergej Proskurin @ 2017-07-17 12:04 UTC (permalink / raw)
To: Xen-devel
Hi all,
My setup comprises an ARMv7 (Arndale, Linux kernel v4.11.6) and an ARMv8
(LeMaker HiKey, Linux kernel v4.9.0) development board. On both boards,
I have Xen version 4.10-unstable running with the associated tools to
manage a domu.
Currently, I am trying to get xl mem-{set|max} to work on both
architectures. Unfortunately, both command invocations fail with the
following message (I remember using xl mem-{set|max} on ARMv7 before
with Xen version 4.7 and 4.8):
---
xl: libxl.c:339: libxl_defbool_val: Assertion
`!libxl_defbool_is_default(db)' failed.
Aborted
---
The domu is created with the following parameters:
---
kernel= "/boot/zImage"
name = "domu"
memory = 512
vcpus = 2
disk=[ 'phy:/dev/vg0/VG0, xvda,w' ]
extra = 'console=hvc0 xencons=tty root=/dev/xvda rw'
---
My Kernel versions have CONFIG_XEN_BALLOON flag set (see ARMv7 example
Linux .config below).
---
$ cat .config | grep -i XEN
CONFIG_XEN_DOM0=y
CONFIG_XEN=y
CONFIG_XEN_BLKDEV_FRONTEND=y
CONFIG_XEN_BLKDEV_BACKEND=y
# CONFIG_XEN_SCSI_FRONTEND is not set
CONFIG_XEN_NETDEV_FRONTEND=y
CONFIG_XEN_NETDEV_BACKEND=y
CONFIG_INPUT_XEN_KBDDEV_FRONTEND=y
CONFIG_HVC_XEN=y
CONFIG_HVC_XEN_FRONTEND=y
# CONFIG_TCG_XEN is not set
# CONFIG_XEN_WDT is not set
CONFIG_XEN_FBDEV_FRONTEND=y
# Xen driver support
CONFIG_XEN_BALLOON=y
CONFIG_XEN_SCRUB_PAGES=y
CONFIG_XEN_DEV_EVTCHN=y
CONFIG_XEN_BACKEND=y
CONFIG_XENFS=y
CONFIG_XEN_COMPAT_XENFS=y
CONFIG_XEN_SYS_HYPERVISOR=y
CONFIG_XEN_XENBUS_FRONTEND=y
CONFIG_XEN_GNTDEV=m
CONFIG_XEN_GRANT_DEV_ALLOC=m
CONFIG_SWIOTLB_XEN=y
CONFIG_XEN_PRIVCMD=y
CONFIG_XEN_AUTO_XLATE=y
---
Besides, I can see in the dmesg output that the balloon driver gets
initialized:
---
# dmesg | grep -i balloon
[ 0.180942] xen:balloon: Initialising balloon driver
[ 0.187103] xen_balloon: Initialising balloon driver
---
It would be great if someone would help me to resolve this issue as I am
obviously missing something. Thank you very much in advance.
Best regards,
~Sergej
_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
https://lists.xen.org/xen-devel
^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: ARM: Adjusting guest memory size through xl mem-{set|max} fails
2017-07-17 12:04 ARM: Adjusting guest memory size through xl mem-{set|max} fails Sergej Proskurin
@ 2017-07-17 13:53 ` Julien Grall
2017-07-17 16:19 ` Sergej Proskurin
0 siblings, 1 reply; 9+ messages in thread
From: Julien Grall @ 2017-07-17 13:53 UTC (permalink / raw)
To: Sergej Proskurin, Xen-devel, Wei Liu, Ian Jackson
(+Wei and Ian)
Hi Sergej
On 17/07/17 13:04, Sergej Proskurin wrote:
> Hi all,
>
> My setup comprises an ARMv7 (Arndale, Linux kernel v4.11.6) and an ARMv8
> (LeMaker HiKey, Linux kernel v4.9.0) development board. On both boards,
> I have Xen version 4.10-unstable running with the associated tools to
> manage a domu.
>
> Currently, I am trying to get xl mem-{set|max} to work on both
> architectures. Unfortunately, both command invocations fail with the
> following message (I remember using xl mem-{set|max} on ARMv7 before
> with Xen version 4.7 and 4.8):
>
> ---
> xl: libxl.c:339: libxl_defbool_val: Assertion
> `!libxl_defbool_is_default(db)' failed.
> Aborted
> ---
I haven't myself tried to use xl mem-{set|max}. Looking at the assert,
you hit because a boolean is not initialized. It would be interesting to
know which one.
I have CCed the tools maintainers to get more feedback.
Cheers,
>
> The domu is created with the following parameters:
>
> ---
> kernel= "/boot/zImage"
> name = "domu"
> memory = 512
> vcpus = 2
> disk=[ 'phy:/dev/vg0/VG0, xvda,w' ]
> extra = 'console=hvc0 xencons=tty root=/dev/xvda rw'
> ---
>
> My Kernel versions have CONFIG_XEN_BALLOON flag set (see ARMv7 example
> Linux .config below).
>
> ---
> $ cat .config | grep -i XEN
> CONFIG_XEN_DOM0=y
> CONFIG_XEN=y
> CONFIG_XEN_BLKDEV_FRONTEND=y
> CONFIG_XEN_BLKDEV_BACKEND=y
> # CONFIG_XEN_SCSI_FRONTEND is not set
> CONFIG_XEN_NETDEV_FRONTEND=y
> CONFIG_XEN_NETDEV_BACKEND=y
> CONFIG_INPUT_XEN_KBDDEV_FRONTEND=y
> CONFIG_HVC_XEN=y
> CONFIG_HVC_XEN_FRONTEND=y
> # CONFIG_TCG_XEN is not set
> # CONFIG_XEN_WDT is not set
> CONFIG_XEN_FBDEV_FRONTEND=y
> # Xen driver support
> CONFIG_XEN_BALLOON=y
> CONFIG_XEN_SCRUB_PAGES=y
> CONFIG_XEN_DEV_EVTCHN=y
> CONFIG_XEN_BACKEND=y
> CONFIG_XENFS=y
> CONFIG_XEN_COMPAT_XENFS=y
> CONFIG_XEN_SYS_HYPERVISOR=y
> CONFIG_XEN_XENBUS_FRONTEND=y
> CONFIG_XEN_GNTDEV=m
> CONFIG_XEN_GRANT_DEV_ALLOC=m
> CONFIG_SWIOTLB_XEN=y
> CONFIG_XEN_PRIVCMD=y
> CONFIG_XEN_AUTO_XLATE=y
> ---
>
> Besides, I can see in the dmesg output that the balloon driver gets
> initialized:
>
> ---
> # dmesg | grep -i balloon
> [ 0.180942] xen:balloon: Initialising balloon driver
> [ 0.187103] xen_balloon: Initialising balloon driver
> ---
>
> It would be great if someone would help me to resolve this issue as I am
> obviously missing something. Thank you very much in advance.
>
> Best regards,
> ~Sergej
>
>
> _______________________________________________
> Xen-devel mailing list
> Xen-devel@lists.xen.org
> https://lists.xen.org/xen-devel
>
--
Julien Grall
_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
https://lists.xen.org/xen-devel
^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: ARM: Adjusting guest memory size through xl mem-{set|max} fails
2017-07-17 13:53 ` Julien Grall
@ 2017-07-17 16:19 ` Sergej Proskurin
2017-07-18 11:16 ` Wei Liu
0 siblings, 1 reply; 9+ messages in thread
From: Sergej Proskurin @ 2017-07-17 16:19 UTC (permalink / raw)
To: Julien Grall, Xen-devel, Wei Liu, Ian Jackson
Hi Julien,
On 07/17/2017 03:53 PM, Julien Grall wrote:
> (+Wei and Ian)
>
> Hi Sergej
>
> On 17/07/17 13:04, Sergej Proskurin wrote:
>> Hi all,
>>
>> My setup comprises an ARMv7 (Arndale, Linux kernel v4.11.6) and an ARMv8
>> (LeMaker HiKey, Linux kernel v4.9.0) development board. On both boards,
>> I have Xen version 4.10-unstable running with the associated tools to
>> manage a domu.
>>
>> Currently, I am trying to get xl mem-{set|max} to work on both
>> architectures. Unfortunately, both command invocations fail with the
>> following message (I remember using xl mem-{set|max} on ARMv7 before
>> with Xen version 4.7 and 4.8):
>>
>> ---
>> xl: libxl.c:339: libxl_defbool_val: Assertion
>> `!libxl_defbool_is_default(db)' failed.
>> Aborted
>> ---
>
> I haven't myself tried to use xl mem-{set|max}. Looking at the assert,
> you hit because a boolean is not initialized. It would be interesting
> to know which one.
>
> I have CCed the tools maintainers to get more feedback.
>
> Cheers,
>
Thank you. That is already a great help!
>>
>> The domu is created with the following parameters:
>>
>> ---
>> kernel= "/boot/zImage"
>> name = "domu"
>> memory = 512
>> vcpus = 2
>> disk=[ 'phy:/dev/vg0/VG0, xvda,w' ]
>> extra = 'console=hvc0 xencons=tty root=/dev/xvda rw'
>> ---
>>
>> My Kernel versions have CONFIG_XEN_BALLOON flag set (see ARMv7 example
>> Linux .config below).
>>
>> ---
>> $ cat .config | grep -i XEN
>> CONFIG_XEN_DOM0=y
>> CONFIG_XEN=y
>> CONFIG_XEN_BLKDEV_FRONTEND=y
>> CONFIG_XEN_BLKDEV_BACKEND=y
>> # CONFIG_XEN_SCSI_FRONTEND is not set
>> CONFIG_XEN_NETDEV_FRONTEND=y
>> CONFIG_XEN_NETDEV_BACKEND=y
>> CONFIG_INPUT_XEN_KBDDEV_FRONTEND=y
>> CONFIG_HVC_XEN=y
>> CONFIG_HVC_XEN_FRONTEND=y
>> # CONFIG_TCG_XEN is not set
>> # CONFIG_XEN_WDT is not set
>> CONFIG_XEN_FBDEV_FRONTEND=y
>> # Xen driver support
>> CONFIG_XEN_BALLOON=y
>> CONFIG_XEN_SCRUB_PAGES=y
>> CONFIG_XEN_DEV_EVTCHN=y
>> CONFIG_XEN_BACKEND=y
>> CONFIG_XENFS=y
>> CONFIG_XEN_COMPAT_XENFS=y
>> CONFIG_XEN_SYS_HYPERVISOR=y
>> CONFIG_XEN_XENBUS_FRONTEND=y
>> CONFIG_XEN_GNTDEV=m
>> CONFIG_XEN_GRANT_DEV_ALLOC=m
>> CONFIG_SWIOTLB_XEN=y
>> CONFIG_XEN_PRIVCMD=y
>> CONFIG_XEN_AUTO_XLATE=y
>> ---
>>
>> Besides, I can see in the dmesg output that the balloon driver gets
>> initialized:
>>
>> ---
>> # dmesg | grep -i balloon
>> [ 0.180942] xen:balloon: Initialising balloon driver
>> [ 0.187103] xen_balloon: Initialising balloon driver
>> ---
>>
>> It would be great if someone would help me to resolve this issue as I am
>> obviously missing something. Thank you very much in advance.
>>
>> Best regards,
>> ~Sergej
>>
>>
>> _______________________________________________
>> Xen-devel mailing list
>> Xen-devel@lists.xen.org
>> https://lists.xen.org/xen-devel
>>
>
Cheers,
~Sergej
_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
https://lists.xen.org/xen-devel
^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: ARM: Adjusting guest memory size through xl mem-{set|max} fails
2017-07-17 16:19 ` Sergej Proskurin
@ 2017-07-18 11:16 ` Wei Liu
2017-07-19 9:40 ` Sergej Proskurin
0 siblings, 1 reply; 9+ messages in thread
From: Wei Liu @ 2017-07-18 11:16 UTC (permalink / raw)
To: Sergej Proskurin; +Cc: Xen-devel, Julien Grall, Wei Liu, Ian Jackson
On Mon, Jul 17, 2017 at 06:19:09PM +0200, Sergej Proskurin wrote:
> Hi Julien,
>
>
> On 07/17/2017 03:53 PM, Julien Grall wrote:
> > (+Wei and Ian)
> >
> > Hi Sergej
> >
> > On 17/07/17 13:04, Sergej Proskurin wrote:
> >> Hi all,
> >>
> >> My setup comprises an ARMv7 (Arndale, Linux kernel v4.11.6) and an ARMv8
> >> (LeMaker HiKey, Linux kernel v4.9.0) development board. On both boards,
> >> I have Xen version 4.10-unstable running with the associated tools to
> >> manage a domu.
> >>
> >> Currently, I am trying to get xl mem-{set|max} to work on both
> >> architectures. Unfortunately, both command invocations fail with the
> >> following message (I remember using xl mem-{set|max} on ARMv7 before
> >> with Xen version 4.7 and 4.8):
> >>
> >> ---
> >> xl: libxl.c:339: libxl_defbool_val: Assertion
> >> `!libxl_defbool_is_default(db)' failed.
> >> Aborted
> >> ---
> >
> > I haven't myself tried to use xl mem-{set|max}. Looking at the assert,
> > you hit because a boolean is not initialized. It would be interesting
> > to know which one.
> >
> > I have CCed the tools maintainers to get more feedback.
> >
Can you provide a backtrace?
$ ulimit -c unlimited
$ xl mem-set
That should generate a coredump, on which you can use gdb to get a
backtrace.
_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
https://lists.xen.org/xen-devel
^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: ARM: Adjusting guest memory size through xl mem-{set|max} fails
2017-07-18 11:16 ` Wei Liu
@ 2017-07-19 9:40 ` Sergej Proskurin
2017-07-19 10:22 ` Wei Liu
0 siblings, 1 reply; 9+ messages in thread
From: Sergej Proskurin @ 2017-07-19 9:40 UTC (permalink / raw)
To: Wei Liu; +Cc: Xen-devel, Julien Grall, Ian Jackson
Hi Wei,
On 07/18/2017 01:16 PM, Wei Liu wrote:
> On Mon, Jul 17, 2017 at 06:19:09PM +0200, Sergej Proskurin wrote:
>> Hi Julien,
>>
>>
>> On 07/17/2017 03:53 PM, Julien Grall wrote:
>>> (+Wei and Ian)
>>>
>>> Hi Sergej
>>>
>>> On 17/07/17 13:04, Sergej Proskurin wrote:
>>>> Hi all,
>>>>
>>>> My setup comprises an ARMv7 (Arndale, Linux kernel v4.11.6) and an ARMv8
>>>> (LeMaker HiKey, Linux kernel v4.9.0) development board. On both boards,
>>>> I have Xen version 4.10-unstable running with the associated tools to
>>>> manage a domu.
>>>>
>>>> Currently, I am trying to get xl mem-{set|max} to work on both
>>>> architectures. Unfortunately, both command invocations fail with the
>>>> following message (I remember using xl mem-{set|max} on ARMv7 before
>>>> with Xen version 4.7 and 4.8):
>>>>
>>>> ---
>>>> xl: libxl.c:339: libxl_defbool_val: Assertion
>>>> `!libxl_defbool_is_default(db)' failed.
>>>> Aborted
>>>> ---
>>> I haven't myself tried to use xl mem-{set|max}. Looking at the assert,
>>> you hit because a boolean is not initialized. It would be interesting
>>> to know which one.
>>>
>>> I have CCed the tools maintainers to get more feedback.
>>>
> Can you provide a backtrace?
>
> $ ulimit -c unlimited
> $ xl mem-set
>
> That should generate a coredump, on which you can use gdb to get a
> backtrace.
I get the following core dumps on ARMv8:
---
(gdb) bt
#0 0x0000ffffacb509e8 in __GI_raise (sig=sig@entry=6)
at ../nptl/sysdeps/unix/sysv/linux/raise.c:56
#1 0x0000ffffacb51cf0 in __GI_abort () at abort.c:89
#2 0x0000ffffacb4a3b8 in __assert_fail_base (
fmt=0xffffacc376f0 "%s%s%s:%u: %s%sAssertion `%s' failed.\n%n",
assertion=assertion@entry=0xffffacd76c38
"!libxl_defbool_is_default(db)",
file=file@entry=0xffffacd769e0 "libxl.c", line=line@entry=339,
function=<optimized out>)
at assert.c:92
#3 0x0000ffffacb4a470 in __GI___assert_fail (
assertion=0xffffacd76c38 "!libxl_defbool_is_default(db)",
file=0xffffacd769e0 "libxl.c",
line=339, function=<optimized out>) at assert.c:101
#4 0x0000ffffacce13f8 in libxl_defbool_val (db=...) at libxl.c:339
#5 0x0000ffffacd490f8 in libxl__arch_extra_memory (gc=0xffffc5d47790,
info=0xffffc5d472b0,
out=0xffffc5d47788) at libxl_arm.c:116
#6 0x0000ffffacd39764 in libxl_set_memory_target (ctx=0xaaab014bf050,
domid=1,
target_memkb=522240, relative=0, enforce=1) at libxl_mem.c:206
#7 0x0000aaaac5f86abc in set_memory_target (domid=1, mem=0xffffc5d47e64
"510m") at xl_mem.c:69
#8 0x0000aaaac5f86bac in main_memset (argc=3, argv=0xffffc5d47a20) at
xl_mem.c:90
#9 0x0000aaaac5f72528 in main (argc=3, argv=0xffffc5d47a20) at xl.c:369
(gdb)
---
As far as I understand, the problem seems to be in libxl_arm.c:116,
checking for info->acpi.
According to docs/man/xl.cfg.pod.5.in, the ACPI option is true for x86
while it's false for ARM by default. By setting acpi = 1 in domu.cfg,
the previous error disappears, yet I get the following error:
---
root@avocet:~# xl mem-set 2 510m
libxl: error: libxl_arm_acpi.c:89:libxl__estimate_madt_size: Unknown GIC
version
libxl: error: libxl_mem.c:208:libxl_set_memory_target: Couldn't get arch
extra constant memory size
: Function not implemented
cannot set domid 2 dynamic max memory to : 510m
---
When I set acpi = 1 on my ARMv7 board, I get the following error already
during the domain creation process:
---
root@thanatos:~# xl create domu.cfg
Parsing config from domu.cfg
libxl: error: libxl_dom.c:418:libxl__build_pre: Couldn't get arch extra
constant memory size: No su
ch file or directory
libxl: error: libxl_create.c:1217:domcreate_rebuild_done: Domain
3:cannot (re-)build domain: -3
libxl: error: libxl_domain.c:1003:libxl__destroy_domid: Domain
3:Non-existant domain
libxl: error: libxl_domain.c:962:domain_destroy_callback: Domain
3:Unable to destroy guest
libxl: error: libxl_domain.c:889:domain_destroy_cb: Domain 3:Destruction
of domain failed
---
Thanks,
~Sergej
_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
https://lists.xen.org/xen-devel
^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: ARM: Adjusting guest memory size through xl mem-{set|max} fails
2017-07-19 9:40 ` Sergej Proskurin
@ 2017-07-19 10:22 ` Wei Liu
2017-07-19 11:52 ` Sergej Proskurin
0 siblings, 1 reply; 9+ messages in thread
From: Wei Liu @ 2017-07-19 10:22 UTC (permalink / raw)
To: Sergej Proskurin; +Cc: Xen-devel, Julien Grall, Wei Liu, Ian Jackson
On Wed, Jul 19, 2017 at 11:40:19AM +0200, Sergej Proskurin wrote:
> Hi Wei,
>
>
> On 07/18/2017 01:16 PM, Wei Liu wrote:
> > On Mon, Jul 17, 2017 at 06:19:09PM +0200, Sergej Proskurin wrote:
> >> Hi Julien,
> >>
> >>
> >> On 07/17/2017 03:53 PM, Julien Grall wrote:
> >>> (+Wei and Ian)
> >>>
> >>> Hi Sergej
> >>>
> >>> On 17/07/17 13:04, Sergej Proskurin wrote:
> >>>> Hi all,
> >>>>
> >>>> My setup comprises an ARMv7 (Arndale, Linux kernel v4.11.6) and an ARMv8
> >>>> (LeMaker HiKey, Linux kernel v4.9.0) development board. On both boards,
> >>>> I have Xen version 4.10-unstable running with the associated tools to
> >>>> manage a domu.
> >>>>
> >>>> Currently, I am trying to get xl mem-{set|max} to work on both
> >>>> architectures. Unfortunately, both command invocations fail with the
> >>>> following message (I remember using xl mem-{set|max} on ARMv7 before
> >>>> with Xen version 4.7 and 4.8):
> >>>>
> >>>> ---
> >>>> xl: libxl.c:339: libxl_defbool_val: Assertion
> >>>> `!libxl_defbool_is_default(db)' failed.
> >>>> Aborted
> >>>> ---
> >>> I haven't myself tried to use xl mem-{set|max}. Looking at the assert,
> >>> you hit because a boolean is not initialized. It would be interesting
> >>> to know which one.
> >>>
> >>> I have CCed the tools maintainers to get more feedback.
> >>>
> > Can you provide a backtrace?
> >
> > $ ulimit -c unlimited
> > $ xl mem-set
> >
> > That should generate a coredump, on which you can use gdb to get a
> > backtrace.
>
> I get the following core dumps on ARMv8:
>
> ---
> (gdb) bt
> #0 0x0000ffffacb509e8 in __GI_raise (sig=sig@entry=6)
> at ../nptl/sysdeps/unix/sysv/linux/raise.c:56
> #1 0x0000ffffacb51cf0 in __GI_abort () at abort.c:89
> #2 0x0000ffffacb4a3b8 in __assert_fail_base (
> fmt=0xffffacc376f0 "%s%s%s:%u: %s%sAssertion `%s' failed.\n%n",
> assertion=assertion@entry=0xffffacd76c38
> "!libxl_defbool_is_default(db)",
> file=file@entry=0xffffacd769e0 "libxl.c", line=line@entry=339,
> function=<optimized out>)
> at assert.c:92
> #3 0x0000ffffacb4a470 in __GI___assert_fail (
> assertion=0xffffacd76c38 "!libxl_defbool_is_default(db)",
> file=0xffffacd769e0 "libxl.c",
> line=339, function=<optimized out>) at assert.c:101
> #4 0x0000ffffacce13f8 in libxl_defbool_val (db=...) at libxl.c:339
> #5 0x0000ffffacd490f8 in libxl__arch_extra_memory (gc=0xffffc5d47790,
> info=0xffffc5d472b0,
> out=0xffffc5d47788) at libxl_arm.c:116
> #6 0x0000ffffacd39764 in libxl_set_memory_target (ctx=0xaaab014bf050,
> domid=1,
> target_memkb=522240, relative=0, enforce=1) at libxl_mem.c:206
> #7 0x0000aaaac5f86abc in set_memory_target (domid=1, mem=0xffffc5d47e64
> "510m") at xl_mem.c:69
> #8 0x0000aaaac5f86bac in main_memset (argc=3, argv=0xffffc5d47a20) at
> xl_mem.c:90
> #9 0x0000aaaac5f72528 in main (argc=3, argv=0xffffc5d47a20) at xl.c:369
> (gdb)
> ---
>
> As far as I understand, the problem seems to be in libxl_arm.c:116,
> checking for info->acpi.
>
> According to docs/man/xl.cfg.pod.5.in, the ACPI option is true for x86
> while it's false for ARM by default. By setting acpi = 1 in domu.cfg,
> the previous error disappears, yet I get the following error:
>
> ---
> root@avocet:~# xl mem-set 2 510m
> libxl: error: libxl_arm_acpi.c:89:libxl__estimate_madt_size: Unknown GIC
> version
Can you give this a try?
---8<---
From bc3d96fa10e9eae7d9af92be66eb6b89b4c86a53 Mon Sep 17 00:00:00 2001
From: Wei Liu <wei.liu2@citrix.com>
Date: Wed, 19 Jul 2017 11:19:15 +0100
Subject: [PATCH] libxl: introduce arch domain configuration save function
It appears that we should save the ARM GIC version and the ACPI config
in the saved guest config file so that we can reference them later.
Introduce an arch domain configuration save helper and fill that in
for ARM.
Reported-by: Sergej Proskurin <proskurin@sec.in.tum.de>
Signed-off-by: Wei Liu <wei.liu2@citrix.com>
---
Not even compile tested on ARM...
---
tools/libxl/libxl_arch.h | 5 +++++
tools/libxl/libxl_arm.c | 12 ++++++++++++
tools/libxl/libxl_internal.c | 3 +++
tools/libxl/libxl_x86.c | 6 ++++++
4 files changed, 26 insertions(+)
diff --git a/tools/libxl/libxl_arch.h b/tools/libxl/libxl_arch.h
index 5e1fc6060e..a300707a23 100644
--- a/tools/libxl/libxl_arch.h
+++ b/tools/libxl/libxl_arch.h
@@ -71,6 +71,11 @@ int libxl__arch_extra_memory(libxl__gc *gc,
const libxl_domain_build_info *info,
uint64_t *out);
+_hidden
+void libxl__arch_update_domain_configuration(libxl__gc *gc,
+ libxl_domain_config *dst,
+ const libxl_domain_config *src);
+
#if defined(__i386__) || defined(__x86_64__)
#define LAPIC_BASE_ADDRESS 0xfee00000
diff --git a/tools/libxl/libxl_arm.c b/tools/libxl/libxl_arm.c
index 8dd798bfdb..738f95be98 100644
--- a/tools/libxl/libxl_arm.c
+++ b/tools/libxl/libxl_arm.c
@@ -1067,6 +1067,18 @@ void libxl__arch_domain_build_info_acpi_setdefault(
libxl_defbool_setdefault(&b_info->acpi, false);
}
+void libxl__arch_update_domain_configuration(libxl__gc *gc,
+ libxl_domain_config *dst,
+ const libxl_domain_config *src)
+{
+ dst->b_info.arch_arm.gic_version = src->b_info.arch_arm.gic_version;
+
+ if (!libxl_defbool_is_default(src->b_info.acpi)) {
+ bool val = libxl_defbool_val(src->b_info.acpi);
+ libxl_defbool_set(&dst->b_info.acpi, val);
+ }
+}
+
/*
* Local variables:
* mode: C
diff --git a/tools/libxl/libxl_internal.c b/tools/libxl/libxl_internal.c
index f492dae5ff..4b11ff47ff 100644
--- a/tools/libxl/libxl_internal.c
+++ b/tools/libxl/libxl_internal.c
@@ -16,6 +16,7 @@
#include "libxl_osdeps.h" /* must come before any other headers */
#include "libxl_internal.h"
+#include "libxl_arch.h"
void libxl__alloc_failed(libxl_ctx *ctx, const char *func,
size_t nmemb, size_t size) {
@@ -573,6 +574,8 @@ void libxl__update_domain_configuration(libxl__gc *gc,
/* video ram */
dst->b_info.video_memkb = src->b_info.video_memkb;
+
+ libxl__arch_update_domain_configuration(gc, dst, src);
}
/*
diff --git a/tools/libxl/libxl_x86.c b/tools/libxl/libxl_x86.c
index 455f6f0bed..c2a0185b82 100644
--- a/tools/libxl/libxl_x86.c
+++ b/tools/libxl/libxl_x86.c
@@ -587,6 +587,12 @@ void libxl__arch_domain_build_info_acpi_setdefault(
libxl_defbool_setdefault(&b_info->acpi, true);
}
+void libxl__arch_update_domain_configuration(libxl__gc *gc,
+ libxl_domain_config *dst,
+ const libxl_domain_config *src)
+{
+}
+
/*
* Local variables:
* mode: C
--
2.11.0
_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
https://lists.xen.org/xen-devel
^ permalink raw reply related [flat|nested] 9+ messages in thread
* Re: ARM: Adjusting guest memory size through xl mem-{set|max} fails
2017-07-19 10:22 ` Wei Liu
@ 2017-07-19 11:52 ` Sergej Proskurin
2017-07-19 11:57 ` Wei Liu
0 siblings, 1 reply; 9+ messages in thread
From: Sergej Proskurin @ 2017-07-19 11:52 UTC (permalink / raw)
To: Wei Liu; +Cc: Xen-devel, Julien Grall, Ian Jackson
Hi Wei,
On 07/19/2017 12:22 PM, Wei Liu wrote:
> On Wed, Jul 19, 2017 at 11:40:19AM +0200, Sergej Proskurin wrote:
>> Hi Wei,
>>
>>
>> On 07/18/2017 01:16 PM, Wei Liu wrote:
>>> On Mon, Jul 17, 2017 at 06:19:09PM +0200, Sergej Proskurin wrote:
>>>> Hi Julien,
>>>>
>>>>
>>>> On 07/17/2017 03:53 PM, Julien Grall wrote:
>>>>> (+Wei and Ian)
>>>>>
>>>>> Hi Sergej
>>>>>
>>>>> On 17/07/17 13:04, Sergej Proskurin wrote:
>>>>>> Hi all,
>>>>>>
>>>>>> My setup comprises an ARMv7 (Arndale, Linux kernel v4.11.6) and an ARMv8
>>>>>> (LeMaker HiKey, Linux kernel v4.9.0) development board. On both boards,
>>>>>> I have Xen version 4.10-unstable running with the associated tools to
>>>>>> manage a domu.
>>>>>>
>>>>>> Currently, I am trying to get xl mem-{set|max} to work on both
>>>>>> architectures. Unfortunately, both command invocations fail with the
>>>>>> following message (I remember using xl mem-{set|max} on ARMv7 before
>>>>>> with Xen version 4.7 and 4.8):
>>>>>>
>>>>>> ---
>>>>>> xl: libxl.c:339: libxl_defbool_val: Assertion
>>>>>> `!libxl_defbool_is_default(db)' failed.
>>>>>> Aborted
>>>>>> ---
>>>>> I haven't myself tried to use xl mem-{set|max}. Looking at the assert,
>>>>> you hit because a boolean is not initialized. It would be interesting
>>>>> to know which one.
>>>>>
>>>>> I have CCed the tools maintainers to get more feedback.
>>>>>
>>> Can you provide a backtrace?
>>>
>>> $ ulimit -c unlimited
>>> $ xl mem-set
>>>
>>> That should generate a coredump, on which you can use gdb to get a
>>> backtrace.
>> I get the following core dumps on ARMv8:
>>
>> ---
>> (gdb) bt
>> #0 0x0000ffffacb509e8 in __GI_raise (sig=sig@entry=6)
>> at ../nptl/sysdeps/unix/sysv/linux/raise.c:56
>> #1 0x0000ffffacb51cf0 in __GI_abort () at abort.c:89
>> #2 0x0000ffffacb4a3b8 in __assert_fail_base (
>> fmt=0xffffacc376f0 "%s%s%s:%u: %s%sAssertion `%s' failed.\n%n",
>> assertion=assertion@entry=0xffffacd76c38
>> "!libxl_defbool_is_default(db)",
>> file=file@entry=0xffffacd769e0 "libxl.c", line=line@entry=339,
>> function=<optimized out>)
>> at assert.c:92
>> #3 0x0000ffffacb4a470 in __GI___assert_fail (
>> assertion=0xffffacd76c38 "!libxl_defbool_is_default(db)",
>> file=0xffffacd769e0 "libxl.c",
>> line=339, function=<optimized out>) at assert.c:101
>> #4 0x0000ffffacce13f8 in libxl_defbool_val (db=...) at libxl.c:339
>> #5 0x0000ffffacd490f8 in libxl__arch_extra_memory (gc=0xffffc5d47790,
>> info=0xffffc5d472b0,
>> out=0xffffc5d47788) at libxl_arm.c:116
>> #6 0x0000ffffacd39764 in libxl_set_memory_target (ctx=0xaaab014bf050,
>> domid=1,
>> target_memkb=522240, relative=0, enforce=1) at libxl_mem.c:206
>> #7 0x0000aaaac5f86abc in set_memory_target (domid=1, mem=0xffffc5d47e64
>> "510m") at xl_mem.c:69
>> #8 0x0000aaaac5f86bac in main_memset (argc=3, argv=0xffffc5d47a20) at
>> xl_mem.c:90
>> #9 0x0000aaaac5f72528 in main (argc=3, argv=0xffffc5d47a20) at xl.c:369
>> (gdb)
>> ---
>>
>> As far as I understand, the problem seems to be in libxl_arm.c:116,
>> checking for info->acpi.
>>
>> According to docs/man/xl.cfg.pod.5.in, the ACPI option is true for x86
>> while it's false for ARM by default. By setting acpi = 1 in domu.cfg,
>> the previous error disappears, yet I get the following error:
>>
>> ---
>> root@avocet:~# xl mem-set 2 510m
>> libxl: error: libxl_arm_acpi.c:89:libxl__estimate_madt_size: Unknown GIC
>> version
>
> Can you give this a try?
>
> ---8<---
> From bc3d96fa10e9eae7d9af92be66eb6b89b4c86a53 Mon Sep 17 00:00:00 2001
> From: Wei Liu <wei.liu2@citrix.com>
> Date: Wed, 19 Jul 2017 11:19:15 +0100
> Subject: [PATCH] libxl: introduce arch domain configuration save function
>
> It appears that we should save the ARM GIC version and the ACPI config
> in the saved guest config file so that we can reference them later.
>
> Introduce an arch domain configuration save helper and fill that in
> for ARM.
>
> Reported-by: Sergej Proskurin <proskurin@sec.in.tum.de>
> Signed-off-by: Wei Liu <wei.liu2@citrix.com>
> ---
> Not even compile tested on ARM...
> ---
> tools/libxl/libxl_arch.h | 5 +++++
> tools/libxl/libxl_arm.c | 12 ++++++++++++
> tools/libxl/libxl_internal.c | 3 +++
> tools/libxl/libxl_x86.c | 6 ++++++
> 4 files changed, 26 insertions(+)
>
> diff --git a/tools/libxl/libxl_arch.h b/tools/libxl/libxl_arch.h
> index 5e1fc6060e..a300707a23 100644
> --- a/tools/libxl/libxl_arch.h
> +++ b/tools/libxl/libxl_arch.h
> @@ -71,6 +71,11 @@ int libxl__arch_extra_memory(libxl__gc *gc,
> const libxl_domain_build_info *info,
> uint64_t *out);
>
> +_hidden
> +void libxl__arch_update_domain_configuration(libxl__gc *gc,
> + libxl_domain_config *dst,
> + const libxl_domain_config *src);
> +
> #if defined(__i386__) || defined(__x86_64__)
>
> #define LAPIC_BASE_ADDRESS 0xfee00000
> diff --git a/tools/libxl/libxl_arm.c b/tools/libxl/libxl_arm.c
> index 8dd798bfdb..738f95be98 100644
> --- a/tools/libxl/libxl_arm.c
> +++ b/tools/libxl/libxl_arm.c
> @@ -1067,6 +1067,18 @@ void libxl__arch_domain_build_info_acpi_setdefault(
> libxl_defbool_setdefault(&b_info->acpi, false);
> }
>
> +void libxl__arch_update_domain_configuration(libxl__gc *gc,
> + libxl_domain_config *dst,
> + const libxl_domain_config *src)
> +{
> + dst->b_info.arch_arm.gic_version = src->b_info.arch_arm.gic_version;
> +
> + if (!libxl_defbool_is_default(src->b_info.acpi)) {
> + bool val = libxl_defbool_val(src->b_info.acpi);
> + libxl_defbool_set(&dst->b_info.acpi, val);
> + }
> +}
> +
> /*
> * Local variables:
> * mode: C
> diff --git a/tools/libxl/libxl_internal.c b/tools/libxl/libxl_internal.c
> index f492dae5ff..4b11ff47ff 100644
> --- a/tools/libxl/libxl_internal.c
> +++ b/tools/libxl/libxl_internal.c
> @@ -16,6 +16,7 @@
> #include "libxl_osdeps.h" /* must come before any other headers */
>
> #include "libxl_internal.h"
> +#include "libxl_arch.h"
>
> void libxl__alloc_failed(libxl_ctx *ctx, const char *func,
> size_t nmemb, size_t size) {
> @@ -573,6 +574,8 @@ void libxl__update_domain_configuration(libxl__gc *gc,
>
> /* video ram */
> dst->b_info.video_memkb = src->b_info.video_memkb;
> +
> + libxl__arch_update_domain_configuration(gc, dst, src);
> }
>
> /*
> diff --git a/tools/libxl/libxl_x86.c b/tools/libxl/libxl_x86.c
> index 455f6f0bed..c2a0185b82 100644
> --- a/tools/libxl/libxl_x86.c
> +++ b/tools/libxl/libxl_x86.c
> @@ -587,6 +587,12 @@ void libxl__arch_domain_build_info_acpi_setdefault(
> libxl_defbool_setdefault(&b_info->acpi, true);
> }
>
> +void libxl__arch_update_domain_configuration(libxl__gc *gc,
> + libxl_domain_config *dst,
> + const libxl_domain_config *src)
> +{
> +}
> +
> /*
> * Local variables:
> * mode: C
Yeap, that did it! At least for mem-set on ARMv8.
However, I discovered that mem-max does not yet work entirely:
---
root@avocet:~# xl list
Name ID Mem VCPUs State
Time(s)
Domain-0 0 1024 6
r----- 38.9
domu1 1 511 2
-b---- 0.3
root@avocet:~# xl mem-max 1 550m
root@avocet:~# xl mem-set 1 520m
libxl: error: libxl_mem.c:272:libxl_set_memory_target: Domain
1:memory_dynamic_max must be less than or equal to memory_static_max
cannot set domid 1 dynamic max memory to : 520m
---
According to the error messages from above, I assume this patch will not
fix the issues on ARMv7 yet, right?
Thanks so far :)
Cheers,
~Sergej
_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
https://lists.xen.org/xen-devel
^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: ARM: Adjusting guest memory size through xl mem-{set|max} fails
2017-07-19 11:52 ` Sergej Proskurin
@ 2017-07-19 11:57 ` Wei Liu
2017-07-19 12:16 ` Sergej Proskurin
0 siblings, 1 reply; 9+ messages in thread
From: Wei Liu @ 2017-07-19 11:57 UTC (permalink / raw)
To: Sergej Proskurin; +Cc: Xen-devel, Julien Grall, Wei Liu, Ian Jackson
On Wed, Jul 19, 2017 at 01:52:08PM +0200, Sergej Proskurin wrote:
>
> ---
> root@avocet:~# xl list
> Name ID Mem VCPUs State
> Time(s)
> Domain-0 0 1024 6
> r----- 38.9
> domu1 1 511 2
> -b---- 0.3
> root@avocet:~# xl mem-max 1 550m
> root@avocet:~# xl mem-set 1 520m
> libxl: error: libxl_mem.c:272:libxl_set_memory_target: Domain
> 1:memory_dynamic_max must be less than or equal to memory_static_max
>
This is a bit strange. What is the maxmem= in your domain config?
I'm not too sure if you can just use xl mem-max. It's a bit messy in
that area.
> cannot set domid 1 dynamic max memory to : 520m
> ---
>
> According to the error messages from above, I assume this patch will not
> fix the issues on ARMv7 yet, right?
>
The error you saw on ARMv7 is different from the one above afaict. Not
sure if my patch would fix ARMv7. I'm not too familiar with the inner
working of ARM guests.
_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
https://lists.xen.org/xen-devel
^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: ARM: Adjusting guest memory size through xl mem-{set|max} fails
2017-07-19 11:57 ` Wei Liu
@ 2017-07-19 12:16 ` Sergej Proskurin
0 siblings, 0 replies; 9+ messages in thread
From: Sergej Proskurin @ 2017-07-19 12:16 UTC (permalink / raw)
To: Wei Liu; +Cc: Xen-devel, Julien Grall, Ian Jackson
On 07/19/2017 01:57 PM, Wei Liu wrote:
> On Wed, Jul 19, 2017 at 01:52:08PM +0200, Sergej Proskurin wrote:
>> ---
>> root@avocet:~# xl list
>> Name ID Mem VCPUs State
>> Time(s)
>> Domain-0 0 1024 6
>> r----- 38.9
>> domu1 1 511 2
>> -b---- 0.3
>> root@avocet:~# xl mem-max 1 550m
>> root@avocet:~# xl mem-set 1 520m
>> libxl: error: libxl_mem.c:272:libxl_set_memory_target: Domain
>> 1:memory_dynamic_max must be less than or equal to memory_static_max
>>
> This is a bit strange. What is the maxmem= in your domain config?
>
> I'm not too sure if you can just use xl mem-max. It's a bit messy in
> that area.
As far as I remember, it was possible before (at least on Xen 4.7 and
4.8). I have not set the maxmem= option in the domain config at all. I
just specify the amount of memory by means of memory=.
>> cannot set domid 1 dynamic max memory to : 520m
>> ---
>>
>> According to the error messages from above, I assume this patch will not
>> fix the issues on ARMv7 yet, right?
>>
> The error you saw on ARMv7 is different from the one above afaict. Not
> sure if my patch would fix ARMv7. I'm not too familiar with the inner
> working of ARM guests.
Alright. Anyway, I will try your patch also on ARMv7; just to be sure.
But I also don't think that it'll fix the issue.
Thanks,
Sergej
_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
https://lists.xen.org/xen-devel
^ permalink raw reply [flat|nested] 9+ messages in thread
end of thread, other threads:[~2017-07-19 12:16 UTC | newest]
Thread overview: 9+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2017-07-17 12:04 ARM: Adjusting guest memory size through xl mem-{set|max} fails Sergej Proskurin
2017-07-17 13:53 ` Julien Grall
2017-07-17 16:19 ` Sergej Proskurin
2017-07-18 11:16 ` Wei Liu
2017-07-19 9:40 ` Sergej Proskurin
2017-07-19 10:22 ` Wei Liu
2017-07-19 11:52 ` Sergej Proskurin
2017-07-19 11:57 ` Wei Liu
2017-07-19 12:16 ` Sergej Proskurin
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).