[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Xen-devel] [PATCH RFC 1/9] xen: Emulate with no writes; compute current instruction length


  • To: Jan Beulich <JBeulich@xxxxxxxx>
  • From: Razvan Cojocaru <rcojocaru@xxxxxxxxxxxxxxx>
  • Date: Wed, 02 Jul 2014 19:18:04 +0300
  • Cc: tim@xxxxxxx, xen-devel@xxxxxxxxxxxxx
  • Comment: DomainKeys? See http://domainkeys.sourceforge.net/
  • Delivery-date: Wed, 02 Jul 2014 16:17:40 +0000
  • Domainkey-signature: a=rsa-sha1; q=dns; c=nofws; s=default; d=bitdefender.com; b=nriykhtM7VnwVNUSceFgg6cBxNsKdN8xtoe3hqVU77j/7Jh0jGZ7XU9kfMNhmy3XApy23qqblvVUqPBBlB3oga/gjzBQMjVNCt4HaRdnpgDmEW3HUd1Sxb4dauf7C62UtXzrBebHWuDEzoowdZufaF9K3AtpHArrkIlUf1xtiRfVX3FjChwkiqkxtrsquDZfZVYe/OhJq6MTkU8cbTPT1RzXJ4inWBwBkU9GZZKDmFCaQXKr8WlQoUOC5q0E6bgvLQ0wtiytYyLT8nqoxMJC0xuLVw6b3ScFjBMusXcFBbc5UNn/0/IfHUVm8a09v/MDNeLEk9PD0b3tiLqe43K1eQ==; h=Received:Received:Received:Received:Message-ID:Date:From:User-Agent:MIME-Version:To:CC:Subject:References:In-Reply-To:Content-Type:Content-Transfer-Encoding:X-BitDefender-Scanner:X-BitDefender-Spam:X-BitDefender-SpamStamp:X-BitDefender-CF-Stamp;
  • List-id: Xen developer discussion <xen-devel.lists.xen.org>

On 07/02/2014 07:08 PM, Jan Beulich wrote:
>>>> On 02.07.14 at 17:43, <rcojocaru@xxxxxxxxxxxxxxx> wrote:
>> On 07/02/2014 06:21 PM, Jan Beulich wrote:
>>>> +    struct x86_emulate_ctxt __attribute__((unused)) *ctxt)
>>>
>>> We don't mark unused function arguments like this (and if we did,
>>> we'd want you to use __maybe_unused).
>>
>> OK, thanks. What's the proper way to mark them? Should I go with
>> __maybe_unused then?
> 
> No - don't mark them.

Noted.

>>>> +void hvm_emulate_one_full(bool_t nowrite)
>>>> +{
>>>> +    struct hvm_emulate_ctxt ctx[1] = {};
>>>> +    int rc = X86EMUL_RETRY;
>>>> +
>>>> +    hvm_emulate_prepare(ctx, guest_cpu_user_regs());
>>>> +
>>>> +    while ( rc == X86EMUL_RETRY )
>>>> +    {
>>>> +        if ( nowrite )
>>>> +            rc = hvm_emulate_one_no_write(ctx);
>>>> +        else
>>>> +            rc = hvm_emulate_one(ctx);
>>>> +    }
>>>> +
>>>> +    switch ( rc )
>>>> +    {
>>>> +    case X86EMUL_UNHANDLEABLE:
>>>> +        hvm_inject_hw_exception(TRAP_invalid_op, 
>> HVM_DELIVER_NO_ERROR_CODE);
>>>
>>> Is it certain that #UD is always the right exception here?
>>
>> For our purposes, yes.
> 
> That's not really a good answer for code that isn't there to only suit
> you.

Of course, all I was trying to say is that as far as this function has
been used (only in conjunction with our application), it has always been
the right exception, and I was hoping that somebody might shed some
light on a scenario of possibly problematic uses of it.

>> Of course, that means that I can't really explain what the original
>> author intended (related to the rest of your critique).
> 
> Which clearly won't help acceptance of this code, assuming that's
> your goal.

Obviously acceptance is the goal, but should the Linux code be cleaned
up and handed in, or is it better to try to enhance the emulator as has
been suggested above?


Thanks,
Razvan Cojocaru

_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxx
http://lists.xen.org/xen-devel


 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.