xen/x86: Identify which vcpu's CR4 is being badly modified
PATCH 1/1 xen/x86: Identify which vcpu's CR4 is being badly modified
When the toolstack is setting vcpu state on behalf of a migrating guest, the domain/vcpu reference from gdprintk() identifies the toolstack, not the affected domain.
After this change, the error looks more like:
domain.c:632:d0v3 Attempt to change d1v0's CR4 flags 00002660 -> 01875000
--- xen/arch/x86/domain.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
xen/arch/x86/domain.c +2 -2
@@ -652,8 +652,8 @@ unsigned long pv_guest_cr4_fixup(const struct vcpu *v, unsigned long guest_cr4)if ( (guest_cr4 & hv_cr4_mask) != (hv_cr4 & hv_cr4_mask) )gdprintk (XENLOG_WARNING , -"Attempt to change CR4 flags %08lx -> %08lx\n" , - hv_cr4, guest_cr4); +"Attempt to change %pv's CR4 flags %08lx -> %08lx\n" , + v, hv_cr4, guest_cr4);return (hv_cr4 & hv_cr4_mask) | (guest_cr4 & ~hv_cr4_mask); }
Signature · 1 line
1.7.10.4
Quoted 8 lines
Quoted 1 line
Quoted 1 line · On 25.03.14 at 20:40, <[email protected]> wrote:
When the toolstack is setting vcpu state on behalf of a migrating guest, the domain/vcpu reference from
gdprintk()identifies the toolstack, not the affected domain.After this change, the error looks more like:
domain.c:632:d0v3 Attempt to change d1v0's CR4 flags 00002660 -> 01875000
And is the leading d0v3 really useful here in any way? I'd really like to see unmotivated uses of gdprintk() replaced by printk(XENLOG_G_...).
Jan
Quoted 25 lines
Signed-off-by Andrew Cooper <[email protected]>CC Keir Fraser <[email protected]>CC Jan Beulich <[email protected]>--- xen/arch/x86/domain.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)xen/arch/x86/domain.c +2
-2@@ -652,8 +652,8 @@ unsigned long pv_guest_cr4_fixup(const struct vcpu *v, unsigned long guest_cr4)if ( (guest_cr4 & hv_cr4_mask) != (hv_cr4 & hv_cr4_mask) )gdprintk (XENLOG_WARNING , -"Attempt to change CR4 flags %08lx -> %08lx\n" , - hv_cr4, guest_cr4); +"Attempt to change %pv's CR4 flags %08lx -> %08lx\n" , + v, hv_cr4, guest_cr4);return (hv_cr4 & hv_cr4_mask) | (guest_cr4 & ~hv_cr4_mask);}
Signature · 1 line
1.7.10.4
Quoted 5 lines · Jan Beulich
Quoted 5 lines
Quoted 1 line
Quoted 1 line · On 25.03.14 at 20:40, <[email protected]> wrote:
When the toolstack is setting vcpu state on behalf of a migrating guest, the domain/vcpu reference from
gdprintk()identifies the toolstack, not the affected domain.
Quoted 7 lines
Quoted 3 lines
After this change, the error looks more like:
domain.c:632:d0v3 Attempt to change d1v0's CR4 flags 00002660 -> 01875000
And is the leading d0v3 really useful here in any way? I'd really like to see unmotivated uses of
gdprintk()replaced byprintk(XENLOG_G_...).Jan
Personally, I find it useful to distinguish between "the toolstack tried something" and "a guest tried something", although the file/line reference is quite useless.
Perhaps printk(XENLOG_G_WARNING "%pv attempted to change %pv's CR4 flags ...", current, v ....) ?
~Andrew
Quoted 28 lines
Quoted 26 lines
Signed-off-by Andrew Cooper <[email protected]>CC Keir Fraser <[email protected]>CC Jan Beulich <[email protected]>--- xen/arch/x86/domain.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)xen/arch/x86/domain.c +2
-2@@ -652,8 +652,8 @@ unsigned long pv_guest_cr4_fixup(const struct vcpu *v, unsigned long guest_cr4)if ( (guest_cr4 & hv_cr4_mask) != (hv_cr4 & hv_cr4_mask) )gdprintk (XENLOG_WARNING , -"Attempt to change CR4 flags %08lx -> %08lx\n" , - hv_cr4, guest_cr4); +"Attempt to change %pv's CR4 flags %08lx -> %08lx\n" , + v, hv_cr4, guest_cr4);return (hv_cr4 & hv_cr4_mask) | (guest_cr4 & ~hv_cr4_mask);}
Signature · 1 line
1.7.10.4
Quoted 13 lines
Quoted 1 line
Quoted 1 line · On 26.03.14 at 14:30, <[email protected]> wrote:
Quoted 11 lines · Jan Beulich
Quoted 8 lines
Quoted 1 line
Quoted 1 line · On 25.03.14 at 20:40, <[email protected]> wrote:
When the toolstack is setting vcpu state on behalf of a migrating guest, the domain/vcpu reference from
gdprintk()identifies the toolstack, not the affected domain.After this change, the error looks more like:
domain.c:632:d0v3 Attempt to change d1v0's CR4 flags 00002660 -> 01875000
And is the leading d0v3 really useful here in any way? I'd really like to see unmotivated uses of
gdprintk()replaced byprintk(XENLOG_G_...).
Quoted 8 lines
Quoted 1 line
Jan
Personally, I find it useful to distinguish between "the toolstack tried something" and "a guest tried something", although the file/line reference is quite useless.
Perhaps
printk(XENLOG_G_WARNING "%pv attempted to change %pv's CR4 flags ...", current, v ....)?
Which vCPU this was being done on is of no interest at all; I can see the originating domain being useful to know.
Jan
PATCH v2 1/1 xen/x86: Identify which vcpu's CR4 is being badly modified
When the toolstack is setting vcpu state on behalf of a migrating guest, the domain/vcpu reference from gdprintk() identifies the toolstack, not the affected domain.
After this change, the error looks more like:
(XEN) d0 attempted to change d6v0's CR4 flags 00002660 -> 01876000
---
v2: gdprintk -> printk, drop current's vcpu reference.
--- xen/arch/x86/domain.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
xen/arch/x86/domain.c +2 -2
@@ -652,8 +652,8 @@ unsigned long pv_guest_cr4_fixup(const struct vcpu *v, unsigned long guest_cr4)if ( (guest_cr4 & hv_cr4_mask) != (hv_cr4 & hv_cr4_mask) )gdprintk (XENLOG_WARNING , -"Attempt to change CR4 flags %08lx -> %08lx\n" , - hv_cr4, guest_cr4); +"Attempt to change %pv's CR4 flags %08lx -> %08lx\n" , + v, hv_cr4, guest_cr4);return (hv_cr4 & hv_cr4_mask) | (guest_cr4 & ~hv_cr4_mask); }
Signature · 1 line
1.7.10.4
Please ignore this - I appear to have gained the new patch message with the old patch. I shall try to correct.
~Andrew
Quoted 33 lines · Andrew Cooper
When the toolstack is setting vcpu state on behalf of a migrating guest, the domain/vcpu reference from
gdprintk()identifies the toolstack, not the affected domain.After this change, the error looks more like:
(XEN) d0 attempted to change d6v0's CR4 flags 00002660 -> 01876000
Signed-off-by Andrew Cooper <[email protected]>CC Keir Fraser <[email protected]>CC Jan Beulich <[email protected]>---
v2: gdprintk -> printk, drop current's vcpu reference.--- xen/arch/x86/domain.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)xen/arch/x86/domain.c +2
-2@@ -652,8 +652,8 @@ unsigned long pv_guest_cr4_fixup(const struct vcpu *v, unsigned long guest_cr4)if ( (guest_cr4 & hv_cr4_mask) != (hv_cr4 & hv_cr4_mask) )gdprintk (XENLOG_WARNING , -"Attempt to change CR4 flags %08lx -> %08lx\n" , - hv_cr4, guest_cr4); +"Attempt to change %pv's CR4 flags %08lx -> %08lx\n" , + v, hv_cr4, guest_cr4);return (hv_cr4 & hv_cr4_mask) | (guest_cr4 & ~hv_cr4_mask); }
Quoted 7 lines
Quoted 1 line
Quoted 1 line · On 26.03.14 at 15:00, <[email protected]> wrote:
When the toolstack is setting vcpu state on behalf of a migrating guest, the domain/vcpu reference from
gdprintk()identifies the toolstack, not the affected domain.After this change, the error looks more like:
Quoted 8 lines
(XEN) d0 attempted to change d6v0's CR4 flags 00002660 -> 01876000
Signed-off-by Andrew Cooper <[email protected]>CC Keir Fraser <[email protected]>CC Jan Beulich <[email protected]>---
v2: gdprintk -> printk, drop current's vcpu reference.
Unrefreshed patch?
Jan
Quoted 22 lines
--- xen/arch/x86/domain.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)xen/arch/x86/domain.c +2
-2@@ -652,8 +652,8 @@ unsigned long pv_guest_cr4_fixup(const struct vcpu *v, unsigned long guest_cr4)if ( (guest_cr4 & hv_cr4_mask) != (hv_cr4 & hv_cr4_mask) )gdprintk (XENLOG_WARNING , -"Attempt to change CR4 flags %08lx -> %08lx\n" , - hv_cr4, guest_cr4); +"Attempt to change %pv's CR4 flags %08lx -> %08lx\n" , + v, hv_cr4, guest_cr4);return (hv_cr4 & hv_cr4_mask) | (guest_cr4 & ~hv_cr4_mask);}
Signature · 1 line
1.7.10.4
PATCH v3 1/1 xen/x86: Identify which vcpu's CR4 is being badly modified
In reply to Jan BeulichWhen the toolstack is setting vcpu state on behalf of a migrating guest, the domain/vcpu reference from gdprintk() identifies the toolstack, not the affected domain.
After this change, the error looks more like:
(XEN) d0 attempted to change d6v0's CR4 flags 00002660 -> 01876000
---
v3: Send correct patch.
v2: gdprintk -> printk, drop current's vcpu reference.
--- xen/arch/x86/domain.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-)
xen/arch/x86/domain.c +3 -3
@@ -651,9 +651,9 @@ unsigned long pv_guest_cr4_fixup(const struct vcpu *v, unsigned long guest_cr4) hv_cr4_mask &= ~X86_CR4_OSXSAVE ;if ( (guest_cr4 & hv_cr4_mask) != (hv_cr4 & hv_cr4_mask) ) -gdprintk (XENLOG_WARNING , -"Attempt to change CR4 flags %08lx -> %08lx\n" , - hv_cr4, guest_cr4); +printk (XENLOG_G_WARNING +"d%d attempted to change %pv's CR4 flags %08lx -> %08lx\n" , + current->domain->domain_id, v, hv_cr4, guest_cr4);return (hv_cr4 & hv_cr4_mask) | (guest_cr4 & ~hv_cr4_mask); }
Signature · 1 line
1.7.10.4