2015-02-23 16:04:20

by Boris Ostrovsky

[permalink] [raw]
Subject: [PATCH] x86/xen: Initialize cr4 shadow for 64-bit PV(H) guests

Commit 1e02ce4cccdc ("x86: Store a per-cpu shadow copy of CR4")
introduced CR4 shadows.

These shadows are initialized in early boot code. The commit missed
initialization for 64-bit PV(H) guests that this patch adds.

Signed-off-by: Boris Ostrovsky <[email protected]>
---
arch/x86/xen/enlighten.c | 1 +
1 files changed, 1 insertions(+), 0 deletions(-)

diff --git a/arch/x86/xen/enlighten.c b/arch/x86/xen/enlighten.c
index bd8b845..7393f3e 100644
--- a/arch/x86/xen/enlighten.c
+++ b/arch/x86/xen/enlighten.c
@@ -1741,6 +1741,7 @@ asmlinkage __visible void __init xen_start_kernel(void)
#ifdef CONFIG_X86_32
i386_start_kernel();
#else
+ cr4_init_shadow(); /* 32b kernel does this in i386_start_kernel() */
x86_64_start_reservations((char *)__pa_symbol(&boot_params));
#endif
}
--
1.7.1


2015-02-23 16:09:35

by Andy Lutomirski

[permalink] [raw]
Subject: Re: [PATCH] x86/xen: Initialize cr4 shadow for 64-bit PV(H) guests

On Mon, Feb 23, 2015 at 8:01 AM, Boris Ostrovsky
<[email protected]> wrote:
> Commit 1e02ce4cccdc ("x86: Store a per-cpu shadow copy of CR4")
> introduced CR4 shadows.
>
> These shadows are initialized in early boot code. The commit missed
> initialization for 64-bit PV(H) guests that this patch adds.

Whoops, worry.

This is needed for 3.21, right?

--Andy

>
> Signed-off-by: Boris Ostrovsky <[email protected]>
> ---
> arch/x86/xen/enlighten.c | 1 +
> 1 files changed, 1 insertions(+), 0 deletions(-)
>
> diff --git a/arch/x86/xen/enlighten.c b/arch/x86/xen/enlighten.c
> index bd8b845..7393f3e 100644
> --- a/arch/x86/xen/enlighten.c
> +++ b/arch/x86/xen/enlighten.c
> @@ -1741,6 +1741,7 @@ asmlinkage __visible void __init xen_start_kernel(void)
> #ifdef CONFIG_X86_32
> i386_start_kernel();
> #else
> + cr4_init_shadow(); /* 32b kernel does this in i386_start_kernel() */
> x86_64_start_reservations((char *)__pa_symbol(&boot_params));
> #endif
> }
> --
> 1.7.1
>



--
Andy Lutomirski
AMA Capital Management, LLC

2015-02-23 16:16:32

by Boris Ostrovsky

[permalink] [raw]
Subject: Re: [PATCH] x86/xen: Initialize cr4 shadow for 64-bit PV(H) guests


On 02/23/2015 11:09 AM, Andy Lutomirski wrote:
> On Mon, Feb 23, 2015 at 8:01 AM, Boris Ostrovsky
> <[email protected]> wrote:
>> Commit 1e02ce4cccdc ("x86: Store a per-cpu shadow copy of CR4")
>> introduced CR4 shadows.
>>
>> These shadows are initialized in early boot code. The commit missed
>> initialization for 64-bit PV(H) guests that this patch adds.
> Whoops, worry.
>
> This is needed for 3.21, right?

It would have been 3.20, I think. Which is now 4.0.


-boris

>
> --Andy
>
>> Signed-off-by: Boris Ostrovsky <[email protected]>
>> ---
>> arch/x86/xen/enlighten.c | 1 +
>> 1 files changed, 1 insertions(+), 0 deletions(-)
>>
>> diff --git a/arch/x86/xen/enlighten.c b/arch/x86/xen/enlighten.c
>> index bd8b845..7393f3e 100644
>> --- a/arch/x86/xen/enlighten.c
>> +++ b/arch/x86/xen/enlighten.c
>> @@ -1741,6 +1741,7 @@ asmlinkage __visible void __init xen_start_kernel(void)
>> #ifdef CONFIG_X86_32
>> i386_start_kernel();
>> #else
>> + cr4_init_shadow(); /* 32b kernel does this in i386_start_kernel() */
>> x86_64_start_reservations((char *)__pa_symbol(&boot_params));
>> #endif
>> }
>> --
>> 1.7.1
>>
>
>

2015-02-23 17:24:28

by David Vrabel

[permalink] [raw]
Subject: Re: [Xen-devel] [PATCH] x86/xen: Initialize cr4 shadow for 64-bit PV(H) guests

On 23/02/15 16:01, Boris Ostrovsky wrote:
> Commit 1e02ce4cccdc ("x86: Store a per-cpu shadow copy of CR4")
> introduced CR4 shadows.
>
> These shadows are initialized in early boot code. The commit missed
> initialization for 64-bit PV(H) guests that this patch adds.

Applied to stable/for-linus-4.0, thanks.

Boris, can you kick of a set of tests on this branch, please?

David