diff mbox series

[3/4] xen/gnttab: Perform compat/native gnttab_query_size check

Message ID 20240415154155.2718064-4-andrew.cooper3@citrix.com (mailing list archive)
State New
Headers show
Series xen/xlat: Improvements to compat hypercall checking | expand

Commit Message

Andrew Cooper April 15, 2024, 3:41 p.m. UTC
This subop appears to have been missed from the compat checks.

Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
---
CC: George Dunlap <George.Dunlap@citrix.com>
CC: Jan Beulich <JBeulich@suse.com>
CC: Stefano Stabellini <sstabellini@kernel.org>
CC: Julien Grall <julien@xen.org>
---
 xen/common/compat/grant_table.c | 4 ++++
 xen/include/xlat.lst            | 1 +
 2 files changed, 5 insertions(+)

Comments

Stefano Stabellini April 15, 2024, 9:54 p.m. UTC | #1
On Mon, 15 Apr 2024, Andrew Cooper wrote:
> This subop appears to have been missed from the compat checks.
> 
> Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
> ---
> CC: George Dunlap <George.Dunlap@citrix.com>
> CC: Jan Beulich <JBeulich@suse.com>
> CC: Stefano Stabellini <sstabellini@kernel.org>
> CC: Julien Grall <julien@xen.org>
> ---
>  xen/common/compat/grant_table.c | 4 ++++
>  xen/include/xlat.lst            | 1 +
>  2 files changed, 5 insertions(+)
> 
> diff --git a/xen/common/compat/grant_table.c b/xen/common/compat/grant_table.c
> index af98eade17c9..8a754055576b 100644
> --- a/xen/common/compat/grant_table.c
> +++ b/xen/common/compat/grant_table.c
> @@ -30,6 +30,10 @@ CHECK_gnttab_unmap_grant_ref;
>  CHECK_gnttab_unmap_and_replace;
>  #undef xen_gnttab_unmap_and_replace
>  
> +#define xen_gnttab_query_size gnttab_query_size
> +CHECK_gnttab_query_size;
> +#undef xen_gnttab_query_size
> +
>  DEFINE_XEN_GUEST_HANDLE(gnttab_setup_table_compat_t);
>  DEFINE_XEN_GUEST_HANDLE(gnttab_transfer_compat_t);
>  DEFINE_XEN_GUEST_HANDLE(gnttab_copy_compat_t);
> diff --git a/xen/include/xlat.lst b/xen/include/xlat.lst
> index b3befd9cc113..53a1bdfc533f 100644
> --- a/xen/include/xlat.lst
> +++ b/xen/include/xlat.lst
> @@ -88,6 +88,7 @@
>  !	gnttab_get_status_frames	grant_table.h
>  ?	gnttab_get_version		grant_table.h
>  ?	gnttab_map_grant_ref		grant_table.h
> +?	gnttab_query_size		grant_table.h
>  ?	gnttab_set_version		grant_table.h
>  !	gnttab_setup_table		grant_table.h
>  ?	gnttab_swap_grant_ref		grant_table.h
 

I am no compat layer expert, but shouldn't there be something like:

#ifndef CHECK_gnttab_map_grant_ref
    CASE(map_grant_ref);
#endif

somewhere under compat_grant_table_op ?
Jan Beulich April 18, 2024, 9:03 a.m. UTC | #2
On 15.04.2024 23:54, Stefano Stabellini wrote:
> On Mon, 15 Apr 2024, Andrew Cooper wrote:
>> This subop appears to have been missed from the compat checks.
>>
>> Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
>> ---
>> CC: George Dunlap <George.Dunlap@citrix.com>
>> CC: Jan Beulich <JBeulich@suse.com>
>> CC: Stefano Stabellini <sstabellini@kernel.org>
>> CC: Julien Grall <julien@xen.org>
>> ---
>>  xen/common/compat/grant_table.c | 4 ++++
>>  xen/include/xlat.lst            | 1 +
>>  2 files changed, 5 insertions(+)
>>
>> diff --git a/xen/common/compat/grant_table.c b/xen/common/compat/grant_table.c
>> index af98eade17c9..8a754055576b 100644
>> --- a/xen/common/compat/grant_table.c
>> +++ b/xen/common/compat/grant_table.c
>> @@ -30,6 +30,10 @@ CHECK_gnttab_unmap_grant_ref;
>>  CHECK_gnttab_unmap_and_replace;
>>  #undef xen_gnttab_unmap_and_replace
>>  
>> +#define xen_gnttab_query_size gnttab_query_size
>> +CHECK_gnttab_query_size;
>> +#undef xen_gnttab_query_size
>> +
>>  DEFINE_XEN_GUEST_HANDLE(gnttab_setup_table_compat_t);
>>  DEFINE_XEN_GUEST_HANDLE(gnttab_transfer_compat_t);
>>  DEFINE_XEN_GUEST_HANDLE(gnttab_copy_compat_t);
>> diff --git a/xen/include/xlat.lst b/xen/include/xlat.lst
>> index b3befd9cc113..53a1bdfc533f 100644
>> --- a/xen/include/xlat.lst
>> +++ b/xen/include/xlat.lst
>> @@ -88,6 +88,7 @@
>>  !	gnttab_get_status_frames	grant_table.h
>>  ?	gnttab_get_version		grant_table.h
>>  ?	gnttab_map_grant_ref		grant_table.h
>> +?	gnttab_query_size		grant_table.h
>>  ?	gnttab_set_version		grant_table.h
>>  !	gnttab_setup_table		grant_table.h
>>  ?	gnttab_swap_grant_ref		grant_table.h
>  
> 
> I am no compat layer expert, but shouldn't there be something like:
> 
> #ifndef CHECK_gnttab_map_grant_ref
>     CASE(map_grant_ref);
> #endif
> 
> somewhere under compat_grant_table_op ?

It's there first in the group of similar constructs. Or do you mean a
counterpart thereof for query_size?

Jan
Jan Beulich April 18, 2024, 9:13 a.m. UTC | #3
On 15.04.2024 17:41, Andrew Cooper wrote:
> This subop appears to have been missed from the compat checks.

Fixes: 5ce8fafa947c ("Dynamic grant-table sizing")

> Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>

With the addition that I'm now sure Stefano meant (see the reply to him):
Reviewed-by: Jan Beulich <jbeulich@suse.com>

Jan
diff mbox series

Patch

diff --git a/xen/common/compat/grant_table.c b/xen/common/compat/grant_table.c
index af98eade17c9..8a754055576b 100644
--- a/xen/common/compat/grant_table.c
+++ b/xen/common/compat/grant_table.c
@@ -30,6 +30,10 @@  CHECK_gnttab_unmap_grant_ref;
 CHECK_gnttab_unmap_and_replace;
 #undef xen_gnttab_unmap_and_replace
 
+#define xen_gnttab_query_size gnttab_query_size
+CHECK_gnttab_query_size;
+#undef xen_gnttab_query_size
+
 DEFINE_XEN_GUEST_HANDLE(gnttab_setup_table_compat_t);
 DEFINE_XEN_GUEST_HANDLE(gnttab_transfer_compat_t);
 DEFINE_XEN_GUEST_HANDLE(gnttab_copy_compat_t);
diff --git a/xen/include/xlat.lst b/xen/include/xlat.lst
index b3befd9cc113..53a1bdfc533f 100644
--- a/xen/include/xlat.lst
+++ b/xen/include/xlat.lst
@@ -88,6 +88,7 @@ 
 !	gnttab_get_status_frames	grant_table.h
 ?	gnttab_get_version		grant_table.h
 ?	gnttab_map_grant_ref		grant_table.h
+?	gnttab_query_size		grant_table.h
 ?	gnttab_set_version		grant_table.h
 !	gnttab_setup_table		grant_table.h
 ?	gnttab_swap_grant_ref		grant_table.h