diff mbox

[v3,1/3] xen/arm: introduce XENFEAT_grant_map_identity

Message ID 1406904984-16068-1-git-send-email-stefano.stabellini@eu.citrix.com
State Superseded
Headers show

Commit Message

Stefano Stabellini Aug. 1, 2014, 2:56 p.m. UTC
The flag tells us that the hypervisor maps a grant page to guest
physical address == machine address of the page in addition to the
normal grant mapping address. It is needed to properly issue cache
maintenance operation at the completion of a DMA operation involving a
foreign grant.

Signed-off-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
Tested-by: Denis Schneider <v1ne2go@gmail.com>

---
Changes in v3:
- rename XENFEAT_grant_map_11 to XENFEAT_grant_map_identity.
---
 arch/arm/xen/enlighten.c         |    6 ++++++
 include/xen/interface/features.h |    3 +++
 2 files changed, 9 insertions(+)

Comments

David Vrabel Aug. 1, 2014, 3:17 p.m. UTC | #1
On 01/08/14 15:56, Stefano Stabellini wrote:
> The flag tells us that the hypervisor maps a grant page to guest
> physical address == machine address of the page in addition to the
> normal grant mapping address. It is needed to properly issue cache
> maintenance operation at the completion of a DMA operation involving a
> foreign grant.
> 
> Signed-off-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
> Tested-by: Denis Schneider <v1ne2go@gmail.com>
> 
> ---
> Changes in v3:
> - rename XENFEAT_grant_map_11 to XENFEAT_grant_map_identity.
> ---
>  arch/arm/xen/enlighten.c         |    6 ++++++
>  include/xen/interface/features.h |    3 +++
>  2 files changed, 9 insertions(+)
> 
> diff --git a/arch/arm/xen/enlighten.c b/arch/arm/xen/enlighten.c
> index b96723e..eef324f 100644
> --- a/arch/arm/xen/enlighten.c
> +++ b/arch/arm/xen/enlighten.c
> @@ -262,6 +262,12 @@ static int __init xen_guest_init(void)
>  	xen_domain_type = XEN_HVM_DOMAIN;
>  
>  	xen_setup_features();
> +
> +	if (!xen_feature(XENFEAT_grant_map_identity)) {
> +		pr_warn("Please upgrade your Xen.\n"
> +				"If your platform has any non-coherent DMA devices, they won't work properly.\n");

I think:

"Non-coherent DMA devices require a hypervisor with
 XENFEAT_grant_map_identity"

Is a more helpful message.

David
Julien Grall Aug. 1, 2014, 4:53 p.m. UTC | #2
Hi Stefano,

On 01/08/14 15:56, Stefano Stabellini wrote:
> The flag tells us that the hypervisor maps a grant page to guest
> physical address == machine address of the page in addition to the
> normal grant mapping address. It is needed to properly issue cache
> maintenance operation at the completion of a DMA operation involving a
> foreign grant.
>
> Signed-off-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
> Tested-by: Denis Schneider <v1ne2go@gmail.com>
>
> ---
> Changes in v3:
> - rename XENFEAT_grant_map_11 to XENFEAT_grant_map_identity.
> ---
>   arch/arm/xen/enlighten.c         |    6 ++++++
>   include/xen/interface/features.h |    3 +++
>   2 files changed, 9 insertions(+)
>
> diff --git a/arch/arm/xen/enlighten.c b/arch/arm/xen/enlighten.c
> index b96723e..eef324f 100644
> --- a/arch/arm/xen/enlighten.c
> +++ b/arch/arm/xen/enlighten.c
> @@ -262,6 +262,12 @@ static int __init xen_guest_init(void)
>   	xen_domain_type = XEN_HVM_DOMAIN;
>
>   	xen_setup_features();
> +
> +	if (!xen_feature(XENFEAT_grant_map_identity)) {
> +		pr_warn("Please upgrade your Xen.\n"
> +				"If your platform has any non-coherent DMA devices, they won't work properly.\n");
> +	}

I know we talked about this on a previous thread but I can't find it in 
my mail :/

Does a Linux with this series will work on Xen 4.4? If not what's the plan?

I think we have to keep any OS working on top on Xen 4.4 as people may 
want to retrieve the latest kernel for drivers bug fixes...

For running a previous kernel on Xen 4.5, then it will still be buggy. 
It might be worse to backport thise series on LTS kernel (i.e at least 
3.14).

Regards,
Stefano Stabellini Aug. 1, 2014, 5:09 p.m. UTC | #3
On Fri, 1 Aug 2014, Julien Grall wrote:
> Hi Stefano,
> 
> On 01/08/14 15:56, Stefano Stabellini wrote:
> > The flag tells us that the hypervisor maps a grant page to guest
> > physical address == machine address of the page in addition to the
> > normal grant mapping address. It is needed to properly issue cache
> > maintenance operation at the completion of a DMA operation involving a
> > foreign grant.
> > 
> > Signed-off-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
> > Tested-by: Denis Schneider <v1ne2go@gmail.com>
> > 
> > ---
> > Changes in v3:
> > - rename XENFEAT_grant_map_11 to XENFEAT_grant_map_identity.
> > ---
> >   arch/arm/xen/enlighten.c         |    6 ++++++
> >   include/xen/interface/features.h |    3 +++
> >   2 files changed, 9 insertions(+)
> > 
> > diff --git a/arch/arm/xen/enlighten.c b/arch/arm/xen/enlighten.c
> > index b96723e..eef324f 100644
> > --- a/arch/arm/xen/enlighten.c
> > +++ b/arch/arm/xen/enlighten.c
> > @@ -262,6 +262,12 @@ static int __init xen_guest_init(void)
> >   	xen_domain_type = XEN_HVM_DOMAIN;
> > 
> >   	xen_setup_features();
> > +
> > +	if (!xen_feature(XENFEAT_grant_map_identity)) {
> > +		pr_warn("Please upgrade your Xen.\n"
> > +				"If your platform has any non-coherent DMA
> > devices, they won't work properly.\n");
> > +	}
> 
> I know we talked about this on a previous thread but I can't find it in my
> mail :/
> 
> Does a Linux with this series will work on Xen 4.4? If not what's the plan?
 
I suggest we backport the changes to Xen 4.4.

"Still working" doesn't apply to a system without networking :-(


> I think we have to keep any OS working on top on Xen 4.4 as people may want to
> retrieve the latest kernel for drivers bug fixes...

Right, that's why we need to backport the fixes. Without the backport of
the Xen patches, with or without this Linux series, networking won't
work once the kernel is upgraded.


> For running a previous kernel on Xen 4.5, then it will still be buggy. It
> might be worse to backport thise series on LTS kernel (i.e at least 3.14).

The old thread is: http://marc.info/?l=xen-devel&m=140483414203686&w=2
diff mbox

Patch

diff --git a/arch/arm/xen/enlighten.c b/arch/arm/xen/enlighten.c
index b96723e..eef324f 100644
--- a/arch/arm/xen/enlighten.c
+++ b/arch/arm/xen/enlighten.c
@@ -262,6 +262,12 @@  static int __init xen_guest_init(void)
 	xen_domain_type = XEN_HVM_DOMAIN;
 
 	xen_setup_features();
+
+	if (!xen_feature(XENFEAT_grant_map_identity)) {
+		pr_warn("Please upgrade your Xen.\n"
+				"If your platform has any non-coherent DMA devices, they won't work properly.\n");
+	}
+
 	if (xen_feature(XENFEAT_dom0))
 		xen_start_info->flags |= SIF_INITDOMAIN|SIF_PRIVILEGED;
 	else
diff --git a/include/xen/interface/features.h b/include/xen/interface/features.h
index 131a6cc..14334d0 100644
--- a/include/xen/interface/features.h
+++ b/include/xen/interface/features.h
@@ -53,6 +53,9 @@ 
 /* operation as Dom0 is supported */
 #define XENFEAT_dom0                      11
 
+/* Xen also maps grant references at pfn = mfn */
+#define XENFEAT_grant_map_identity        12
+
 #define XENFEAT_NR_SUBMAPS 1
 
 #endif /* __XEN_PUBLIC_FEATURES_H__ */