|
From: | Peter Lieven |
Subject: | Re: [Qemu-devel] memtest 4.20+ does not work with -cpu host |
Date: | Mon, 10 Sep 2012 14:29:43 +0200 |
User-agent: | Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.9.2.24) Gecko/20111108 Thunderbird/3.1.16 |
On 09/10/12 14:21, Gleb Natapov wrote:
rdmsr returns it cannot read those MSRs. regardless if I use -cpu host or -cpu qemu64.On Mon, Sep 10, 2012 at 02:15:49PM +0200, Paolo Bonzini wrote:Il 10/09/2012 13:52, Peter Lieven ha scritto:dd if=/dev/cpu/0/msr skip=$((0x194)) bs=8 count=1 | xxd dd if=/dev/cpu/0/msr skip=$((0xCE)) bs=8 count=1 | xxdit only works without the skip. but the msr device returns all zeroes.Hmm, the strange API of the MSR device doesn't work well with dd (dd skips to 0x194 * 8 because bs is 8. You can try this program:There is rdmsr/wrmsr in msr-tools.
peter
#include<fcntl.h> #include<stdio.h> #include<stdlib.h> int rdmsr(int fd, long reg) { char msg[40]; long long val; sprintf(msg, "rdmsr(%#x)", reg); if (pread(fd,&val, 8, reg)< 0) { perror(msg); } else { printf("%s: %#016llx\n", msg, val); fflush(stdout); } } int main() { int fd = open("/dev/cpu/0/msr", O_RDONLY); if (fd< 0) { perror("open"); exit(1); } rdmsr(fd, 0x194); rdmsr(fd, 0xCE); } Paolo -- To unsubscribe from this list: send the line "unsubscribe kvm" in the body of a message to address@hidden More majordomo info at http://vger.kernel.org/majordomo-info.html-- Gleb.
[Prev in Thread] | Current Thread | [Next in Thread] |