[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20200302191940.GD6244@linux.intel.com>
Date: Mon, 2 Mar 2020 11:19:41 -0800
From: Sean Christopherson <sean.j.christopherson@...el.com>
To: Paolo Bonzini <pbonzini@...hat.com>
Cc: Vitaly Kuznetsov <vkuznets@...hat.com>,
Wanpeng Li <wanpengli@...cent.com>,
Jim Mattson <jmattson@...gle.com>,
Joerg Roedel <joro@...tes.org>, kvm@...r.kernel.org,
linux-kernel@...r.kernel.org
Subject: Re: [PATCH v2 10/13] KVM: x86: Shrink the usercopy region of the
emulation context
On Mon, Mar 02, 2020 at 07:40:27PM +0100, Paolo Bonzini wrote:
> On 26/02/20 18:51, Vitaly Kuznetsov wrote:
> >> +
> >> + /* Here begins the usercopy section. */
> >> + struct operand src;
> >> + struct operand src2;
> >> + struct operand dst;
> > Out of pure curiosity, how certain are we that this is going to be
> > enough for userspaces?
> >
>
> And also, where exactly are the user copies done?
Anything that funnels into ctxt->ops->read_std() or ctxt->ops->write_std(),
e.g.
if (ctxt->src2.type == OP_MEM) {
rc = segmented_read(ctxt, ctxt->src2.addr.mem,
&ctxt->src2.val, ctxt->src2.bytes);
if (rc != X86EMUL_CONTINUE)
goto done;
}
segmented_read() : @data = &ctxt->src2.val
|
|-> read_emulated()
|
|-> ctxt->ops->read_emulated() / emulator_read_emulated()
|
|-> emulator_read_write()
|
|-> emulator_read_write_onepage()
|
|-> ops->read_write_emulate() / read_emulate()
|
|-> kvm_vcpu_read_guest()
|
...
|-> __kvm_read_guest_page()
|
|-> __copy_from_user(data, ...)
Powered by blists - more mailing lists