From mboxrd@z Thu Jan 1 00:00:00 1970 Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.remote-ip=209.85.210.72 ARC-Seal: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=none; t=1796325182; b=QUMyBbQFYYbse1NRNnEdZLbLBweRth7rpBx8n8KGcNzGlWUuQJKbAfI8erjyXElRJWbK 6YZu4ISxuMbe7GcBcSeSx9U3HRnDhvfv8shvLAnuHYMRxYv60cTknQpbeeDFDVYHeRx0T U9xbaAmq7qJDeCbRNZomehYH7GmNn6wgV0whB6LZl/qv0X6NX0fIEyl3M+YFZpCvMULl5 +jx/oPQESM73nTK035ER9oA5H/4EQxqO24ro6RdlGDwxdBHA9SskkKuSQgI81xLF7jc2F VLqF06GHQuPgiLJjrTmJWldtg8KAa1HK1OQZHnAVXjYqZYXeD9w1HSL9o49sCuPDDeA== ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1796325182; h=DMARC-Filter:Received:DKIM-Signature:X-Google-DKIM-Signature: X-Forwarded-Encrypted:X-Gm-Message-State:X-Received:Date:In-Reply-To: Mime-Version:References:X-Mailer:Message-ID:Subject:From:To:Cc: Content-Type; bh=i2EQog5sPZ6g9oNWZvlHBsTV6LY5BF0gV3A/lAVIiMo=; b=PS8H3ob3U0axBrPO09ylukuSuVemtJSMIAA+QwK4yE4FY3r2d6AlaMp2Rs+fpbD4OC3s fBg9qmvC96SYUHfMU4Hged7+QzdVg33fLLIDHxA5a4hFbSybsNEYea2WffaAY1CCwcAfq zTRQc2LnJhg4pYHuaiE4fbggr6xd2ZYmBrkN2IEDSuFVNnDJZUnWsYBPHNwCjiAST4n+q 5J4TILgx3XxqJRHQPnjIuoQcT0mSzpzNjySc3GeZfa74u0Erzj+p9NsGUxYWIrCCzumTa KnO4OXn61FroL2dK6vB6LYIeF22uhg8X9rzF2aJZxe+4ofi4zxRdzYGvpmufit8+bpA== ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass header.from=google.com; spf=pass smtp.mailfrom=flex--coltonlewis.bounces.google.com; dkim=pass header.d=google.com header.i=@google.com header.a=rsa-sha256 header.s=20260707 header.b=XD85l2+I; arc=none smtp.remote-ip=209.85.210.72 Received: from mail-ot1-f72.google.com (mail-ot1-f72.google.com [209.85.210.72]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature ECDSA (prime256v1) server-digest SHA256) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 81FD360A2604 for ; Thu, 3 Dec 2026 19:13:02 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.2 smtp.subspace.kernel.org 81FD360A2604 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=google.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=flex--coltonlewis.bounces.google.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=google.com header.i=@google.com header.a=rsa-sha256 header.s=20260707 header.b=XD85l2+I Received: by mail-ot1-f72.google.com with SMTP id 46e09a7af769-84c4dce8182so270379a34.2 for ; Thu, 03 Dec 2026 11:13:02 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20260707; t=1796325181; x=1796929981; darn=vger.kernel.org; h=content-type:cc:to:from:subject:message-id:references:mime-version :in-reply-to:date:from:to:cc:subject:date:message-id:reply-to :content-type; bh=i2EQog5sPZ6g9oNWZvlHBsTV6LY5BF0gV3A/lAVIiMo=; b=XD85l2+IuevETWJaBS/cQ912KhT2GjDyWehMb0nglPH49FC2Y0DXMwaKtmLLanqP/c qp/A/7BJyIlUTwCiPrVEP1+nw3QUgezvchbaGK5tIjlUrVmQunS/oEQVC1zaGs4DVips T1nBZtZv6kGHWEeofbC1Q2mPZca8Y1jmN/r33HtIgiy/n9+qMI1EZx64gVO8vMdpnhUs Iy57JQP7ErrzH4cXy/FVCmLIu58UMV2lFp+WHpKZdSZqOX9zo8q0TZZSXAzq2kGZ+ovf 4XvgRUssIJSAnSrEcHLr0xC4z1xCf87jdQqxxGa/5noP6NfDJz5saLI5K5/C1mPQNG2r QMXQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20260707; t=1796325181; x=1796929981; h=content-type:cc:to:from:subject:message-id:references:mime-version :in-reply-to:date:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to:content-type; bh=i2EQog5sPZ6g9oNWZvlHBsTV6LY5BF0gV3A/lAVIiMo=; b=V1kEco0+oB1rQWf6HInhnRC5aiaHj52qjbKRpC27VXRw9sE8mJwXUmJAcJC9H1fooM c/xe+3pRnGETKVkcmk9Wrq/SDEQT+EF8wu7j+a0mtSzT3phGoCriGX5B5e5+yyI4HJgT dtV3a7/+nAJwMmszmgPduMRHPQ99E07nJw/NK6WldmCsF5VaITfSoJAZwj5ajLI717EN xzREWSzPtTzBU9Qlgr0x4XdMxpwkJmkJjpIebUf8eXJjNgqoBofaQYo8Ah6pgtluxoNG p4t+fWAtRtk65oayJ+mdXkmfOQ8nthZfXsn/w+p//t7UYSaDvrUE4aApQNK4jSCPgDo8 jIHg== X-Forwarded-Encrypted: i=1; AL+hErFEy2NMrONPgHaTwp+0jram9fYRdK9TjEIH6w/gezAnIfyJr/rFPBFuF5DuPUR3/7PmV+Rl9j0v3t1Woak=@vger.kernel.org X-Gm-Message-State: APuU4Z8ZLT2VJE49SdIAGBjd9hkiEdKdB56A7kTWWyrgrdtEPAjqMGxh sEl+wRTKJiDGNO5argqaTwaZpevmahU5j7Gqqjen/5yKUVRdM5EWDSp0CektwDFm6G/SFW//Dxa ZC9WZ6gtpRifPhuJmBxmomV6IFw== X-Received: from ilbdx21-n2.prod.google.com ([2002:a05:6e02:4215:20b0:53a:fdcd:cad6]) (user=coltonlewis job=prod-delivery.src-stubby-dispatcher) by 2002:a05:6820:250c:b0:6cd:3fdc:5ff9 with SMTP id 006d021491bc7-71b395c5a83mr31735502eaf.74.1796325181179; Thu, 03 Dec 2026 11:13:01 -0800 (PST) Date: Thu, 3 Dec 2026 19:13:00 +0000 In-Reply-To: X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Post: List-Help: List-Subscribe: List-Unsubscribe: List-Owner: Precedence: list Mime-Version: 1.0 References: <20261119185215.632334-1-coltonlewis@google.com> <20261119185215.632334-16-coltonlewis@google.com> X-Mailer: git-send-email 2.56.1.915.g69d5ec7298-goog Message-ID: <20261203191300.2262975-1-coltonlewis@google.com> Subject: Re: [PATCH v10 15/33] KVM: arm64: Construct mdcr_el2 in a local variable in kvm_arm_setup_mdcr_el2() From: Colton Lewis To: Oliver Upton Cc: Colton Lewis , Marc Zyngier , Catalin Marinas , Will Deacon , Mark Rutland , Peter Zijlstra , Ingo Molnar , Paolo Bonzini , Russell King , Jonathan Corbet , Fuad Tabba , Joey Gouly , Suzuki K Poulose , Zenghui Yu , Shuah Khan , James Clark , Alexandru Elisei , Mingwei Zhang , Ganapatrao Kulkarni , kvmarm@lists.linux.dev, linux-arm-kernel@lists.infradead.org, kvm@vger.kernel.org, linux-perf-users@vger.kernel.org, linux-kselftest@vger.kernel.org, linux-doc@vger.kernel.org, linux-kernel@vger.kernel.org Content-Type: text/plain; charset="UTF-8" Oliver Upton writes: > On Thu, Nov 19, 2026 at 06:51:57PM +0000, Colton Lewis wrote: >> Construct the new MDCR_EL2 value in a local variable before writing it >> once to vcpu->arch.mdcr_el2. This avoids exposing intermediate states in >> vcpu->arch.mdcr_el2 to interrupt or NMI handlers that may inspect it, >> and simplifies upcoming Partitioned PMU modifications to MDCR_EL2. > > Is this actually necessary? The number of PMCs is fixed for the lifetime > of the VM. It's not necessary. Sashiko suggested it initially but it's not needed since patch 16 changed to local_daif_save() anyway.