All of lore.kernel.org
 help / color / mirror / Atom feed
From: Avi Kivity <avi@redhat.com>
To: Marcelo Tosatti <mtosatti@redhat.com>
Cc: kvm@vger.kernel.org
Subject: Re: [patch 3/3] Add mce test
Date: Mon, 06 Sep 2010 17:53:20 +0300	[thread overview]
Message-ID: <4C850060.2000303@redhat.com> (raw)
In-Reply-To: <20100905211722.GA3030@amt.cnet>

  On 09/06/2010 12:17 AM, Marcelo Tosatti wrote:
> On Sun, Sep 05, 2010 at 11:15:16AM +0300, Avi Kivity wrote:
>>   On 09/03/2010 02:36 AM, Marcelo Tosatti wrote:
>>> +
>>> +int main(void)
>>> +{
>>> +    unsigned long long status, addr;
>>> +    int bank;
>>> +
>>> +    smp_init();
>>> +    init_idt();
>>> +    set_idt_entry(18, do_handle_mce);
>>> +
>>> +    write_cr4(read_cr4() | X86_CR4_MCE);
>>> +
>>> +    wrmsr(MSR_IA32_MCG_CTL, ~0ULL);
>>> +    wrmsr(MSR_IA32_MC0_CTL, ~0ULL);
>>> +
>>> +    status = MCI_STATUS_VAL|MCI_STATUS_UC;
>>> +    addr = 0x7ffffff;
>>> +    bank = 0;
>>> +    ex_done = 0;
>>> +    /* mce cpu bank status mcgstatus addr misc */
>>> +    monitor_printf("mce %d %d 0x%llx 1 0x%llx 1\n", 0, bank, status, addr);
>> Wow, this is really evil.
>>
>> I guess it could be done more nicely via the api unit tests we
>> talked about during kf2010?
> I don't remember the details.

Map gpa:hva 1:1; map gva:gpa 1:1; do direct calls between host userspace 
and guest kernel.

Hope to post a patch soon.

> What do you consider evil?

Not really evil.  It's a nice roundabout loop guest -> testdev -> 
chardev -> host -> chardev -> monitor -> kvm -> guest.

Works well, but only for features that are directly controlled via the 
monitor.  To test save/restore (for vcpu events or fpu) we need 
something more direct (guest -> host userspace -> guest).

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


      reply	other threads:[~2010-09-06 14:53 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-09-02 23:36 [patch 0/3] add mce test Marcelo Tosatti
2010-09-02 23:36 ` [patch 1/3] kvm test: add monitor_printf Marcelo Tosatti
2010-09-03  7:56   ` Paolo Bonzini
2010-09-03 16:48     ` Marcelo Tosatti
2010-09-03 17:23   ` [patch 1/3] kvm test: add monitor_printf (v2) Marcelo Tosatti
2010-09-02 23:36 ` [patch 2/3] kvm test: add kvm-unit.cfg Marcelo Tosatti
2010-09-02 23:36 ` [patch 3/3] Add mce test Marcelo Tosatti
2010-09-05  8:15   ` Avi Kivity
2010-09-05 21:17     ` Marcelo Tosatti
2010-09-06 14:53       ` Avi Kivity [this message]

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=4C850060.2000303@redhat.com \
    --to=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 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.