From patchwork Fri Jan 6 08:28:43 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Thomas Huth X-Patchwork-Id: 639685 Delivered-To: patch@linaro.org Received: by 2002:a17:522:f3c4:b0:4b4:3859:abed with SMTP id in4csp658381pvb; Fri, 6 Jan 2023 00:29:34 -0800 (PST) X-Google-Smtp-Source: AMrXdXtIDby7CiGtIkKJBpR3e3nExbcCedmlN0WS+qSnt+aC48ANpgdyopSkZEmKqjsKkXsNWryv X-Received: by 2002:adf:fb91:0:b0:27c:88f3:8cb8 with SMTP id a17-20020adffb91000000b0027c88f38cb8mr22346631wrr.25.1672993774712; Fri, 06 Jan 2023 00:29:34 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1672993774; cv=none; d=google.com; s=arc-20160816; b=VC+cng03sx938I7Eu3LagKDs42C5dW/fxu0R11iyzGMcKIYXz0T62M8M5cU52p+Qti bCJjm1Bcte1uYFkJOSHjP1pjWfPql0bYJBaj6TY1N97kgTGHamOWg9UwOrFCjBldDLjL z394prqbw5rQu/TFvKXTo1qiPWASCowHMtnVcJ8DxEbAmavdYM8+/zIx1zN1Kje3Kc81 D4nZ8WG1uumQ5fviPxFxXZXVDf2yWI1mS1bHuue9KsoSUN9CpSu03GdVJLoDDT/PLbjW mzylSDj+Nsaif9QRVQ8KwGd45CPn/GY3q/3dapayYTU5JzlwUM7zmWC68dPQVs/cMDNk EJyw== 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:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=YECT37xFnoENI7l6yJNtVYwVr86adRzuuOKbFfDnvY8=; b=xhwT5aNQMPkvSe7q+Nrxu86/Dzdz9bdHg01eCvlCBkviT4jO+kLqOS3/7Yb8L8cLtk 8gFr287j+H/ZgGaKi+qLR3UI+v9JNarEszjd/gp6dV40RZ/GTwxDT6YRWw2li6pG6xqR dZCEK3wMomK9oLF6tCjJJwaw7WHuFtWNJrEUt9HnD6ffLGxEZVHY/2B3nOO5eeP6V7OH gSbiIbpKLkk7nZX+dhNa+RFep4xEE6obGiTtTThmZv+z5Y3j/cuT2na5d8UDhoa8gbuR 4QT9v+isFYz68TT2nHZyLWnkhXo7tdCLyrFNqr9en2RKeTAwUBLwW9HLoD21rk49T7vM jyfg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=G42y6+JM; 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=redhat.com Return-Path: Received: from lists.gnu.org (lists.gnu.org. [209.51.188.17]) by mx.google.com with ESMTPS id l18-20020adfe9d2000000b0028223adb232si454985wrn.887.2023.01.06.00.29.34 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Fri, 06 Jan 2023 00:29:34 -0800 (PST) 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=@redhat.com header.s=mimecast20190719 header.b=G42y6+JM; 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=redhat.com Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1pDi6B-0002Z1-I6; Fri, 06 Jan 2023 03:29:11 -0500 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 1pDi69-0002Xj-Na for qemu-devel@nongnu.org; Fri, 06 Jan 2023 03:29:09 -0500 Received: from us-smtp-delivery-124.mimecast.com ([170.10.129.124]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1pDi68-0005VX-7P for qemu-devel@nongnu.org; Fri, 06 Jan 2023 03:29:09 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1672993747; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=YECT37xFnoENI7l6yJNtVYwVr86adRzuuOKbFfDnvY8=; b=G42y6+JM2RZtc5Iwr9tD1Cpd+U8liZLZjPXGFpA/sgu9QHjK1+ysIgjK1TnR0bQpaOo6bj ZUjpfIzIwVnyKiit0kGw+ok1/bFH2W34+rGV7Ajq51hkKJhz1fq1TFb23hiq8MGC6KtmBC B9CEN+CokwOt0bu+cyfdkvhjHC0TGys= Received: from mimecast-mx02.redhat.com (mimecast-mx02.redhat.com [66.187.233.88]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-615-KHWM2W1JO2OpKPFe7uJvuw-1; Fri, 06 Jan 2023 03:29:04 -0500 X-MC-Unique: KHWM2W1JO2OpKPFe7uJvuw-1 Received: from smtp.corp.redhat.com (int-mx09.intmail.prod.int.rdu2.redhat.com [10.11.54.9]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 22FA8101A52E; Fri, 6 Jan 2023 08:29:04 +0000 (UTC) Received: from thuth.com (unknown [10.39.192.37]) by smtp.corp.redhat.com (Postfix) with ESMTP id F2434492B06; Fri, 6 Jan 2023 08:29:02 +0000 (UTC) From: Thomas Huth To: Peter Maydell , qemu-devel@nongnu.org Cc: Nikita Ivanov Subject: [PULL 05/15] hw/s390x/pv: Restrict Protected Virtualization to sysemu Date: Fri, 6 Jan 2023 09:28:43 +0100 Message-Id: <20230106082853.31787-6-thuth@redhat.com> In-Reply-To: <20230106082853.31787-1-thuth@redhat.com> References: <20230106082853.31787-1-thuth@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 3.1 on 10.11.54.9 Received-SPF: pass client-ip=170.10.129.124; envelope-from=thuth@redhat.com; helo=us-smtp-delivery-124.mimecast.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, DKIMWL_WL_HIGH=-0.001, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H2=-0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham 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 From: Philippe Mathieu-Daudé Protected Virtualization is irrelevant in user emulation. Signed-off-by: Philippe Mathieu-Daudé Message-Id: <20221217152454.96388-4-philmd@linaro.org> Reviewed-by: Thomas Huth Reviewed-by: Richard Henderson Signed-off-by: Thomas Huth --- target/s390x/cpu_features.c | 4 ++++ target/s390x/cpu_models.c | 4 +++- 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/target/s390x/cpu_features.c b/target/s390x/cpu_features.c index 5528acd082..2e4e11d264 100644 --- a/target/s390x/cpu_features.c +++ b/target/s390x/cpu_features.c @@ -14,7 +14,9 @@ #include "qemu/osdep.h" #include "qemu/module.h" #include "cpu_features.h" +#ifndef CONFIG_USER_ONLY #include "hw/s390x/pv.h" +#endif #define DEF_FEAT(_FEAT, _NAME, _TYPE, _BIT, _DESC) \ [S390_FEAT_##_FEAT] = { \ @@ -107,6 +109,7 @@ void s390_fill_feat_block(const S390FeatBitmap features, S390FeatType type, feat = find_next_bit(features, S390_FEAT_MAX, feat + 1); } +#ifndef CONFIG_USER_ONLY if (!s390_is_pv()) { return; } @@ -147,6 +150,7 @@ void s390_fill_feat_block(const S390FeatBitmap features, S390FeatType type, default: return; } +#endif } void s390_add_from_feat_block(S390FeatBitmap features, S390FeatType type, diff --git a/target/s390x/cpu_models.c b/target/s390x/cpu_models.c index c3a4f80633..065ec6d66c 100644 --- a/target/s390x/cpu_models.c +++ b/target/s390x/cpu_models.c @@ -23,8 +23,8 @@ #include "qemu/qemu-print.h" #ifndef CONFIG_USER_ONLY #include "sysemu/sysemu.h" -#endif #include "hw/s390x/pv.h" +#endif #define CPUDEF_INIT(_type, _gen, _ec_ga, _mha_pow, _hmfai, _name, _desc) \ { \ @@ -236,6 +236,7 @@ bool s390_has_feat(S390Feat feat) return 0; } +#ifndef CONFIG_USER_ONLY if (s390_is_pv()) { switch (feat) { case S390_FEAT_DIAG_318: @@ -259,6 +260,7 @@ bool s390_has_feat(S390Feat feat) break; } } +#endif return test_bit(feat, cpu->model->features); }