public inbox for kvm@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH][QEMU] vmxcap: Open MSR file in unbuffered mode
@ 2013-02-13 11:43 Jan Kiszka
  2013-02-14  7:55 ` Gleb Natapov
  0 siblings, 1 reply; 4+ messages in thread
From: Jan Kiszka @ 2013-02-13 11:43 UTC (permalink / raw)
  To: Marcelo Tosatti, Gleb Natapov; +Cc: qemu-devel, kvm

Python may otherwise decide to to read larger chunks, applying the seek
only on the software buffer. This will return results from the wrong
MSRs.

Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com>
---
 scripts/kvm/vmxcap |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/scripts/kvm/vmxcap b/scripts/kvm/vmxcap
index 0b23f77..6363e73 100755
--- a/scripts/kvm/vmxcap
+++ b/scripts/kvm/vmxcap
@@ -27,9 +27,9 @@ MSR_IA32_VMX_VMFUNC = 0x491
 class msr(object):
     def __init__(self):
         try:
-            self.f = file('/dev/cpu/0/msr')
+            self.f = open('/dev/cpu/0/msr', 'r', 0)
         except:
-            self.f = file('/dev/msr0')
+            self.f = open('/dev/msr0', 'r', 0)
     def read(self, index, default = None):
         import struct
         self.f.seek(index)
-- 
1.7.3.4

^ permalink raw reply related	[flat|nested] 4+ messages in thread

* Re: [PATCH][QEMU] vmxcap: Open MSR file in unbuffered mode
  2013-02-13 11:43 [PATCH][QEMU] vmxcap: Open MSR file in unbuffered mode Jan Kiszka
@ 2013-02-14  7:55 ` Gleb Natapov
  2013-02-14 10:25   ` [Qemu-devel] " Andreas Färber
  0 siblings, 1 reply; 4+ messages in thread
From: Gleb Natapov @ 2013-02-14  7:55 UTC (permalink / raw)
  To: Jan Kiszka; +Cc: Marcelo Tosatti, kvm, qemu-devel

On Wed, Feb 13, 2013 at 12:43:10PM +0100, Jan Kiszka wrote:
> Python may otherwise decide to to read larger chunks, applying the seek
> only on the software buffer. This will return results from the wrong
> MSRs.
> 
> Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com>
Applied, thanks.

> ---
>  scripts/kvm/vmxcap |    4 ++--
>  1 files changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/scripts/kvm/vmxcap b/scripts/kvm/vmxcap
> index 0b23f77..6363e73 100755
> --- a/scripts/kvm/vmxcap
> +++ b/scripts/kvm/vmxcap
> @@ -27,9 +27,9 @@ MSR_IA32_VMX_VMFUNC = 0x491
>  class msr(object):
>      def __init__(self):
>          try:
> -            self.f = file('/dev/cpu/0/msr')
> +            self.f = open('/dev/cpu/0/msr', 'r', 0)
>          except:
> -            self.f = file('/dev/msr0')
> +            self.f = open('/dev/msr0', 'r', 0)
>      def read(self, index, default = None):
>          import struct
>          self.f.seek(index)
> -- 
> 1.7.3.4

--
			Gleb.

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [Qemu-devel] [PATCH][QEMU] vmxcap: Open MSR file in unbuffered mode
  2013-02-14  7:55 ` Gleb Natapov
@ 2013-02-14 10:25   ` Andreas Färber
  2013-02-14 12:02     ` Gleb Natapov
  0 siblings, 1 reply; 4+ messages in thread
From: Andreas Färber @ 2013-02-14 10:25 UTC (permalink / raw)
  To: Gleb Natapov; +Cc: Jan Kiszka, Marcelo Tosatti, qemu-devel, kvm

Am 14.02.2013 08:55, schrieb Gleb Natapov:
> On Wed, Feb 13, 2013 at 12:43:10PM +0100, Jan Kiszka wrote:
>> Python may otherwise decide to to read larger chunks, applying the seek
>> only on the software buffer. This will return results from the wrong
>> MSRs.
>>
>> Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com>
> Applied, thanks.

Could you please fix the "to to"? :)

Andreas

-- 
SUSE LINUX Products GmbH, Maxfeldstr. 5, 90409 Nürnberg, Germany
GF: Jeff Hawn, Jennifer Guild, Felix Imendörffer; HRB 16746 AG Nürnberg

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH][QEMU] vmxcap: Open MSR file in unbuffered mode
  2013-02-14 10:25   ` [Qemu-devel] " Andreas Färber
@ 2013-02-14 12:02     ` Gleb Natapov
  0 siblings, 0 replies; 4+ messages in thread
From: Gleb Natapov @ 2013-02-14 12:02 UTC (permalink / raw)
  To: Andreas Färber; +Cc: Jan Kiszka, Marcelo Tosatti, qemu-devel, kvm

On Thu, Feb 14, 2013 at 11:25:05AM +0100, Andreas Färber wrote:
> Am 14.02.2013 08:55, schrieb Gleb Natapov:
> > On Wed, Feb 13, 2013 at 12:43:10PM +0100, Jan Kiszka wrote:
> >> Python may otherwise decide to to read larger chunks, applying the seek
> >> only on the software buffer. This will return results from the wrong
> >> MSRs.
> >>
> >> Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com>
> > Applied, thanks.
> 
> Could you please fix the "to to"? :)
> 
Too too late :( Pushed already.

--
			Gleb.

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2013-02-14 12:02 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-02-13 11:43 [PATCH][QEMU] vmxcap: Open MSR file in unbuffered mode Jan Kiszka
2013-02-14  7:55 ` Gleb Natapov
2013-02-14 10:25   ` [Qemu-devel] " Andreas Färber
2013-02-14 12:02     ` Gleb Natapov

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox