virt: sev-guest: Add MODULE_ALIAS

Message ID ff480c5e688eb0a72a4db0a29c7b1bb54c45bfd4.1667594253.git.crobinso@redhat.com
State New
Headers
Series virt: sev-guest: Add MODULE_ALIAS |

Commit Message

Cole Robinson Nov. 4, 2022, 8:42 p.m. UTC
  This fixes driver autoloading

Fixes: fce96cf04430 ("virt: Add SEV-SNP guest driver")
Signed-off-by: Cole Robinson <crobinso@redhat.com>
---
 drivers/virt/coco/sev-guest/sev-guest.c | 1 +
 1 file changed, 1 insertion(+)
  

Comments

Borislav Petkov Nov. 4, 2022, 8:53 p.m. UTC | #1
On Fri, Nov 04, 2022 at 04:42:45PM -0400, Cole Robinson wrote:
> This fixes driver autoloading

What is the scenario where this needs to be autoloaded?
  
Cole Robinson Nov. 5, 2022, 4:08 p.m. UTC | #2
On 11/4/22 4:53 PM, Borislav Petkov wrote:
> On Fri, Nov 04, 2022 at 04:42:45PM -0400, Cole Robinson wrote:
>> This fixes driver autoloading
> 
> What is the scenario where this needs to be autoloaded?
> 

Any use case that needs /dev/sev-guest, I guess. Saves software from
having to do the modprobe manually. For example, nothing I can find in
https://github.com/AMDESE/sev-guest loads the driver, it expects
/dev/sev-guest to be there already

Mostly I assumed lack of autoloading was an oversight. Was it
intentionally omitted?

Thanks,
Cole
  
Tom Lendacky Nov. 7, 2022, 2:09 p.m. UTC | #3
On 11/5/22 11:08, Cole Robinson wrote:
> On 11/4/22 4:53 PM, Borislav Petkov wrote:
>> On Fri, Nov 04, 2022 at 04:42:45PM -0400, Cole Robinson wrote:
>>> This fixes driver autoloading
>>
>> What is the scenario where this needs to be autoloaded?
>>
> 
> Any use case that needs /dev/sev-guest, I guess. Saves software from
> having to do the modprobe manually. For example, nothing I can find in
> https://github.com/AMDESE/sev-guest loads the driver, it expects
> /dev/sev-guest to be there already
> 
> Mostly I assumed lack of autoloading was an oversight. Was it
> intentionally omitted?

It probably was an oversight. To me, it makes sense to auto-load the 
module if the SNP support created the platform device as part of SNP 
initialization.

Thanks,
Tom

> 
> Thanks,
> Cole
>
  
Tom Lendacky Nov. 7, 2022, 10:10 p.m. UTC | #4
On 11/4/22 15:42, Cole Robinson wrote:
> This fixes driver autoloading
> 
> Fixes: fce96cf04430 ("virt: Add SEV-SNP guest driver")
> Signed-off-by: Cole Robinson <crobinso@redhat.com>

Acked-by: Tom Lendacky <thomas.lendacky@amd.com>

> ---
>   drivers/virt/coco/sev-guest/sev-guest.c | 1 +
>   1 file changed, 1 insertion(+)
> 
> diff --git a/drivers/virt/coco/sev-guest/sev-guest.c b/drivers/virt/coco/sev-guest/sev-guest.c
> index f422f9c58ba7..4c426dbcd166 100644
> --- a/drivers/virt/coco/sev-guest/sev-guest.c
> +++ b/drivers/virt/coco/sev-guest/sev-guest.c
> @@ -744,3 +744,4 @@ MODULE_AUTHOR("Brijesh Singh <brijesh.singh@amd.com>");
>   MODULE_LICENSE("GPL");
>   MODULE_VERSION("1.0.0");
>   MODULE_DESCRIPTION("AMD SEV Guest Driver");
> +MODULE_ALIAS("platform:sev-guest");
  

Patch

diff --git a/drivers/virt/coco/sev-guest/sev-guest.c b/drivers/virt/coco/sev-guest/sev-guest.c
index f422f9c58ba7..4c426dbcd166 100644
--- a/drivers/virt/coco/sev-guest/sev-guest.c
+++ b/drivers/virt/coco/sev-guest/sev-guest.c
@@ -744,3 +744,4 @@  MODULE_AUTHOR("Brijesh Singh <brijesh.singh@amd.com>");
 MODULE_LICENSE("GPL");
 MODULE_VERSION("1.0.0");
 MODULE_DESCRIPTION("AMD SEV Guest Driver");
+MODULE_ALIAS("platform:sev-guest");