Received: by 2002:a89:d88:0:b0:1fa:5c73:8e2d with SMTP id eb8csp65845lqb; Thu, 23 May 2024 10:53:52 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCU7hFvhw3dv66Ukbf7NVMLedsf2V9OYG2fDUnk0IvrVyzLTvnfveOaD9/OfZse4tSWyLc79PGw2SqmvaevT2e4yUcuZkg7T7ifZWeu9iA== X-Google-Smtp-Source: AGHT+IGLB5gTv4oUzu7ph9cu6CfUhCfTuPrAVMWB6lvKmJ+JBf/hKWXooQjG7DgFD/GrOZ9hH58u X-Received: by 2002:a05:6a00:98b:b0:6f4:179a:fa5 with SMTP id d2e1a72fcca58-6f6d61b7db6mr6991689b3a.31.1716486832146; Thu, 23 May 2024 10:53:52 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1716486832; cv=pass; d=google.com; s=arc-20160816; b=f1MsJYDgv4E+PP5aMz/x1QmpYF7yGHRi07FQOfpS4Z8KE3O9y4q3ez+m+tMg5Zjsyi UYTTpPypApH2EvB3ip6MPH2UZQq/XwWFSIc6w6fqxuzdrj4lJP6+gOtjrcqdN9opS9mR NLRTabX8ZlRpx8zE95SHU8HrI0pyotplgCbTz7cdg9iPtobmwEgsw7QOaYsWuD6E3hgV /+CCRhUMX9Dyc7y7QHC/n6Y4qtIX1b4iL0tAjSOF0+1TiKWe7blwLL1A2hDKBSBX2XHM rYXxsdocQ1Edwvlr0gNz4sExdmUjsh3Zkr21HA+HcGZUeoLdqQwl6T9gDhO+VF6SUAf7 Fd+g== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:in-reply-to:autocrypt:from :content-language:references:cc:to:subject:user-agent:mime-version :list-unsubscribe:list-subscribe:list-id:precedence:date:message-id :dkim-signature; bh=1vlJyEbwuX0ZoN749JOIjA4u6/xlKVfxbDsvgdeX7zI=; fh=BjkGM9B74MY0tS4qx7DaaSDdJRVpqtyvYeN3Qi30i8U=; b=CzjNhUAfjstaE5VaUpX8yAvX90vQkZfaUrXKyfQqeknoHeVIwtcaNirAzHWT4l9LAj wg7iDeaM00x44lSALfHjGXwNX/fjCT/JLpb13g4xEbf9qsKATUC484YopvNZjbUZXKqc uBqJ0Q8ONpMKo/k3vB0vZceKEfxZTKpIl/1UFqYJCe2Wqw519Rn3pz8gO4xfH9SwqldQ gFMOt9iPzVeTOhueJg5PpBo8SaNIUaMAbWuK9Se7Kx/6yF/MeLxyAEeAoUNqUC1F443N KLuP9tuPb8pPQajhTYieZvqP9lGVMWHEqaDjvHWv7TD7vu8lL+mr4bhjeyYN3u0DtfbK 4wcw==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@citrix.com header.s=google header.b=GFokNs26; arc=pass (i=1 spf=pass spfdomain=cloud.com dkim=pass dkdomain=citrix.com dmarc=pass fromdomain=citrix.com); spf=pass (google.com: domain of linux-kernel+bounces-187849-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-187849-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=citrix.com Return-Path: Received: from sv.mirrors.kernel.org (sv.mirrors.kernel.org. [2604:1380:45e3:2400::1]) by mx.google.com with ESMTPS id 41be03b00d2f7-63413d72ec7si5274902a12.836.2024.05.23.10.53.51 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 23 May 2024 10:53:52 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-187849-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) client-ip=2604:1380:45e3:2400::1; Authentication-Results: mx.google.com; dkim=pass header.i=@citrix.com header.s=google header.b=GFokNs26; arc=pass (i=1 spf=pass spfdomain=cloud.com dkim=pass dkdomain=citrix.com dmarc=pass fromdomain=citrix.com); spf=pass (google.com: domain of linux-kernel+bounces-187849-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-187849-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=citrix.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 sv.mirrors.kernel.org (Postfix) with ESMTPS id 70035283929 for ; Thu, 23 May 2024 17:53:51 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 56A7180603; Thu, 23 May 2024 17:53:42 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=citrix.com header.i=@citrix.com header.b="GFokNs26" Received: from mail-qk1-f170.google.com (mail-qk1-f170.google.com [209.85.222.170]) (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 C034E2746F for ; Thu, 23 May 2024 17:53:39 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.222.170 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1716486821; cv=none; b=RJqGuY1NIyRmFhCBexnqKqB1zD6ePaabcMs52qFX2GFbBCO6HumrEmKfefx/MdR0HFOP0XsQOmwpKwht8r7C+HDLZZauxuZrMV3ubjymWAtgCLbP1oBtjrPZORz5v/u4kqPZJMxjg6RO2IIFqvpacqOvToUWFHLeW20rCX3XCic= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1716486821; c=relaxed/simple; bh=1vlJyEbwuX0ZoN749JOIjA4u6/xlKVfxbDsvgdeX7zI=; h=Message-ID:Date:MIME-Version:Subject:To:Cc:References:From: In-Reply-To:Content-Type; b=TeVeaEZr0foPkEEVVrl4DQyxLPcd1R9vWtegnXiUAvJsyd4wdwFa7BwRJNWUFxzmDpEWL4Vho7wRyHjxuLptpWb5AUSFVXmaKcw1gd1Boehv64eyQECgjPDitw+40Fv39gKRoiXfKSX1qlFmmtd7hgcUI0E0U0phrs7jPD6vzeQ= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=citrix.com; spf=pass smtp.mailfrom=cloud.com; dkim=pass (1024-bit key) header.d=citrix.com header.i=@citrix.com header.b=GFokNs26; arc=none smtp.client-ip=209.85.222.170 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=citrix.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=cloud.com Received: by mail-qk1-f170.google.com with SMTP id af79cd13be357-792d65cd7a8so328121785a.1 for ; Thu, 23 May 2024 10:53:39 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=citrix.com; s=google; t=1716486819; x=1717091619; darn=vger.kernel.org; h=content-transfer-encoding:in-reply-to:autocrypt:from :content-language:references:cc:to:subject:user-agent:mime-version :date:message-id:from:to:cc:subject:date:message-id:reply-to; bh=1vlJyEbwuX0ZoN749JOIjA4u6/xlKVfxbDsvgdeX7zI=; b=GFokNs2639blQKjNSCx44Qm73y5ZcwUf2/YV/8LmDzfVxmDxE98ehiRerYGcEYRSgV vwiSD3+fvCwF25ibN74KRFZbXpAbPAkoOD83IFhXKriDQS+OKjfStj2xwsLMl4wYKfxc F0k0YBn5V3+KDEDxm8shoIHJtcT4fa1IXDx/0= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1716486819; x=1717091619; h=content-transfer-encoding:in-reply-to:autocrypt:from :content-language:references:cc:to:subject:user-agent:mime-version :date:message-id:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to; bh=1vlJyEbwuX0ZoN749JOIjA4u6/xlKVfxbDsvgdeX7zI=; b=gNwDMscyUU2xXN2Dai0oes+OPmaSxhPx/+8iuQrqlmqIkNC7MthlvEKTZbafAnuVIs 4snrLZAhNXhI9Bs27ZhI8j1mD34K06TJlXOEhK6zPqB4qG9zHUZlSOVoKB6LvOKLEIVu u39JcMH0Uz7wZVNA9VknmT+uv3Qvc6IZHatzQfSL24O19fNZ/4t+/GgGl7+OnOf9tAME AE5poSp9rbS9ejUa7OLrtr2+TbT2ug8sViZFdOrqJksL9fF9BG68bg6Di899jMM0gNmo IvsrWmwG3hUmIpugJn26BfzmJ671WyVAADgiirCRMO9Hoyko2iZpvv+JrdcegSRNQGfJ KpwQ== X-Gm-Message-State: AOJu0YxME+dvblEr88B/agReFrTngftpvcA0NJbgJ6Ettyi/i6xSkv27 QLJayvKZCVoKrmC2EHE3dX9PsCPfljK0iAOUQ2+STAwgEaBJqVj+Yd2cbvIIQCQ= X-Received: by 2002:ae9:e009:0:b0:792:bb55:906d with SMTP id af79cd13be357-79499455581mr571133085a.39.1716486818588; Thu, 23 May 2024 10:53:38 -0700 (PDT) Received: from [10.125.231.30] ([217.156.233.157]) by smtp.gmail.com with ESMTPSA id af79cd13be357-792bf2a11e8sm1497940085a.58.2024.05.23.10.53.35 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Thu, 23 May 2024 10:53:37 -0700 (PDT) Message-ID: <0fcbfcba-9fe2-414c-8424-347364fcbf35@citrix.com> Date: Thu, 23 May 2024 18:53:34 +0100 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH] x86/bhi: BHI mitigation can trigger warning in #DB handler To: Alexandre Chartre , Dave Hansen , x86@kernel.org, kvm@vger.kernel.org Cc: linux-kernel@vger.kernel.org, daniel.sneddon@linux.intel.com, pawan.kumar.gupta@linux.intel.com, tglx@linutronix.de, konrad.wilk@oracle.com, peterz@infradead.org, gregkh@linuxfoundation.org, seanjc@google.com, dave.hansen@linux.intel.com, nik.borisov@suse.com, kpsingh@kernel.org, longman@redhat.com, bp@alien8.de, pbonzini@redhat.com References: <20240523123322.3326690-1-alexandre.chartre@oracle.com> <1c69f62e-0dee-4caa-9cbe-f43d8efd597b@oracle.com> <93510641-9032-4612-9424-c048145e883e@intel.com> <5ed7d3c8-63c3-48f3-aaeb-a19514f4ef5e@oracle.com> Content-Language: en-GB From: Andrew Cooper Autocrypt: addr=andrew.cooper3@citrix.com; keydata= xsFNBFLhNn8BEADVhE+Hb8i0GV6mihnnr/uiQQdPF8kUoFzCOPXkf7jQ5sLYeJa0cQi6Penp VtiFYznTairnVsN5J+ujSTIb+OlMSJUWV4opS7WVNnxHbFTPYZVQ3erv7NKc2iVizCRZ2Kxn srM1oPXWRic8BIAdYOKOloF2300SL/bIpeD+x7h3w9B/qez7nOin5NzkxgFoaUeIal12pXSR Q354FKFoy6Vh96gc4VRqte3jw8mPuJQpfws+Pb+swvSf/i1q1+1I4jsRQQh2m6OTADHIqg2E ofTYAEh7R5HfPx0EXoEDMdRjOeKn8+vvkAwhviWXTHlG3R1QkbE5M/oywnZ83udJmi+lxjJ5 YhQ5IzomvJ16H0Bq+TLyVLO/VRksp1VR9HxCzItLNCS8PdpYYz5TC204ViycobYU65WMpzWe LFAGn8jSS25XIpqv0Y9k87dLbctKKA14Ifw2kq5OIVu2FuX+3i446JOa2vpCI9GcjCzi3oHV e00bzYiHMIl0FICrNJU0Kjho8pdo0m2uxkn6SYEpogAy9pnatUlO+erL4LqFUO7GXSdBRbw5 gNt25XTLdSFuZtMxkY3tq8MFss5QnjhehCVPEpE6y9ZjI4XB8ad1G4oBHVGK5LMsvg22PfMJ ISWFSHoF/B5+lHkCKWkFxZ0gZn33ju5n6/FOdEx4B8cMJt+cWwARAQABzSlBbmRyZXcgQ29v cGVyIDxhbmRyZXcuY29vcGVyM0BjaXRyaXguY29tPsLBegQTAQgAJAIbAwULCQgHAwUVCgk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UX2Rs 6+ahAA== In-Reply-To: <5ed7d3c8-63c3-48f3-aaeb-a19514f4ef5e@oracle.com> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit On 23/05/2024 6:03 pm, Alexandre Chartre wrote: > > On 5/23/24 17:36, Dave Hansen wrote: >> On 5/23/24 07:52, Alexandre Chartre wrote: >>>> Should we wrap up this gem and put it with the other entry selftests? >>> >>> It looks like tools/testing/selftests/x86/single_step_syscall.c tests >>> sysenter with TF set but it doesn't check if the kernel issues any >>> warning. >> >> Does it actually trip the warning though? I'm a bit surprised that >> nobody reported it if so. > > single_step_syscall does trigger the warning: > > $ ./single_step_syscall > [RUN]    Set TF and check nop > [OK]    Survived with TF set and 26 traps > [RUN]    Set TF and check syscall-less opportunistic sysret > [OK]    Survived with TF set and 30 traps > [RUN]    Set TF and check a fast syscall > [OK]    Survived with TF set and 40 traps > [RUN]    Fast syscall with TF cleared > [OK]    Nothing unexpected happened > [RUN]    Set TF and check SYSENTER >     Got SIGSEGV with RIP=ed7fe579, TF=256 > [RUN]    Fast syscall with TF cleared > [OK]    Nothing unexpected happened :-/ What about the exit code? I find the absence of a [FAIL] concerning... ~Andrew