[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>, Julien Grall <julien@xxxxxxx>
  • From: Jan Beulich <jbeulich@xxxxxxxx>
  • Date: Thu, 3 Feb 2022 15:19:11 +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=xMImXoeAqgdJ264Zg4yEYdEmkeDqy4vj7E3LyN4DGd0=; b=dpQIZe6ERi3Qk1SRJt50mA2OzzjqG+6gFd2iRhue1FgKWppeWLP5dD0k3OXz+z3Jn39t13J23ZGNWzKgMTFqczb/lSLOomFQ5sut/3D6wlrdeQMWOTUcJyUOIt1ykVZz8cwpD4H9hek6NY5LGFnT+3Dw/p0J96U5G+L3mIWmb1iH0tdW1VpySryp+c6FQJXXbLLir9c/i8Vim+aFk9ErmOkNflrGQy0uuDf0jPNA6SbxOy9+6DsPtyU1KPfpyjyhRasK7641VdI/v+45Te/dYvdKu8hbYysf871yt+JhGed302fsCEZ53DqM0Vx6BMSaJedQMpN3RVlLQOvZrYgbDQ==
  • Arc-seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=OaSRqxtaAAvbs0U+oABso9pWHlSr8F4l/YLWefIHMDmQ1vOZUn/OGBSNAd4Hm7ptZFKZMpFRQ/juerGqysULLK5NM0crqKHwiqA3iKCuvaYFBh5zKdqObydrEh3TXY62W0liE6aX2JJsrRgEUGHAPHdwKlfa1Yy6lHpmH06Qiu/Q1oFS5UcQk8N1d3UM2KJ5cQQB11ZCGJ5fFHPuE6atCgRnL7SF9aoyF00vS1tMbgKXMykJyIJO4vD/aVF4Ihwr+PWrpwE+WvoG8xUChzPMn0wlHbuqjBOdDV88W9Omk5iylFrnPrPn0Peo0ZYXih/aa7G3vvjmO8BRBwlmMKB5vg==
  • 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>
  • Delivery-date: Thu, 03 Feb 2022 14:19:21 +0000
  • List-id: Xen developer discussion <xen-devel.lists.xenproject.org>

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? The prior
printk() simply ended up defaulting to a warning, and I would think
that's what the new one should be doing too. Or even leave the
setting of the log level to the invocation sites of the macro.

Jan




 


Rackspace

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