[RFC PATCH 0/4] hw/ppc: remove call to tcg-only function

Lucas Mateus Castro (alqotel) posted 4 patches 3 years ago
Test checkpatch failed
Patches applied successfully (tree, apply log)
git fetch https://github.com/patchew-project/qemu tags/patchew/20210422193131.22560-1-lucas.araujo@eldorado.org.br
Maintainers: David Gibson <david@gibson.dropbear.id.au>, Greg Kurz <groug@kaod.org>
hw/ppc/meson.build            |   10 +-
hw/ppc/spapr.c                |    1 +
hw/ppc/spapr_caps.c           |    1 +
hw/ppc/spapr_cpu_core.c       |    1 +
hw/ppc/spapr_hcall.c          |    1 +
hw/ppc/spapr_hcall_tcg_stub.c | 1825 +++++++++++++++++++++++++++++++++
hw/ppc/spapr_rtas.c           |    1 +
target/ppc/common-misc.c      |   86 ++
target/ppc/common-misc.h      |   13 +
target/ppc/int_helper.c       |   10 +-
target/ppc/meson.build        |   21 +-
target/ppc/mmu-hash64.c       |   67 +-
target/ppc/mmu-hash64.h       |    4 -
13 files changed, 1957 insertions(+), 84 deletions(-)
create mode 100644 hw/ppc/spapr_hcall_tcg_stub.c
create mode 100644 target/ppc/common-misc.c
create mode 100644 target/ppc/common-misc.h
[RFC PATCH 0/4] hw/ppc: remove call to tcg-only function
Posted by Lucas Mateus Castro (alqotel) 3 years ago
Hi,

I'm working with Bruno Larsen (billionai) to enable the disable-tcg
option for PowerPC, right now I'm aiming at removing call to tcg-only
functions from hw/ppc, there is still some work to be done in
target/ppc.

This patch creates a spapr_hcall_tcg_stub.c file
that has the same hcalls as spapr_hcall except those that call tcg-only
functions, said functions now only trip a fatal error.

The functions ppc_store_lpcr and ppc_hash64_filter_pagesizes were in
tcg-only files but as their logic is necessary they have been moved to a
non-tcg-only file.

This is still a work in progress and this patches focuses on the
spapr* calls, as there will still be some undefined references to
functions in tcg-only files and include to tcg-only .h, mostly on
target/ppc.

Comments are welcome, thanks,
Lucas Mateus.

Lucas Mateus Castro (alqotel) (4):
  target/ppc: updated build options
  hw/ppc: Add kvm-only file spapr_hcall_tcg_stub.c
  hw/ppc: updated build rules to use new file
  target/ppc: transfered functions to non-tcg-only files

 hw/ppc/meson.build            |   10 +-
 hw/ppc/spapr.c                |    1 +
 hw/ppc/spapr_caps.c           |    1 +
 hw/ppc/spapr_cpu_core.c       |    1 +
 hw/ppc/spapr_hcall.c          |    1 +
 hw/ppc/spapr_hcall_tcg_stub.c | 1825 +++++++++++++++++++++++++++++++++
 hw/ppc/spapr_rtas.c           |    1 +
 target/ppc/common-misc.c      |   86 ++
 target/ppc/common-misc.h      |   13 +
 target/ppc/int_helper.c       |   10 +-
 target/ppc/meson.build        |   21 +-
 target/ppc/mmu-hash64.c       |   67 +-
 target/ppc/mmu-hash64.h       |    4 -
 13 files changed, 1957 insertions(+), 84 deletions(-)
 create mode 100644 hw/ppc/spapr_hcall_tcg_stub.c
 create mode 100644 target/ppc/common-misc.c
 create mode 100644 target/ppc/common-misc.h

-- 
2.17.1


Re: [RFC PATCH 0/4] hw/ppc: remove call to tcg-only function
Posted by no-reply@patchew.org 3 years ago
Patchew URL: https://patchew.org/QEMU/20210422193131.22560-1-lucas.araujo@eldorado.org.br/



Hi,

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

Type: series
Message-id: 20210422193131.22560-1-lucas.araujo@eldorado.org.br
Subject: [RFC PATCH 0/4] hw/ppc: remove call to tcg-only function

=== 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/20210422193131.22560-1-lucas.araujo@eldorado.org.br -> patchew/20210422193131.22560-1-lucas.araujo@eldorado.org.br
Switched to a new branch 'test'
1d1179f target/ppc: transfered functions to non-tcg-only files
a938556 hw/ppc: updated build rules to use new file
bed5362 hw/ppc: Add kvm-only file spapr_hcall_tcg_stub.c
7725f72 target/ppc: updated build options

=== OUTPUT BEGIN ===
1/4 Checking commit 7725f72d37a7 (target/ppc: updated build options)
2/4 Checking commit bed5362bcfdb (hw/ppc: Add kvm-only file spapr_hcall_tcg_stub.c)
Use of uninitialized value $acpi_testexpected in string eq at ./scripts/checkpatch.pl line 1529.
WARNING: added, moved or deleted file(s), does MAINTAINERS need updating?
#24: 
new file mode 100644

ERROR: spaces required around that '*' (ctx:VxV)
#172: FILE: hw/ppc/spapr_hcall_tcg_stub.c:144:
+        target_ulong *tsh = &args[i*2];
                                    ^

ERROR: spaces required around that '*' (ctx:VxV)
#173: FILE: hw/ppc/spapr_hcall_tcg_stub.c:145:
+        target_ulong tsl = args[i*2 + 1];
                                  ^

WARNING: Block comments use a leading /* on a separate line
#244: FILE: hw/ppc/spapr_hcall_tcg_stub.c:216:
+    /* These fields are private to the preparation thread if

WARNING: Block comments use a trailing */ on a separate line
#245: FILE: hw/ppc/spapr_hcall_tcg_stub.c:217:
+     * !complete, otherwise protected by the BQL */

WARNING: Block comments use a leading /* on a separate line
#307: FILE: hw/ppc/spapr_hcall_tcg_stub.c:279:
+/* Convert a return code from the KVM ioctl()s implementing resize HPT

WARNING: Block comments use a trailing */ on a separate line
#308: FILE: hw/ppc/spapr_hcall_tcg_stub.c:280:
+ * into a PAPR hypercall return code */

WARNING: Block comments use a leading /* on a separate line
#377: FILE: hw/ppc/spapr_hcall_tcg_stub.c:349:
+    /* We only allow the guest to allocate an HPT one order above what

WARNING: Block comments use a trailing */ on a separate line
#379: FILE: hw/ppc/spapr_hcall_tcg_stub.c:351:
+     * chunk of resources in the HPT */

WARNING: Block comments use a leading /* on a separate line
#420: FILE: hw/ppc/spapr_hcall_tcg_stub.c:392:
+    /* In theory we could estimate the time more accurately based on

WARNING: Block comments use a trailing */ on a separate line
#421: FILE: hw/ppc/spapr_hcall_tcg_stub.c:393:
+     * the new size, but there's not much point */

ERROR: spaces required around that '*' (ctx:VxV)
#984: FILE: hw/ppc/spapr_hcall_tcg_stub.c:956:
+                           nret, rtas_r3 + 12 + 4*nargs);
                                                  ^

WARNING: line over 80 characters
#1424: FILE: hw/ppc/spapr_hcall_tcg_stub.c:1396:
+            warn_report("guest has multiple active vCPUs at CAS, which is not allowed");

WARNING: Block comments use a leading /* on a separate line
#1445: FILE: hw/ppc/spapr_hcall_tcg_stub.c:1417:
+            /* We fail to set compat mode (likely because running with KVM PR),

WARNING: Block comments use a leading /* on a separate line
#1504: FILE: hw/ppc/spapr_hcall_tcg_stub.c:1476:
+            /* Guest doesn't know about HPT resizing, so we

WARNING: Block comments use a trailing */ on a separate line
#1507: FILE: hw/ppc/spapr_hcall_tcg_stub.c:1479:
+             * entered into the existing HPT */

WARNING: Block comments use a leading /* on a separate line
#1513: FILE: hw/ppc/spapr_hcall_tcg_stub.c:1485:
+    /* NOTE: there are actually a number of ov5 bits where input from the

WARNING: line over 80 characters
#1729: FILE: hw/ppc/spapr_hcall_tcg_stub.c:1701:
+static spapr_hcall_fn kvmppc_hypercall_table[KVMPPC_HCALL_MAX - KVMPPC_HCALL_BASE + 1];

WARNING: line over 80 characters
#1730: FILE: hw/ppc/spapr_hcall_tcg_stub.c:1702:
+static spapr_hcall_fn svm_hypercall_table[(SVM_HCALL_MAX - SVM_HCALL_BASE) / 4 + 1];

WARNING: Block comments use a leading /* on a separate line
#1830: FILE: hw/ppc/spapr_hcall_tcg_stub.c:1802:
+    /* "debugger" hcalls (also used by SLOF). Note: We do -not- differenciate

total: 3 errors, 17 warnings, 1824 lines checked

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

3/4 Checking commit a938556b3ba5 (hw/ppc: updated build rules to use new file)
4/4 Checking commit 1d1179fb6f57 (target/ppc: transfered functions to non-tcg-only files)
Use of uninitialized value $acpi_testexpected in string eq at ./scripts/checkpatch.pl line 1529.
WARNING: added, moved or deleted file(s), does MAINTAINERS need updating?
#102: 
new file mode 100644

total: 0 errors, 1 warnings, 210 lines checked

Patch 4/4 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/20210422193131.22560-1-lucas.araujo@eldorado.org.br/testing.checkpatch/?type=message.
---
Email generated automatically by Patchew [https://patchew.org/].
Please send your feedback to patchew-devel@redhat.com