lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <1377076513.31937.22.camel@hastur.hellion.org.uk>
Date:	Wed, 21 Aug 2013 10:15:13 +0100
From:	Ian Campbell <ian.campbell@...rix.com>
To:	Konrad Rzeszutek Wilk <konrad.wilk@...cle.com>
CC:	<xen-devel@...ts.xenproject.org>, <linux-kernel@...r.kernel.org>
Subject: Re: [Xen-devel] [PATCH] xen/hvc: If we use xen_raw_printk let it
 also work on HVM guests.

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, ...)


--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ