Received: by 2002:a89:288:0:b0:1f7:eeee:6653 with SMTP id j8csp2189lqh; Mon, 6 May 2024 09:25:20 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCVP0M4nN+7tExx1Mk5PTmZtGRVA/HAfHoupMMDoPAwmWqsR5Ra4Yu6KUVOhULtMGIB7rPxa3OlVb3miuRAFLL5xz0+J7vXlOKUfrA/pMQ== X-Google-Smtp-Source: AGHT+IG9Ofchx9rtTBrel4fbauxyCeTGzocPQ/vESVsehX73euwfja4d9CuoIGZr4j/xlvi65ke2 X-Received: by 2002:a50:ab4f:0:b0:56f:e585:2388 with SMTP id t15-20020a50ab4f000000b0056fe5852388mr6824548edc.36.1715012720412; Mon, 06 May 2024 09:25:20 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1715012720; cv=pass; d=google.com; s=arc-20160816; b=VGGd0t98BThJZ+7TTb8CFALGKFzYqE/ZOHJTVbDr5t67/eV0V2go5JzgwpttlMqZAP XKdZ12xe0Brg0OP0i3Go7Z2xhnSE63QU1CYYO3cl2c3Eu/+7upO+zw3A8Fe+j9Ugfvn3 5Fbr6Fz3yTgjcSIQ1gwMZjU0oeTJBYurUeYue+450Qnsg1PizMCRMZX9Vxzv94W+meMn 8yuf/TC35lGFf6S2u/5TPqNXOe7ow1iLCDEaEpXmuVRcSkfwcvapA5bcmQe9jP+mv/ts IcZg2W5le/R/5i3IAa4eTb7lvaT8LK+AJWXgut6Pfcz3M8HBpEy16+HyRFhIqaiSEaMN oqQQ== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:list-unsubscribe:list-subscribe :list-id:precedence:dkim-signature; bh=v0dZxDAccYcCY4EmOhr7flN+YOjsFHzjNLPRNOnfYa0=; fh=z4HglFkUpT4SWR0Bo/T4ZwXZq5jPqHIIdGJ5goxuZyw=; b=lv5v0793kc1SyWpgMckUMorYU5Ob6AigYa0UBsBPN1N+34bpK3HJZg9TbeZQJA7Xqx qMMREEfIN+ZJZ+lEhUXBKqNY2ZhqUprtZm7ZjSXcUBbgCAP6jZSGqVIB03lgPrHG8iNe rfJ2/pGEpG+b1rN5OR3o3LFy0ZGi39kQZ29DDx1iGc6ssw/6xDvTRaC8XktlX4HFtztM c2AQk9c7JS5t+ykLI/XbjfoXjMmwvcy1xnz/fCetjE2C0SbJ6bkG2umjIv6AP+cMiIGS B+XaD0kRykRn+mEoOf0ksdKQUvSSOq2UhToOIA0KCLoOF6/3maXW1z4t/bd0nYCjW4p6 KRLQ==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@google.com header.s=20230601 header.b=qViKs9Wd; arc=pass (i=1 spf=pass spfdomain=google.com dkim=pass dkdomain=google.com dmarc=pass fromdomain=google.com); spf=pass (google.com: domain of linux-kernel+bounces-170163-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-kernel+bounces-170163-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.com Return-Path: Received: from am.mirrors.kernel.org (am.mirrors.kernel.org. [147.75.80.249]) by mx.google.com with ESMTPS id n10-20020a05640206ca00b00572afc71183si4461123edy.433.2024.05.06.09.25.20 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 06 May 2024 09:25:20 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-170163-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) client-ip=147.75.80.249; Authentication-Results: mx.google.com; dkim=pass header.i=@google.com header.s=20230601 header.b=qViKs9Wd; arc=pass (i=1 spf=pass spfdomain=google.com dkim=pass dkdomain=google.com dmarc=pass fromdomain=google.com); spf=pass (google.com: domain of linux-kernel+bounces-170163-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-kernel+bounces-170163-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.com Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by am.mirrors.kernel.org (Postfix) with ESMTPS id F1FE71F2369C for ; Mon, 6 May 2024 16:25:19 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id DE9E715665E; Mon, 6 May 2024 16:24:23 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=google.com header.i=@google.com header.b="qViKs9Wd" Received: from mail-ed1-f47.google.com (mail-ed1-f47.google.com [209.85.208.47]) (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 7D890156232 for ; Mon, 6 May 2024 16:24:21 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.208.47 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1715012663; cv=none; b=ray/YV5zox5bA1DIEF6aYEI+sLtZrPUFGsb9Uoxc0uPVEWEGoYTjgUzarpcxQZ81ooYEQ/TnsObS4oYK8J9n0bBZNWEBSLQ9U89OohS+0RcGNEtrLjSYM2eYzy8zJ9oAWTooT+aGuFNGlgnhbdwMJdJrSvUSRwsqeP32GtiRJ74= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1715012663; c=relaxed/simple; bh=1umspOg6P+YBt+kF0yVj2x9Zp4XiH8wmBDIrxcQqV7g=; h=MIME-Version:References:In-Reply-To:From:Date:Message-ID:Subject: To:Cc:Content-Type; b=MkR+DlV43UxTH7W14mon43IS0Jl3UivMYPkRvv41bQO1yJnQtTlUM5PTjbY9Di4yb45iaoSv0naAXGExxOwbWiPmH79XvqrhzIx9qGHYGyDqefJV/vIaDqK8vtVb8YS+ahfR/Nf4++n0SON2l9PY6qvSDifImtGWA4jVAFsZSsM= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=google.com; spf=pass smtp.mailfrom=google.com; dkim=pass (2048-bit key) header.d=google.com header.i=@google.com header.b=qViKs9Wd; arc=none smtp.client-ip=209.85.208.47 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=google.com Received: by mail-ed1-f47.google.com with SMTP id 4fb4d7f45d1cf-572f6c56cdaso11863a12.0 for ; Mon, 06 May 2024 09:24:21 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20230601; t=1715012660; x=1715617460; darn=vger.kernel.org; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:from:to:cc:subject:date :message-id:reply-to; bh=v0dZxDAccYcCY4EmOhr7flN+YOjsFHzjNLPRNOnfYa0=; b=qViKs9Wd+c7g78kKgq8EMMvh7MvtZ4OmxCKyh2SRwzBLBVTlF/7O8ruQn+x3Wqtm12 I59mrENk1veQ95lmFFoPEFTTRmkiCuB22DTFWAdcijIf5wXsM2+5RttZpXsesjqeNyZh q5kU8j5gIAqH21CbwNrsvOUbq1u0h92GlzZiDMv3RfQrLMOyCfcbWxjAPaT/ahhZMvPj AWAnWfqBtT1r0HhzQzDhFTcAU/abk0Gg+49X5PsXRnyh7OrZTpL1s5E+LoiB6FBKWBtG C3WJec2At8RrKn8/OFZoDabKf12tyb/YjOKblzFgRhL3FM6lLsSTP+D2XsJpNWniJP4n JXwg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1715012660; x=1715617460; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=v0dZxDAccYcCY4EmOhr7flN+YOjsFHzjNLPRNOnfYa0=; b=jVqniPVVi93zBUIPY5K/RzC7DqKJnDDjpWgxi3pAFj04anBGUz0HgCJiFL/sxUwMWt MdQj2i7I6m7+XgHhApg2c99XTYNaYadLaspmlm0myoSj860Big6/qmw9vCOj8F96LuoO HGmnD8y+wyuWZJw9NHrMiKmxATDdGQEn+YVQj8fP8ydrEsyv9LZ14ViwyPWQlcECEx9v XoA0Tvn4zGkEanvn/+Zpxip3IEQ3IBIqPmACjaLlZ97WAk/6T1FSRv+6QLCUek+wyoXs MCqOIDeEkAEd29nvMUmbQmsJ82qrLT5Y6VXX6g0f2cPz+bPStBB+43QASbENJ+leDS8N TK2A== X-Forwarded-Encrypted: i=1; AJvYcCU3p6uZx8x8Wse67+C3Qgv+w8y/OJrkbLIZ4S4UltPJjldm2s+B5IYB+pPmmgyoJvOkJEc9Dl2BCOMKMJPCO4LgvTGb7HOw1R1g2mhQ X-Gm-Message-State: AOJu0YyinnP7R2fdr5O+6DNnVIrFIXB7y+2STsaoR5IMR+vlkZq3dWyN WUjdDlKoSOPP8P4Ih6paxCN3Hefc7TplvE4TvzPPy0Vkhe1PWGXdTEadV17DpYvRELeit7ydpzr Svvd1GO3mGbW6lQcc3DpJBqVxUugYwnm8EOpr X-Received: by 2002:aa7:d44f:0:b0:572:e6fb:ab07 with SMTP id 4fb4d7f45d1cf-572e6fbac14mr225538a12.7.1715012653454; Mon, 06 May 2024 09:24:13 -0700 (PDT) Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 References: <20240429060643.211-1-ravi.bangoria@amd.com> <20240429060643.211-3-ravi.bangoria@amd.com> In-Reply-To: <20240429060643.211-3-ravi.bangoria@amd.com> From: Jim Mattson Date: Mon, 6 May 2024 09:24:00 -0700 Message-ID: Subject: Re: [PATCH 2/3] x86/bus_lock: Add support for AMD To: Ravi Bangoria Cc: tglx@linutronix.de, mingo@redhat.com, bp@alien8.de, dave.hansen@linux.intel.com, seanjc@google.com, pbonzini@redhat.com, thomas.lendacky@amd.com, hpa@zytor.com, rmk+kernel@armlinux.org.uk, peterz@infradead.org, james.morse@arm.com, lukas.bulwahn@gmail.com, arjan@linux.intel.com, j.granados@samsung.com, sibs@chinatelecom.cn, nik.borisov@suse.com, michael.roth@amd.com, nikunj.dadhania@amd.com, babu.moger@amd.com, x86@kernel.org, kvm@vger.kernel.org, linux-kernel@vger.kernel.org, santosh.shukla@amd.com, ananth.narayan@amd.com, sandipan.das@amd.com Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable On Sun, Apr 28, 2024 at 11:08=E2=80=AFPM Ravi Bangoria wrote: > > Upcoming AMD uarch will support Bus Lock Detect (called Bus Lock Trap > in AMD docs). Add support for the same in Linux. Bus Lock Detect is > enumerated with cpuid CPUID Fn0000_0007_ECX_x0 bit [24 / BUSLOCKTRAP]. > It can be enabled through MSR_IA32_DEBUGCTLMSR. When enabled, hardware > clears DR6[11] and raises a #DB exception on occurrence of Bus Lock if > CPL > 0. More detail about the feature can be found in AMD APM[1]. > > [1]: AMD64 Architecture Programmer's Manual Pub. 40332, Rev. 4.07 - June > 2023, Vol 2, 13.1.3.6 Bus Lock Trap > https://bugzilla.kernel.org/attachment.cgi?id=3D304653 Is there any chance of getting something similar to Intel's "VMM bus-lock detection," which causes a trap-style VM-exit on a bus lock event?