From patchwork Sat Jun 24 20:06:44 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= X-Patchwork-Id: 695729 Delivered-To: patch@linaro.org Received: by 2002:adf:e885:0:0:0:0:0 with SMTP id d5csp2541633wrm; Sat, 24 Jun 2023 13:08:03 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ4E8D3x0Cf11kAoNmydM+iQz+SnfGNFunRJTTv7OC3OAITwKOB1qoRrtIx9B911bmhDwaAE X-Received: by 2002:ac8:5a83:0:b0:3ff:2192:b007 with SMTP id c3-20020ac85a83000000b003ff2192b007mr20495533qtc.11.1687637283162; Sat, 24 Jun 2023 13:08:03 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1687637283; cv=none; d=google.com; s=arc-20160816; b=fltbx/WtBNC4stx98FjKvNJCl5/Luxemo0PqEgTjueShv/3qR8/YKUxWTTOY4PrRGj bwJf3EX6AFMGKT+323pUuN2v4eH8iACF2q3xbjyl8qVaOSlUcKoG4QMWDzUQms77Voz1 zfvTgYfWTbY/YkM83YxHEHi+qaHpx9gwjxCgXN/FZ4Fqzk40rU9tmUoks8EZKmZZ53Rm S5OZsjSE7jc1fkIUXlbwru5K6g1AcIA0jfKsDUJpk88Nwhqllun4JKvrIEseK8a0RHCG X1yNyC0Rma8WWGbwts43Je+Md3qzx11sakMG4nulJtv4inXH0yC9gtzYF59nubmcIUi0 6e/g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:content-transfer-encoding :mime-version:message-id:date:subject:cc:to:from:dkim-signature; bh=suySfMWT62kPBU2z0N6L8PuJkuKeNQPE9tqzQjS0L+A=; fh=nKZn8yAKb8TW3SnG7MUrXpXVRLeV18Ilxhtbu9e7rBQ=; b=DJiEv+JXt7PspCq4MqK+68kINXC3I9JX0yibFptx6dsmchJ//jX18JDaVFy04vSV1M qjodCau3a0upLKtiGiLaFqNVj4cc2wNbo+BrXugQa65boJiFw27VM7jtZUqz4D0ICENH lmrJhiK+srOdBJYaTkimt1P7codbte5Z+XeK4ozIvax9VN/cP2OCId1/qBcBxj6MvDoc a/biBTmxNZjTPHxgD6VFPY5qfm1MMbOfUPZHDVnguLAq74kySDJaA4VVS7ueT8eI+D6z 8r9MKQn5MKTE7jTteQrxZfXJAa6OU8gleFeu2Sw4pMHIjeDKrdWbC+QGrV2ukrwS0Ey5 A7SQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=Wcaox1O5; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from lists.gnu.org (lists.gnu.org. [209.51.188.17]) by mx.google.com with ESMTPS id kl27-20020a056214519b00b0062de663a9fcsi851518qvb.178.2023.06.24.13.08.02 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Sat, 24 Jun 2023 13:08:03 -0700 (PDT) Received-SPF: pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=Wcaox1O5; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1qD9XA-0006Zj-2R; Sat, 24 Jun 2023 16:07:00 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1qD9X8-0006ZE-JS for qemu-devel@nongnu.org; Sat, 24 Jun 2023 16:06:58 -0400 Received: from mail-wm1-x332.google.com ([2a00:1450:4864:20::332]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1qD9X6-0006Ne-Gq for qemu-devel@nongnu.org; Sat, 24 Jun 2023 16:06:58 -0400 Received: by mail-wm1-x332.google.com with SMTP id 5b1f17b1804b1-3fa71db41b6so19158075e9.1 for ; Sat, 24 Jun 2023 13:06:56 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1687637214; x=1690229214; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:from:to:cc:subject:date:message-id:reply-to; bh=suySfMWT62kPBU2z0N6L8PuJkuKeNQPE9tqzQjS0L+A=; b=Wcaox1O5LulMLd04A6QYc+8ZDEUZbYMNbH656K25T8OuHdV+RACfWz0VIsBiYW22UH bK7z72XIeccw/oq8T66+EegeEY+TeFt/4BRGEA57Dqibb1Mpv7L1LkblCCWT5oRJ2VQQ fOtDY3XvDcKaLg7CogFwf1J7wYZEzVXIF/fR8ngSkmQ04Chd1BKdeAQzmoUMXcdDMPWA Fq1ma4EQTyTZNJyEdhxMhUK3c1CDFR4i9TLPk1FaYzJgdrYEzPKC/Mc2w0Nu9NqqIMaI SeFnCjAxeJHiv4HasiSADJL6B4FFMYY1TPDBRliq+UF7dvGffCXpUIoub7+UCkz/rGhW szeg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1687637214; x=1690229214; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=suySfMWT62kPBU2z0N6L8PuJkuKeNQPE9tqzQjS0L+A=; b=agmE12TYPqDpFAGwDPyXG/tA1cDGUjeuJmKlGBVzifstcdk/q8oyFBnkGh9z85O4Qj UGKCkUEjzbHW1w3N+BjVDZA6E+sEt9O00TYrnOiQ+wupJZ04SH+zaPdQhGyJ4IWqS8P0 05a7T+/ttvU6Xth8H2OGjqD1rh/gqW8MLVT0Btsc/TK0kvtn9TixOS7elSu0P5iRHwWJ UjV74hPpnelXR9ovqJR5DHT5IAbgHxgXT1OZDl7bijH6Dy9bpt2qtv+tkJgQtaI3yzOs kmgDYpOXEDjABIIv7yXvTS3EXj881vRLKOQx4qUboej3bf6NLAWiZ8D6ZBN3bI/C17uF Z94g== X-Gm-Message-State: AC+VfDzh38+3oT35skVaio8mQu1nqXVAzDJx4AXxgxAoWVKBzllakWqK lHrWfNjO+DQzabiajVMsh1e8IwRzk59o4qFcszM= X-Received: by 2002:a05:600c:b51:b0:3fa:8422:1585 with SMTP id k17-20020a05600c0b5100b003fa84221585mr1521249wmr.36.1687637214444; Sat, 24 Jun 2023 13:06:54 -0700 (PDT) Received: from m1x-phil.lan ([176.187.217.150]) by smtp.gmail.com with ESMTPSA id m6-20020a7bcb86000000b003f80946116dsm5780464wmi.45.2023.06.24.13.06.49 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Sat, 24 Jun 2023 13:06:54 -0700 (PDT) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: Matthew Rosato , Christian Borntraeger , qemu-s390x@nongnu.org, Eric Farman , Ilya Leoshkevich , Richard Henderson , Halil Pasic , David Hildenbrand , Janosch Frank , Thomas Huth , =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= Subject: [PATCH v2] hw/s390x: Move KVM specific PV from hw/ to target/s390x/kvm/ Date: Sat, 24 Jun 2023 22:06:44 +0200 Message-Id: <20230624200644.23931-1-philmd@linaro.org> X-Mailer: git-send-email 2.38.1 MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::332; envelope-from=philmd@linaro.org; helo=mail-wm1-x332.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=unavailable autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: qemu-devel-bounces+patch=linaro.org@nongnu.org Protected Virtualization (PV) is not a real hardware device: it is a feature of the firmware on s390x that is exposed to userspace via the KVM interface. Move the pv.c/pv.h files to target/s390x/kvm/ to make this clearer. Suggested-by: Thomas Huth Signed-off-by: Philippe Mathieu-Daudé --- v1: https://lore.kernel.org/qemu-devel/20230405160454.97436-11-philmd@linaro.org/ --- MAINTAINERS | 2 -- {include/hw/s390x => target/s390x/kvm}/pv.h | 0 hw/s390x/ipl.c | 2 +- hw/s390x/s390-pci-kvm.c | 2 +- hw/s390x/s390-virtio-ccw.c | 2 +- hw/s390x/tod-kvm.c | 2 +- target/s390x/arch_dump.c | 2 +- target/s390x/cpu-sysemu.c | 2 +- target/s390x/cpu_features.c | 2 +- target/s390x/cpu_models.c | 2 +- target/s390x/diag.c | 2 +- target/s390x/helper.c | 2 +- target/s390x/ioinst.c | 2 +- target/s390x/kvm/kvm.c | 2 +- {hw/s390x => target/s390x/kvm}/pv.c | 2 +- hw/s390x/meson.build | 1 - target/s390x/kvm/meson.build | 1 + 17 files changed, 14 insertions(+), 16 deletions(-) rename {include/hw/s390x => target/s390x/kvm}/pv.h (100%) rename {hw/s390x => target/s390x/kvm}/pv.c (99%) diff --git a/MAINTAINERS b/MAINTAINERS index 1da135b0c8..5f00e2a1c3 100644 --- a/MAINTAINERS +++ b/MAINTAINERS @@ -451,8 +451,6 @@ S: Supported F: target/s390x/kvm/ F: target/s390x/machine.c F: target/s390x/sigp.c -F: hw/s390x/pv.c -F: include/hw/s390x/pv.h F: gdb-xml/s390*.xml T: git https://github.com/borntraeger/qemu.git s390-next L: qemu-s390x@nongnu.org diff --git a/include/hw/s390x/pv.h b/target/s390x/kvm/pv.h similarity index 100% rename from include/hw/s390x/pv.h rename to target/s390x/kvm/pv.h diff --git a/hw/s390x/ipl.c b/hw/s390x/ipl.c index 8612684d48..515dcf51b5 100644 --- a/hw/s390x/ipl.c +++ b/hw/s390x/ipl.c @@ -26,7 +26,7 @@ #include "hw/s390x/vfio-ccw.h" #include "hw/s390x/css.h" #include "hw/s390x/ebcdic.h" -#include "hw/s390x/pv.h" +#include "target/s390x/kvm/pv.h" #include "hw/scsi/scsi.h" #include "hw/virtio/virtio-net.h" #include "ipl.h" diff --git a/hw/s390x/s390-pci-kvm.c b/hw/s390x/s390-pci-kvm.c index 9134fe185f..ff41e4106d 100644 --- a/hw/s390x/s390-pci-kvm.c +++ b/hw/s390x/s390-pci-kvm.c @@ -14,7 +14,7 @@ #include #include "kvm/kvm_s390x.h" -#include "hw/s390x/pv.h" +#include "target/s390x/kvm/pv.h" #include "hw/s390x/s390-pci-bus.h" #include "hw/s390x/s390-pci-kvm.h" #include "hw/s390x/s390-pci-inst.h" diff --git a/hw/s390x/s390-virtio-ccw.c b/hw/s390x/s390-virtio-ccw.c index 2dece8eab8..4516d73ff5 100644 --- a/hw/s390x/s390-virtio-ccw.c +++ b/hw/s390x/s390-virtio-ccw.c @@ -42,7 +42,7 @@ #include "hw/s390x/tod.h" #include "sysemu/sysemu.h" #include "sysemu/cpus.h" -#include "hw/s390x/pv.h" +#include "target/s390x/kvm/pv.h" #include "migration/blocker.h" #include "qapi/visitor.h" diff --git a/hw/s390x/tod-kvm.c b/hw/s390x/tod-kvm.c index e2202dae2d..9588b90f2b 100644 --- a/hw/s390x/tod-kvm.c +++ b/hw/s390x/tod-kvm.c @@ -13,7 +13,7 @@ #include "qemu/module.h" #include "sysemu/runstate.h" #include "hw/s390x/tod.h" -#include "hw/s390x/pv.h" +#include "target/s390x/kvm/pv.h" #include "kvm/kvm_s390x.h" static void kvm_s390_get_tod_raw(S390TOD *tod, Error **errp) diff --git a/target/s390x/arch_dump.c b/target/s390x/arch_dump.c index cb98f4894d..51a2116515 100644 --- a/target/s390x/arch_dump.c +++ b/target/s390x/arch_dump.c @@ -17,8 +17,8 @@ #include "s390x-internal.h" #include "elf.h" #include "sysemu/dump.h" -#include "hw/s390x/pv.h" #include "kvm/kvm_s390x.h" +#include "target/s390x/kvm/pv.h" struct S390xUserRegsStruct { uint64_t psw[2]; diff --git a/target/s390x/cpu-sysemu.c b/target/s390x/cpu-sysemu.c index 97d6c760a8..8112561e5e 100644 --- a/target/s390x/cpu-sysemu.c +++ b/target/s390x/cpu-sysemu.c @@ -33,7 +33,7 @@ #include "qapi/qapi-visit-run-state.h" #include "sysemu/hw_accel.h" -#include "hw/s390x/pv.h" +#include "target/s390x/kvm/pv.h" #include "hw/boards.h" #include "sysemu/sysemu.h" #include "sysemu/tcg.h" diff --git a/target/s390x/cpu_features.c b/target/s390x/cpu_features.c index 2e4e11d264..ebb155ce1c 100644 --- a/target/s390x/cpu_features.c +++ b/target/s390x/cpu_features.c @@ -15,7 +15,7 @@ #include "qemu/module.h" #include "cpu_features.h" #ifndef CONFIG_USER_ONLY -#include "hw/s390x/pv.h" +#include "target/s390x/kvm/pv.h" #endif #define DEF_FEAT(_FEAT, _NAME, _TYPE, _BIT, _DESC) \ diff --git a/target/s390x/cpu_models.c b/target/s390x/cpu_models.c index ae8880e81d..42b52afdb4 100644 --- a/target/s390x/cpu_models.c +++ b/target/s390x/cpu_models.c @@ -24,7 +24,7 @@ #include "qemu/qemu-print.h" #ifndef CONFIG_USER_ONLY #include "sysemu/sysemu.h" -#include "hw/s390x/pv.h" +#include "target/s390x/kvm/pv.h" #endif #define CPUDEF_INIT(_type, _gen, _ec_ga, _mha_pow, _hmfai, _name, _desc) \ diff --git a/target/s390x/diag.c b/target/s390x/diag.c index e5f0df19e7..8ce18e08f3 100644 --- a/target/s390x/diag.c +++ b/target/s390x/diag.c @@ -19,9 +19,9 @@ #include "sysemu/cpus.h" #include "hw/s390x/ipl.h" #include "hw/s390x/s390-virtio-ccw.h" -#include "hw/s390x/pv.h" #include "sysemu/kvm.h" #include "kvm/kvm_s390x.h" +#include "target/s390x/kvm/pv.h" #include "qemu/error-report.h" diff --git a/target/s390x/helper.c b/target/s390x/helper.c index 2b363aa959..d76c06381b 100644 --- a/target/s390x/helper.c +++ b/target/s390x/helper.c @@ -24,7 +24,7 @@ #include "gdbstub/helpers.h" #include "qemu/timer.h" #include "hw/s390x/ioinst.h" -#include "hw/s390x/pv.h" +#include "target/s390x/kvm/pv.h" #include "sysemu/hw_accel.h" #include "sysemu/runstate.h" diff --git a/target/s390x/ioinst.c b/target/s390x/ioinst.c index 053aaabb5a..bbe45a497a 100644 --- a/target/s390x/ioinst.c +++ b/target/s390x/ioinst.c @@ -16,7 +16,7 @@ #include "hw/s390x/ioinst.h" #include "trace.h" #include "hw/s390x/s390-pci-bus.h" -#include "hw/s390x/pv.h" +#include "target/s390x/kvm/pv.h" /* All I/O instructions but chsc use the s format */ static uint64_t get_address_from_regs(CPUS390XState *env, uint32_t ipb, diff --git a/target/s390x/kvm/kvm.c b/target/s390x/kvm/kvm.c index 3ac7ec9acf..a9e5880349 100644 --- a/target/s390x/kvm/kvm.c +++ b/target/s390x/kvm/kvm.c @@ -50,7 +50,7 @@ #include "exec/memattrs.h" #include "hw/s390x/s390-virtio-ccw.h" #include "hw/s390x/s390-virtio-hcall.h" -#include "hw/s390x/pv.h" +#include "target/s390x/kvm/pv.h" #ifndef DEBUG_KVM #define DEBUG_KVM 0 diff --git a/hw/s390x/pv.c b/target/s390x/kvm/pv.c similarity index 99% rename from hw/s390x/pv.c rename to target/s390x/kvm/pv.c index b63f3784c6..6a69be7e5c 100644 --- a/hw/s390x/pv.c +++ b/target/s390x/kvm/pv.c @@ -21,9 +21,9 @@ #include "qom/object_interfaces.h" #include "exec/confidential-guest-support.h" #include "hw/s390x/ipl.h" -#include "hw/s390x/pv.h" #include "hw/s390x/sclp.h" #include "target/s390x/kvm/kvm_s390x.h" +#include "target/s390x/kvm/pv.h" static bool info_valid; static struct kvm_s390_pv_info_vm info_vm; diff --git a/hw/s390x/meson.build b/hw/s390x/meson.build index f291016fee..6fd096813a 100644 --- a/hw/s390x/meson.build +++ b/hw/s390x/meson.build @@ -22,7 +22,6 @@ s390x_ss.add(when: 'CONFIG_KVM', if_true: files( 'tod-kvm.c', 's390-skeys-kvm.c', 's390-stattrib-kvm.c', - 'pv.c', 's390-pci-kvm.c', )) s390x_ss.add(when: 'CONFIG_TCG', if_true: files( diff --git a/target/s390x/kvm/meson.build b/target/s390x/kvm/meson.build index 37253f75bf..d6aca590ae 100644 --- a/target/s390x/kvm/meson.build +++ b/target/s390x/kvm/meson.build @@ -1,5 +1,6 @@ s390x_ss.add(when: 'CONFIG_KVM', if_true: files( + 'pv.c', 'kvm.c' ), if_false: files( 'stubs.c'