Received: by 2002:a05:7412:8d10:b0:f3:1519:9f41 with SMTP id bj16csp2685861rdb; Fri, 8 Dec 2023 16:23:58 -0800 (PST) X-Google-Smtp-Source: AGHT+IE0Ss9Kxw29GG0eulKw+Sca0/IZ5xWatx2b5HOOgouRbH644VvlwJW5TmOX6R4MEJw+dslf X-Received: by 2002:a05:6870:b28d:b0:1fb:75b:12eb with SMTP id c13-20020a056870b28d00b001fb075b12ebmr1041173oao.61.1702081437931; Fri, 08 Dec 2023 16:23:57 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1702081437; cv=none; d=google.com; s=arc-20160816; b=uBQnnrdItW3gxjmgzkK4ITssaDREWDuhx603PVT40RLBS40dlTeP2JK4HYKS1iZJS0 +E6OTTwlIFaDrxVJRmu29A4q7o2X3DeKaxroX82eh2iwbix30JdXgUk+9R6Fsgym+PNX 3ih15B6KGQ/56b4puhfWkWZU4djYCSMuKJAR4xMnXNBpFa2y20z7Qz2PKTVCmcWgf2wl 0ppY89sLr2DDc2sMXPCg287WpRSE6xnldDvwGCKjsIbxU3BM92xmReNjp8miBF6pNt9i cfrooiH8YmtKFaLj4g8KIoef61XlfNeFACn+EknxY4oswDD+npdh4DGQnM+z98jza1N2 jxng== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :organization:references:in-reply-to:message-id:subject:cc:to:from :date:dkim-signature; bh=phS2R2QHxZTAdirC2hTL4QMyzVHOIHWizDvqBalwSgk=; fh=ZvpbeHpP0Y0v3u+CaZzOwTVebjaGJIGbrjWY8xhkDeQ=; b=iFPdVZIFinX8EvrxyvshqgILVMPoOkgEptoJ66TvJpMLxTM/loHZryUQ9M54cvv6h2 7HNdLUr3Bg5kXIzShi5oXFrgts36ineH9rL+c9rC4E3H67fbtqQy8fY00Z8Hr9kRQYkk +GwkXetZwUTiKnP0KTgD6oNUZl49Yuo5+zOmIkPDBE9kDxOk+VDjp/JwBhvkJpPqUX5B Yx11uTGTcdpc+ae1a5n1AyA8Ja+Pk71BFYWRyPA3K2XDE8ZRoY1/TgkrkL8xFrJh0SLg ifAsnGYNlpqW9nuYGJZ39GZpXXM+2fBKFnpraJO2+KvaH7TPsHFFQtI++fQexpVqY2hR yluQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=fQD899gs; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.34 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=intel.com Return-Path: Received: from howler.vger.email (howler.vger.email. [23.128.96.34]) by mx.google.com with ESMTPS id n8-20020a654508000000b005c625d44bd5si2210181pgq.281.2023.12.08.16.23.57 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 08 Dec 2023 16:23:57 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.34 as permitted sender) client-ip=23.128.96.34; Authentication-Results: mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=fQD899gs; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.34 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=intel.com Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by howler.vger.email (Postfix) with ESMTP id 68C56844BC71; Fri, 8 Dec 2023 16:23:55 -0800 (PST) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.11 at howler.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1574820AbjLIAXi (ORCPT + 99 others); Fri, 8 Dec 2023 19:23:38 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:41084 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234173AbjLIAXh (ORCPT ); Fri, 8 Dec 2023 19:23:37 -0500 Received: from mgamail.intel.com (mgamail.intel.com [192.55.52.151]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 2CD571989; Fri, 8 Dec 2023 16:23:44 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1702081424; x=1733617424; h=date:from:to:cc:subject:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=piv1ufn8iwzW/IVvizlJtD5QiZOF1k8OCC/NJ5zGeeU=; b=fQD899gsJ44xOKKWkcO9XlQRouWvqwCEhMpevieIShferUUUKmoF/FOY Yhqz3KvPVfk2RwSFwiP0r8RxwoHyecTVUlw7jFV8XfoFTlo9Xx+7wVoeY 5CYapWya3ApSj5vy4RS6smAX5Dp4RfVdcYdu5X/VwGPIHco1QRlws+Iwo 0C6dAwDYdyhS8oqYa3I9nTiJS1y6OJlbuTtJ0ViSJxw+as9USAUqjKrGi mEBHztQUDZ6z+PqZQPbWdRHNp5qL9tcTi1K/Km/+E5GwL0EVk/YJaZ0LR b9HPfSyOvNozypr6Ku0YpXyD8Av6CtgG/khs4VJpq+Am3M3/C7HyamAWe A==; X-IronPort-AV: E=McAfee;i="6600,9927,10918"; a="374644195" X-IronPort-AV: E=Sophos;i="6.04,262,1695711600"; d="scan'208";a="374644195" Received: from fmsmga006.fm.intel.com ([10.253.24.20]) by fmsmga107.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 08 Dec 2023 16:23:43 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6600,9927,10918"; a="1019534298" X-IronPort-AV: E=Sophos;i="6.04,262,1695711600"; d="scan'208";a="1019534298" Received: from jacob-builder.jf.intel.com (HELO jacob-builder) ([10.24.100.114]) by fmsmga006-auth.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 08 Dec 2023 16:23:43 -0800 Date: Fri, 8 Dec 2023 16:28:35 -0800 From: Jacob Pan To: Thomas Gleixner Cc: LKML , X86 Kernel , iommu@lists.linux.dev, Lu Baolu , kvm@vger.kernel.org, Dave Hansen , Joerg Roedel , "H. Peter Anvin" , Borislav Petkov , Ingo Molnar , Raj Ashok , "Tian, Kevin" , maz@kernel.org, peterz@infradead.org, seanjc@google.com, Robin Murphy , jacob.jun.pan@linux.intel.com Subject: Re: [PATCH RFC 01/13] x86: Move posted interrupt descriptor out of vmx code Message-ID: <20231208162835.1505f927@jacob-builder> In-Reply-To: <875y19t507.ffs@tglx> References: <20231112041643.2868316-1-jacob.jun.pan@linux.intel.com> <20231112041643.2868316-2-jacob.jun.pan@linux.intel.com> <87wmtruw87.ffs@tglx> <20231207205431.75a214c2@jacob-builder> <875y19t507.ffs@tglx> Organization: OTC X-Mailer: Claws Mail 3.17.5 (GTK+ 2.24.32; x86_64-pc-linux-gnu) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=-0.8 required=5.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on howler.vger.email Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (howler.vger.email [0.0.0.0]); Fri, 08 Dec 2023 16:23:55 -0800 (PST) Hi Thomas, On Fri, 08 Dec 2023 10:31:20 +0100, Thomas Gleixner wrote: > On Thu, Dec 07 2023 at 20:54, Jacob Pan wrote: > > On Wed, 06 Dec 2023 17:33:28 +0100, Thomas Gleixner > > wrote: > >> On Sat, Nov 11 2023 at 20:16, Jacob Pan wrote: > >> u32 rsvd[6]; > >> } __aligned(64); > >> > > It seems bit-fields cannot pass type check. I got these compile error. > > And why are you telling me that instead if simply fixing it? I guess we can fix it like this to use the new bitfields: void intel_posted_msi_init(void) { - this_cpu_write(posted_interrupt_desc.nv, POSTED_MSI_NOTIFICATION_VECTOR); - this_cpu_write(posted_interrupt_desc.ndst, this_cpu_read(x86_cpu_to_apicid)); + struct pi_desc *pid = this_cpu_ptr(&posted_interrupt_desc); + + pid->nv = POSTED_MSI_NOTIFICATION_VECTOR; + pid->ndst = this_cpu_read(x86_cpu_to_apicid); It is init time, no IOMMU posting yet. So no need for atomics. Thanks, Jacob