From: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
To: Ian Campbell <ian.campbell@citrix.com>
Cc: xen-devel@lists.xenproject.org, linux-kernel@vger.kernel.org
Subject: Re: [Xen-devel] [PATCH] xen/hvc: If we use xen_raw_printk let it also work on HVM guests.
Date: Wed, 21 Aug 2013 06:44:24 -0400 [thread overview]
Message-ID: <9a4bcff8-932e-4f32-b64f-469d174e82b3@email.android.com> (raw)
In-Reply-To: <1377076513.31937.22.camel@hastur.hellion.org.uk>
Ian Campbell <ian.campbell@citrix.com> wrote:
>On Tue, 2013-08-20 at 15:35 -0400, Konrad Rzeszutek Wilk wrote:
>> void xen_raw_console_write(const char *str)
>> {
>> - dom0_write_console(0, str, strlen(str));
>> + ssize_t len = strlen(str);
>> + int rc = 0;
>> +
>> + if (xen_domain()) {
>> + rc = dom0_write_console(0, str, len);
>> + if (rc != len && xen_hvm_domain()) /* -ENOSYS */
>
>If you want to catch ENOSYS then I suggest doing so explicitly, rather
>that relying on len != -ENOSYS.
>
>> + goto outb_print;
>
>How about reversing this into
> if (rc == len) return;
> if (rc != -ENOSYS) panic(...) /* yes, this won't get far... *.
>
>Then fall through to the following block as a plain if not an else if.
>Maybe with a xen_hvm_domain && added.
>
>That avoids the yucky goto I think.
>
>> + } else if (xen_cpuid_base()) {
>> + int i;
>> +outb_print:
>> + for (i = 0; i < len; i++)
>> + outb(str[i], 0xe9);
>> + }
>> }
>>
>> void xen_raw_printk(const char *fmt, ...)
B/c the function dom0_write_console never returns negative values. Instead it converts it to a zero return value. Perhaps it can return negative values - will have to look.
next prev parent reply other threads:[~2013-08-21 10:44 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-08-09 14:55 Konrad Rzeszutek Wilk
2013-08-13 20:31 ` [Xen-devel] " Ian Campbell
2013-08-13 20:53 ` Konrad Rzeszutek Wilk
2013-08-13 20:59 ` Ian Campbell
2013-08-13 22:20 ` Ian Campbell
2013-08-14 0:10 ` Konrad Rzeszutek Wilk
2013-08-14 7:15 ` Ian Campbell
2013-08-14 12:46 ` Konrad Rzeszutek Wilk
2013-08-15 14:40 ` Ian Campbell
2013-08-20 19:35 ` Konrad Rzeszutek Wilk
2013-08-21 9:15 ` Ian Campbell
2013-08-21 10:44 ` Konrad Rzeszutek Wilk [this message]
2013-08-22 7:15 ` Ian Campbell
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=9a4bcff8-932e-4f32-b64f-469d174e82b3@email.android.com \
--to=konrad.wilk@oracle.com \
--cc=ian.campbell@citrix.com \
--cc=linux-kernel@vger.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
Powered by JetHome