From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org 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 smtp.lore.kernel.org (Postfix) with ESMTPS id 26B7BC61D85 for ; Tue, 21 Nov 2023 15:48:31 +0000 (UTC) Received: from list by lists.xenproject.org with outflank-mailman.637922.994021 (Exim 4.92) (envelope-from ) id 1r5Sz0-0003CI-VY; Tue, 21 Nov 2023 15:48:14 +0000 X-Outflank-Mailman: Message body and most headers restored to incoming version Received: by outflank-mailman (output) from mailman id 637922.994021; Tue, 21 Nov 2023 15:48:14 +0000 Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1r5Sz0-0003CB-Ro; Tue, 21 Nov 2023 15:48:14 +0000 Received: by outflank-mailman (input) for mailman id 637922; Tue, 21 Nov 2023 15:48:13 +0000 Received: from se1-gles-flk1-in.inumbo.com ([94.247.172.50] helo=se1-gles-flk1.inumbo.com) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1r5Syz-0003Bn-Jt for xen-devel@lists.xenproject.org; Tue, 21 Nov 2023 15:48:13 +0000 Received: from mail-lj1-x22b.google.com (mail-lj1-x22b.google.com [2a00:1450:4864:20::22b]) by se1-gles-flk1.inumbo.com (Halon) with ESMTPS id 5fd200d3-8885-11ee-9b0e-b553b5be7939; Tue, 21 Nov 2023 16:48:11 +0100 (CET) Received: by mail-lj1-x22b.google.com with SMTP id 38308e7fff4ca-2c88750e7d1so20912981fa.3 for ; Tue, 21 Nov 2023 07:48:11 -0800 (PST) Received: from localhost ([213.195.113.99]) by smtp.gmail.com with ESMTPSA id p4-20020a05600c468400b00405959bbf4fsm17643150wmo.19.2023.11.21.07.48.10 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 21 Nov 2023 07:48:10 -0800 (PST) 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: 5fd200d3-8885-11ee-9b0e-b553b5be7939 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=citrix.com; s=google; t=1700581691; x=1701186491; darn=lists.xenproject.org; h=in-reply-to:content-transfer-encoding:content-disposition :mime-version:references:message-id:subject:cc:to:from:date:from:to :cc:subject:date:message-id:reply-to; bh=HqIFDC7sw9FrFrkiQN6BhvfYvQBHh1SHDXc9ULlRUL8=; b=MSZyFd4PA4M/FgsziFQkPmxx2nZMIBz7Z2sMq2wWToge/JjM7na8YpGexKcvbOBijQ +Zpp9gG1g4ufDkL/O0Xj2IpCqAcblVpJtMDISKlUAeEis5aAm7CWMUPhV89kvmqaBinW Xdt3LoZPclO/5NnciKAwKiNVrdmQvPbvQ9fIY= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1700581691; x=1701186491; h=in-reply-to:content-transfer-encoding:content-disposition :mime-version:references:message-id:subject:cc:to:from:date :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=HqIFDC7sw9FrFrkiQN6BhvfYvQBHh1SHDXc9ULlRUL8=; b=P9TP6s4WpkwNX6uJv9wZJwOapnt1Lv9KwThGtX2M5shIt4S1u0WTwR9kPkjdkcWMgZ +XEGdXpa0tDEo6zsfAHnNMa1ndBefVNxjfb8wTp9Z7EM30pRcnf+M28tO+45jAnReod0 qIUUH+zbotP3gpMKjLQAyP/K2QO3dT5UQwAwyICwhi7p4i9uMEl8xRlNgbilVL4/jMmI k5lSbF3/kgXpJVF3qRuDUZAU2jOLXtZ54qkHCJnxqHLnkVoAc8/83gQZGjhBpcNyK5hI +8RVnsdh8UW6XVJi8Vr6bh2uxMXKvwkfZYA9potWBYWI5vCfb2XpKmvDmanyWMMUMcC9 YqFg== X-Gm-Message-State: AOJu0YyNsKJVrkgdbS28qtTOf9tpUu7raHfypeBlQXev9ZPOjyUHhbRS mwcGxFdPeKPzWbZ6C9HaV83B7Q== X-Google-Smtp-Source: AGHT+IEaKtrk9t/a08zPYEN191u5MGbb8/k5FVQr9Izc6FtTnlM5aHANZK8JHE6zVJ2w+lAfVYOdHQ== X-Received: by 2002:a05:651c:1507:b0:2c8:8ba8:afa7 with SMTP id e7-20020a05651c150700b002c88ba8afa7mr1675228ljf.39.1700581691015; Tue, 21 Nov 2023 07:48:11 -0800 (PST) Date: Tue, 21 Nov 2023 16:48:09 +0100 From: Roger Pau =?utf-8?B?TW9ubsOp?= To: Jan Beulich Cc: "xen-devel@lists.xenproject.org" , Andrew Cooper , Wei Liu , Kevin Tian , Jun Nakajima Subject: Re: [PATCH 1/5] VMX: drop vmx_virt_exception and make vmx_vmfunc static Message-ID: References: <791a9f45-2bed-48f9-af6a-9fbde65bcc71@suse.com> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: On Thu, Nov 16, 2023 at 02:30:41PM +0100, Jan Beulich wrote: > The variable was introduced by 69b830e5ffb4 ("VMX: VMFUNC and #VE > definitions and detection") without any use and - violating Misra C:2012 > rule 8.4 - without a declaration. Since no use has appeared, drop it. > > For vmx_vmfunc the situation is similar, but not identical: It at least > has one use. Convert it to be static (and make style adjustments while > there). I think you could also remove the sole user of vmx_vmfunc, as it's just a cap_check() usage (unless there are more hidden usages). > > Signed-off-by: Jan Beulich Acked-by: Roger Pau Monné > --- > In how far the sole vmx_vmfunc use is actually meaningful (on its own) > I'm not really sure. > > --- a/xen/arch/x86/hvm/vmx/vmcs.c > +++ b/xen/arch/x86/hvm/vmx/vmcs.c > @@ -167,8 +167,7 @@ u32 vmx_secondary_exec_control __read_mo > u32 vmx_vmexit_control __read_mostly; > u32 vmx_vmentry_control __read_mostly; > u64 vmx_ept_vpid_cap __read_mostly; > -u64 vmx_vmfunc __read_mostly; > -bool_t vmx_virt_exception __read_mostly; > +static uint64_t __read_mostly vmx_vmfunc; I'm quite sure this should be __ro_after_init, but I guess we cannot be sure give the current code in vmx_init_vmcs_config(). Any CPU hot plugged that has a different set of VMX controls should not be onlined, the more that migrating an already running VMCS to such CPU will lead to failures if non-supported features are used. Thanks, Roger.