All of lore.kernel.org
 help / color / mirror / Atom feed
From: Corneliu ZUZU <czuzu@bitdefender.com>
To: Tamas K Lengyel <tamas@tklengyel.com>
Cc: Kevin Tian <kevin.tian@intel.com>, Keir Fraser <keir@xen.org>,
	Ian Campbell <ian.campbell@citrix.com>,
	Razvan Cojocaru <rcojocaru@bitdefender.com>,
	Andrew Cooper <andrew.cooper3@citrix.com>,
	Xen-devel <xen-devel@lists.xen.org>,
	Jan Beulich <jbeulich@suse.com>,
	Stefano Stabellini <stefano.stabellini@citrix.com>,
	Jun Nakajima <jun.nakajima@intel.com>
Subject: Re: [PATCH v2 3/7] xen/vm-events: Move monitor_domctl to common-side.
Date: Thu, 11 Feb 2016 09:21:19 +0200	[thread overview]
Message-ID: <56BC366F.5060802@bitdefender.com> (raw)
In-Reply-To: <CABfawh=ZGcqxBPv9vw41xiA9iqNOxcsBBFmuVmR0xbZObgVPZA@mail.gmail.com>


[-- Attachment #1.1: Type: text/plain, Size: 4076 bytes --]

On 2/10/2016 7:56 PM, Tamas K Lengyel wrote:
>
>
> On Wed, Feb 10, 2016 at 10:34 AM, Corneliu ZUZU <czuzu@bitdefender.com 
> <mailto:czuzu@bitdefender.com>> wrote:
>
>
>     On 2/10/2016 6:39 PM, Tamas K Lengyel wrote:
>>
>>
>>         diff --git a/xen/arch/x86/Kconfig b/xen/arch/x86/Kconfig
>>         index 3a90f47..e46be1b 100644
>>         --- a/xen/arch/x86/Kconfig
>>         +++ b/xen/arch/x86/Kconfig
>>         @@ -14,6 +14,10 @@ config X86
>>                 select HAS_MEM_ACCESS
>>                 select HAS_MEM_PAGING
>>                 select HAS_MEM_SHARING
>>         +       select HAS_VM_EVENT_WRITE_CTRLREG
>>
>>
>>     You mentioned in the previous revision of this series that
>>     currently you only have plans to implement write_ctrleg and
>>     guest_request events for ARM. I think singlestep and
>>     software_breakpoint should not be moved to common without a clear
>>     plan to have those implemented. Now, if you were to include the
>>     implementation of write_ctrlreg and guest_request in this series
>>     and leave the others in x86 as they are now, I don't think there
>>     would be any reason to have these Kconfig options present at all.
>
>     Moving what made sense to be moved to common was a suggestion of
>     Ian's.
>     The purpose of this patch is to --avoid-- having to go through
>     this process again
>     when an implementation of feature X for architecture A != X86
>     comes into place.
>     IMHO what is common should stay in common and I don't see any
>     issues w/
>     having them there, only advantages (future implementations of
>     these features will
>     be easier).
>     Maybe Ian can chime in on this.
>
>
> That's the upside. The downside is that in the interim, while those 
> features are not implemented, we need to add a bunch of Kconfig 
> variables to decide under what build they are available.

Technically, you don't need to add anything unless you implement that 
feature.
E.g. the ARM Kconfig currently contains no mention of these options, 
since they're not implemented there @ all.
And when implemented they're only added once and it's one line "select 
HAS_....", it's not like you have to specify a command-line
parameter when building Xen or something like that, so IMO they don't 
add considerable complexity.
And after all, these kind of situations (i.e. activating/deactivating 
code based on architecture) are why arch-specific Kconfigs exist, right? 
Why not use them? :)

> If it was moved to common only when the feature is available for all 
> architectures, we wouldn't need that many ifdefs and the code would be 
> clearer. So I do see why it would be beneficial having these moved to 
> common now, but I still rather have it happen when it's necessary and 
> without the Kconfig settings.

What if a 3rd architecture comes into place, you'd have to move them 
back from common to the arch-side and get back to the code duplication 
we just got rid of?
And if you then also implement it for the 3rd architecture, you move 
them back to common from the arch-side?
It seems uncomfortable having to keep track of all architectures when 
wanting to add such a feature implementation for just one of them.
I don't know what & if such plans exist for Xen, but why make that 
future process of adding in support for other architectures 
unnecessarily complicated,
even if it won't happen soon?

Also, IMO the code is clearer like this:
* you know what parts interest you when implementing parts of these 
features/when debugging/when simply looking @ the code
* the #ifdefs make it possible for that code to be put in common => that 
makes it *clear* that those code parts are NOT
architecture specific and their implementation can be safely used for 
all architectures.
* code duplication is avoided => avoid having to reflect a modification 
when it happens in more places than it would be necessary

There are disadvantages, everything has a downside but IMHO they are 
minor compared to the alternative.

Ian, any comments on this? :)

Thank you,
Corneliu.

[-- Attachment #1.2: Type: text/html, Size: 7344 bytes --]

[-- Attachment #2: Type: text/plain, Size: 126 bytes --]

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

  reply	other threads:[~2016-02-11  7:21 UTC|newest]

Thread overview: 38+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-02-10 15:47 [PATCH v2 0/7] Vm-events: move monitor vm-events code to common-side Corneliu ZUZU
2016-02-10 15:47 ` [PATCH v2 1/7] xen/arm: fix file comments Corneliu ZUZU
2016-02-10 16:05   ` Stefano Stabellini
2016-02-10 15:50 ` [PATCH v2 2/7] xen/x86: merge 2 hvm_event_... functions into 1 Corneliu ZUZU
2016-02-10 16:18   ` Jan Beulich
2016-02-10 16:37     ` Andrew Cooper
2016-02-10 17:05       ` Jan Beulich
2016-02-10 17:04     ` Corneliu ZUZU
2016-02-10 17:11       ` Jan Beulich
2016-02-10 20:50         ` Corneliu ZUZU
2016-02-10 20:56         ` Andrew Cooper
2016-02-11 10:31           ` Jan Beulich
2016-02-11  6:03         ` Corneliu ZUZU
2016-02-10 17:28       ` Razvan Cojocaru
2016-02-10 17:52         ` Tamas K Lengyel
2016-02-10 15:52 ` [PATCH v2 3/7] xen/vm-events: Move monitor_domctl to common-side Corneliu ZUZU
2016-02-10 16:26   ` Jan Beulich
2016-02-10 16:30     ` Jan Beulich
2016-02-10 17:14       ` Corneliu ZUZU
2016-02-10 17:12     ` Corneliu ZUZU
2016-02-10 16:39   ` Tamas K Lengyel
2016-02-10 17:34     ` Corneliu ZUZU
2016-02-10 17:56       ` Tamas K Lengyel
2016-02-11  7:21         ` Corneliu ZUZU [this message]
2016-02-11 15:44           ` Tamas K Lengyel
2016-02-12  6:05             ` Corneliu ZUZU
2016-02-12  8:14               ` Corneliu ZUZU
2016-02-11  6:20     ` Corneliu ZUZU
2016-02-10 15:54 ` [PATCH v2 4/7] Rename monitor_x86.c to monitor.c and monitor_arch.h to monitor.h Corneliu ZUZU
2016-02-10 16:44   ` Tamas K Lengyel
2016-02-10 17:16     ` Jan Beulich
2016-02-10 20:54       ` Corneliu ZUZU
2016-02-10 20:36     ` Corneliu ZUZU
2016-02-10 15:56 ` [PATCH v2 5/7] xen/vm-events: Move hvm_event_* functions to common-side Corneliu ZUZU
2016-02-10 15:58 ` [PATCH v2 6/7] Rename event_x86.c to event.c and event_arch.h to event.h + minor fixes Corneliu ZUZU
2016-02-10 16:00 ` [PATCH v2 7/7] xen/vm-events: move arch_domain.monitor bits to common Corneliu ZUZU
2016-02-10 16:29   ` Jan Beulich
2016-02-10 17:14     ` Corneliu ZUZU

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=56BC366F.5060802@bitdefender.com \
    --to=czuzu@bitdefender.com \
    --cc=andrew.cooper3@citrix.com \
    --cc=ian.campbell@citrix.com \
    --cc=jbeulich@suse.com \
    --cc=jun.nakajima@intel.com \
    --cc=keir@xen.org \
    --cc=kevin.tian@intel.com \
    --cc=rcojocaru@bitdefender.com \
    --cc=stefano.stabellini@citrix.com \
    --cc=tamas@tklengyel.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.