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

Re: [PATCH] xen: Modify domain_crash() to take a print string


  • To: Andrew Cooper <Andrew.Cooper3@xxxxxxxxxx>
  • From: Jan Beulich <jbeulich@xxxxxxxx>
  • Date: Thu, 3 Feb 2022 16:06:59 +0100
  • Arc-authentication-results: i=1; mx.microsoft.com 1; spf=none; dmarc=none; dkim=none; 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=Js3txiK8y2wuTcENUZZgLbSeBUUXCipYNEd2R8WFlyQ=; b=Mf6qS7vlTX0AFye+EID00BBNstmwXQfSeNKFvCCLFoPBvWfuzsRj8gO2EI83ab9AB819ia3igotb3wRjnfeIgHExB+x9KpIBhfIrtCjSwHLXbjGC6/Ma73Aqyv//mC7zMlQm4ckq8q5o+qStcPB36M2pQDhUadJxBsggFU/wU5t4lEgrv/XrZUCumAjIG+cY2hO311a4ecoQrJsu1eKPkPBZIXE48GU8tSfYLcpoQ098raodq/CpHZIIX0FSNpJ5HEduJlZVCOQaCVZWe4LBi27J9z3P9ojv4D+UxJEQfQS66s+WJM01PFngEUfrHc1B/MIzfhoS+FWoOo7v7DLPIQ==
  • Arc-seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=oP0jizxOElE1U9WSjjpR3t98t+XQrd5ulTs4mudeGb28xXyA5H5rigw+FMvSBwEqGiUbktqMENQpuDv0gob/ojfQGIIwZ1+P5hsazrTzGChF3UpcZBKB6s5+JYfbYkpEXA/eCDokOhhGk+xOhKVVajOL1MmPcSCBrfjk0bzt0IAwtXUKKQG4sm/uUUY/XuBjvnYuV0FdawwGwfckNpAXkHgkAhyI9zN+Zt3x6pdGkwftyiXl9HbLfiBPBcgynLYlqyRUyyXSw3BwCx+zlY3W+poOMXUwxo6S+nPg9hFZ9Yxfy/qFPwChILlR8KwSkzoC+swEUbkTRX7DBS6DsEL/9Q==
  • Authentication-results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=suse.com;
  • Cc: Roger Pau Monne <roger.pau@xxxxxxxxxx>, Wei Liu <wl@xxxxxxx>, Stefano Stabellini <sstabellini@xxxxxxxxxx>, Volodymyr Babchuk <Volodymyr_Babchuk@xxxxxxxx>, Bertrand Marquis <bertrand.marquis@xxxxxxx>, Xen-devel <xen-devel@xxxxxxxxxxxxxxxxxxxx>, Julien Grall <julien@xxxxxxx>
  • Delivery-date: Thu, 03 Feb 2022 15:07:19 +0000
  • List-id: Xen developer discussion <xen-devel.lists.xenproject.org>

On 03.02.2022 15:41, Andrew Cooper wrote:
> On 03/02/2022 14:19, Jan Beulich wrote:
>> On 03.02.2022 15:11, Andrew Cooper wrote:
>>> On 03/02/2022 13:48, Julien Grall wrote:
>>>> On 03/02/2022 13:38, Andrew Cooper wrote:
>>>>> diff --git a/xen/include/xen/sched.h b/xen/include/xen/sched.h
>>>>> index 37f78cc4c4c9..38b390d20371 100644
>>>>> --- a/xen/include/xen/sched.h
>>>>> +++ b/xen/include/xen/sched.h
>>>>> @@ -736,10 +736,15 @@ void vcpu_end_shutdown_deferral(struct vcpu *v);
>>>>>    * from any processor.
>>>>>    */
>>>>>   void __domain_crash(struct domain *d);
>>>>> -#define domain_crash(d) do
>>>>> {                                              \
>>>>> -    printk("domain_crash called from %s:%d\n", __FILE__,
>>>>> __LINE__);       \
>>>>> -   
>>>>> __domain_crash(d);                                                    \
>>>>> -} while (0)
>>>>> +#define domain_crash(d, ...)                            \
>>>>> +    do {                                                \
>>>>> +        if ( count_args(__VA_ARGS__) == 0 )             \
>>>>> +            printk("domain_crash called from %s:%d\n",  \
>>>>> +                   __FILE__, __LINE__);                 \
>>>> I find a bit odd that here you are using a normal printk
>>> That's unmodified from before.  Only reformatted.
>>>
>>>> but...
>>>>
>>>>
>>>>> +        else                                            \
>>>>> +            printk(XENLOG_G_ERR __VA_ARGS__);           \
>>>> here it is XENLOG_G_ERR. In fact, isn't it ratelimited? If so,
>>>> wouldn't it be better to only use XENLOG_ERR so they can always be
>>>> seen? (A domain shouldn't be able to abuse it).
>>> Perhaps.  I suppose it is more important information than pretty much
>>> anything else about the guest.
>> Indeed, but then - is this really an error in all cases?
> 
> Yes.  It is always a fatal event for the VM.

Which may or may not be Xen's fault. If the guest put itself in a bad
state, I don't see why we shouldn't consider such just a warning. IOW
I continue to think a log level, if so wanted, should be supplied by
the user of the macro.

Jan




 


Rackspace

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