diff mbox series

[1/2] drm/vmwgfx: Fix missing HYPERVISOR_GUEST dependency

Message ID 20240616012511.198243-1-alexey.makhalov@broadcom.com (mailing list archive)
State Handled Elsewhere
Headers show
Series [1/2] drm/vmwgfx: Fix missing HYPERVISOR_GUEST dependency | expand

Commit Message

Alexey Makhalov June 16, 2024, 1:25 a.m. UTC
VMWARE_HYPERCALL alternative will not work as intended without
VMware guest code initialization.

Reported-by: kernel test robot <lkp@intel.com>
Closes: https://lore.kernel.org/oe-kbuild-all/202406152104.FxakP1MB-lkp@intel.com/
Signed-off-by: Alexey Makhalov <alexey.makhalov@broadcom.com>
---
 drivers/gpu/drm/vmwgfx/Kconfig | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comments

Borislav Petkov June 17, 2024, 9:07 a.m. UTC | #1
On Sat, Jun 15, 2024 at 06:25:10PM -0700, Alexey Makhalov wrote:
> VMWARE_HYPERCALL alternative will not work as intended without
> VMware guest code initialization.
> 
> Reported-by: kernel test robot <lkp@intel.com>
> Closes: https://lore.kernel.org/oe-kbuild-all/202406152104.FxakP1MB-lkp@intel.com/
> Signed-off-by: Alexey Makhalov <alexey.makhalov@broadcom.com>
> ---
>  drivers/gpu/drm/vmwgfx/Kconfig | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/drivers/gpu/drm/vmwgfx/Kconfig b/drivers/gpu/drm/vmwgfx/Kconfig
> index faddae3d6ac2..6f1ac940cbae 100644
> --- a/drivers/gpu/drm/vmwgfx/Kconfig
> +++ b/drivers/gpu/drm/vmwgfx/Kconfig
> @@ -2,7 +2,7 @@
>  config DRM_VMWGFX
>  	tristate "DRM driver for VMware Virtual GPU"
>  	depends on DRM && PCI && MMU
> -	depends on X86 || ARM64
> +	depends on (X86 && HYPERVISOR_GUEST) || ARM64
>  	select DRM_TTM
>  	select DRM_TTM_HELPER
>  	select MAPPING_DIRTY_HELPERS
> -- 

Right, I'll queue this soon but it doesn't reproduce here with gcc-11 or gcc-13.
This must be something gcc-9 specific or so...
Borislav Petkov June 17, 2024, 10:01 a.m. UTC | #2
On Mon, Jun 17, 2024 at 11:07:09AM +0200, Borislav Petkov wrote:
> On Sat, Jun 15, 2024 at 06:25:10PM -0700, Alexey Makhalov wrote:
> > VMWARE_HYPERCALL alternative will not work as intended without
> > VMware guest code initialization.
> > 
> > Reported-by: kernel test robot <lkp@intel.com>
> > Closes: https://lore.kernel.org/oe-kbuild-all/202406152104.FxakP1MB-lkp@intel.com/
> > Signed-off-by: Alexey Makhalov <alexey.makhalov@broadcom.com>
> > ---
> >  drivers/gpu/drm/vmwgfx/Kconfig | 2 +-
> >  1 file changed, 1 insertion(+), 1 deletion(-)
> > 
> > diff --git a/drivers/gpu/drm/vmwgfx/Kconfig b/drivers/gpu/drm/vmwgfx/Kconfig
> > index faddae3d6ac2..6f1ac940cbae 100644
> > --- a/drivers/gpu/drm/vmwgfx/Kconfig
> > +++ b/drivers/gpu/drm/vmwgfx/Kconfig
> > @@ -2,7 +2,7 @@
> >  config DRM_VMWGFX
> >  	tristate "DRM driver for VMware Virtual GPU"
> >  	depends on DRM && PCI && MMU
> > -	depends on X86 || ARM64
> > +	depends on (X86 && HYPERVISOR_GUEST) || ARM64
> >  	select DRM_TTM
> >  	select DRM_TTM_HELPER
> >  	select MAPPING_DIRTY_HELPERS
> > -- 
> 
> Right, I'll queue this soon but it doesn't reproduce here with gcc-11 or gcc-13.
> This must be something gcc-9 specific or so...

Actually, that's a DRM patch.

Folks in To: ok to carry this though the tip tree?

Thx.
Zack Rusin June 17, 2024, 1:47 p.m. UTC | #3
On Mon, Jun 17, 2024 at 6:02 AM Borislav Petkov <bp@alien8.de> wrote:
>
> On Mon, Jun 17, 2024 at 11:07:09AM +0200, Borislav Petkov wrote:
> > On Sat, Jun 15, 2024 at 06:25:10PM -0700, Alexey Makhalov wrote:
> > > VMWARE_HYPERCALL alternative will not work as intended without
> > > VMware guest code initialization.
> > >
> > > Reported-by: kernel test robot <lkp@intel.com>
> > > Closes: https://lore.kernel.org/oe-kbuild-all/202406152104.FxakP1MB-lkp@intel.com/
> > > Signed-off-by: Alexey Makhalov <alexey.makhalov@broadcom.com>
> > > ---
> > >  drivers/gpu/drm/vmwgfx/Kconfig | 2 +-
> > >  1 file changed, 1 insertion(+), 1 deletion(-)
> > >
> > > diff --git a/drivers/gpu/drm/vmwgfx/Kconfig b/drivers/gpu/drm/vmwgfx/Kconfig
> > > index faddae3d6ac2..6f1ac940cbae 100644
> > > --- a/drivers/gpu/drm/vmwgfx/Kconfig
> > > +++ b/drivers/gpu/drm/vmwgfx/Kconfig
> > > @@ -2,7 +2,7 @@
> > >  config DRM_VMWGFX
> > >     tristate "DRM driver for VMware Virtual GPU"
> > >     depends on DRM && PCI && MMU
> > > -   depends on X86 || ARM64
> > > +   depends on (X86 && HYPERVISOR_GUEST) || ARM64
> > >     select DRM_TTM
> > >     select DRM_TTM_HELPER
> > >     select MAPPING_DIRTY_HELPERS
> > > --
> >
> > Right, I'll queue this soon but it doesn't reproduce here with gcc-11 or gcc-13.
> > This must be something gcc-9 specific or so...
>
> Actually, that's a DRM patch.
>
> Folks in To: ok to carry this though the tip tree?

That's fine with me. Thanks.

z
Alexey Makhalov June 17, 2024, 8:51 p.m. UTC | #4
On 6/17/24 2:07 AM, Borislav Petkov wrote:
> On Sat, Jun 15, 2024 at 06:25:10PM -0700, Alexey Makhalov wrote:
>> VMWARE_HYPERCALL alternative will not work as intended without
>> VMware guest code initialization.
>>
>> Reported-by: kernel test robot <lkp@intel.com>
>> Closes: https://lore.kernel.org/oe-kbuild-all/202406152104.FxakP1MB-lkp@intel.com/
>> Signed-off-by: Alexey Makhalov <alexey.makhalov@broadcom.com>
>> ---
>>   drivers/gpu/drm/vmwgfx/Kconfig | 2 +-
>>   1 file changed, 1 insertion(+), 1 deletion(-)
>>
>> diff --git a/drivers/gpu/drm/vmwgfx/Kconfig b/drivers/gpu/drm/vmwgfx/Kconfig
>> index faddae3d6ac2..6f1ac940cbae 100644
>> --- a/drivers/gpu/drm/vmwgfx/Kconfig
>> +++ b/drivers/gpu/drm/vmwgfx/Kconfig
>> @@ -2,7 +2,7 @@
>>   config DRM_VMWGFX
>>   	tristate "DRM driver for VMware Virtual GPU"
>>   	depends on DRM && PCI && MMU
>> -	depends on X86 || ARM64
>> +	depends on (X86 && HYPERVISOR_GUEST) || ARM64
>>   	select DRM_TTM
>>   	select DRM_TTM_HELPER
>>   	select MAPPING_DIRTY_HELPERS
>> -- 
> 
> Right, I'll queue this soon but it doesn't reproduce here with gcc-11 or gcc-13.
> This must be something gcc-9 specific or so...
> 

Not really a gcc related, but the matter of a config file. It is 
reproducible if CONFIG_HYPERVISOR_GUEST not set, but 
CONFIG_DRM_VMWGFX=y. And this combination was allowed before the fix.

Regards,
--Alexey
Borislav Petkov June 17, 2024, 9:17 p.m. UTC | #5
On Mon, Jun 17, 2024 at 01:51:23PM -0700, Alexey Makhalov wrote:
> Not really a gcc related, but the matter of a config file. It is
> reproducible if CONFIG_HYPERVISOR_GUEST not set, but CONFIG_DRM_VMWGFX=y.
> And this combination was allowed before the fix.

Using their config:

$ grep -E "(CONFIG_DRM_VMWGFX|CONFIG_HYPERVISOR_GUEST)" .config
# CONFIG_HYPERVISOR_GUEST is not set
CONFIG_DRM_VMWGFX=y
CONFIG_DRM_VMWGFX_MKSSTATS=y

$ make ...

  OBJCOPY arch/x86/boot/setup.bin
  BUILD   arch/x86/boot/bzImage
Kernel: arch/x86/boot/bzImage is ready  (#2)
$ gcc --version
gcc (Debian 13.2.0-25) 13.2.0
$

So no, I can't reproduce with my compiler.
Alexey Makhalov June 17, 2024, 10:48 p.m. UTC | #6
On 6/17/24 2:17 PM, Borislav Petkov wrote:
> On Mon, Jun 17, 2024 at 01:51:23PM -0700, Alexey Makhalov wrote:
>> Not really a gcc related, but the matter of a config file. It is
>> reproducible if CONFIG_HYPERVISOR_GUEST not set, but CONFIG_DRM_VMWGFX=y.
>> And this combination was allowed before the fix.
> 
> Using their config:
> 
> $ grep -E "(CONFIG_DRM_VMWGFX|CONFIG_HYPERVISOR_GUEST)" .config
> # CONFIG_HYPERVISOR_GUEST is not set
> CONFIG_DRM_VMWGFX=y
> CONFIG_DRM_VMWGFX_MKSSTATS=y
> 
> $ make ...
> 
>    OBJCOPY arch/x86/boot/setup.bin
>    BUILD   arch/x86/boot/bzImage
> Kernel: arch/x86/boot/bzImage is ready  (#2)
> $ gcc --version
> gcc (Debian 13.2.0-25) 13.2.0
> $
> 
> So no, I can't reproduce with my compiler.
> 

That is interesting! Happy to debug it, but unfortunately I can not 
reproduce your "good" compilation without the fix.
I tried
"gcc (Ubuntu 13.2.0-23ubuntu4) 13.2.0" in Ubuntu, and
"gcc (GCC) 12.2.0" in Photon OS.
All of them fail with an "undefined reference to `vmware_hypercall_slow'"
diff mbox series

Patch

diff --git a/drivers/gpu/drm/vmwgfx/Kconfig b/drivers/gpu/drm/vmwgfx/Kconfig
index faddae3d6ac2..6f1ac940cbae 100644
--- a/drivers/gpu/drm/vmwgfx/Kconfig
+++ b/drivers/gpu/drm/vmwgfx/Kconfig
@@ -2,7 +2,7 @@ 
 config DRM_VMWGFX
 	tristate "DRM driver for VMware Virtual GPU"
 	depends on DRM && PCI && MMU
-	depends on X86 || ARM64
+	depends on (X86 && HYPERVISOR_GUEST) || ARM64
 	select DRM_TTM
 	select DRM_TTM_HELPER
 	select MAPPING_DIRTY_HELPERS