From mboxrd@z Thu Jan 1 00:00:00 1970 From: Corneliu ZUZU Subject: Re: [PATCH v2 3/7] xen/vm-events: Move monitor_domctl to common-side. Date: Thu, 11 Feb 2016 09:21:19 +0200 Message-ID: <56BC366F.5060802@bitdefender.com> References: <1455119259-2161-1-git-send-email-czuzu@bitdefender.com> <1455119548-2401-1-git-send-email-czuzu@bitdefender.com> <56BB74B8.1020207@bitdefender.com> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="===============7407525481393696140==" Return-path: In-Reply-To: List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xen.org Errors-To: xen-devel-bounces@lists.xen.org To: Tamas K Lengyel Cc: Kevin Tian , Keir Fraser , Ian Campbell , Razvan Cojocaru , Andrew Cooper , Xen-devel , Jan Beulich , Stefano Stabellini , Jun Nakajima List-Id: xen-devel@lists.xenproject.org This is a multi-part message in MIME format. --===============7407525481393696140== Content-Type: multipart/alternative; boundary="------------000502030707060407080900" This is a multi-part message in MIME format. --------------000502030707060407080900 Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit On 2/10/2016 7:56 PM, Tamas K Lengyel wrote: > > > On Wed, Feb 10, 2016 at 10:34 AM, Corneliu ZUZU > 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. --------------000502030707060407080900 Content-Type: text/html; charset=utf-8 Content-Length: 7494 Content-Transfer-Encoding: quoted-printable
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> 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
=C2=A0 =C2=A0 =C2=A0 =C2=A0 select HAS_MEM_ACCESS
=C2=A0 =C2=A0 =C2=A0 =C2=A0 select HAS_MEM_PAGING
=C2=A0 =C2=A0 =C2=A0 =C2=A0 select HAS_MEM_SHARING
+=C2=A0 =C2=A0 =C2=A0 =C2=A0select 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 !=3D 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=3F Why not use them=3F :)

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=3F
And if you then also implement it for the 3rd architecture, you move them back to common from the arch-side=3F
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=3F

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 =3D> 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 =3D> 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=3F :)

Thank you,
Corneliu.
--------------000502030707060407080900-- --===============7407525481393696140== Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Disposition: inline _______________________________________________ Xen-devel mailing list Xen-devel@lists.xen.org http://lists.xen.org/xen-devel --===============7407525481393696140==--