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] [day] [month] [year] [list]
Message-Id: <1163815686.5374.12.camel@localhost.localdomain>
Date:	Fri, 17 Nov 2006 18:08:06 -0800
From:	john stultz <johnstul@...ibm.com>
To:	Rusty Russell <rusty@...tcorp.com.au>
Cc:	Andi Kleen <ak@....de>, Andi Kleen <ak@...e.de>,
	virtualization@...ts.osdl.org, Chris Wright <chrisw@...s-sol.org>,
	akpm@...l.org, linux-kernel@...r.kernel.org
Subject: Re: [PATCH 1/7] paravirtualization: header and stubs for
	paravirtualizing critical operations

On Wed, 2006-11-01 at 21:27 +1100, Rusty Russell wrote:
> Create a paravirt.h header for all the critical operations which need
> to be replaced with hypervisor calls, and include that instead of
> defining native operations, when CONFIG_PARAVIRT.
> 
> This patch does the dumbest possible replacement of paravirtualized
> instructions: calls through a "paravirt_ops" structure.  Currently
> these are function implementations of native hardware: hypervisors
> will override the ops structure with their own variants.
> 
[snip]

> +struct paravirt_ops paravirt_ops = {
> +	.name = "bare hardware",
[snip]
> +	.get_wallclock = native_get_wallclock,
> +	.set_wallclock = native_set_wallclock,

[snip]

> --- /dev/null
> +++ b/include/asm-i386/time.h
> @@ -0,0 +1,41 @@
> +#ifndef _ASMi386_TIME_H
> +#define _ASMi386_TIME_H
> +
> +#include <linux/efi.h>
> +#include "mach_time.h"
> +
> +static inline unsigned long native_get_wallclock(void)
> +{
> +	unsigned long retval;
> +
> +	if (efi_enabled)
> +		retval = efi_get_time();
> +	else
> +		retval = mach_get_cmos_time();
> +
> +	return retval;
> +}
> +
> +static inline int native_set_wallclock(unsigned long nowtime)
> +{
> +	int retval;
> +
> +	if (efi_enabled)
> +		retval = efi_set_rtc_mmss(nowtime);
> +	else
> +		retval = mach_set_rtc_mmss(nowtime);
> +
> +	return retval;
> +}
> +
> +#ifdef CONFIG_PARAVIRT
> +#include <asm/paravirt.h>
> +#else /* !CONFIG_PARAVIRT */
> +
> +#define get_wallclock() native_get_wallclock()
> +#define set_wallclock(x) native_set_wallclock(x)


Could a better name then "get/set_wallclock" be used here? Its too vague
and would be easily confused with do_set/gettimeofday() functions.

My suggestion would be to use "persistent_clock" to describe the
battery-backed CMOS/hardware clock. (I assume that is what you intend
this paravirt_op to be, rather then get the high-resolution system
timeofday)

thanks
-john


-
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