From patchwork Sat Dec 17 15:24:52 2022 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: 634850 Delivered-To: patch@linaro.org Received: by 2002:a17:522:c983:b0:460:3032:e3c4 with SMTP id kr3csp1414327pvb; Sat, 17 Dec 2022 07:27:37 -0800 (PST) X-Google-Smtp-Source: AA0mqf5GqlLv7mxRBRS96TGHJ8Tt4ZGHmsezajzU6J6GIn9ZX8oL5/sBe2GKLrcMl3aJiEpIIUq9 X-Received: by 2002:a05:622a:1f8d:b0:3a8:19a4:4004 with SMTP id cb13-20020a05622a1f8d00b003a819a44004mr34845006qtb.33.1671290856988; Sat, 17 Dec 2022 07:27:36 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1671290856; cv=none; d=google.com; s=arc-20160816; b=hZoRQPCc8WslTMi1Rv/RAgAX2vjTPIZjXyozRBtM8wyzEGpUcD0JnW9NchR8ZhIrXp SAdGSN5OXhyUahIGM18TbbW4NbA+yVB5HaOaB/qvDrW5IwLyEK+7W6eSK1c4b7xx9xUh IA9/kMZzUT+dqHmlJ0dhuAiCMJ45qLNIqfDK9Xu99ysliARpsaTi2c3N7BX1cH6XKCSk +eVcQlPQjx8SfMDrFaYm4wyGYesvA5HJ4Oy9FOp7e6ryQkH0fgJlQRkLmcR0QIifz2E5 iBUMxlrzLoGT1QSLXN3k3LizG7i0pNStdBTSIlqV3TCEWYO/eoKfMvV3eedKhUcKyFmt Kzgg== 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=m3BLA48xNHLVgpYtc5xcAlbVIvNCftpdVHH8TeBr2fM=; b=AECdM1WohMRFRFUSEDOqZGE+pJDPDt59XKrpnf1TU6YcStD4ga5L3aq/JpIa3OHb6P gsVNaCq+iGH6n46+MuckBtABadCJ/fu59W8JCJtTYI42psaei4AqaRHTPG1VDSwQ+3cw Ws0Xz7vT2E5X5gsQhGCXK54U/VUnjO+hgFTdOtgYAg2wommNSHs9tuKeqssdzupD71Rg HVmXDGGXHa6P8OlfKpX3rebbL1fzqXo+vzdgiqX2BGekgKOiINFl/wK81lIcy6LSkXhz iIUyDi4m+wxln6fru0jyaJrk4dWd3OGP6YuFFZ0bxAfwTsAYd5HAwSE0C3I/TXVPYEn3 spVA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=ap1mJF0A; 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 z25-20020ac86b99000000b003a7f93a0df9si2226985qts.413.2022.12.17.07.27.36 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Sat, 17 Dec 2022 07:27:36 -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=@linaro.org header.s=google header.b=ap1mJF0A; 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 1p6Z3y-0003Ru-Fk; Sat, 17 Dec 2022 10:25:22 -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 1p6Z3v-0003RI-Rc for qemu-devel@nongnu.org; Sat, 17 Dec 2022 10:25:19 -0500 Received: from mail-ed1-x52a.google.com ([2a00:1450:4864:20::52a]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1p6Z3t-0005Pg-4v for qemu-devel@nongnu.org; Sat, 17 Dec 2022 10:25:19 -0500 Received: by mail-ed1-x52a.google.com with SMTP id c17so7356763edj.13 for ; Sat, 17 Dec 2022 07:25:16 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=m3BLA48xNHLVgpYtc5xcAlbVIvNCftpdVHH8TeBr2fM=; b=ap1mJF0AaUvEOAbk2a+bCaChfHX0HNw7ei51hoapYvVdLctPOSsJsHc/n8VA707MkE gpyR85b+A6RbRQK7K8szl6Z+eM9RtGWL+or9F9rNnc7zmOcmTnF1xaZsxkEvDmr2TDlb +eRWhG+GjuVCQB6JZKAYT64qlutv/n9uypru7KYeCdgZEu3CqlLCalTsuqTaAywPC5mJ 3fdgX197zxDkzU7qBN291FueRr/XuNa6FL5fGz7RYzEc9lVWiJn60HgXSdLK9ZQF3aaR yk4zspviXTzYGAVbnHCtJWpvPradsSk9ec2pmMrSngNycauVFEFIdkDk7IgLC6fbbBAX g2mQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=m3BLA48xNHLVgpYtc5xcAlbVIvNCftpdVHH8TeBr2fM=; b=5HBccS7RLxXhDQWfv3FUgwuyiZ88JChFtW+LsKOKTVq1a6xI6HnCHqusR6Z3/0mJQo bEZMlNjzX9AoI5mjLlHwTceqL4t3II6l/BOo6ej2cgsZ9Ss07CzNi1vJoCeLZ8W6ag9d MoItPve8/bH4G4ahJweJNEiJr26DeM6zkUw1Mk7EDfAb1jFi2TJyCnxxnaIctyalSeR1 jKGwEs3iWatJovNGb/ugKLtckVL5rppvQDf5AQFWZ9d5sQVPdIqvSp3bS7yO2CthQ7uZ Kd9j+GYMyyVgfSJtQkuNGVPpWbxkHBWy57UYTFKmo1s5w6iW2MgT3eZbamu1ke825XxY i5Mg== X-Gm-Message-State: ANoB5plcJPag2BoOAd+xxfEYeX844JAug3+0XmZGkNLsUY8wjyYBfFS7 R7+FldwKioy0KzG6ryNcc0EQhlMbBS5aAcUwfq4= X-Received: by 2002:a05:6402:7ca:b0:46b:aa:8564 with SMTP id u10-20020a05640207ca00b0046b00aa8564mr27004505edy.30.1671290715342; Sat, 17 Dec 2022 07:25:15 -0800 (PST) Received: from localhost.localdomain ([185.126.107.38]) by smtp.gmail.com with ESMTPSA id ck29-20020a0564021c1d00b0046f73b46c5csm2071998edb.23.2022.12.17.07.25.13 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Sat, 17 Dec 2022 07:25:14 -0800 (PST) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: qemu-s390x@nongnu.org, Richard Henderson , Paolo Bonzini , Peter Xu , Matthew Rosato , Halil Pasic , =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= , David Hildenbrand , Christian Borntraeger , Thomas Huth , Eric Farman , Ilya Leoshkevich Subject: [PATCH v2 3/5] hw/s390x/pv: Restrict Protected Virtualization to sysemu Date: Sat, 17 Dec 2022 16:24:52 +0100 Message-Id: <20221217152454.96388-4-philmd@linaro.org> X-Mailer: git-send-email 2.38.1 In-Reply-To: <20221217152454.96388-1-philmd@linaro.org> References: <20221217152454.96388-1-philmd@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::52a; envelope-from=philmd@linaro.org; helo=mail-ed1-x52a.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 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 is irrelevant in user emulation. Signed-off-by: Philippe Mathieu-Daudé Reviewed-by: Richard Henderson Reviewed-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); }