All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 0/2] Cleanup internal WHPX headers
@ 2020-12-19  9:06 Paolo Bonzini
  2020-12-19  9:06 ` [PATCH 1/2] whpx: rename whp-dispatch to whpx-internal.h Paolo Bonzini
                   ` (2 more replies)
  0 siblings, 3 replies; 7+ messages in thread
From: Paolo Bonzini @ 2020-12-19  9:06 UTC (permalink / raw)
  To: qemu-devel; +Cc: marcandre.lureau

Remove Windows type usage from sysemu/whpx.h, because
the whp-dispatch.h header is internal to the WHPX accelerator
implementation.  Fixes WHPX build.

Paolo Bonzini (2):
  whpx: rename whp-dispatch to whpx-internal.h
  whpx: move internal definitions to whpx-internal.h

 include/sysemu/whpx.h                         | 22 +----------------
 target/i386/whpx/whpx-all.c                   |  9 +++----
 target/i386/whpx/whpx-apic.c                  |  2 +-
 target/i386/whpx/whpx-cpus.c                  |  4 +---
 .../whpx/{whp-dispatch.h => whpx-internal.h}  | 24 ++++++++++++++++---
 5 files changed, 29 insertions(+), 32 deletions(-)
 rename target/i386/whpx/{whp-dispatch.h => whpx-internal.h} (91%)

-- 
2.26.2



^ permalink raw reply	[flat|nested] 7+ messages in thread

* [PATCH 1/2] whpx: rename whp-dispatch to whpx-internal.h
  2020-12-19  9:06 [PATCH 0/2] Cleanup internal WHPX headers Paolo Bonzini
@ 2020-12-19  9:06 ` Paolo Bonzini
  2020-12-21  8:15   ` Marc-André Lureau
  2020-12-19  9:06 ` [PATCH 2/2] whpx: move internal definitions " Paolo Bonzini
  2020-12-19  9:12 ` [PATCH 0/2] Cleanup internal WHPX headers no-reply
  2 siblings, 1 reply; 7+ messages in thread
From: Paolo Bonzini @ 2020-12-19  9:06 UTC (permalink / raw)
  To: qemu-devel; +Cc: marcandre.lureau

Rename the file in preparation for moving more implementation-internal
definitions to it.  The build is still broken though.

Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
---
 target/i386/whpx/whpx-all.c                          | 5 +----
 target/i386/whpx/whpx-apic.c                         | 2 +-
 target/i386/whpx/whpx-cpus.c                         | 4 +---
 target/i386/whpx/{whp-dispatch.h => whpx-internal.h} | 6 +++---
 4 files changed, 6 insertions(+), 11 deletions(-)
 rename target/i386/whpx/{whp-dispatch.h => whpx-internal.h} (98%)

diff --git a/target/i386/whpx/whpx-all.c b/target/i386/whpx/whpx-all.c
index 3b824fc9d7..12f79e2cd6 100644
--- a/target/i386/whpx/whpx-all.c
+++ b/target/i386/whpx/whpx-all.c
@@ -26,13 +26,10 @@
 #include "qapi/qapi-types-common.h"
 #include "qapi/qapi-visit-common.h"
 #include "migration/blocker.h"
-#include "whp-dispatch.h"
 #include <winerror.h>
 
 #include "whpx-cpus.h"
-
-#include <WinHvPlatform.h>
-#include <WinHvEmulation.h>
+#include "whpx-internal.h"
 
 #define HYPERV_APIC_BUS_FREQUENCY      (200000000ULL)
 
diff --git a/target/i386/whpx/whpx-apic.c b/target/i386/whpx/whpx-apic.c
index b127a3cb8a..1d330bf749 100644
--- a/target/i386/whpx/whpx-apic.c
+++ b/target/i386/whpx/whpx-apic.c
@@ -18,7 +18,7 @@
 #include "hw/pci/msi.h"
 #include "sysemu/hw_accel.h"
 #include "sysemu/whpx.h"
-#include "whp-dispatch.h"
+#include "whpx-internal.h"
 
 static void whpx_put_apic_state(APICCommonState *s,
                                 struct whpx_lapic_state *kapic)
diff --git a/target/i386/whpx/whpx-cpus.c b/target/i386/whpx/whpx-cpus.c
index d9bd5a2d36..f7e69881a3 100644
--- a/target/i386/whpx/whpx-cpus.c
+++ b/target/i386/whpx/whpx-cpus.c
@@ -15,11 +15,9 @@
 #include "qemu/guest-random.h"
 
 #include "sysemu/whpx.h"
+#include "whpx-internal.h"
 #include "whpx-cpus.h"
 
-#include <WinHvPlatform.h>
-#include <WinHvEmulation.h>
-
 static void *whpx_cpu_thread_fn(void *arg)
 {
     CPUState *cpu = arg;
diff --git a/target/i386/whpx/whp-dispatch.h b/target/i386/whpx/whpx-internal.h
similarity index 98%
rename from target/i386/whpx/whp-dispatch.h
rename to target/i386/whpx/whpx-internal.h
index cef5d848bd..e0a9ea1dce 100644
--- a/target/i386/whpx/whp-dispatch.h
+++ b/target/i386/whpx/whpx-internal.h
@@ -1,5 +1,5 @@
-#ifndef WHP_DISPATCH_H
-#define WHP_DISPATCH_H
+#ifndef WHP_INTERNAL_H
+#define WHP_INTERNAL_H
 
 #include <windows.h>
 #include <WinHvPlatform.h>
@@ -72,4 +72,4 @@ typedef enum WHPFunctionList {
     WINHV_PLATFORM_FNS_SUPPLEMENTAL
 } WHPFunctionList;
 
-#endif /* WHP_DISPATCH_H */
+#endif /* WHP_INTERNAL_H */
-- 
2.26.2




^ permalink raw reply related	[flat|nested] 7+ messages in thread

* [PATCH 2/2] whpx: move internal definitions to whpx-internal.h
  2020-12-19  9:06 [PATCH 0/2] Cleanup internal WHPX headers Paolo Bonzini
  2020-12-19  9:06 ` [PATCH 1/2] whpx: rename whp-dispatch to whpx-internal.h Paolo Bonzini
@ 2020-12-19  9:06 ` Paolo Bonzini
  2020-12-21  8:17   ` Marc-André Lureau
  2021-01-07 11:15   ` Philippe Mathieu-Daudé
  2020-12-19  9:12 ` [PATCH 0/2] Cleanup internal WHPX headers no-reply
  2 siblings, 2 replies; 7+ messages in thread
From: Paolo Bonzini @ 2020-12-19  9:06 UTC (permalink / raw)
  To: qemu-devel; +Cc: marcandre.lureau

Only leave the external interface in sysemu/whpx.h.  whpx_apic_in_platform
is moved to a .c file because it needs whpx_state.

Reported-by: Marc-André Lureau <marcandre.lureau@redhat.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
---
 include/sysemu/whpx.h            | 22 +---------------------
 target/i386/whpx/whpx-all.c      |  4 ++++
 target/i386/whpx/whpx-internal.h | 18 ++++++++++++++++++
 3 files changed, 23 insertions(+), 21 deletions(-)

diff --git a/include/sysemu/whpx.h b/include/sysemu/whpx.h
index 9346fd92e9..8ca1c1c4ac 100644
--- a/include/sysemu/whpx.h
+++ b/include/sysemu/whpx.h
@@ -15,28 +15,8 @@
 
 #ifdef CONFIG_WHPX
 
-#include "whp-dispatch.h"
-
-struct whpx_state {
-    uint64_t mem_quota;
-    WHV_PARTITION_HANDLE partition;
-    bool kernel_irqchip_allowed;
-    bool kernel_irqchip_required;
-    bool apic_in_platform;
-};
-
-struct whpx_lapic_state {
-    struct {
-        uint32_t data;
-        uint32_t padding[3];
-    } fields[256];
-};
-
-extern struct whpx_state whpx_global;
 int whpx_enabled(void);
-
-void whpx_apic_get(DeviceState *s);
-#define whpx_apic_in_platform() (whpx_global.apic_in_platform)
+bool whpx_apic_in_platform(void);
 
 #else /* CONFIG_WHPX */
 
diff --git a/target/i386/whpx/whpx-all.c b/target/i386/whpx/whpx-all.c
index 12f79e2cd6..985ceba8f8 100644
--- a/target/i386/whpx/whpx-all.c
+++ b/target/i386/whpx/whpx-all.c
@@ -1866,6 +1866,10 @@ int whpx_enabled(void)
     return whpx_allowed;
 }
 
+bool whpx_apic_in_platform(void) {
+    return whpx_global.apic_in_platform;
+}
+
 static void whpx_accel_class_init(ObjectClass *oc, void *data)
 {
     AccelClass *ac = ACCEL_CLASS(oc);
diff --git a/target/i386/whpx/whpx-internal.h b/target/i386/whpx/whpx-internal.h
index e0a9ea1dce..8cfaaef141 100644
--- a/target/i386/whpx/whpx-internal.h
+++ b/target/i386/whpx/whpx-internal.h
@@ -5,6 +5,24 @@
 #include <WinHvPlatform.h>
 #include <WinHvEmulation.h>
 
+struct whpx_state {
+    uint64_t mem_quota;
+    WHV_PARTITION_HANDLE partition;
+    bool kernel_irqchip_allowed;
+    bool kernel_irqchip_required;
+    bool apic_in_platform;
+};
+
+struct whpx_lapic_state {
+    struct {
+        uint32_t data;
+        uint32_t padding[3];
+    } fields[256];
+};
+
+extern struct whpx_state whpx_global;
+void whpx_apic_get(DeviceState *s);
+
 #define WHV_E_UNKNOWN_CAPABILITY 0x80370300L
 
 #define LIST_WINHVPLATFORM_FUNCTIONS(X) \
-- 
2.26.2



^ permalink raw reply related	[flat|nested] 7+ messages in thread

* Re: [PATCH 0/2] Cleanup internal WHPX headers
  2020-12-19  9:06 [PATCH 0/2] Cleanup internal WHPX headers Paolo Bonzini
  2020-12-19  9:06 ` [PATCH 1/2] whpx: rename whp-dispatch to whpx-internal.h Paolo Bonzini
  2020-12-19  9:06 ` [PATCH 2/2] whpx: move internal definitions " Paolo Bonzini
@ 2020-12-19  9:12 ` no-reply
  2 siblings, 0 replies; 7+ messages in thread
From: no-reply @ 2020-12-19  9:12 UTC (permalink / raw)
  To: pbonzini; +Cc: marcandre.lureau, qemu-devel

Patchew URL: https://patchew.org/QEMU/20201219090637.1700900-1-pbonzini@redhat.com/



Hi,

This series seems to have some coding style problems. See output below for
more information:

Type: series
Message-id: 20201219090637.1700900-1-pbonzini@redhat.com
Subject: [PATCH 0/2] Cleanup internal WHPX headers

=== TEST SCRIPT BEGIN ===
#!/bin/bash
git rev-parse base > /dev/null || exit 0
git config --local diff.renamelimit 0
git config --local diff.renames True
git config --local diff.algorithm histogram
./scripts/checkpatch.pl --mailback base..
=== TEST SCRIPT END ===

Updating 3c8cf5a9c21ff8782164d1def7f44bd888713384
From https://github.com/patchew-project/qemu
 * [new tag]         patchew/20201219090637.1700900-1-pbonzini@redhat.com -> patchew/20201219090637.1700900-1-pbonzini@redhat.com
Switched to a new branch 'test'
aada1bf whpx: move internal definitions to whpx-internal.h
2b0771a whpx: rename whp-dispatch to whpx-internal.h

=== OUTPUT BEGIN ===
1/2 Checking commit 2b0771ae8ad0 (whpx: rename whp-dispatch to whpx-internal.h)
WARNING: added, moved or deleted file(s), does MAINTAINERS need updating?
#64: 
rename from target/i386/whpx/whp-dispatch.h

total: 0 errors, 1 warnings, 46 lines checked

Patch 1/2 has style problems, please review.  If any of these errors
are false positives report them to the maintainer, see
CHECKPATCH in MAINTAINERS.
2/2 Checking commit aada1bf26255 (whpx: move internal definitions to whpx-internal.h)
ERROR: open brace '{' following function declarations go on the next line
#56: FILE: target/i386/whpx/whpx-all.c:1869:
+bool whpx_apic_in_platform(void) {

total: 1 errors, 0 warnings, 63 lines checked

Patch 2/2 has style problems, please review.  If any of these errors
are false positives report them to the maintainer, see
CHECKPATCH in MAINTAINERS.

=== OUTPUT END ===

Test command exited with code: 1


The full log is available at
http://patchew.org/logs/20201219090637.1700900-1-pbonzini@redhat.com/testing.checkpatch/?type=message.
---
Email generated automatically by Patchew [https://patchew.org/].
Please send your feedback to patchew-devel@redhat.com

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [PATCH 1/2] whpx: rename whp-dispatch to whpx-internal.h
  2020-12-19  9:06 ` [PATCH 1/2] whpx: rename whp-dispatch to whpx-internal.h Paolo Bonzini
@ 2020-12-21  8:15   ` Marc-André Lureau
  0 siblings, 0 replies; 7+ messages in thread
From: Marc-André Lureau @ 2020-12-21  8:15 UTC (permalink / raw)
  To: Paolo Bonzini; +Cc: qemu-devel

[-- Attachment #1: Type: text/plain, Size: 3006 bytes --]

On Sat, Dec 19, 2020 at 1:06 PM Paolo Bonzini <pbonzini@redhat.com> wrote:

> Rename the file in preparation for moving more implementation-internal
> definitions to it.  The build is still broken though.
>
> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
>

Reviewed-by: Marc-André Lureau <marcandre.lureau@redhat.com>

---
>  target/i386/whpx/whpx-all.c                          | 5 +----
>  target/i386/whpx/whpx-apic.c                         | 2 +-
>  target/i386/whpx/whpx-cpus.c                         | 4 +---
>  target/i386/whpx/{whp-dispatch.h => whpx-internal.h} | 6 +++---
>  4 files changed, 6 insertions(+), 11 deletions(-)
>  rename target/i386/whpx/{whp-dispatch.h => whpx-internal.h} (98%)
>
> diff --git a/target/i386/whpx/whpx-all.c b/target/i386/whpx/whpx-all.c
> index 3b824fc9d7..12f79e2cd6 100644
> --- a/target/i386/whpx/whpx-all.c
> +++ b/target/i386/whpx/whpx-all.c
> @@ -26,13 +26,10 @@
>  #include "qapi/qapi-types-common.h"
>  #include "qapi/qapi-visit-common.h"
>  #include "migration/blocker.h"
> -#include "whp-dispatch.h"
>  #include <winerror.h>
>
>  #include "whpx-cpus.h"
> -
> -#include <WinHvPlatform.h>
> -#include <WinHvEmulation.h>
> +#include "whpx-internal.h"
>
>  #define HYPERV_APIC_BUS_FREQUENCY      (200000000ULL)
>
> diff --git a/target/i386/whpx/whpx-apic.c b/target/i386/whpx/whpx-apic.c
> index b127a3cb8a..1d330bf749 100644
> --- a/target/i386/whpx/whpx-apic.c
> +++ b/target/i386/whpx/whpx-apic.c
> @@ -18,7 +18,7 @@
>  #include "hw/pci/msi.h"
>  #include "sysemu/hw_accel.h"
>  #include "sysemu/whpx.h"
> -#include "whp-dispatch.h"
> +#include "whpx-internal.h"
>
>  static void whpx_put_apic_state(APICCommonState *s,
>                                  struct whpx_lapic_state *kapic)
> diff --git a/target/i386/whpx/whpx-cpus.c b/target/i386/whpx/whpx-cpus.c
> index d9bd5a2d36..f7e69881a3 100644
> --- a/target/i386/whpx/whpx-cpus.c
> +++ b/target/i386/whpx/whpx-cpus.c
> @@ -15,11 +15,9 @@
>  #include "qemu/guest-random.h"
>
>  #include "sysemu/whpx.h"
> +#include "whpx-internal.h"
>  #include "whpx-cpus.h"
>
> -#include <WinHvPlatform.h>
> -#include <WinHvEmulation.h>
> -
>  static void *whpx_cpu_thread_fn(void *arg)
>  {
>      CPUState *cpu = arg;
> diff --git a/target/i386/whpx/whp-dispatch.h
> b/target/i386/whpx/whpx-internal.h
> similarity index 98%
> rename from target/i386/whpx/whp-dispatch.h
> rename to target/i386/whpx/whpx-internal.h
> index cef5d848bd..e0a9ea1dce 100644
> --- a/target/i386/whpx/whp-dispatch.h
> +++ b/target/i386/whpx/whpx-internal.h
> @@ -1,5 +1,5 @@
> -#ifndef WHP_DISPATCH_H
> -#define WHP_DISPATCH_H
> +#ifndef WHP_INTERNAL_H
> +#define WHP_INTERNAL_H
>
>  #include <windows.h>
>  #include <WinHvPlatform.h>
> @@ -72,4 +72,4 @@ typedef enum WHPFunctionList {
>      WINHV_PLATFORM_FNS_SUPPLEMENTAL
>  } WHPFunctionList;
>
> -#endif /* WHP_DISPATCH_H */
> +#endif /* WHP_INTERNAL_H */
> --
> 2.26.2
>
>
>

[-- Attachment #2: Type: text/html, Size: 4070 bytes --]

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [PATCH 2/2] whpx: move internal definitions to whpx-internal.h
  2020-12-19  9:06 ` [PATCH 2/2] whpx: move internal definitions " Paolo Bonzini
@ 2020-12-21  8:17   ` Marc-André Lureau
  2021-01-07 11:15   ` Philippe Mathieu-Daudé
  1 sibling, 0 replies; 7+ messages in thread
From: Marc-André Lureau @ 2020-12-21  8:17 UTC (permalink / raw)
  To: Paolo Bonzini; +Cc: qemu-devel

[-- Attachment #1: Type: text/plain, Size: 2832 bytes --]

On Sat, Dec 19, 2020 at 1:06 PM Paolo Bonzini <pbonzini@redhat.com> wrote:

> Only leave the external interface in sysemu/whpx.h.  whpx_apic_in_platform
> is moved to a .c file because it needs whpx_state.
>
> Reported-by: Marc-André Lureau <marcandre.lureau@redhat.com>
> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
>

Reviewed-by: Marc-André Lureau <marcandre.lureau@redhat.com>

---
>  include/sysemu/whpx.h            | 22 +---------------------
>  target/i386/whpx/whpx-all.c      |  4 ++++
>  target/i386/whpx/whpx-internal.h | 18 ++++++++++++++++++
>  3 files changed, 23 insertions(+), 21 deletions(-)
>
> diff --git a/include/sysemu/whpx.h b/include/sysemu/whpx.h
> index 9346fd92e9..8ca1c1c4ac 100644
> --- a/include/sysemu/whpx.h
> +++ b/include/sysemu/whpx.h
> @@ -15,28 +15,8 @@
>
>  #ifdef CONFIG_WHPX
>
> -#include "whp-dispatch.h"
> -
> -struct whpx_state {
> -    uint64_t mem_quota;
> -    WHV_PARTITION_HANDLE partition;
> -    bool kernel_irqchip_allowed;
> -    bool kernel_irqchip_required;
> -    bool apic_in_platform;
> -};
> -
> -struct whpx_lapic_state {
> -    struct {
> -        uint32_t data;
> -        uint32_t padding[3];
> -    } fields[256];
> -};
> -
> -extern struct whpx_state whpx_global;
>  int whpx_enabled(void);
> -
> -void whpx_apic_get(DeviceState *s);
> -#define whpx_apic_in_platform() (whpx_global.apic_in_platform)
> +bool whpx_apic_in_platform(void);
>
>  #else /* CONFIG_WHPX */
>
> diff --git a/target/i386/whpx/whpx-all.c b/target/i386/whpx/whpx-all.c
> index 12f79e2cd6..985ceba8f8 100644
> --- a/target/i386/whpx/whpx-all.c
> +++ b/target/i386/whpx/whpx-all.c
> @@ -1866,6 +1866,10 @@ int whpx_enabled(void)
>      return whpx_allowed;
>  }
>
> +bool whpx_apic_in_platform(void) {
> +    return whpx_global.apic_in_platform;
> +}
> +
>  static void whpx_accel_class_init(ObjectClass *oc, void *data)
>  {
>      AccelClass *ac = ACCEL_CLASS(oc);
> diff --git a/target/i386/whpx/whpx-internal.h
> b/target/i386/whpx/whpx-internal.h
> index e0a9ea1dce..8cfaaef141 100644
> --- a/target/i386/whpx/whpx-internal.h
> +++ b/target/i386/whpx/whpx-internal.h
> @@ -5,6 +5,24 @@
>  #include <WinHvPlatform.h>
>  #include <WinHvEmulation.h>
>
> +struct whpx_state {
> +    uint64_t mem_quota;
> +    WHV_PARTITION_HANDLE partition;
> +    bool kernel_irqchip_allowed;
> +    bool kernel_irqchip_required;
> +    bool apic_in_platform;
> +};
> +
> +struct whpx_lapic_state {
> +    struct {
> +        uint32_t data;
> +        uint32_t padding[3];
> +    } fields[256];
> +};
> +
> +extern struct whpx_state whpx_global;
> +void whpx_apic_get(DeviceState *s);
> +
>  #define WHV_E_UNKNOWN_CAPABILITY 0x80370300L
>
>  #define LIST_WINHVPLATFORM_FUNCTIONS(X) \
> --
> 2.26.2
>
>

[-- Attachment #2: Type: text/html, Size: 3788 bytes --]

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [PATCH 2/2] whpx: move internal definitions to whpx-internal.h
  2020-12-19  9:06 ` [PATCH 2/2] whpx: move internal definitions " Paolo Bonzini
  2020-12-21  8:17   ` Marc-André Lureau
@ 2021-01-07 11:15   ` Philippe Mathieu-Daudé
  1 sibling, 0 replies; 7+ messages in thread
From: Philippe Mathieu-Daudé @ 2021-01-07 11:15 UTC (permalink / raw)
  To: Paolo Bonzini, qemu-devel; +Cc: marcandre.lureau

On 12/19/20 10:06 AM, Paolo Bonzini wrote:
> Only leave the external interface in sysemu/whpx.h.  whpx_apic_in_platform
> is moved to a .c file because it needs whpx_state.
> 
> Reported-by: Marc-André Lureau <marcandre.lureau@redhat.com>
> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
> ---
>  include/sysemu/whpx.h            | 22 +---------------------
>  target/i386/whpx/whpx-all.c      |  4 ++++
>  target/i386/whpx/whpx-internal.h | 18 ++++++++++++++++++
>  3 files changed, 23 insertions(+), 21 deletions(-)

Reviewed-by: Philippe Mathieu-Daudé <philmd@redhat.com>



^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2021-01-07 11:17 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-12-19  9:06 [PATCH 0/2] Cleanup internal WHPX headers Paolo Bonzini
2020-12-19  9:06 ` [PATCH 1/2] whpx: rename whp-dispatch to whpx-internal.h Paolo Bonzini
2020-12-21  8:15   ` Marc-André Lureau
2020-12-19  9:06 ` [PATCH 2/2] whpx: move internal definitions " Paolo Bonzini
2020-12-21  8:17   ` Marc-André Lureau
2021-01-07 11:15   ` Philippe Mathieu-Daudé
2020-12-19  9:12 ` [PATCH 0/2] Cleanup internal WHPX headers no-reply

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.