mbox series

[SRU,mantic:linux-gcp,lunar:linux-gcp,0/2] SEV_SNP failure to init

Message ID 20230925183922.71728-1-john.cabaj@canonical.com
Headers show
Series SEV_SNP failure to init | expand

Message

John Cabaj Sept. 25, 2023, 6:39 p.m. UTC
BugLink: https://bugs.launchpad.net/bugs/2037316

[Impact]

* Kernel fails to boot on SEV-SNP instances when compiled with GCC 12.3.0

[Fix]

* https://lore.kernel.org/lkml/20230912002703.3924521-1-acdunlap@google.com/

[Test Case]

* Compile tested
* Boot tested
* Tested by Google

[Where things could go wrong]

* Patches relatively isolated and maintain similar checking functionality, 
  just earlier in boot. Likely a low chance of regression.

Adam Dunlap (2):
  x86/sev-es: Allow copy_from_kernel_nofault in earlier boot
  x86/sev-es: Only set x86_virt_bits to correct value

 arch/x86/kernel/cpu/common.c | 37 +++++++++++++++++++++---------------
 arch/x86/mm/maccess.c        | 19 +++++++++++++-----
 2 files changed, 36 insertions(+), 20 deletions(-)

Comments

Tim Gardner Sept. 25, 2023, 6:47 p.m. UTC | #1
On 9/25/23 12:39 PM, John Cabaj wrote:
> BugLink: https://bugs.launchpad.net/bugs/2037316
> 
> [Impact]
> 
> * Kernel fails to boot on SEV-SNP instances when compiled with GCC 12.3.0
> 
> [Fix]
> 
> * https://lore.kernel.org/lkml/20230912002703.3924521-1-acdunlap@google.com/
> 
> [Test Case]
> 
> * Compile tested
> * Boot tested
> * Tested by Google
> 
> [Where things could go wrong]
> 
> * Patches relatively isolated and maintain similar checking functionality,
>    just earlier in boot. Likely a low chance of regression.
> 
> Adam Dunlap (2):
>    x86/sev-es: Allow copy_from_kernel_nofault in earlier boot
>    x86/sev-es: Only set x86_virt_bits to correct value
> 
>   arch/x86/kernel/cpu/common.c | 37 +++++++++++++++++++++---------------
>   arch/x86/mm/maccess.c        | 19 +++++++++++++-----
>   2 files changed, 36 insertions(+), 20 deletions(-)
> 

Is there any reason these patches shouldn't be applied to the generic 
kernel ? That way all the derivatives are fixed wrt SEV-SNP.
John Cabaj Sept. 25, 2023, 6:51 p.m. UTC | #2
On 9/25/23 1:47 PM, Tim Gardner wrote:
> On 9/25/23 12:39 PM, John Cabaj wrote:
>> BugLink: https://bugs.launchpad.net/bugs/2037316
>>
>> [Impact]
>>
>> * Kernel fails to boot on SEV-SNP instances when compiled with GCC 12.3.0
>>
>> [Fix]
>>
>> * https://lore.kernel.org/lkml/20230912002703.3924521-1-acdunlap@google.com/
>>
>> [Test Case]
>>
>> * Compile tested
>> * Boot tested
>> * Tested by Google
>>
>> [Where things could go wrong]
>>
>> * Patches relatively isolated and maintain similar checking functionality,
>>    just earlier in boot. Likely a low chance of regression.
>>
>> Adam Dunlap (2):
>>    x86/sev-es: Allow copy_from_kernel_nofault in earlier boot
>>    x86/sev-es: Only set x86_virt_bits to correct value
>>
>>   arch/x86/kernel/cpu/common.c | 37 +++++++++++++++++++++---------------
>>   arch/x86/mm/maccess.c        | 19 +++++++++++++-----
>>   2 files changed, 36 insertions(+), 20 deletions(-)
>>
> 
> Is there any reason these patches shouldn't be applied to the generic kernel ? That way all the derivatives are fixed wrt SEV-SNP.

They're simple enough that we could apply to the generic kernel as well, since I know a couple other kernels could use it. GCP needs this for 2023.10.02, so these patches would need ACKs and application by 27-Sep. Might need some coordination with the Stable team.


John
Tim Gardner Sept. 25, 2023, 7:19 p.m. UTC | #3
On 9/25/23 12:51 PM, John Cabaj wrote:
> On 9/25/23 1:47 PM, Tim Gardner wrote:
>> On 9/25/23 12:39 PM, John Cabaj wrote:
>>> BugLink: https://bugs.launchpad.net/bugs/2037316
>>>
>>> [Impact]
>>>
>>> * Kernel fails to boot on SEV-SNP instances when compiled with GCC 12.3.0
>>>
>>> [Fix]
>>>
>>> * https://lore.kernel.org/lkml/20230912002703.3924521-1-acdunlap@google.com/
>>>
>>> [Test Case]
>>>
>>> * Compile tested
>>> * Boot tested
>>> * Tested by Google
>>>
>>> [Where things could go wrong]
>>>
>>> * Patches relatively isolated and maintain similar checking functionality,
>>>     just earlier in boot. Likely a low chance of regression.
>>>
>>> Adam Dunlap (2):
>>>     x86/sev-es: Allow copy_from_kernel_nofault in earlier boot
>>>     x86/sev-es: Only set x86_virt_bits to correct value
>>>
>>>    arch/x86/kernel/cpu/common.c | 37 +++++++++++++++++++++---------------
>>>    arch/x86/mm/maccess.c        | 19 +++++++++++++-----
>>>    2 files changed, 36 insertions(+), 20 deletions(-)
>>>
>>
>> Is there any reason these patches shouldn't be applied to the generic kernel ? That way all the derivatives are fixed wrt SEV-SNP.
> 
> They're simple enough that we could apply to the generic kernel as well, since I know a couple other kernels could use it. GCP needs this for 2023.10.02, so these patches would need ACKs and application by 27-Sep. Might need some coordination with the Stable team.
> 
> 
> John
> 
Acked-by: Tim Gardner <tim.gardner@canonical.com>

Would you mind reposting these for generic ? I'd like to get them in the 
2023.10.02 cycle as well.

Should these be SAUCE until they've made it upstream ?
John Cabaj Sept. 25, 2023, 7:21 p.m. UTC | #4
On 9/25/23 2:19 PM, Tim Gardner wrote:
> On 9/25/23 12:51 PM, John Cabaj wrote:
>> On 9/25/23 1:47 PM, Tim Gardner wrote:
>>> On 9/25/23 12:39 PM, John Cabaj wrote:
>>>> BugLink: https://bugs.launchpad.net/bugs/2037316
>>>>
>>>> [Impact]
>>>>
>>>> * Kernel fails to boot on SEV-SNP instances when compiled with GCC 12.3.0
>>>>
>>>> [Fix]
>>>>
>>>> * https://lore.kernel.org/lkml/20230912002703.3924521-1-acdunlap@google.com/
>>>>
>>>> [Test Case]
>>>>
>>>> * Compile tested
>>>> * Boot tested
>>>> * Tested by Google
>>>>
>>>> [Where things could go wrong]
>>>>
>>>> * Patches relatively isolated and maintain similar checking functionality,
>>>>     just earlier in boot. Likely a low chance of regression.
>>>>
>>>> Adam Dunlap (2):
>>>>     x86/sev-es: Allow copy_from_kernel_nofault in earlier boot
>>>>     x86/sev-es: Only set x86_virt_bits to correct value
>>>>
>>>>    arch/x86/kernel/cpu/common.c | 37 +++++++++++++++++++++---------------
>>>>    arch/x86/mm/maccess.c        | 19 +++++++++++++-----
>>>>    2 files changed, 36 insertions(+), 20 deletions(-)
>>>>
>>>
>>> Is there any reason these patches shouldn't be applied to the generic kernel ? That way all the derivatives are fixed wrt SEV-SNP.
>>
>> They're simple enough that we could apply to the generic kernel as well, since I know a couple other kernels could use it. GCP needs this for 2023.10.02, so these patches would need ACKs and application by 27-Sep. Might need some coordination with the Stable team.
>>
>>
>> John
>>
> Acked-by: Tim Gardner <tim.gardner@canonical.com>
> 
> Would you mind reposting these for generic ? I'd like to get them in the 2023.10.02 cycle as well.

Will do, with below considerations.

> 
> Should these be SAUCE until they've made it upstream ?

Will fix this in the APPLIED.


Thanks,
John
Thadeu Lima de Souza Cascardo Sept. 25, 2023, 8:25 p.m. UTC | #5
On Mon, Sep 25, 2023 at 01:19:51PM -0600, Tim Gardner wrote:
> On 9/25/23 12:51 PM, John Cabaj wrote:
> > On 9/25/23 1:47 PM, Tim Gardner wrote:
> > > On 9/25/23 12:39 PM, John Cabaj wrote:
> > > > BugLink: https://bugs.launchpad.net/bugs/2037316
> > > > 
> > > > [Impact]
> > > > 
> > > > * Kernel fails to boot on SEV-SNP instances when compiled with GCC 12.3.0
> > > > 
> > > > [Fix]
> > > > 
> > > > * https://lore.kernel.org/lkml/20230912002703.3924521-1-acdunlap@google.com/
> > > > 
> > > > [Test Case]
> > > > 
> > > > * Compile tested
> > > > * Boot tested
> > > > * Tested by Google
> > > > 
> > > > [Where things could go wrong]
> > > > 
> > > > * Patches relatively isolated and maintain similar checking functionality,
> > > >     just earlier in boot. Likely a low chance of regression.
> > > > 
> > > > Adam Dunlap (2):
> > > >     x86/sev-es: Allow copy_from_kernel_nofault in earlier boot
> > > >     x86/sev-es: Only set x86_virt_bits to correct value
> > > > 
> > > >    arch/x86/kernel/cpu/common.c | 37 +++++++++++++++++++++---------------
> > > >    arch/x86/mm/maccess.c        | 19 +++++++++++++-----
> > > >    2 files changed, 36 insertions(+), 20 deletions(-)
> > > > 
> > > 
> > > Is there any reason these patches shouldn't be applied to the generic kernel ? That way all the derivatives are fixed wrt SEV-SNP.
> > 
> > They're simple enough that we could apply to the generic kernel as well, since I know a couple other kernels could use it. GCP needs this for 2023.10.02, so these patches would need ACKs and application by 27-Sep. Might need some coordination with the Stable team.
> > 
> > 
> > John
> > 
> Acked-by: Tim Gardner <tim.gardner@canonical.com>
> 
> Would you mind reposting these for generic ? I'd like to get them in the
> 2023.10.02 cycle as well.

Those are not upstream yet, so I'd be weary to apply them so soon in -generic.
If other kernels seem to require it, perhaps you should consider sending the
patches for those kernels instead of having them land on -generic so soon.

Cascardo.

> 
> Should these be SAUCE until they've made it upstream ?
> -- 
> -----------
> Tim Gardner
> Canonical, Inc
Thadeu Lima de Souza Cascardo Sept. 25, 2023, 8:26 p.m. UTC | #6
Acked-by: Thadeu Lima de Souza Cascardo <cascardo@canonical.com>

Don't forget to apply them as SAUCE.

Cascardo.
John Cabaj Sept. 26, 2023, 1:07 a.m. UTC | #7
On 9/25/23 1:39 PM, John Cabaj wrote:
> BugLink: https://bugs.launchpad.net/bugs/2037316
> 
> [Impact]
> 
> * Kernel fails to boot on SEV-SNP instances when compiled with GCC 12.3.0
> 
> [Fix]
> 
> * https://lore.kernel.org/lkml/20230912002703.3924521-1-acdunlap@google.com/
> 
> [Test Case]
> 
> * Compile tested
> * Boot tested
> * Tested by Google
> 
> [Where things could go wrong]
> 
> * Patches relatively isolated and maintain similar checking functionality, 
>   just earlier in boot. Likely a low chance of regression.
> 
> Adam Dunlap (2):
>   x86/sev-es: Allow copy_from_kernel_nofault in earlier boot
>   x86/sev-es: Only set x86_virt_bits to correct value
> 
>  arch/x86/kernel/cpu/common.c | 37 +++++++++++++++++++++---------------
>  arch/x86/mm/maccess.c        | 19 +++++++++++++-----
>  2 files changed, 36 insertions(+), 20 deletions(-)
> 

Patches applied to mantic:linux-gcp and lunar:linux-gcp master-next branches.


Thanks,
John