From: Jan Beulich <jbeulich@suse.com>
To: Tamas K Lengyel <tamas@tklengyel.com>
Cc: "Petre Pircalabu" <ppircalabu@bitdefender.com>,
"Stefano Stabellini" <sstabellini@kernel.org>,
"Julien Grall" <julien@xen.org>, "Wei Liu" <wl@xen.org>,
"Andrew Cooper" <andrew.cooper3@citrix.com>,
"Ian Jackson" <ian.jackson@eu.citrix.com>,
"George Dunlap" <george.dunlap@citrix.com>,
"Alexandru Isaila" <aisaila@bitdefender.com>,
Xen-devel <xen-devel@lists.xenproject.org>,
"Roger Pau Monné" <roger.pau@citrix.com>
Subject: Re: [PATCH 1/3] xen/monitor: Control register values
Date: Wed, 20 May 2020 15:48:21 +0200 [thread overview]
Message-ID: <d0cd29c0-3070-ceb2-cd21-4ae359a0ec57@suse.com> (raw)
In-Reply-To: <CABfawhmg+ZtzKvJecAJE8=C+rnPiywUy8vO81Yz9dC4j2h-feg@mail.gmail.com>
On 20.05.2020 15:42, Tamas K Lengyel wrote:
> On Wed, May 20, 2020 at 7:36 AM Jan Beulich <jbeulich@suse.com> wrote:
>>
>> On 15.05.2020 18:53, Tamas K Lengyel wrote:
>>> Extend the monitor_op domctl to include option that enables
>>> controlling what values certain registers are permitted to hold
>>> by a monitor subscriber.
>>
>> This needs a bit more explanation, especially for those of us
>> who aren't that introspection savvy. For example, from the text
>> here I didn't expect a simple bool control, but something where
>> actual (register) values get passed back and forth.
>>
>>> --- a/xen/arch/x86/hvm/hvm.c
>>> +++ b/xen/arch/x86/hvm/hvm.c
>>> @@ -2263,9 +2263,10 @@ int hvm_set_cr0(unsigned long value, bool may_defer)
>>> {
>>> ASSERT(v->arch.vm_event);
>>>
>>> - if ( hvm_monitor_crX(CR0, value, old_value) )
>>> + if ( hvm_monitor_crX(CR0, value, old_value) &&
>>> + v->domain->arch.monitor.control_register_values )
>>> {
>>> - /* The actual write will occur in hvm_do_resume(), if permitted. */
>>> + /* The actual write will occur in hvm_do_resume, if permitted. */
>>
>> Please can you leave alone this and the similar comments below.
>> And for consistency _add_ parentheses to the one new instance
>> you add?
>
> I changed to because now it doesn't fit into the 80-line limit below,
> and then changed it everywhere _for_ consistency.
The 80-char limit is easy to deal with - wrap the line.
>>> --- a/xen/arch/x86/monitor.c
>>> +++ b/xen/arch/x86/monitor.c
>>> @@ -144,7 +144,15 @@ int arch_monitor_domctl_event(struct domain *d,
>>> struct xen_domctl_monitor_op *mop)
>>> {
>>> struct arch_domain *ad = &d->arch;
>>> - bool requested_status = (XEN_DOMCTL_MONITOR_OP_ENABLE == mop->op);
>>> + bool requested_status;
>>> +
>>> + if ( XEN_DOMCTL_MONITOR_OP_CONTROL_REGISTERS == mop->op )
>>> + {
>>> + ad->monitor.control_register_values = true;
>>
>> And there's no way to clear this flag again?
>
> There is. Disable the monitor vm_event interface and reinitialize.
Quite heavy handed, isn't it?
Jan
next prev parent reply other threads:[~2020-05-20 13:48 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-05-15 16:52 [PATCH 0/3] vm_event: fix race-condition when disabling monitor events Tamas K Lengyel
2020-05-15 16:53 ` [PATCH 1/3] xen/monitor: Control register values Tamas K Lengyel
2020-05-20 13:36 ` Jan Beulich
2020-05-20 13:42 ` Tamas K Lengyel
2020-05-20 13:48 ` Jan Beulich [this message]
2020-05-21 1:28 ` Tamas K Lengyel
2020-05-15 16:53 ` [PATCH 2/3] xen/vm_event: add vm_event_check_pending_op Tamas K Lengyel
2020-05-15 16:53 ` [PATCH 3/3] xen/vm_event: Add safe to disable vm_event Tamas K Lengyel
2020-05-20 13:45 ` Jan Beulich
2020-05-20 15:27 ` Tamas K Lengyel
2020-05-21 2:18 ` Tamas K Lengyel
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=d0cd29c0-3070-ceb2-cd21-4ae359a0ec57@suse.com \
--to=jbeulich@suse.com \
--cc=aisaila@bitdefender.com \
--cc=andrew.cooper3@citrix.com \
--cc=george.dunlap@citrix.com \
--cc=ian.jackson@eu.citrix.com \
--cc=julien@xen.org \
--cc=ppircalabu@bitdefender.com \
--cc=roger.pau@citrix.com \
--cc=sstabellini@kernel.org \
--cc=tamas@tklengyel.com \
--cc=wl@xen.org \
--cc=xen-devel@lists.xenproject.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).