From: Jan Beulich <jbeulich@suse.com>
To: "Roger Pau Monné" <roger.pau@citrix.com>, dmkhn@proton.me
Cc: xen-devel@lists.xenproject.org, andrew.cooper3@citrix.com,
anthony.perard@vates.tech, julien@xen.org, michal.orzel@amd.com,
sstabellini@kernel.org, dmukhin@ford.com
Subject: Re: [PATCH v1] x86/domain: revisit logging in arch_domain_create()
Date: Tue, 1 Apr 2025 09:51:53 +0200 [thread overview]
Message-ID: <e87e77ea-0d5b-4fca-abe9-abbb0688ca28@suse.com> (raw)
In-Reply-To: <Z-uO4X_mk8QycVVe@macbook.local>
On 01.04.2025 08:59, Roger Pau Monné wrote:
> On Mon, Mar 31, 2025 at 09:34:24PM +0000, dmkhn@proton.me wrote:
>> --- a/xen/arch/x86/domain.c
>> +++ b/xen/arch/x86/domain.c
>> @@ -798,13 +798,12 @@ int arch_domain_create(struct domain *d,
>> {
>> if ( !opt_allow_unsafe )
>> {
>> - printk(XENLOG_G_ERR "Xen does not allow DomU creation on this CPU"
>> - " for security reasons.\n");
>> + printk(XENLOG_G_ERR "%pd: Xen does not allow DomU creation on this CPU"
>> + " for security reasons.\n", d);
>
> Since you are already touching this, I would switch to gprintk, and
> avoid splitting the lines:
>
> gprintk(XENLOG_ERR,
> "%pd: Xen does not allow DomU creation on this CPU for security reasons.\n",
> d);
>
> Same for the other messages below.
IOW you see value in also logging current->domain?
What I'd like to ask for when touching these log messages is to get rid of
the full stops.
>> return -EPERM;
>> }
>> printk(XENLOG_G_WARNING
>> - "Dom%d may compromise security on this CPU.\n",
>> - d->domain_id);
>> + "%pd: domain may compromise security on this CPU.\n", d);
>> }
>>
>> emflags = config->arch.emulation_flags;
>> @@ -814,16 +813,19 @@ int arch_domain_create(struct domain *d,
>>
>> if ( emflags & ~XEN_X86_EMU_ALL )
>> {
>> - printk(XENLOG_G_ERR "d%d: Invalid emulation bitmap: %#x\n",
>> - d->domain_id, emflags);
>> + printk(XENLOG_G_ERR "%pd: Invalid emulation bitmap: %#x\n",
>> + d, emflags);
>> return -EINVAL;
>> }
>>
>> if ( !emulation_flags_ok(d, emflags) )
>> {
>> - printk(XENLOG_G_ERR "d%d: Xen does not allow %s domain creation "
>> + printk(XENLOG_G_ERR "%pd: Xen does not allow %s %sdomain creation "
>> "with the current selection of emulators: %#x\n",
>> - d->domain_id, is_hvm_domain(d) ? "HVM" : "PV", emflags);
>> + d,
>> + is_hvm_domain(d) ? "HVM" : "PV",
>> + is_hardware_domain(d) ? "(hardware) " : "",
>
> I wouldn't use parentheses around hardware, but that's just my taste.
+1 (provided we really need this extra property logged here)
Jan
next prev parent reply other threads:[~2025-04-01 7:52 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-03-31 21:34 [PATCH v1] x86/domain: revisit logging in arch_domain_create() dmkhn
2025-04-01 6:59 ` Roger Pau Monné
2025-04-01 7:51 ` Jan Beulich [this message]
2025-04-01 13:32 ` Roger Pau Monné
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=e87e77ea-0d5b-4fca-abe9-abbb0688ca28@suse.com \
--to=jbeulich@suse.com \
--cc=andrew.cooper3@citrix.com \
--cc=anthony.perard@vates.tech \
--cc=dmkhn@proton.me \
--cc=dmukhin@ford.com \
--cc=julien@xen.org \
--cc=michal.orzel@amd.com \
--cc=roger.pau@citrix.com \
--cc=sstabellini@kernel.org \
--cc=xen-devel@lists.xenproject.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.