From: Rusty Russell <rusty@rustcorp.com.au>
To: Marcelo Tosatti <mtosatti@redhat.com>,
Rusty Russell <rusty.russell@linaro.org>
Cc: kvm@vger.kernel.org, Avi Kivity <avi@redhat.com>,
Christoffer Dall <c.dall@virtualopensystems.com>,
Alexander Graf <agraf@suse.de>,
Peter Maydell <peter.maydell@linaro.org>
Subject: Re: [PATCH 3/3] KVM: Add KVM_VCPU_GET_REG_LIST/KVM_CAP_REG_LIST.
Date: Thu, 11 Oct 2012 18:41:47 +1030 [thread overview]
Message-ID: <87lifd77i4.fsf@rustcorp.com.au> (raw)
In-Reply-To: <20121010181239.GA10649@amt.cnet>
Marcelo Tosatti <mtosatti@redhat.com> writes:
> On Wed, Sep 05, 2012 at 05:28:46PM +0930, Rusty Russell wrote:
...
>> +struct kvm_reg_list {
>> + __u64 n; /* number of registers in reg[] */
>> + __u64 reg[0];
>> +};
>>
>> diff --git a/virt/kvm/kvm_main.c b/virt/kvm/kvm_main.c
>> index 169a001..453fe93 100644
>> --- a/virt/kvm/kvm_main.c
>> +++ b/virt/kvm/kvm_main.c
>> @@ -2082,6 +2082,23 @@ out_free2:
>> break;
>> }
>> #endif
>> +#ifdef KVM_HAVE_REG_LIST
>> + case KVM_VCPU_GET_REG_LIST: {
>> + struct kvm_reg_list __user *user_list = argp;
>> + struct kvm_reg_list reg_list;
>> + unsigned n;
>> +
>> + if (copy_from_user(®_list, user_list, sizeof reg_list))
>> + return -EFAULT;
>> + n = reg_list.n;
>> + reg_list.n = kvm_arch_num_regs(vcpu);
>
> The code does not actually support more than 2^32 registers, does it?
> Why "__u64 n" ?
Well, the interface is simpler, and the alignment issues vanish.
kvm_arch_num_regs could return a 64-bit number in future if we want to
get completely insane :)
Cheers,
Rusty.
next prev parent reply other threads:[~2012-10-11 20:49 UTC|newest]
Thread overview: 28+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-09-05 7:58 [PATCH 0/3] KVM_VCPU_GET_REG_LIST API Rusty Russell
2012-09-05 7:58 ` [PATCH 1/3] KVM: Move KVM_SET_ONE_REG/KVM_GET_ONE_REG to generic code Rusty Russell
2012-09-19 14:17 ` Alexander Graf
2012-09-05 7:58 ` [PATCH 2/3] KVM: Add KVM_REG_SIZE() helper Rusty Russell
2012-09-19 14:18 ` Alexander Graf
2012-09-05 7:58 ` [PATCH 3/3] KVM: Add KVM_VCPU_GET_REG_LIST/KVM_CAP_REG_LIST Rusty Russell
2012-09-19 14:22 ` Alexander Graf
2012-10-10 18:12 ` Marcelo Tosatti
2012-10-11 8:11 ` Rusty Russell [this message]
2012-10-18 14:45 ` [PATCH 0/3] KVM_VCPU_GET_REG_LIST API Avi Kivity
2012-10-19 0:36 ` Rusty Russell
2012-10-19 6:19 ` Rusty Russell
2012-10-19 16:06 ` Christoffer Dall
2012-10-22 3:09 ` Rusty Russell
2012-10-22 17:45 ` Will Deacon
2012-10-22 18:11 ` Christoffer Dall
2012-10-24 11:25 ` RFC: Move kvm's instruction decoding into generic code Rusty Russell
2012-10-24 11:25 ` [PATCH 01/10] kvm: split out instruction structure from decoding method Rusty Russell
2012-10-24 11:25 ` [PATCH 02/10] kvm: split out instruction decode from emulation Rusty Russell
2012-10-24 11:25 ` [PATCH 03/10] kvm: split out instruction decode from emulation (thumb instructions) Rusty Russell
2012-10-24 11:25 ` [PATCH 04/10] kvm: completely separate decoding from execution Rusty Russell
2012-10-24 11:25 ` [PATCH 05/10] kvm: move instruction copying inside kvm_decode() Rusty Russell
2012-10-24 11:25 ` [PATCH 06/10] kvm: cleanup use of instr Rusty Russell
2012-10-24 11:25 ` [PATCH 07/10] kvm: clean up use of is_wide_instruction() Rusty Russell
2012-10-24 11:25 ` [PATCH 08/10] kvm: avoid using vcpu_cpsr() by passing down PSR Rusty Russell
2012-10-24 11:25 ` [PATCH 09/10] kvm: avoid reference vcpu->arch.hxfar by making thumb offset_addr relative Rusty Russell
2012-10-24 11:25 ` [PATCH 10/10] opcode: move generic instruction decode out of KVM Rusty Russell
2012-10-24 16:27 ` RFC: Move kvm's instruction decoding into generic code Dave Martin
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=87lifd77i4.fsf@rustcorp.com.au \
--to=rusty@rustcorp.com.au \
--cc=agraf@suse.de \
--cc=avi@redhat.com \
--cc=c.dall@virtualopensystems.com \
--cc=kvm@vger.kernel.org \
--cc=mtosatti@redhat.com \
--cc=peter.maydell@linaro.org \
--cc=rusty.russell@linaro.org \
/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.