From: Razvan Cojocaru <rcojocaru@bitdefender.com>
To: Jan Beulich <JBeulich@suse.com>
Cc: andrew.cooper3@citrix.com, paul.durrant@citrix.com, keir@xen.org,
xen-devel@lists.xen.org
Subject: Re: [PATCH] x86/emulate: Check current->arch.vm_event in hvmemul_virtual_to_linear()
Date: Thu, 7 Apr 2016 20:54:20 +0300 [thread overview]
Message-ID: <57069ECC.9090306@bitdefender.com> (raw)
In-Reply-To: <5706A69C02000078000E5FFB@prv-mh.provo.novell.com>
On 04/07/16 20:27, Jan Beulich wrote:
>>>> On 07.04.16 at 10:39, <rcojocaru@bitdefender.com> wrote:
>> Theoretically it is possible for mem_access_emulate_each_rep to be
>> true even when current->arch.vm_event == NULL, so add an extra
>> check to hvmemul_virtual_to_linear().
>
> Mind saying what those theoretical conditions are when this might
> happen?
This could happen if someone were to call xc_monitor_emulate_each_rep(),
but not xc_monitor_enable() (when current->arch.vm_event gets
allocated), or after someone called both, but afterwards called
xc_monitor_disable() (when current->arch.vm_event gets freed).
>> --- a/xen/arch/x86/hvm/emulate.c
>> +++ b/xen/arch/x86/hvm/emulate.c
>> @@ -514,7 +514,7 @@ static int hvmemul_virtual_to_linear(
>> * vm_event being triggered for repeated writes to a whole page.
>> */
>> if ( unlikely(current->domain->arch.mem_access_emulate_each_rep) &&
>> - current->arch.vm_event->emulate_flags != 0 )
>> + current->arch.vm_event && current->arch.vm_event->emulate_flags != 0 )
>
> That's then the third instance of "current" here - this needs
> latching into a local variable.
No problem.
Thanks,
Razvan
_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel
next prev parent reply other threads:[~2016-04-07 17:54 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-04-07 8:39 [PATCH] x86/emulate: Check current->arch.vm_event in hvmemul_virtual_to_linear() Razvan Cojocaru
2016-04-07 17:27 ` Jan Beulich
2016-04-07 17:54 ` Razvan Cojocaru [this message]
2016-04-07 18:13 ` Razvan Cojocaru
2016-04-07 21:17 ` Jan Beulich
2016-04-08 5:32 ` Razvan Cojocaru
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=57069ECC.9090306@bitdefender.com \
--to=rcojocaru@bitdefender.com \
--cc=JBeulich@suse.com \
--cc=andrew.cooper3@citrix.com \
--cc=keir@xen.org \
--cc=paul.durrant@citrix.com \
--cc=xen-devel@lists.xen.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.