From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([208.118.235.92]:58739) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TB2zY-0006Cb-Sv for qemu-devel@nongnu.org; Mon, 10 Sep 2012 08:21:38 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1TB2zU-0006XT-Lq for qemu-devel@nongnu.org; Mon, 10 Sep 2012 08:21:28 -0400 Received: from mx1.redhat.com ([209.132.183.28]:63092) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TB2zU-0006XJ-Dm for qemu-devel@nongnu.org; Mon, 10 Sep 2012 08:21:24 -0400 Date: Mon, 10 Sep 2012 15:21:20 +0300 From: Gleb Natapov Message-ID: <20120910122120.GA20907@redhat.com> References: <5034F587.4000403@dlhnet.de> <5048BA0F.3070300@redhat.com> <504DC9BC.1060407@dlhnet.de> <504DCF1A.1@redhat.com> <504DD483.6050104@dlhnet.de> <504DD9F5.2040300@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <504DD9F5.2040300@redhat.com> Subject: Re: [Qemu-devel] memtest 4.20+ does not work with -cpu host List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Paolo Bonzini Cc: Peter Lieven , Avi Kivity , "kvm@vger.kernel.org" , "qemu-devel@nongnu.org" 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 | xxd > > it 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. > #include > #include > #include > > 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 majordomo@vger.kernel.org > More majordomo info at http://vger.kernel.org/majordomo-info.html -- Gleb.