Skip to contentSkip to conversation

How long is a kernel supported?

Xen-users Henning Sprang 3 participants 6 messages Nov 21, 2006 1 message not in the archive

lore
Share & tools
lore
#1 lore raw
In reply to a message not in the archive

I also also copy this message to xen-devel, because developers should say something about this.

Quoted 2 lines · Goran

[...]
A. How long will be Xen 3.0.3_0 supported?

If "support" means for you something like bugfix or security releases that keep most of the API and configuration, I have not seen such thing in Xen 3. Each release is significantly different in terms of kernel-version and -configuration (xend and vm configs keep _mostly_ the same), even if the developers decide to go only minor steps in the version numbers, which I really don't understand because the common conception of minor version changes is that only bad bugs and security problems get fixed, everything else keeps the same.
I've not seen any security release in these terms and my questions about these things on xen-devel remained unanswerded.

Maybe you need to buy the Enterprise version and buy support to get information about these things and to get security updates (hmm, but if they give security updates to the kernel to customers, they have to make them public, also.)

On the other hand, I've not heard from xen security problems until now, but that's a bad reason to have no security information for users at all.

Quoted 2 lines

B. How long will I be able to compile Xen-able linux-kernels ver. 2.6.16.xy with Xen 3.0.3_0?

I don't understand this question exactly. As far as I understand it:
I've not seen a Xen Release where only the Kernel was updated. Trying to use an other Kernel means, you have to see yourself to get the most current Xen patches into the Kernel, and you probably have to work with testing/unstable Xen and Xen kernel Versions.

Quoted 3 lines

C. Will I be able to compile Xen-able linux-kernels ver. 2.6.16.xy with other versions than Xen 3.0.3_0?

The developers can tell about the future, in the past, later versions of Xen where incompatible to older Kernels AFAIK. And the Xen Linux Patches where for exact the Linux version that comes with the sources.

It would be really nice to hear comments from the developers here. Maybe they hear and reply one day.

Henning

#2 lore raw
Quoted 9 lines · Henning Sprang
Quoted 2 lines

C. Will I be able to compile Xen-able linux-kernels ver. 2.6.16.xy with other versions than Xen 3.0.3_0?

The developers can tell about the future, in the past, later versions of Xen where incompatible to older Kernels AFAIK. And the Xen Linux Patches where for exact the Linux version that comes with the sources.

It would be really nice to hear comments from the developers here. Maybe they hear and reply one day.

We support older XenLinux trees built against more recent Xen, but not vice versa. We support older XenLinux binaries running on newer Xen, *and* newer XenLinux binaries running as far back as Xen 3.0.2.

-- Keir

#3 lore raw

Xen Crashes when releasing gnttab mappings - of a crashed domain.

Observation:
------------
When connecting two miniOs (using a shared ring), Xen (not a domain) crashes when the miniOs's exits..

Xen crashes and produces the following:
(XEN) Xen call trace:

(XEN)    [<ff11d20d>] __bug+0x29/0x45
(XEN)    [<ff107cb3>] gnttab_release_mappings+0xcb/0x2e5
(XEN)    [<ff1046dd>] domain_kill+0x29/0x62
(XEN)    [<ff10349a>] do_domctl+0x6d6/0xfbc
(XEN)    [<ff165755>] hypercall+0x95/0xb5

(XEN)
(XEN)
(XEN) ****************************************
(XEN) Panic on CPU 1:
(XEN) BUG at grant_table.c:1122
(XEN) ****************************************

The cause:
----------
Xen tries to release the grant table mappings by accessing a remote domain grant table.
But the remote domain seems to be non-existent and consequently Xen fails:
find_domain_by_id (in gnttab_release_mappings) returns NULL.

Analysis:
---------
This situation described above should never happen: if I understand correctly, a domain should not be completely destroyed until there are no more references to it.
See: put_domain(d) // sched.h
Which is defined as follows:
If ( atomic_dec_and_test( &(_d_->refcnt) ) domain_destroy(_d)

It does however happen when a domain crashes.

Note that there are two ways to "finish" with a domain (domain.c):
1. domain_kill (which calls domain_destroy) - releases all
resources in a gracefull
manner.
2. __domain_crash (which calls domain_shutdown) - which seems to
kill the domain
without proper releasing of resources that reference to it..
(this function is called on extreme cases)

Our scenario:
-------------

We are running two miniOs with the same profile:
Open a ring (share a page with a grant ref and map a page from a remote domain)
Write
Read
Close the ring (dealloc, unmap*)
do_exit()

Timeline - >
MiniOs 1: .......... calls do_exit() ->

                                     .. domain_kill() -> 
                                            .. gnttab_release_mapping()
-> 
                                                    .. BUG()

MiniOs 2: crashes**

*When we unmap we use Xen's hypercall to unmap a grant reference and the gnttab_unmap_grant_ref structure.
Note that we have a bug and do NOT set unmap_op.dev_bus_addr to 0 as we should.
Xen's API (in public/grant_table.h) explicitly describes that it should be 0 or
the grant reference will be treated as valid device mapping.

** Because of the bug descrived in * we cause the domain to crash. We observe:
(XEN) grant_table.c:394: Bad frame number doesn't match gntref (XEN) mm.c:760: Attempt to implicitly unmap a granted PTE (XEN) domain_crash called from mm.c:761

Summary:
-----------

1. Setting unmap_op.dev_bus_addr removes the BUG and all is well.
2. But crashing Xen - even with our error - doesn't seem to be a healthy choice.

:)
Micha.

#4 lore raw

Re: Xen Crashes when releasing gnttab mappings - of a crashed domain.

Quoted 3 lines · Micha

1. Setting unmap_op.dev_bus_addr removes the BUG and all is well.
2. But crashing Xen - even with our error - doesn't seem to be a healthy choice.

Does the attached patch fix this issue? It's against unstable tip -- may apply to your tree with patch fuzz.

-- Keir

xen/common/grant_table.c +8 -4
diff -r 6661355c450e xen/common/grant_table.c
@@ -371,10 +371,9 @@ __gnttab_unmap_grant_ref(
 
     if ( unlikely((rd = find_domain_by_id(dom)) == NULL) )
     {
-        if ( rd != NULL )
-            put_domain(rd);
+        /* This can happen when a grant is implicitly unmapped. */
         gdprintk(XENLOG_INFO, "Could not find domain %d\n", dom);
-        op->status = GNTST_bad_domain;
+        domain_crash(ld); /* naughty... */
         return;
     }
 
@@ -1130,7 +1129,12 @@ gnttab_release_mappings(
                 handle, ref, map->flags, map->domid);
 
         rd = find_domain_by_id(map->domid);
-        BUG_ON(rd == NULL);
+        if ( rd == NULL )
+        {
+            /* Nothing to clear up... */
+            map->flags = 0;
+            continue;
+        }
 
         spin_lock(&rd->grant_table->lock);
 

_______________________________________________
Xen-devel mailing list
[email protected]
http://lists.xensource.com/xen-devel

#5 lore raw

RE: Xen Crashes when releasing gnttab mappings - of a crashed domain.

Yes, fixed.

Quoted 1 line

+ domain_crash(ld); /* naughty... */

By why do you crash the local domain if the reference can not be ungranted?
Is there no way to clean up? And if ld == 0?

Thanks,
:)
Micha.

-----Original Message-----
From: Keir Fraser [mailto:[email protected]]
Sent: 21 November 2006 14:33
To: Moffie, Micha; xen-devel
Subject: Re: [Xen-devel] Xen Crashes when releasing gnttab mappings - of a crashed domain.

Quoted 3 lines · Micha

1. Setting unmap_op.dev_bus_addr removes the BUG and all is well.
2. But crashing Xen - even with our error - doesn't seem to be a healthy choice.

Does the attached patch fix this issue? It's against unstable tip -- may apply to your tree with patch fuzz.

-- Keir

#6 lore raw

Re: Xen Crashes when releasing gnttab mappings - of a crashed domain.

Quoted 3 lines · Micha

By why do you crash the local domain if the reference can not be ungranted?
Is there no way to clean up? And if ld == 0?

This situation signals that the mapping domain cleared the granted mapping by simply zapping the PTE, rather than going thru the explicit grant-unmap operation. The effect of this is undefined (although of course it should not crash Xen!) and for sanity's sake I prefer to crash the offender whenever I can detect that this has happened.

-- Keir