public inbox for kvm@vger.kernel.org
 help / color / mirror / Atom feed
From: Gleb Natapov <gleb@redhat.com>
To: Avi Kivity <avi@redhat.com>
Cc: mtosatti@redhat.com, kvm@vger.kernel.org
Subject: Re: [PATCH unit-tests 06/16] Specify correct operand length for ltr and str.
Date: Wed, 29 Dec 2010 11:40:15 +0200	[thread overview]
Message-ID: <20101229094015.GA32688@redhat.com> (raw)
In-Reply-To: <4D1B0176.60504@redhat.com>

On Wed, Dec 29, 2010 at 11:37:58AM +0200, Avi Kivity wrote:
> On 12/22/2010 05:06 PM, Gleb Natapov wrote:
> >Signed-off-by: Gleb Natapov<gleb@redhat.com>
> >---
> >  lib/x86/processor.h |    4 ++--
> >  1 files changed, 2 insertions(+), 2 deletions(-)
> >
> >diff --git a/lib/x86/processor.h b/lib/x86/processor.h
> >index c348808..c3ab109 100644
> >--- a/lib/x86/processor.h
> >+++ b/lib/x86/processor.h
> >@@ -193,13 +193,13 @@ static inline u16 sldt(void)
> >
> >  static inline void ltr(unsigned val)
> >  {
> >-    asm volatile ("ltr %0" : : "rm"(val));
> >+    asm volatile ("ltr %w0" : : "rm"(val));
> >  }
> 
> Is this really needed?  And isn't this done better by declaring 'u16 val'?
> 
> >
> >  static inline u16 str(void)
> >  {
> >      u16 val;
> >-    asm volatile ("str %0" : "=rm"(val));
> >+    asm volatile ("str %w0" : "=rm"(val));
> >      return val;
> >  }
> >
> 
> This looks completely unneeded, since val is already a u16.
> 
IIRC I got errors from assembler. Will recheck.

--
			Gleb.

  reply	other threads:[~2010-12-29  9:40 UTC|newest]

Thread overview: 22+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-12-22 15:06 [PATCH unit-tests 00/16] task switch and event injection tests Gleb Natapov
2010-12-22 15:06 ` [PATCH unit-tests 01/16] Move idt.c into lib code Gleb Natapov
2010-12-22 15:06 ` [PATCH unit-tests 02/16] Make access.c use library functions Gleb Natapov
2010-12-22 15:06 ` [PATCH unit-tests 03/16] Remove duplicated idt code from apic test Gleb Natapov
2010-12-22 15:06 ` [PATCH unit-tests 04/16] Remove unused function " Gleb Natapov
2010-12-22 15:06 ` [PATCH unit-tests 05/16] Rename idt.[ch] into desc.[ch] Gleb Natapov
2010-12-29  9:38   ` Avi Kivity
2010-12-22 15:06 ` [PATCH unit-tests 06/16] Specify correct operand length for ltr and str Gleb Natapov
2010-12-29  9:37   ` Avi Kivity
2010-12-29  9:40     ` Gleb Natapov [this message]
2010-12-29  9:43       ` Gleb Natapov
2010-12-29  9:47         ` Avi Kivity
2010-12-22 15:06 ` [PATCH unit-tests 07/16] Move irq_(enable|disable) into library code Gleb Natapov
2010-12-22 15:06 ` [PATCH unit-tests 08/16] Add another task switch test Gleb Natapov
2010-12-22 15:06 ` [PATCH unit-tests 09/16] Move vm.[ch] info library code Gleb Natapov
2010-12-22 15:06 ` [PATCH unit-tests 10/16] Fix mmu on 32 bit Gleb Natapov
2010-12-22 15:06 ` [PATCH unit-tests 11/16] Set WP bit in CR0 to make write protection work Gleb Natapov
2010-12-22 15:06 ` [PATCH unit-tests 12/16] Fix exception handling on i386 arch Gleb Natapov
2010-12-22 15:06 ` [PATCH unit-tests 13/16] Move handle_irq() from apic test into library code Gleb Natapov
2010-12-22 15:06 ` [PATCH unit-tests 14/16] Add handle_exception() interface Gleb Natapov
2010-12-22 15:06 ` [PATCH unit-tests 15/16] Move invlpg() into library code Gleb Natapov
2010-12-22 15:06 ` [PATCH unit-tests 16/16] Add even injection test Gleb Natapov

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=20101229094015.GA32688@redhat.com \
    --to=gleb@redhat.com \
    --cc=avi@redhat.com \
    --cc=kvm@vger.kernel.org \
    --cc=mtosatti@redhat.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