All of lore.kernel.org
 help / color / mirror / Atom feed
From: Avi Kivity <avi@redhat.com>
To: Jan Kiszka <jan.kiszka@web.de>
Cc: Marcelo Tosatti <mtosatti@redhat.com>,
	kvm@vger.kernel.org, qemu-devel@nongnu.org
Subject: Re: [PATCH] i386: wire up MSR_IA32_MISC_ENABLE
Date: Tue, 04 Oct 2011 19:08:19 +0200	[thread overview]
Message-ID: <4E8B3D83.8050903@redhat.com> (raw)
In-Reply-To: <4E8B2EB8.80408@web.de>

On 10/04/2011 06:05 PM, Jan Kiszka wrote:
> On 2011-10-04 16:26, Avi Kivity wrote:
> >  It's needed for its default value - bit 0 specifies that "rep movs" is
> >  good enough for memcpy, and Linux may use a slower memcpu if it is not set,
> >  depending on cpu family/model.
> >
> >  Signed-off-by: Avi Kivity<avi@redhat.com>
> >  ---
> >   target-i386/cpu.h       |    5 +++++
> >   target-i386/helper.c    |    1 +
> >   target-i386/kvm.c       |   15 +++++++++++++++
> >   target-i386/machine.c   |   21 +++++++++++++++++++++
> >   target-i386/op_helper.c |    6 ++++++
> >   5 files changed, 48 insertions(+), 0 deletions(-)
> >
> >  diff --git a/target-i386/cpu.h b/target-i386/cpu.h
> >  index ae36489..5416809 100644
> >  --- a/target-i386/cpu.h
> >  +++ b/target-i386/cpu.h
> >  @@ -299,6 +299,10 @@
> >
> >   #define MSR_IA32_PERF_STATUS            0x198
> >
> >  +#define MSR_IA32_MISC_ENABLE		0x1a0
>
> I smell tabs...

Oops.  Cut'n'paste flew underneath the emacs radar.

> >  +
> >  +static const VMStateDescription vmstate_msr_ia32_misc_enable = {
> >  +    .name = "cpu/msr_ia32_misc_enable",
> >  +    .version_id = 1,
> >  +    .minimum_version_id = 1,
> >  +    .minimum_version_id_old = 1,
> >  +    .fields      = (VMStateField []) {
> >  +        VMSTATE_UINT64(msr_ia32_misc_enable, CPUState),
> >  +        VMSTATE_END_OF_LIST()
> >  +    }
> >  +};
> >  +
>
> We are about to bump the CPU_SAVE_VERSION for the sake of APIC deadline
> timer, so you can jump on that train and avoid this subsection.

Must we do that?  Considering that no guest will use the deadline timer, 
it seems to be an excellent candidates for subsections.

> >  diff --git a/target-i386/op_helper.c b/target-i386/op_helper.c
> >  index 3bb5a91..c89e4a4 100644
> >  --- a/target-i386/op_helper.c
> >  +++ b/target-i386/op_helper.c
> >  @@ -3280,6 +3280,9 @@ void helper_wrmsr(void)
> >       case MSR_TSC_AUX:
> >           env->tsc_aux = val;
> >           break;
> >  +    case MSR_IA32_MISC_ENABLE:
> >  +        env->msr_ia32_misc_enable = val;
> >  +        break;
>
> This MSR is Intel-specific, isn't it? Then I guess it should be limited
> to Intel CPU types.

It's an "architectural MSR" that is only available on some Intel 
models.  Either we do a full cpuid qualification of accessible MSRs (and 
bits within MSRs), or not.  Qualifying just by vendor ID is pointless.

-- 
error compiling committee.c: too many arguments to function


WARNING: multiple messages have this Message-ID (diff)
From: Avi Kivity <avi@redhat.com>
To: Jan Kiszka <jan.kiszka@web.de>
Cc: Marcelo Tosatti <mtosatti@redhat.com>,
	qemu-devel@nongnu.org, kvm@vger.kernel.org
Subject: Re: [Qemu-devel] [PATCH] i386: wire up MSR_IA32_MISC_ENABLE
Date: Tue, 04 Oct 2011 19:08:19 +0200	[thread overview]
Message-ID: <4E8B3D83.8050903@redhat.com> (raw)
In-Reply-To: <4E8B2EB8.80408@web.de>

On 10/04/2011 06:05 PM, Jan Kiszka wrote:
> On 2011-10-04 16:26, Avi Kivity wrote:
> >  It's needed for its default value - bit 0 specifies that "rep movs" is
> >  good enough for memcpy, and Linux may use a slower memcpu if it is not set,
> >  depending on cpu family/model.
> >
> >  Signed-off-by: Avi Kivity<avi@redhat.com>
> >  ---
> >   target-i386/cpu.h       |    5 +++++
> >   target-i386/helper.c    |    1 +
> >   target-i386/kvm.c       |   15 +++++++++++++++
> >   target-i386/machine.c   |   21 +++++++++++++++++++++
> >   target-i386/op_helper.c |    6 ++++++
> >   5 files changed, 48 insertions(+), 0 deletions(-)
> >
> >  diff --git a/target-i386/cpu.h b/target-i386/cpu.h
> >  index ae36489..5416809 100644
> >  --- a/target-i386/cpu.h
> >  +++ b/target-i386/cpu.h
> >  @@ -299,6 +299,10 @@
> >
> >   #define MSR_IA32_PERF_STATUS            0x198
> >
> >  +#define MSR_IA32_MISC_ENABLE		0x1a0
>
> I smell tabs...

Oops.  Cut'n'paste flew underneath the emacs radar.

> >  +
> >  +static const VMStateDescription vmstate_msr_ia32_misc_enable = {
> >  +    .name = "cpu/msr_ia32_misc_enable",
> >  +    .version_id = 1,
> >  +    .minimum_version_id = 1,
> >  +    .minimum_version_id_old = 1,
> >  +    .fields      = (VMStateField []) {
> >  +        VMSTATE_UINT64(msr_ia32_misc_enable, CPUState),
> >  +        VMSTATE_END_OF_LIST()
> >  +    }
> >  +};
> >  +
>
> We are about to bump the CPU_SAVE_VERSION for the sake of APIC deadline
> timer, so you can jump on that train and avoid this subsection.

Must we do that?  Considering that no guest will use the deadline timer, 
it seems to be an excellent candidates for subsections.

> >  diff --git a/target-i386/op_helper.c b/target-i386/op_helper.c
> >  index 3bb5a91..c89e4a4 100644
> >  --- a/target-i386/op_helper.c
> >  +++ b/target-i386/op_helper.c
> >  @@ -3280,6 +3280,9 @@ void helper_wrmsr(void)
> >       case MSR_TSC_AUX:
> >           env->tsc_aux = val;
> >           break;
> >  +    case MSR_IA32_MISC_ENABLE:
> >  +        env->msr_ia32_misc_enable = val;
> >  +        break;
>
> This MSR is Intel-specific, isn't it? Then I guess it should be limited
> to Intel CPU types.

It's an "architectural MSR" that is only available on some Intel 
models.  Either we do a full cpuid qualification of accessible MSRs (and 
bits within MSRs), or not.  Qualifying just by vendor ID is pointless.

-- 
error compiling committee.c: too many arguments to function

  reply	other threads:[~2011-10-04 17:08 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-10-04 14:26 [PATCH] i386: wire up MSR_IA32_MISC_ENABLE Avi Kivity
2011-10-04 14:26 ` [Qemu-devel] " Avi Kivity
2011-10-04 16:05 ` Jan Kiszka
2011-10-04 16:05   ` [Qemu-devel] " Jan Kiszka
2011-10-04 17:08   ` Avi Kivity [this message]
2011-10-04 17:08     ` Avi Kivity
2011-10-04 17:14     ` Jan Kiszka
2011-10-04 17:14       ` [Qemu-devel] " Jan Kiszka
2011-10-04 17:21       ` Avi Kivity
2011-10-04 17:21         ` [Qemu-devel] " Avi Kivity
2011-10-04 17:24         ` Jan Kiszka
2011-10-04 17:24           ` [Qemu-devel] " Jan Kiszka
2011-10-04 17:51           ` Avi Kivity
2011-10-04 17:51             ` [Qemu-devel] " Avi Kivity

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=4E8B3D83.8050903@redhat.com \
    --to=avi@redhat.com \
    --cc=jan.kiszka@web.de \
    --cc=kvm@vger.kernel.org \
    --cc=mtosatti@redhat.com \
    --cc=qemu-devel@nongnu.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.