From patchwork Fri Apr 23 09:43:43 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Roger_Pau_Monn=C3=A9?= X-Patchwork-Id: 12219997 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,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED, 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 8F8E7C433B4 for ; Fri, 23 Apr 2021 09:44:31 +0000 (UTC) Received: from lists.xenproject.org (lists.xenproject.org [192.237.175.120]) (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 182C661458 for ; Fri, 23 Apr 2021 09:44:31 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 182C661458 Authentication-Results: mail.kernel.org; dmarc=fail (p=reject dis=none) header.from=citrix.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=xen-devel-bounces@lists.xenproject.org Received: from list by lists.xenproject.org with outflank-mailman.116002.221382 (Exim 4.92) (envelope-from ) id 1lZsMH-0002ar-98; Fri, 23 Apr 2021 09:44:21 +0000 X-Outflank-Mailman: Message body and most headers restored to incoming version Received: by outflank-mailman (output) from mailman id 116002.221382; Fri, 23 Apr 2021 09:44:21 +0000 Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1lZsMH-0002ah-5X; Fri, 23 Apr 2021 09:44:21 +0000 Received: by outflank-mailman (input) for mailman id 116002; Fri, 23 Apr 2021 09:44:19 +0000 Received: from us1-rack-iad1.inumbo.com ([172.99.69.81]) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1lZsMF-0002Zj-MO for xen-devel@lists.xenproject.org; Fri, 23 Apr 2021 09:44:19 +0000 Received: from esa1.hc3370-68.iphmx.com (unknown [216.71.145.142]) by us1-rack-iad1.inumbo.com (Halon) with ESMTPS id 3c36b503-ee47-4d45-91da-929ad3d53259; Fri, 23 Apr 2021 09:44:18 +0000 (UTC) X-BeenThere: xen-devel@lists.xenproject.org List-Id: Xen developer discussion List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Errors-To: xen-devel-bounces@lists.xenproject.org Precedence: list Sender: "Xen-devel" X-Inumbo-ID: 3c36b503-ee47-4d45-91da-929ad3d53259 DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=citrix.com; s=securemail; t=1619171058; h=from:to:cc:subject:date:message-id:in-reply-to: references:content-transfer-encoding:mime-version; bh=FnjIKy4vPMufM1E2A44dzla8avWRqW9V4Gx5/pT11/U=; b=doaGTPs1F4rXiVXrOth7NSyPKzmIoBxH7jxQizbJyCvobaoJ3RcBOjUP qsIcXwC1VR4963zKbMQbxrekE2tGpo1cNZbPlDE17ZSCKK9Qx0wfl86Wo 6Fb06Z6/z0l7KPWjsUagog8NJArZhuyv6wUYagLWfhxg7NyD4f7sRZBLn 4=; Authentication-Results: esa1.hc3370-68.iphmx.com; dkim=pass (signature verified) header.i=@citrix.onmicrosoft.com IronPort-SDR: vamjpA7vshUN28lcXqHLfkp0uYiF3LQhRHBayNgIS4wkGQf0kyw4PxG7iLfXtIL7crlT4MC4uv JbzhIn8bwKm9Fw89Fo6xa46hkL1vBiWwUJT+LgcghziuLdJXVyNDLwLcI8CGKFefYyqRLyeVER CO/n0xJaaRXDGAv7Zg75+MT7jKiZmRYQq4LvcG6KYrb3Sse2OB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Gqg1RQsBjNtSmJupJnwWXJDogEHd2nud6wYhtmZcWdOmFyKOwF4VMGTNA JEvVx49eaWIvWrtG4fIuPiFljfo2oYpXqMQZtZsLaE/93ZdpQxCYtjfrdwGwXNHxlcgh1rt2 9HVQ8BSibkZ3DToJTgqKZRKPDUdtF6jgvuC9VTs2jjuUKVotxqemEWRAe0UcmcgR8nQh1dgl EZyd5ZvJOw3RKUbUcviuUxN1NBLECaGqhPAgi+aIJIobzzYw1rQWCWhTuVtgErdgPRhjYvr1 2kCRfRVeDAA1JbtHwd6Krs/V9uXki2fk57aBlBwMZAPFWDnkw2/f6AZ6K13WfUV0ALxfsFNi rZJREIJBl1+tyx3BmJuTqLGHk83K8yNujFALlLScCU5lqdbKmz0Y0WFf5d+5hocO30uugQSO SFZku7Kij7B+5B4X3iml8VfA1P7F8qnvPj1Ee7sCyW3HsjDeHTJ1ojbbcBON2Y53XlQfHN8J gRt6NAgcKAdkHKLviBwuXrShQGDDX5i2u/VfspppBZprhajso6I7DrFR/zkEha1xA/JvrunE wQQK5H8KnMU7UfCvA6SmZ8xB4Vj9yBI0sgjxzuDsI/dV8riWXHP9nh2cu+lZMfRmmIpA79Ij CkglVg1saAeyuIzrgBDa0sZUxQdUgn8XxnldnyPbH4OUGPd+tZ+kC9PWL4WLhBSLKdEbFVih ph+dmHk6u2cCX/sTqg8AdTE+Zr82y9R9m1Dx/JMelU88aiMVDJu5CU2qeI/X7KYAr+TV8Zi4 1DfVERacoGqgBKtvxJ7gGCDortokwklFNC5ypAjVCF4Pn+3Fvm X-IronPort-AV: E=Sophos;i="5.82,245,1613451600"; d="scan'208";a="42643215" ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=SXOCZfLq4krO+JQ8KWdLiyaJB22F4Pn4xLdFw2xXKOmQ14mPe77fM8Nf2MbKu/RH3rP8IlB8HPEYl3IapuifWyD2mLKlTw9MTGmQFk9wzb8/XeoH4wR7xdw5+Rik3WuAffBfxq0AgFr2vfy52t6fyFVrGH1UOumBA0HSyB1RWJ9BsEHDut73+hA4VTJj7Y3KGXi1lcS0Cqm+/TbuwIUkazoVIuOF0O8YcUet7zzQxgcqny90a+9Z1W5gh3AbKdGqz2ORpyTJ/2ILNKbeSSwvM+7vokO6frLXlqqB9XjSXwuRkiM2n3Ba4mIzBYY5ivMY8Yuud85tV2YojjSQmS9F2g== 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=lTwYXU5O3V5OqqnU/mlpo7hQAAvN0IpnHHnFd6kULLw=; b=XFsKiOIG+nUq9TSB54nLXvSttZnAyyxdHCauyQo7c6v3ibjsZvIEfuF61eded3tsVwxZDjcr4fxb6sABMwAYvGyrRF6ACbmFlqqmcl9n1Pk9pj4TlNYvxwkl8b86a6qENITauvZkHeYgtSnxrdQNQh8aJ/PGw8zRKI5ufwuzgwDu+bAt8LRGcQFVv/dFr2vF4DbozZZCVLDJHSTY3jaUYpLh2X6/erxnwRW6fTyHirHbyGYNMcIk/zs5FLMjf7Pzox+3CL/9EKcsR6lz8ye3qjsl7VmHNMa5mAaMrY9+8wzqJIHBbBU7dotQK8x9p4CAN+F91fRDCwwbEfBIZOXu/g== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=citrix.com; dmarc=pass action=none header.from=citrix.com; dkim=pass header.d=citrix.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=citrix.onmicrosoft.com; s=selector2-citrix-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=lTwYXU5O3V5OqqnU/mlpo7hQAAvN0IpnHHnFd6kULLw=; b=MFIAHLU6EjbXbncfZNc/l9xKHrxR2u+SQkRDeAe5SOWOJYaCkWl/lYpJMe9GGP0l7/Bb1gc+iUdJsSLVUZaIyGiDyoRZ8VbvEm2Mwh6Jwfh4bCTTXmZF9tS5/ubt8/47kGdFSoSu3bleK2VE8BeyZLLxrIg/1xh47BuLEyhBW3g= From: Roger Pau Monne To: CC: Roger Pau Monne , Jan Beulich , Andrew Cooper , Wei Liu Subject: [PATCH 2/2] x86/pv: fix clang build without CONFIG_PV32 Date: Fri, 23 Apr 2021 11:43:43 +0200 Message-ID: <20210423094343.5850-3-roger.pau@citrix.com> X-Mailer: git-send-email 2.30.1 In-Reply-To: <20210423094343.5850-1-roger.pau@citrix.com> References: <20210423094343.5850-1-roger.pau@citrix.com> X-ClientProxiedBy: MR2P264CA0117.FRAP264.PROD.OUTLOOK.COM (2603:10a6:500:33::33) To DS7PR03MB5608.namprd03.prod.outlook.com (2603:10b6:5:2c9::18) MIME-Version: 1.0 X-MS-Exchange-MessageSentRepresentingType: 1 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 0e797e53-58c2-44a8-c696-08d9063c5b36 X-MS-TrafficTypeDiagnostic: DS7PR03MB5591: X-MS-Exchange-Transport-Forked: True X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:7691; X-MS-Exchange-SenderADCheck: 1 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: 6wq2RkAETP2g0ipHbZu9/xyiRMm55x4yjIgfiW1+zTFwKtsSELua+PVcFVh3+RqDBANv86a5QnX57ovzjQq61CueywqYaVJo8O3IcUyXBVs8U+qDHFwpDniZ+CfISc2jCu8sqrClI8h2CY4h4TA12ajcPTRscVpyhUqIxwUGLEEh67uE+3yw5pErBB5hliUOF9ANQWR9q/wFwLRh9EzsgRwyWLMI5CahLb47TRb4kMcyR6E+I2utVMZX/tgo2JCMIvzK9H8hwtThTJnG5EAjeJDpyR3qiKCpj2U/PFIYvmF0w1f5REzn1X2b9C0lvnYXFtbo+ZgKR445J1KZIYUBNXEPI0JV4kJAIzxJi4F6aG9nTkJSboj0vxHGYSxMNMYmIVCAlIX+Hb3G849jSIoNhECBDV1YiQvKTvPYFb23N8laGsgx4r9e1+EhZc9jozcJGSVakUKgTQDu6BxOFHK+VUJKv8za4BEQnRgKRTdSBEdGAfdcOCqeZPb1Wf4DHvilVbdysWaCcj3p86RQgX8TfNC413cPxEQK+/jv8tiP/V/vMhJ+/m4A0nlBLE1Iru2zSt42/YvdZ65nJeJY4OeoWU7XaJOZUer24W8SM3XVmsM= X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:DS7PR03MB5608.namprd03.prod.outlook.com;PTR:;CAT:NONE;SFS:(4636009)(396003)(136003)(39860400002)(366004)(376002)(346002)(2906002)(2616005)(26005)(66556008)(66476007)(16526019)(186003)(956004)(38100700002)(4326008)(316002)(6496006)(8936002)(478600001)(54906003)(66946007)(86362001)(6666004)(8676002)(1076003)(6486002)(83380400001)(36756003)(5660300002)(6916009);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData: =?utf-8?q?fktf2uxCpFSSjxCE3jgeoE+hosMx8O?= =?utf-8?q?AncVq5HYvqeWZIuUZFc1O1BtJV0SMCXsUJnkZHUVMeuhakC64YTPf0byuWBrpSkNM?= =?utf-8?q?zboT3pFu9mRGyMFzC+uzMUnYBbpdahMOkHVYYOY2/g4kiXmDbBVGRnICf4C85uQxa?= =?utf-8?q?+OEqsttVGslV4tKMPF2Lb8btDhmQ+Pady5K3Zm1YZTWKkXXoiI2zvCi/EfhtkT/dU?= =?utf-8?q?P9v0uKBbwLPjpZTQFD7eXWKz2ye1DpgnZLt3BvLE43tp4WFmRXGCrTOg5CD2Za8dq?= =?utf-8?q?ACF85A5I0mxxiw7w/KNROZ5tySlDViTFa3vxCrtJaik/FxfI6fD/U4YgThO1jXxtY?= =?utf-8?q?tvQwSvOgjK3mOz86hv/2Vwun2aX9lyNrhQ/IUGXasgD+MzVb0Z1+cK1wWiHLw1JOk?= =?utf-8?q?ghrzs6iBThYvyPyl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ZJF05NS?= X-MS-Exchange-CrossTenant-Network-Message-Id: 0e797e53-58c2-44a8-c696-08d9063c5b36 X-MS-Exchange-CrossTenant-AuthSource: DS7PR03MB5608.namprd03.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 23 Apr 2021 09:44:15.0046 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 335836de-42ef-43a2-b145-348c2ee9ca5b X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: mtFOVglOPsYRgmNjPsPv4pgc6atJziUrb2JJ+LWEt2CGkCKd7ANXXeclSjkO33TDUQ0pfYEjDvL/95LU9iaIcw== X-MS-Exchange-Transport-CrossTenantHeadersStamped: DS7PR03MB5591 X-OriginatorOrg: citrix.com Clang reports the following build error without CONFIG_PV: hypercall.c:253:10: error: variable 'op' is used uninitialized whenever 'if' condition is false [-Werror,-Wsometimes-uninitialized] if ( !is_pv_32bit_vcpu(curr) ) ^~~~~~~~~~~~~~~~~~~~~~~ hypercall.c:282:21: note: uninitialized use occurs here return unlikely(op == __HYPERVISOR_iret) ^~ /root/src/xen/xen/include/xen/compiler.h:21:43: note: expanded from macro 'unlikely' #define unlikely(x) __builtin_expect(!!(x),0) ^ hypercall.c:253:5: note: remove the 'if' if its condition is always true if ( !is_pv_32bit_vcpu(curr) ) ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ hypercall.c:251:21: note: initialize the variable 'op' to silence this warning unsigned long op; ^ = 0 Rearrange the code in arch_do_multicall_call so that the if guards the 32bit branch and when CONFIG_PV32 is not set there's no conditional at all. Fixes: 527922008bc ('x86: slim down hypercall handling when !PV32') Signed-off-by: Roger Pau Monné Acked-by: Jan Beulich --- Should the is_pv_32bit_vcpu be wrapped in an unlikely hint? --- xen/arch/x86/pv/hypercall.c | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/xen/arch/x86/pv/hypercall.c b/xen/arch/x86/pv/hypercall.c index e30c59b6286..d573f74aa1e 100644 --- a/xen/arch/x86/pv/hypercall.c +++ b/xen/arch/x86/pv/hypercall.c @@ -250,34 +250,34 @@ enum mc_disposition arch_do_multicall_call(struct mc_state *state) struct vcpu *curr = current; unsigned long op; - if ( !is_pv_32bit_vcpu(curr) ) +#ifdef CONFIG_PV32 + if ( is_pv_32bit_vcpu(curr) ) { - struct multicall_entry *call = &state->call; + struct compat_multicall_entry *call = &state->compat_call; op = call->op; if ( (op < ARRAY_SIZE(pv_hypercall_table)) && - pv_hypercall_table[op].native ) - call->result = pv_hypercall_table[op].native( + pv_hypercall_table[op].compat ) + call->result = pv_hypercall_table[op].compat( call->args[0], call->args[1], call->args[2], call->args[3], call->args[4], call->args[5]); else call->result = -ENOSYS; } -#ifdef CONFIG_PV32 else +#endif { - struct compat_multicall_entry *call = &state->compat_call; + struct multicall_entry *call = &state->call; op = call->op; if ( (op < ARRAY_SIZE(pv_hypercall_table)) && - pv_hypercall_table[op].compat ) - call->result = pv_hypercall_table[op].compat( + pv_hypercall_table[op].native ) + call->result = pv_hypercall_table[op].native( call->args[0], call->args[1], call->args[2], call->args[3], call->args[4], call->args[5]); else call->result = -ENOSYS; } -#endif return unlikely(op == __HYPERVISOR_iret) ? mc_exit