From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-wm1-f52.google.com (mail-wm1-f52.google.com [209.85.128.52]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id CD40E33C50D for ; Mon, 30 Mar 2026 21:24:28 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.128.52 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1774905870; cv=none; b=uwgcNQxYUTjI7JIVYPlY96SCcNr0Vg0qp01YtS/JY9xeXanSttnbeMHwsKRM+rFxRoaLzLCpObJII9cOn7AP4Zoe09nQV48mrUCCbiMkZnz6qso0JpM5vIO4Wto3HYP6hLUqyHrogDy5S5aqBIHL/baZ2VbrKMO/0c24eFBGRes= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1774905870; c=relaxed/simple; bh=DDM1bj9XB4J9eudI0DQwLSKR7PNcUW5XxK6rwE3Tj1A=; h=Date:From:To:Cc:Subject:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=r+9MXe7u5396Hhr9bEveISdMfwxVMhbpfwIFT9qx7QksEfm193gUqhUEywk5XtKsMl6ShvJYrYaCdtGLzLrTBUuaIB2ynfVLQbkpoQ0dg0P4jy5heHd8BL+A++lvagbzpXHBHakOKMpV4N3U8AYCNn9wfAEigK815BN/NzVLl0s= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com; spf=pass smtp.mailfrom=gmail.com; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b=l4PFQ8Ad; arc=none smtp.client-ip=209.85.128.52 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="l4PFQ8Ad" Received: by mail-wm1-f52.google.com with SMTP id 5b1f17b1804b1-482f454be5bso56887415e9.0 for ; Mon, 30 Mar 2026 14:24:28 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20251104; t=1774905867; x=1775510667; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:subject:cc:to:from:date:from:to:cc:subject:date :message-id:reply-to; bh=nVxGXi9tOYZBkBeZMRSRJMOtno41yt25C5xgsm5mNZs=; b=l4PFQ8AdsiBByWDKirTpeadyamL/765sZ1wHa7e+YgVQcb/hIeWigfIlHCHrq1S4/z PRY8klyLWjNK9a6V6fijWQb+gVtP4hqYyFP1+mKJxX/rhnkjmGxGTbljFxhsxKe5Gpv1 gncIrRVsYsglUFUgdmRGBxOnx1KNHqvfNCSHo3G5kwcoxLkN8qa17QovtyZ6ME5w/ZdI UnvwKybFq2Ni0g9l0gu+BKSD/hxIB0VAcWXskH8fM1pJa6du25Qs1gBfKuaPb6ofQELM SG4Dsjoyf8Xq8TL0MDofCMHIn5OkyokeIoN1F4U/UlOOC4SVHh5zxMHFUv/sLzpBPsf7 ixJw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1774905867; x=1775510667; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:subject:cc:to:from:date:x-gm-gg:x-gm-message-state:from :to:cc:subject:date:message-id:reply-to; bh=nVxGXi9tOYZBkBeZMRSRJMOtno41yt25C5xgsm5mNZs=; b=f5mRzu50WoRBcRwv3bM2IcDxOkciosyZ06g5DLb5YIm06IId6PHi79WT5kalQt9xYt OaEZeUe0fFWvDPdtHUHbfJ6trIrpR23WfRfkquS4+Pp+nQXFOfW6+3XmlrheInHvXXL+ P51ZWiipNQ90vBCmu0fuLmiYZGzJFr3Jm+i8hx+hG2Jb/sM0bB4JWTuA6TbStevtSEMx PN266thMUT0ImOSBZ3DEOHTYM5IW0etMDQnDi+NeNd/KH0YUxVr+RFo/tNDGVafgGC6u haTiS6IJrLGvL9KFqYsPxJRElOwMInXR2gfNxrjdKz2+FQx/7O2Tdpqz1CFfeH/8TU7o FwjQ== X-Forwarded-Encrypted: i=1; AJvYcCUuHTwzcxHE1n/PZirzmqCsFKQfN5alDXv4M9DeH5c+kySyWMuSI5SejhvDoyTlPsDjQcIJwJyTKgDlJB0=@vger.kernel.org X-Gm-Message-State: AOJu0YzSjx+1pRBi1WHhJgIraXxUHNFAHH4/IOIQhqlO3nL0T64AAN2s PlpZolxvodAlRnOghP0pElKhr5dUXGIkwBM2ncIfP03Q4eCnBjnk8JDg X-Gm-Gg: ATEYQzybU3EiqT28TEYLP+6RNaiyFAUEca4Ex/zTHBVrGm32erhACLuBmlAnsirmdtF TQPhTLTw147RZgV0C0cYtVvhB9mcQxdw5N9/eHA/ApO4euY4OVauwlOGG9DA5OdfWLLE4ZD7nEX 2bOOJcAhJUT5D+J9GkuYEHOKKEFvoR7yMfmSocv0ua5kZ3BbP12lHGv/quQsrCpS/Wn0nTdBVYa KcyKxtPAYbY6DuisIeKixcKCmp3v9vjHDoUTFD5TjUkNSc2bWy5DCL8+WCDrNduF2UkbUoWGidp JSeg30isCkAvSzVKM/IdhQXAbAkLADsDAYR2fW1e0aYJfXua4cqAZFgvwdMc18piwAU/fYj8Yj7 E0YaEa2Yb6uhp/igOPCV4X5Zedj5Oc6uWrj+dyuiqhR5INcmH5Xw3AJxSiyUUJcn76720RRb/QK ybl/26/oZYoi47A6qgGC+Z7pRA4RlVRHGKoMVWHKhanAXwtO5PgpeI6IXQmDnQ X-Received: by 2002:a05:600c:41c3:b0:487:22ad:403e with SMTP id 5b1f17b1804b1-488783b1117mr10889585e9.14.1774905866742; Mon, 30 Mar 2026 14:24:26 -0700 (PDT) Received: from pumpkin (82-69-66-36.dsl.in-addr.zen.co.uk. [82.69.66.36]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-4887adae019sm1941685e9.25.2026.03.30.14.24.25 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 30 Mar 2026 14:24:26 -0700 (PDT) Date: Mon, 30 Mar 2026 22:24:24 +0100 From: David Laight To: Maciej Wieczor-Retman Cc: "H. Peter Anvin" , Pawan Gupta , tglx@kernel.org, peterz@infradead.org, xin@zytor.com, maciej.wieczor-retman@intel.com, babu.moger@amd.com, chang.seok.bae@intel.com, sohil.mehta@intel.com, dave.hansen@linux.intel.com, jpoimboe@kernel.org, elena.reshetova@intel.com, ak@linux.intel.com, darwi@linutronix.de, bp@alien8.de, mingo@redhat.com, x86@kernel.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH v11 3/4] x86/cpu: Do a sanity check on required feature bits Message-ID: <20260330222424.39948b9c@pumpkin> In-Reply-To: References: <7312c9f2feab8aea4612ed9a1841e8c22f5f69b1.1774008873.git.m.wieczorretman@pm.me> <20260321003015.4i7wrqmaunbljguw@desk> <20260326190430.i4dt2dxqpfzwlhcc@desk> X-Mailer: Claws Mail 4.1.1 (GTK 3.24.38; arm-unknown-linux-gnueabihf) Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit On Mon, 30 Mar 2026 10:09:47 +0000 Maciej Wieczor-Retman wrote: > On 2026-03-27 at 18:52:30 -0700, H. Peter Anvin wrote: ... > >One thing that matters here is that these bitmaps are *already* accessed using > >bitop operations. Therefore, if this is a problem *here*, then it is a problem > >*everywhere*. > > I think for example the set_bit()/clear_bit() bitops are not problematic while > for_each_set_bit() is, specfically used in this context. Most operations seem to > not affect or not be affected by the potential unaligned 32-bit. Oh they are... Look up 'split lock'. You must not cast int[] to long[] for the 'bit' functions. Basically if the 'long' gets split over a cache-line boundary the cpu has to do an 'old fashioned' lock of the inter-cpu bus in order to perform the locked memory accesses. That is both slow and kills the rest of the machine. David