From patchwork Mon May 24 02:52:52 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Al Cho X-Patchwork-Id: 12275375 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-18.7 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER, INCLUDES_PATCH,MAILING_LIST_MULTI,MSGID_FROM_MTA_HEADER,SPF_HELO_NONE, SPF_PASS,USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id EAE35C47080 for ; Mon, 24 May 2021 03:02:05 +0000 (UTC) Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 712B460720 for ; Mon, 24 May 2021 03:02:05 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 712B460720 Authentication-Results: mail.kernel.org; dmarc=fail (p=quarantine dis=none) header.from=suse.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Received: from localhost ([::1]:58442 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1ll0qy-0005at-HR for qemu-devel@archiver.kernel.org; Sun, 23 May 2021 23:02:04 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:46470) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1ll0jC-0006qm-6q for qemu-devel@nongnu.org; Sun, 23 May 2021 22:54:02 -0400 Received: from de-smtp-delivery-102.mimecast.com ([194.104.109.102]:31506) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1ll0j7-0003U8-8N for qemu-devel@nongnu.org; Sun, 23 May 2021 22:54:01 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.com; s=mimecast20200619; t=1621824835; 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=fzbkg690dkCOikJCLOaHbr0U5s9Wb53xAk+ckmOce+c=; b=Cy/o6Km+BImmgULY0i0gDw72+tSKcExMus1e9UFuovdFX+Jz4zlRWDULa5isHRDieEsniU 7unbe/r2264O+IcfpA0W0T0Qy3+PEtaxUsn368ZYKk7h7RzohEyaocOl2k+JJTc+JYJBm6 zJFfJz/mSbVqzW/AeEfqXbVnygryTK0= Received: from EUR05-AM6-obe.outbound.protection.outlook.com (mail-am6eur05lp2111.outbound.protection.outlook.com [104.47.18.111]) (Using TLS) by relay.mimecast.com with ESMTP id de-mta-39-_QBC8zpQMwmmbixbuniTOw-1; Mon, 24 May 2021 04:53:54 +0200 X-MC-Unique: _QBC8zpQMwmmbixbuniTOw-1 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=DZflUj24px2tZZUR+L1ai5eQ1Q6jJXNNkiLfq9auC0uozJoAj+PMioORI7jRYkWrRalO6LJsHoD/vsyuw1DwQ8s7oqfMGRUP7UEvyxjI66cRfahkmFr11mXh5fEjcTBchnWU+TtUXVi+GIJPzCuICt0pHDh/X4wwVxt/XaxuWw3+fB0EG0oC/xumN654wZJsdopz8wZ/WFyivezgJHxNZfZVLz+vflCqY/8w5FDSMx2DYwDSojcXjApVG+wtP6CTajsTRJ3CHEVJe07SGzYa+Pysw7TEHIvaiCosp95dTFnZNzSS0L6IyQh+IA5UOWduSnmJr1N6SJtNxfeEaGaXHA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=znd18hKlQ68bGgc9PoKO8PlkjrpRpyXis4DJZeKfBx8=; b=X4QCbkHtDwMWYqxgv8e2wG9er+dmW7XYKOeS0MERJZZ4jVYx4JayY5Vc6XO8pf6KNJpOTgqCSG6c8YgFZIo9OPWRcCIrI4HqMqPn+Wt2doehx1wt1RCS7MZ4kIGe12t3bP9HQrsfgQrGlXnDc2OlvCqGKp9+1FEL10w1RFZQWs5ZZ9UtfAh6K+tmTgsK/sX2iBajsyIYbacA0oL1DfcMn6ddpDvKxFoNZ/b1+aiP3S5aQ6Xna7+fP0ncyHWvP1rvrVsVX780yIGGaIq8ezXCYa6IgRGdYRk6klt2Mpo+vFb0+cWAtJ0OJ8H1Nu0PVq3YOsBddugyGH7We1TTfWhW5A== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=suse.com; dmarc=pass action=none header.from=suse.com; dkim=pass header.d=suse.com; arc=none Authentication-Results: nongnu.org; dkim=none (message not signed) header.d=none;nongnu.org; dmarc=none action=none header.from=suse.com; Received: from VI1PR0402MB3744.eurprd04.prod.outlook.com (2603:10a6:803:16::25) by VI1PR04MB4126.eurprd04.prod.outlook.com (2603:10a6:803:47::12) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4150.23; Mon, 24 May 2021 02:53:53 +0000 Received: from VI1PR0402MB3744.eurprd04.prod.outlook.com ([fe80::b446:f4ea:d07c:ef5f]) by VI1PR0402MB3744.eurprd04.prod.outlook.com ([fe80::b446:f4ea:d07c:ef5f%7]) with mapi id 15.20.4150.027; Mon, 24 May 2021 02:53:53 +0000 From: "Cho, Yu-Chen" To: qemu-devel@nongnu.org, qemu-s390x@nongnu.org CC: cohuck@redhat.com, thuth@redhat.com, richard.henderson@linaro.org, cfontana@suse.de, david@redhat.com, pasic@linux.ibm.com, borntraeger@de.ibm.com, pbonzini@redhat.com, acho@suse.com Subject: [RFC v4 10/14] target/s390x: use kvm_enabled() to wrap call to kvm_s390_get_hpage_1m Date: Mon, 24 May 2021 10:52:52 +0800 Message-ID: <20210524025256.22252-10-acho@suse.com> X-Mailer: git-send-email 2.31.1 In-Reply-To: <20210524025256.22252-1-acho@suse.com> References: <20210524025256.22252-1-acho@suse.com> X-Originating-IP: [114.24.18.39] X-ClientProxiedBy: HK2PR04CA0057.apcprd04.prod.outlook.com (2603:1096:202:14::25) To VI1PR0402MB3744.eurprd04.prod.outlook.com (2603:10a6:803:16::25) MIME-Version: 1.0 X-MS-Exchange-MessageSentRepresentingType: 1 Received: from localhost.localdomain (114.24.18.39) by HK2PR04CA0057.apcprd04.prod.outlook.com (2603:1096:202:14::25) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4150.23 via Frontend Transport; Mon, 24 May 2021 02:53:49 +0000 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: fd8648fd-e158-4653-0870-08d91e5f2a3d X-MS-TrafficTypeDiagnostic: VI1PR04MB4126: X-MS-Exchange-Transport-Forked: True X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:2276; X-MS-Exchange-SenderADCheck: 1 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: ThpuOpNvIeKUzXBXcRVtN8b+efB6VKlYtVy2ckS4uzMl2YSck8bSq0tu91W7PHj6oHSc7Q+bhA4iMtzWAYvoC78rvvlLFTS9Eq3DJD44hASTQxy9fg4HUPauvZPzjtW6MTPgdS26xgcOImO0DlAB4cjihQbnIS6Js1WPTCCVvk4fWZNOzb7f3faJCLIoWW2tqXmCifWWAZZRMsBmMOVWg9YNPPIkZSnTBvYSr3W9JCQO4lstVwKb9FR7Q318iJrqIwvFUPZ0087b7++1GOftn4uRX1eneKBzj9Fb7NCeb8i3lw56/6osXvRqgyMybkCPwhZ/YOxqNZ8APPFSRV6vm/VzKLKOoo9wRzzBHvw3TxH/37TOkuMccfAAdplZ3q7ZYbC0UFfXCa2pXtvtYeK5xq9OxEQaHxgU16dosPeJ3G8DZ574NT8UC33nroDKlFxRnQ5ndpSUJZdStvV0tTwYgrEXOscn7fnjJ/6IyT+MQeawpeYyiuSUQWwVpEyzXm5h18j/bRlXxIMdZabc3svyX/M7sHLHDMLGpSNdag5SAQwmh99LrIGU8uRZDYo9jebfD2yrij3j9l/tvdiYcVg1wCaOSYcUN6mPkR78glz/xrktg+kA16UnW0Aju+iyu1+Xf6PcNYTGho4177AAhu2ffVkO33QJakUFlSUmNUvxGCswowergUrhspsHLXN8ynxX X-Forefront-Antispam-Report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:VI1PR0402MB3744.eurprd04.prod.outlook.com; PTR:; CAT:NONE; SFS:(366004)(346002)(136003)(376002)(396003)(39860400002)(36756003)(316002)(66476007)(38100700002)(8676002)(38350700002)(86362001)(52116002)(478600001)(66946007)(8936002)(1076003)(2906002)(956004)(26005)(6512007)(4744005)(16526019)(6506007)(186003)(83380400001)(2616005)(6666004)(4326008)(7416002)(5660300002)(6486002)(107886003)(66556008)(69590400013); DIR:OUT; SFP:1101; X-MS-Exchange-AntiSpam-MessageData: THYB4Jp/Cd5U3+/9UVGC3B7GnejStqRtyaHIJPsTlfRgnSiiPfdyLHKBLgnRha22X95spIy/WgEf1FmqwQLcsDGb7KyB1M5twvArY0Km/tXcJdEHaMxt/Xr2WkPHgUURnl9EXsocc76OANxNrGjhgrlXjaOItpvFU+1GiRLGP3hXDt9qT8FRnQTylwhedTYWa0MCpXfnTZayobOlpQA4zPmqyEKHIaBqSQIRskX9euRd22GATvjxCqEPjtkfOrbWgY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S0sMGaoz1Jchu X-OriginatorOrg: suse.com X-MS-Exchange-CrossTenant-Network-Message-Id: fd8648fd-e158-4653-0870-08d91e5f2a3d X-MS-Exchange-CrossTenant-AuthSource: VI1PR0402MB3744.eurprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 24 May 2021 02:53:53.2523 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: f7a17af6-1c5c-4a36-aa8b-f5be247aa4ba X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: NuaNjHmRiAcKv54AML/zjQten3+Jweavs/bkqxlNIesxeH+9KB8Bd7Su5Oihp3Yv X-MS-Exchange-Transport-CrossTenantHeadersStamped: VI1PR04MB4126 Received-SPF: pass client-ip=194.104.109.102; envelope-from=acho@suse.com; helo=de-smtp-delivery-102.mimecast.com X-Spam_score_int: -27 X-Spam_score: -2.8 X-Spam_bar: -- X-Spam_report: (-2.8 / 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, MSGID_FROM_MTA_HEADER=0.001, RCVD_IN_DNSWL_LOW=-0.7, RCVD_IN_MSPIKE_H2=-0.001, 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.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Sender: "Qemu-devel" this will allow to remove the kvm stubs. Signed-off-by: Claudio Fontana Signed-off-by: Cho, Yu-Chen --- target/s390x/diag.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/target/s390x/diag.c b/target/s390x/diag.c index c17a2498a7..8405f69df0 100644 --- a/target/s390x/diag.c +++ b/target/s390x/diag.c @@ -20,6 +20,7 @@ #include "hw/s390x/ipl.h" #include "hw/s390x/s390-virtio-ccw.h" #include "hw/s390x/pv.h" +#include "sysemu/kvm.h" #include "kvm_s390x.h" int handle_diag_288(CPUS390XState *env, uint64_t r1, uint64_t r3) @@ -168,7 +169,7 @@ out: return; } - if (kvm_s390_get_hpage_1m()) { + if (kvm_enabled() && kvm_s390_get_hpage_1m()) { error_report("Protected VMs can currently not be backed with " "huge pages"); env->regs[r1 + 1] = DIAG_308_RC_INVAL_FOR_PV;