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

Re: [PATCH v10 2/9] xen: do not free reserved memory into heap


  • To: Julien Grall <julien@xxxxxxx>, Penny Zheng <Penny.Zheng@xxxxxxx>
  • From: Jan Beulich <jbeulich@xxxxxxxx>
  • Date: Wed, 24 Aug 2022 12:42:24 +0200
  • Arc-authentication-results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=suse.com; dmarc=pass action=none header.from=suse.com; dkim=pass header.d=suse.com; arc=none
  • Arc-message-signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=bYcjVrWhIRhByjbAsj0XKTTuIp54RW0MRu/QBcwaDpM=; b=Jj0ke63y+31Ut4H3SMhvJNguMHDKCbS7KdBi/lxmGMlEaJix2nGpEyESTvUaEUfAOjlFVfSeegR7g2gq/ob/Q1BYKgtEOCQAs6xYrPRwY+4ioBFVqQD/BMBBcRziPw6N0upXfbKWHr/ZOHursYrPOBdS4CiN/DLDWpO1RcGF49U572KZSr6kaZo2K5rMwTbTxQ+cu7rgglBY1ricN9s4TjSy2zkAz5EgG7aJede9B8E2WlA18TYM6S4F/OHSCeBnhW3QiFgXeeOi47R1GRI56tMdWkt68m1Cc1JdAJVt6/aLi+NIm1yfflWNFdN/bUgs7o1x6x+CBKvbR1YnS5jdfg==
  • Arc-seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=XGVOW/KBlGUGBOsNMEcN1LcDF8nUie208+t6cSopyu4v3MnyVSYw4EJ2BxIPNhXon1xMka9WR45pskh+e4WHZQ1sNKYDYGhGEu32KhSS4MgNp0sz1ddmx9YA+gxR2eY4pJ3ccDnZeIWxk/cA2B8TWTou4+1c4OjzmXpPHfXBdhDZuvFEj3cXT6fQyQ9uY2wsNIep/IC2OOvw2HVlaD7YJKS8AG8ciKeQJJ86VvNomQZMKQt/yt67kFfgppZ+L3S4op/W94dr84K6Uj1Rs4j8Ptn8RUMtX4HuRrg0P6RSdoccs/xTNxUBThFujuUORqbu01ars9UeHDqjSmHpp2A9Cg==
  • Authentication-results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=suse.com;
  • Cc: wei.chen@xxxxxxx, Stefano Stabellini <sstabellini@xxxxxxxxxx>, Bertrand Marquis <bertrand.marquis@xxxxxxx>, Volodymyr Babchuk <Volodymyr_Babchuk@xxxxxxxx>, Andrew Cooper <andrew.cooper3@xxxxxxxxxx>, George Dunlap <george.dunlap@xxxxxxxxxx>, Wei Liu <wl@xxxxxxx>, Julien Grall <jgrall@xxxxxxxxxx>, xen-devel@xxxxxxxxxxxxxxxxxxxx
  • Delivery-date: Wed, 24 Aug 2022 10:42:31 +0000
  • List-id: Xen developer discussion <xen-devel.lists.xenproject.org>

On 24.08.2022 11:03, Julien Grall wrote:
> Hi,
> 
> On 16/08/2022 07:40, Jan Beulich wrote:
>> On 16.08.2022 04:36, Penny Zheng wrote:
>>> +void free_domstatic_page(struct page_info *page)
>>> +{
>>> +    struct domain *d = page_get_owner(page);
>>> +    bool drop_dom_ref;
>>> +
>>> +    if ( unlikely(!d) )
>>> +    {
>>> +        ASSERT_UNREACHABLE();
>>> +        printk("The about-to-free static page %"PRI_mfn" must be owned by 
>>> a domain\n",
>>> +               mfn_x(page_to_mfn(page)));
>>> +        return;
>>> +    }
>>
>> For the message to be useful as a hint if the assertion triggers, it
>> wants printing ahead of the assertion. I also think it wants to be a
>> XENLOG_G_* kind of log level, so it would be rate limited by default
>> in release builds. Just to be on the safe side.
> 
> +1
> 
>> (I'm not in favor of
>> the log message in the first place, but I do know that Julien had
>> asked for one.)
> TBH, I think all ASSERT_UNREACHABLE() paths should be accompanied with a 
> printk().

If you want more than just the line number, use ASSERT() with a meaningful
expression. That'll be easily a fair replacement for a separate printk().
And no, as said in reply to Jürgen's patch, ASSERT() and friends should
not leave any traces in non-debug builds. If you want such, use WARN_ON()
or BUG_ON().

Jan



 


Rackspace

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