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 74292D3398B for ; Mon, 28 Oct 2024 14:25:49 +0000 (UTC) Received: from list by lists.xenproject.org with outflank-mailman.826605.1240919 (Exim 4.92) (envelope-from ) id 1t5QgN-0006zS-Oo; Mon, 28 Oct 2024 14:25:23 +0000 X-Outflank-Mailman: Message body and most headers restored to incoming version Received: by outflank-mailman (output) from mailman id 826605.1240919; Mon, 28 Oct 2024 14:25:23 +0000 Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1t5QgN-0006zL-Lu; Mon, 28 Oct 2024 14:25:23 +0000 Received: by outflank-mailman (input) for mailman id 826605; Mon, 28 Oct 2024 14:25:22 +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 1t5QgM-0006zF-5n for xen-devel@lists.xenproject.org; Mon, 28 Oct 2024 14:25:22 +0000 Received: from mail-wm1-x32f.google.com (mail-wm1-x32f.google.com [2a00:1450:4864:20::32f]) by se1-gles-flk1.inumbo.com (Halon) with ESMTPS id 75b79eca-9538-11ef-99a3-01e77a169b0f; Mon, 28 Oct 2024 15:25:19 +0100 (CET) Received: by mail-wm1-x32f.google.com with SMTP id 5b1f17b1804b1-43169902057so42722565e9.0 for ; Mon, 28 Oct 2024 07:25:19 -0700 (PDT) Received: from [10.156.60.236] (ip-037-024-206-209.um08.pools.vodafone-ip.de. [37.24.206.209]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-4318b567977sm141456675e9.27.2024.10.28.07.25.18 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Mon, 28 Oct 2024 07:25:19 -0700 (PDT) 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: 75b79eca-9538-11ef-99a3-01e77a169b0f DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.com; s=google; t=1730125519; x=1730730319; darn=lists.xenproject.org; h=content-transfer-encoding:in-reply-to:autocrypt:from :content-language:references:cc:to:subject:user-agent:mime-version :date:message-id:from:to:cc:subject:date:message-id:reply-to; bh=hRk3zhoQ1tugjUj705YDbrxqHJjVDY/zLW7g4vcr1to=; b=NYuJk8mkBAp9bG4tc6SnEAJPPXxZCpn7zVBhrNJ1ZCTG2YRxTSpo3rJ28+ddrgxBez DYUso4Gr8tjliYmQ0u/z0ozAvKAqDFkr59/0YS5NSbKOeEQyTQLfHJgnWcJZuyLAzBGh 3ALLM2Zfx5LZsdTrk1t9E6knILv/KLRvhvd6jzU+pWk3N5/ww+2afW/0t2CBy+CWvOec pSI3scDAFXYUa1LGng/1hxNl/w1RVq4QzH2+3HbV83hXABvyHdk8CxuHtvvTar37kBV7 5ogu4kDnWWmYC/Rfr1XiyxvZabDuG4D89J3AhDZAM60d6n4ZRvuZURf8TfOjVMFCyiuj Umaw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1730125519; x=1730730319; h=content-transfer-encoding:in-reply-to:autocrypt:from :content-language:references:cc:to:subject:user-agent:mime-version :date:message-id:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to; bh=hRk3zhoQ1tugjUj705YDbrxqHJjVDY/zLW7g4vcr1to=; b=Mu9zxNpmGT5DCHTvNqJS7DHdWMuCNczEhnWHqcUoCh3TFaqp/Hb3PlhBCQTyNom3AG c4KLGORCQ1t5VUV9W15eCfxRJpkOHdL0tUg8QOVaEaibxEcStGTlqBlFNFoSQjpTsFCp 9epRs1bD6AVqbJBzzkc94IxMDIJewmeRs0lzunG5HVcgGwLW8ifsYJuhcSx6aLnaWSy3 Hv9uN75lwD1jNTIr3JyZuGuDX4oUIizqU/vGA5ZaxWR+9EZWZpAXaW6efkeMBXKcXyya AFsAPLsdWiSz8JOrVhsQnyrT3pDE9CxCFm5+0lSdCXMKDVnuqgOGpnhm7N0FmAUemQSL G7+Q== X-Forwarded-Encrypted: i=1; AJvYcCUPXC4h9iBFTr47h0S1RhF282ZkXbaEvvziHmy6/QY26KzRPEJHsUIsAw+JuN4/TffKMugco28dS1s=@lists.xenproject.org X-Gm-Message-State: AOJu0YyY87OLTVkO1AaTjcClK54Jy4COcYEbkH8XvhFboiYJdvr5Phjk /YN7VaMkCuamfih4X07c55w1fmoJ+SrBm1QZhTbwTEHyPolwucHLqgoP57n78Q== X-Google-Smtp-Source: AGHT+IHdTiw4F3+8QlcZL6LIhuQYnXiBejtIg7AcjrXl3tRCYTUFc44oevSSQdmvZHUAnkGjDT4xQQ== X-Received: by 2002:a05:600c:4455:b0:42c:b16e:7a22 with SMTP id 5b1f17b1804b1-4319ac9acadmr68465875e9.12.1730125519298; Mon, 28 Oct 2024 07:25:19 -0700 (PDT) Message-ID: <2e3dfea1-8277-4d4e-b594-87b3cac3052b@suse.com> Date: Mon, 28 Oct 2024 15:25:18 +0100 MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH 07/10] x86/ucode: Move the CPIO path string into microcode_ops To: Andrew Cooper Cc: =?UTF-8?Q?Roger_Pau_Monn=C3=A9?= , "Daniel P . Smith" , Xen-devel References: <20241028091856.2151603-1-andrew.cooper3@citrix.com> <20241028091856.2151603-8-andrew.cooper3@citrix.com> Content-Language: en-US From: Jan Beulich Autocrypt: addr=jbeulich@suse.com; keydata= xsDiBFk3nEQRBADAEaSw6zC/EJkiwGPXbWtPxl2xCdSoeepS07jW8UgcHNurfHvUzogE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/XcPzldjv+3 HYudvpdNK3lLujXeA5fLOH+Z/G9WBc5pFVSMocI71I8bT8lIAzreg0WvkWg5V2WZsUMlnDL9 mpwIGFhlbM3gfDMs7MPMu8YQRFVdUvtSpaAs8OFfGQ0ia3LGZcjA6Ik2+xcqscEJzNH+qh8V m5jjp28yZgaqTaRbg3M/+MTbMpicpZuqF4rnB0AQD12/3BNWDR6bmh+EkYSMcEIpQmBM51qM EKYTQGybRCjpnKHGOxG0rfFY1085mBDZCH5Kx0cl0HVJuQKC+dV2ZY5AqjcKwAxpE75MLFkr wkkEGBECAAkFAlk3nEQCGwwACgkQoDSui/t3IH7nnwCfcJWUDUFKdCsBH/E5d+0ZnMQi+G0A nAuWpQkjM1ASeQwSHEeAWPgskBQL In-Reply-To: <20241028091856.2151603-8-andrew.cooper3@citrix.com> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit On 28.10.2024 10:18, Andrew Cooper wrote: > We've got a perfectly good vendor abstraction already for microcode. No need > for a second ad-hoc one in microcode_scan_module(). > > This is in preparation to use ucode_ops.cpio_path in multiple places. > > These paths are only used during __init, so take the opportunity to move them > into __initconst. As an alternative to this, how about ... > --- a/xen/arch/x86/cpu/microcode/private.h > +++ b/xen/arch/x86/cpu/microcode/private.h > @@ -59,6 +59,13 @@ struct microcode_ops { > */ > enum microcode_match_result (*compare_patch)( > const struct microcode_patch *new, const struct microcode_patch *old); > + > + /* > + * For Linux inird microcode compatibliity. > + * > + * The path where this vendor's microcode can be found in CPIO. > + */ > + const char *cpio_path; const char cpio_path[]; inheriting the __initconst from the struct instances? Acked-by: Jan Beulich with a slight preference to the form without the extra pointer. Except that: gcc14 looks to be buggy when it comes to the copying of such a struct. The example below yields an internal compiler error. And the direct structure assignment also doesn't quite do what I would expect it to do (visible when commenting out the "else" branch. Bottom line - leave the code as is. Jan struct s { unsigned long ul; int i; char ac[]; }; const struct s gs = { 3, -4, "abcdef" }; void copy_s(struct s*d, const struct s*s) { *d = *s; } unsigned test(struct s*ps, _Bool direct) { if(direct) *ps = gs; else copy_s(ps, &gs); return sizeof(*ps); } unsigned size(void) { return sizeof(gs); }