mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Chuck Ebbert <76306.1226@compuserve.com>
To: Zachary Amsden <zach@vmware.com>
Cc: linux-kernel <linux-kernel@vger.kernel.org>,
	Chris Wright <chrisw@sous-sol.org>,
	Jan Beulich <JBeulich@novell.com>,
	Xen-devel <xen-devel@lists.xensource.com>,
	Virtualization Mailing List <virtualization@lists.osdl.org>
Subject: Re: [RFC, PATCH 12/24] i386 Vmi processor header
Date: Thu, 16 Mar 2006 11:30:43 -0500	[thread overview]
Message-ID: <200603161133_MC3-1-BACA-4C6C@compuserve.com> (raw)

In-Reply-To: <200603131808.k2DI8KYs005714@zach-dev.vmware.com>

On Mon, 13 Mar 2006 10:08:20 -0800, Zachary Amsden wrote:

> Index: linux-2.6.16-rc5/include/asm-i386/mach-vmi/mach_processor.h
> ===================================================================
> --- linux-2.6.16-rc5.orig/include/asm-i386/mach-vmi/mach_processor.h  2006-03-10 13:03:35.000000000 -0800
> +++ linux-2.6.16-rc5/include/asm-i386/mach-vmi/mach_processor.h       2006-03-10 13:03:35.000000000 -0800
> @@ -0,0 +1,137 @@
> +/*
> + * Copyright (C) 2005, VMware, Inc.
> + *
> + * All rights reserved.
> + *
> + * This program is free software; you can redistribute it and/or modify
> + * it under the terms of the GNU General Public License as published by
> + * the Free Software Foundation; either version 2 of the License, or
> + * (at your option) any later version.
> + *
> + * This program is distributed in the hope that it will be useful, but
> + * WITHOUT ANY WARRANTY; without even the implied warranty of
> + * MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE, GOOD TITLE or
> + * NON INFRINGEMENT.  See the GNU General Public License for more
> + * details.
> + *
> + * You should have received a copy of the GNU General Public License
> + * along with this program; if not, write to the Free Software
> + * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
> + *
> + * Send feedback to zach@vmware.com
> + *
> + */
> +
> +
> +#ifndef _MACH_PROCESSOR_H
> +#define _MACH_PROCESSOR_H
> +
> +#include <vmi.h>
> +
> +static inline void vmi_cpuid(const int op, int *eax, int *ebx, int *ecx, int *edx)
> +{
> +     vmi_wrap_call(
> +             CPUID, "cpuid",
> +             XCONC("=a" (*eax), "=b" (*ebx), "=c" (*ecx), "=d" (*edx)),
> +             1, "a" (op),
> +             VMI_CLOBBER(FOUR_RETURNS));
> +}
> +
> +/*
> + * Generic CPUID function
> + */
> +static inline void cpuid(int op, int *eax, int *ebx, int *ecx, int *edx)
> +{
> +     vmi_cpuid(op, eax, ebx, ecx, edx);
> +}
> +
> +
> +/* Some CPUID calls want 'count' to be placed in ecx */
> +static inline void cpuid_count(int op, int count, int *eax, int *ebx, int *ecx,
> +             int *edx)
> +{
> +     asm volatile(""::"c"(count));
> +     vmi_cpuid(op, eax, ebx, ecx, edx);
> +}

You can't assume those last two statements will stay together.
>From the gcc 4.0.2 info file:

> <...> you can't expect a sequence of volatile `asm' instructions
> to remain perfectly consecutive.  If you want consecutive output, use a
> single `asm'.

Maybe you could make vmi_cpuid always take a 'count' param, then just make cpuid
do:

        vmi_cpuid(op, 0, eax, ebx, ecx, edx);

and cpuid_count do:

        vmi_cpuid(op, count, eax, ebx, ecx, edx);


(And sorry about trimming the cc: but I'm reading from a digest and that list
is too long to enter manually.)

-- 
Chuck
"Penguins don't come from next door, they come from the Antarctic!"

             reply	other threads:[~2006-03-16 16:33 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2006-03-16 16:30 Chuck Ebbert [this message]
2006-03-16 17:47 ` Zachary Amsden
  -- strict thread matches above, loose matches on Subject: below --
2006-03-13 18:08 Zachary Amsden

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=200603161133_MC3-1-BACA-4C6C@compuserve.com \
    --to=76306.1226@compuserve.com \
    --cc=JBeulich@novell.com \
    --cc=chrisw@sous-sol.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=virtualization@lists.osdl.org \
    --cc=xen-devel@lists.xensource.com \
    --cc=zach@vmware.com \
    /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

all inboxes | Powered by JetHome®