|
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] Re: [Xen-devel] [PATCH 6/7] vm-event/arm: move hvm_event_cr->common vm_event_monitor_cr
On 6/16/2016 6:16 PM, Jan Beulich wrote: On 16.06.16 at 16:12, <czuzu@xxxxxxxxxxxxxxx> wrote:Prepare for ARM implementation of control-register write vm-events by moving X86-specific hvm_event_cr to the common-side. Signed-off-by: Corneliu ZUZU <czuzu@xxxxxxxxxxxxxxx> --- xen/arch/x86/hvm/event.c | 30 ------------------------------ xen/arch/x86/hvm/hvm.c | 2 +- xen/arch/x86/monitor.c | 37 ------------------------------------- xen/arch/x86/vm_event.c | 2 +- xen/common/monitor.c | 40 ++++++++++++++++++++++++++++++++++++++++ xen/common/vm_event.c | 31 +++++++++++++++++++++++++++++++ xen/include/asm-x86/hvm/event.h | 13 ++++--------- xen/include/asm-x86/monitor.h | 2 -- xen/include/xen/monitor.h | 4 ++++ xen/include/xen/vm_event.h | 10 ++++++++++ 10 files changed, 91 insertions(+), 80 deletions(-)Considering that there's no ARM file getting altered here at all, mentioning ARM in the subject is a little odd. This patch and the following one should be meld together.I only split them to ease reviewing, sorry I forgot to mention that in the cover letter. --- a/xen/common/monitor.c +++ b/xen/common/monitor.c @@ -62,6 +62,46 @@ int monitor_domctl(struct domain *d, struct xen_domctl_monitor_op *mop)switch ( mop->event ) Ack.
Then we need to find a resolution that avoids code duplication.The code is the same, but those bits that are currently on the arch side (arch.monitor.write_ctrlreg_*) cannot be moved to common as they are, since their -number- might differ from arch-to-arch. But we could:- in public/vm_event.h, besides the VM_EVENT_X86_* and VM_EVENT_ARM_* defines (wcr index), also have
#define VM_EVENT_X86_CR_COUNT 4
#define VM_EVENT_ARM_CR_COUNT 4
- move the 3 write_ctrlreg_{enabled,sync,onchangeonly} fields from
arch_domain to domain (common) and make them 8-bits wide each for now
(widened more in the future if the need arises)
- let monitor_ctrlreg_bitmask() macro to be architecture-dependent and
use the introduced VM_EVENT_<arch>_CR_COUNT
Tamas, we also talked on this matter @ some point (when I sent the patches that moved vm-event parts to common). What do you think of the above? And looking at all the uses of this variable I get the impression that you really want a shorthand for &d->arch.monitor (if any such helper variable is worthwhile to have here in the first place). Well, this was a simple cut-paste operation, not very old content aware :)Personally I prefer the current shorthand (ad) (seems more intuitive and is consistent with the other XEN_DOMCTL_MONITOR_EVENT_* cases), but if you prefer I'll change that shorthand to am = &d->arch.monitor? --- a/xen/include/asm-x86/monitor.h +++ b/xen/include/asm-x86/monitor.h @@ -24,8 +24,6 @@#include <xen/sched.h> -#define monitor_ctrlreg_bitmask(ctrlreg_index) (1U << (ctrlreg_index)) Meld comment above.
Meld comment above. Corneliu. _______________________________________________ Xen-devel mailing list Xen-devel@xxxxxxxxxxxxx http://lists.xen.org/xen-devel
|
![]() |
Lists.xenproject.org is hosted with RackSpace, monitoring our |