From nobody Tue Dec 23 22:00:48 2025 Received: from galois.linutronix.de (Galois.linutronix.de [193.142.43.55]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 5B8C312CD8D; Tue, 30 Jan 2024 16:26:10 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=193.142.43.55 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1706631972; cv=none; b=LyCt/9Qbtp9qy9JvzXxWviHAoQYqlJkBCOOh7fMz/TEekpLzSJVlm7U+hrMA81rW7ux46jwwtabT3F8kaNX+taorTCqJjAhSSpW7jy7TYPr4kXkAlf2o6FlvpKw0cUBUdHui+caH6HmCc2vhubMc6NY112oSGYONpDQ5ZB1QWmw= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1706631972; c=relaxed/simple; bh=WADDM1H92wETD+9wiEl2YfbHXXl8A+FMqf1KJYev7uk=; h=Date:From:To:Subject:Cc:In-Reply-To:References:MIME-Version: Message-ID:Content-Type; b=stDHiC4DDngyy7IN/1UQaHwPs4wTkS5MkNJ6qGae/51Q/X3aracb4RIDu77u2HRxz58H4RilDxSPzcIX4bHp9Dpyi3VWvPFrbs3rp9sHD59Afxl1vv4NXR+WdjOCSUt70iNvOIRlm03NdIEhUH1C+CQx8Y9nrsEkjkzB3lqlqzg= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linutronix.de; spf=pass smtp.mailfrom=linutronix.de; dkim=pass (2048-bit key) header.d=linutronix.de header.i=@linutronix.de header.b=tOwHBaff; dkim=permerror (0-bit key) header.d=linutronix.de header.i=@linutronix.de header.b=ukcV1/gE; arc=none smtp.client-ip=193.142.43.55 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linutronix.de Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=linutronix.de Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=linutronix.de header.i=@linutronix.de header.b="tOwHBaff"; dkim=permerror (0-bit key) header.d=linutronix.de header.i=@linutronix.de header.b="ukcV1/gE" Date: Tue, 30 Jan 2024 16:26:08 -0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020; t=1706631969; h=from:from:sender:sender:reply-to:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=AGPmg3bM0K0ziuVF/bpOWtTuv50Na0x4WowzmqJ4PB8=; b=tOwHBaffiUlFO5kIuXr//hbLLmbnz6Ef+a2Fb8S8dzGgdB0SolG6VRtfR0GIM3XqHKZDKp b4rXn/YHKOpgarsgraTIIEK1Yny6ecpGzNAXQ0F30cfRGhK0tfrD5QokfkGHmpiJA7YesQ gtv6k6rNZf8CbRIpOw4a9uRzWJp9iDsJWvDtwar6CE5GqTPue+TiSuPng5N8GytcIPEvfp N4K+7qDRpkZnm39GKeGhjJ4AP4zylSpNA4ipNJ2fT+9MMP3mF9b5Tlb0eWbkvDwa3QLVwX KkuzrSBhV6nXneXAAijeHg1iFLyPUq9pQmK31LBEYiRQVWBESyNFmV5Q62sigQ== DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020e; t=1706631969; h=from:from:sender:sender:reply-to:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=AGPmg3bM0K0ziuVF/bpOWtTuv50Na0x4WowzmqJ4PB8=; b=ukcV1/gEqMWEBII8uTbHIDJibiA837km17WChHzxaxGd5hy8S4dMG8R9/44J2aaSGEgiUk wTbgUp0BTNqR8UDQ== From: "tip-bot2 for Brijesh Singh" Sender: tip-bot2@linutronix.de Reply-to: linux-kernel@vger.kernel.org To: linux-tip-commits@vger.kernel.org Subject: [tip: x86/sev] x86/traps: Define RMP violation #PF error code Cc: Brijesh Singh , Michael Roth , "Borislav Petkov (AMD)" , Dave Hansen , x86@kernel.org, linux-kernel@vger.kernel.org In-Reply-To: <20240126041126.1927228-9-michael.roth@amd.com> References: <20240126041126.1927228-9-michael.roth@amd.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Message-ID: <170663196817.398.3820994161857678840.tip-bot2@tip-bot2> Robot-ID: Robot-Unsubscribe: Contact to get blacklisted from these emails Precedence: bulk Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable The following commit has been merged into the x86/sev branch of tip: Commit-ID: 54055344b232c917a9e492a8bf5864fed99ad6b8 Gitweb: https://git.kernel.org/tip/54055344b232c917a9e492a8bf5864fed= 99ad6b8 Author: Brijesh Singh AuthorDate: Thu, 25 Jan 2024 22:11:08 -06:00 Committer: Borislav Petkov (AMD) CommitterDate: Mon, 29 Jan 2024 17:26:56 +01:00 x86/traps: Define RMP violation #PF error code Bit 31 in the page fault-error bit will be set when processor encounters an RMP violation. While at it, use the BIT() macro. Signed-off-by: Brijesh Singh Signed-off-by: Michael Roth Signed-off-by: Borislav Petkov (AMD) Acked-by: Dave Hansen Link: https://lore.kernel.org/r/20240126041126.1927228-9-michael.roth@amd.c= om --- arch/x86/include/asm/trap_pf.h | 20 ++++++++++++-------- arch/x86/mm/fault.c | 1 + 2 files changed, 13 insertions(+), 8 deletions(-) diff --git a/arch/x86/include/asm/trap_pf.h b/arch/x86/include/asm/trap_pf.h index afa5243..a23a7b7 100644 --- a/arch/x86/include/asm/trap_pf.h +++ b/arch/x86/include/asm/trap_pf.h @@ -2,6 +2,8 @@ #ifndef _ASM_X86_TRAP_PF_H #define _ASM_X86_TRAP_PF_H =20 +#include + /* * Page fault error code bits: * @@ -13,16 +15,18 @@ * bit 5 =3D=3D 1: protection keys block access * bit 6 =3D=3D 1: shadow stack access fault * bit 15 =3D=3D 1: SGX MMU page-fault + * bit 31 =3D=3D 1: fault was due to RMP violation */ enum x86_pf_error_code { - X86_PF_PROT =3D 1 << 0, - X86_PF_WRITE =3D 1 << 1, - X86_PF_USER =3D 1 << 2, - X86_PF_RSVD =3D 1 << 3, - X86_PF_INSTR =3D 1 << 4, - X86_PF_PK =3D 1 << 5, - X86_PF_SHSTK =3D 1 << 6, - X86_PF_SGX =3D 1 << 15, + X86_PF_PROT =3D BIT(0), + X86_PF_WRITE =3D BIT(1), + X86_PF_USER =3D BIT(2), + X86_PF_RSVD =3D BIT(3), + X86_PF_INSTR =3D BIT(4), + X86_PF_PK =3D BIT(5), + X86_PF_SHSTK =3D BIT(6), + X86_PF_SGX =3D BIT(15), + X86_PF_RMP =3D BIT(31), }; =20 #endif /* _ASM_X86_TRAP_PF_H */ diff --git a/arch/x86/mm/fault.c b/arch/x86/mm/fault.c index 679b09c..8805e2e 100644 --- a/arch/x86/mm/fault.c +++ b/arch/x86/mm/fault.c @@ -547,6 +547,7 @@ show_fault_oops(struct pt_regs *regs, unsigned long err= or_code, unsigned long ad !(error_code & X86_PF_PROT) ? "not-present page" : (error_code & X86_PF_RSVD) ? "reserved bit violation" : (error_code & X86_PF_PK) ? "protection keys violation" : + (error_code & X86_PF_RMP) ? "RMP violation" : "permissions violation"); =20 if (!(error_code & X86_PF_USER) && user_mode(regs)) {