Re: [PATCH 48/65] x86/aepi: Annotate fnptr targets

2021-11-29 Thread Jan Beulich
On 26.11.2021 13:34, Andrew Cooper wrote:
> Signed-off-by: Andrew Cooper 

Nit: In the title I think you mean "x86/apei:".

Jan




[PATCH 48/65] x86/aepi: Annotate fnptr targets

2021-11-26 Thread Andrew Cooper
Signed-off-by: Andrew Cooper 
---
CC: Jan Beulich 
CC: Roger Pau Monné 
CC: Wei Liu 

I was very surprised when encountering this...  AML and EFI are bad enough,
but why on earth do we need yet another firmware provided arbitrary turning
machine to be executing in Xen's context.
---
 xen/drivers/acpi/apei/apei-base.c | 32 ++--
 xen/drivers/acpi/apei/apei-internal.h | 20 ++--
 xen/drivers/acpi/apei/erst.c  | 57 +--
 3 files changed, 54 insertions(+), 55 deletions(-)

diff --git a/xen/drivers/acpi/apei/apei-base.c 
b/xen/drivers/acpi/apei/apei-base.c
index 6f81e7fa366a..de75c1cef992 100644
--- a/xen/drivers/acpi/apei/apei-base.c
+++ b/xen/drivers/acpi/apei/apei-base.c
@@ -80,8 +80,8 @@ int __apei_exec_read_register(struct acpi_whea_header *entry, 
u64 *val)
return 0;
 }
 
-int apei_exec_read_register(struct apei_exec_context *ctx,
-   struct acpi_whea_header *entry)
+int cf_check apei_exec_read_register(
+   struct apei_exec_context *ctx, struct acpi_whea_header *entry)
 {
int rc;
u64 val = 0;
@@ -94,8 +94,8 @@ int apei_exec_read_register(struct apei_exec_context *ctx,
return 0;
 }
 
-int apei_exec_read_register_value(struct apei_exec_context *ctx,
- struct acpi_whea_header *entry)
+int cf_check apei_exec_read_register_value(
+   struct apei_exec_context *ctx, struct acpi_whea_header *entry)
 {
int rc;
 
@@ -126,14 +126,14 @@ int __apei_exec_write_register(struct acpi_whea_header 
*entry, u64 val)
return rc;
 }
 
-int apei_exec_write_register(struct apei_exec_context *ctx,
-struct acpi_whea_header *entry)
+int cf_check apei_exec_write_register(
+   struct apei_exec_context *ctx, struct acpi_whea_header *entry)
 {
return __apei_exec_write_register(entry, ctx->value);
 }
 
-int apei_exec_write_register_value(struct apei_exec_context *ctx,
-  struct acpi_whea_header *entry)
+int cf_check apei_exec_write_register_value(
+   struct apei_exec_context *ctx, struct acpi_whea_header *entry)
 {
int rc;
 
@@ -143,8 +143,8 @@ int apei_exec_write_register_value(struct apei_exec_context 
*ctx,
return rc;
 }
 
-int apei_exec_noop(struct apei_exec_context *ctx,
-  struct acpi_whea_header *entry)
+int cf_check apei_exec_noop(
+   struct apei_exec_context *ctx, struct acpi_whea_header *entry)
 {
return 0;
 }
@@ -230,9 +230,9 @@ static int __init apei_exec_for_each_entry(struct 
apei_exec_context *ctx,
return 0;
 }
 
-static int __init pre_map_gar_callback(struct apei_exec_context *ctx,
-  struct acpi_whea_header *entry,
-  void *data)
+static int __init cf_check pre_map_gar_callback(
+   struct apei_exec_context *ctx, struct acpi_whea_header *entry,
+   void *data)
 {
u8 ins = entry->instruction;
 
@@ -259,9 +259,9 @@ int __init apei_exec_pre_map_gars(struct apei_exec_context 
*ctx)
return rc;
 }
 
-static int __init post_unmap_gar_callback(struct apei_exec_context *ctx,
- struct acpi_whea_header *entry,
- void *data)
+static int __init cf_check post_unmap_gar_callback(
+   struct apei_exec_context *ctx, struct acpi_whea_header *entry,
+   void *data)
 {
u8 ins = entry->instruction;
 
diff --git a/xen/drivers/acpi/apei/apei-internal.h 
b/xen/drivers/acpi/apei/apei-internal.h
index b813d55b92a9..360e94b9c877 100644
--- a/xen/drivers/acpi/apei/apei-internal.h
+++ b/xen/drivers/acpi/apei/apei-internal.h
@@ -68,16 +68,16 @@ static inline int apei_exec_run_optional(struct 
apei_exec_context *ctx, u8 actio
 
 int __apei_exec_read_register(struct acpi_whea_header *entry, u64 *val);
 int __apei_exec_write_register(struct acpi_whea_header *entry, u64 val);
-int apei_exec_read_register(struct apei_exec_context *ctx,
-   struct acpi_whea_header *entry);
-int apei_exec_read_register_value(struct apei_exec_context *ctx,
- struct acpi_whea_header *entry);
-int apei_exec_write_register(struct apei_exec_context *ctx,
-struct acpi_whea_header *entry);
-int apei_exec_write_register_value(struct apei_exec_context *ctx,
-  struct acpi_whea_header *entry);
-int apei_exec_noop(struct apei_exec_context *ctx,
-  struct acpi_whea_header *entry);
+int cf_check apei_exec_read_register(
+   struct apei_exec_context *ctx, struct acpi_whea_header *entry);
+int cf_check apei_exec_read_register_value(
+   struct apei_exec_context *ctx, struct acpi_whea_header *entry);
+int cf_check apei_exec_write_register(
+   struct apei_exec_context *ctx, struct acpi_whea_header *entry);
+int cf_check apei_exec_write_register_value(
+