From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 909BDC433F5 for ; Tue, 2 Nov 2021 20:02:01 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 7301761058 for ; Tue, 2 Nov 2021 20:02:01 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230444AbhKBUEf (ORCPT ); Tue, 2 Nov 2021 16:04:35 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:35072 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230060AbhKBUEe (ORCPT ); Tue, 2 Nov 2021 16:04:34 -0400 Received: from mail-lj1-x22d.google.com (mail-lj1-x22d.google.com [IPv6:2a00:1450:4864:20::22d]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 7F210C061203 for ; Tue, 2 Nov 2021 13:01:59 -0700 (PDT) Received: by mail-lj1-x22d.google.com with SMTP id g3so103394ljm.8 for ; Tue, 02 Nov 2021 13:01:59 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20210112; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=BDslnEzmaYl8XemO8H14C3E5c69KKbu6q3LyWC8hs6c=; b=Y27DdbKfhZ9/em7rMZL3gynod2fwnh07kZ/RrJMtHRxIkaacuz/t1gWiIlisWzp66P 0vy3sU9WnqbGhx5odG2aKcwRyOfePyWlTLndkiWKaDlR2hoamDr2VC6rHkxfOtWpuP+Z ziv8The/TmmcLSQp4curc6nXf41+Kb5ZcCP4bOpkUWs8/1LWyxEvLyTfIx8L7cKL7xWh 95rhU0KD2PlzngyxJiEn+D1lI+/dUUk91seFcdbdceB/C+WrwBIvN2lncT+KH+Ur9yqe rI1OKChd+w93QeyfYRhCaM+RJyUnXCkYukVxTqjjHT/WxI8HhfI7xw38Z7Mw4UX/+a9v 0vQw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=BDslnEzmaYl8XemO8H14C3E5c69KKbu6q3LyWC8hs6c=; b=1VC4NwgG1SV/zHmBHGyCli32DC0EY/wq6aRhaz1zDPMPlI0cbJxOnthuw9pxnLHkk5 lY+lpENLEHGIP8Yw++yUOoJObDEFOt62TNXgAtVCdCh5O/FCQFbj+CHy+De4/+MDtUqU rPJrYnXST/SB7VucL/74IRsf5cM1JdHF9kVfHhsfE1CDXzVXtXtHCNN54wDGkck4IyH8 ENu6LshW/TcCiwAA1RsgcPAGbcUfhMg6H7huM+fuNQQhE4Qt9LpCIGjiE7mnI3rYS68P 4MINxu6GucW/SChW9LK8gFv1nrQVcw0zubEp4VGwG4nX65Z1xxiX1Sy9Xp/nCcmm30W6 3RQA== X-Gm-Message-State: AOAM532Eaiw+ZHrsUoRUrTITViZyOIytzyXz0UaMg2HYWL4XxFH2Ck5b p4qlUgdR5xGzBUSxmZKHbDT/8wxUmc2sVYF5sgEjyA== X-Google-Smtp-Source: ABdhPJxwGH/Xjrm74EIMk3UQCQLZsG2pEJnnfrQ2FDpM1CoFNZIbHEdfny5vZ0lVDpSfXmbDZCATT/vApVIzPh/Vpzo= X-Received: by 2002:a05:651c:1051:: with SMTP id x17mr38505200ljm.337.1635883317514; Tue, 02 Nov 2021 13:01:57 -0700 (PDT) MIME-Version: 1.0 References: <20211102094651.2071532-1-oupton@google.com> <20211102094651.2071532-7-oupton@google.com> <875ytaak5q.wl-maz@kernel.org> In-Reply-To: From: Oliver Upton Date: Tue, 2 Nov 2021 13:01:46 -0700 Message-ID: Subject: Re: [PATCH v2 6/6] selftests: KVM: Test OS lock behavior To: Marc Zyngier Cc: kvmarm@lists.cs.columbia.edu, kvm@vger.kernel.org, James Morse , Alexandru Elisei , Suzuki K Poulose , linux-arm-kernel@lists.infradead.org, Andrew Jones , Peter Shier , Ricardo Koller , Reiji Watanabe Content-Type: text/plain; charset="UTF-8" Precedence: bulk List-ID: X-Mailing-List: kvm@vger.kernel.org On Tue, Nov 2, 2021 at 7:53 AM Oliver Upton wrote: > > > > I haven't had a change to properly review the series, but this one > > definitely caught my eye. My expectations are that BRK is *not* > > affected by the OS Lock. The ARMv8 ARM goes as far as saying: > > > > > > Breakpoint Instruction exceptions are enabled regardless of the state > > of the OS Lock and the OS Double Lock. > > > > > > as well as: > > > > > > There is no enable control for Breakpoint Instruction exceptions. They > > are always enabled, and cannot be masked. > > > > /facepalm I had thought I read "Breakpoint Instruction exceptions" in > the list on D2.5 "The effect of powerdown on debug exceptions", > although on second read I most definitely did not. And if I had read > the bottom of the section, I'd of seen one of the quotes. > > > I wonder how your test succeeds, though. > > Probably because the expectations I wrote match the non-architected > behavior I implemented :-) Alright, gave the series a good once over after this and fixed up quite a few things. Unless you're ready for it, I'll hold back for a bit to avoid spamming inboxes. As an FYI, here's the fixes I have queued up: v2 -> v3: - Stop trapping debug exceptions when the OS Lock is enabled, as it does *not* block software breakpoint exceptions (Marc) - Trap accesses to debug registers if the OS Lock is enabled to prevent the guest from wiping out KVM's configuration of MDSCR_EL1 - Update the debug-exceptions test to expect a software breakpoint exception even when the OS Lock is enabled. -- Thanks, Oliver From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id D607FC433EF for ; Tue, 2 Nov 2021 20:02:03 +0000 (UTC) Received: from mm01.cs.columbia.edu (mm01.cs.columbia.edu [128.59.11.253]) by mail.kernel.org (Postfix) with ESMTP id 536CB60F70 for ; Tue, 2 Nov 2021 20:02:03 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.1 mail.kernel.org 536CB60F70 Authentication-Results: mail.kernel.org; dmarc=fail (p=reject dis=none) header.from=google.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=lists.cs.columbia.edu Received: from localhost (localhost [127.0.0.1]) by mm01.cs.columbia.edu (Postfix) with ESMTP id BD86E4B091; Tue, 2 Nov 2021 16:02:02 -0400 (EDT) X-Virus-Scanned: at lists.cs.columbia.edu Authentication-Results: mm01.cs.columbia.edu (amavisd-new); dkim=softfail (fail, message has been altered) header.i=@google.com Received: from mm01.cs.columbia.edu ([127.0.0.1]) by localhost (mm01.cs.columbia.edu [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id r7toSwVzNdMd; Tue, 2 Nov 2021 16:02:01 -0400 (EDT) Received: from mm01.cs.columbia.edu (localhost [127.0.0.1]) by mm01.cs.columbia.edu (Postfix) with ESMTP id ADE514B106; Tue, 2 Nov 2021 16:02:01 -0400 (EDT) Received: from localhost (localhost [127.0.0.1]) by mm01.cs.columbia.edu (Postfix) with ESMTP id 6289F4B091 for ; Tue, 2 Nov 2021 16:02:00 -0400 (EDT) X-Virus-Scanned: at lists.cs.columbia.edu Received: from mm01.cs.columbia.edu ([127.0.0.1]) by localhost (mm01.cs.columbia.edu [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id khGYJI-vgK6d for ; Tue, 2 Nov 2021 16:01:59 -0400 (EDT) Received: from mail-lj1-f181.google.com (mail-lj1-f181.google.com [209.85.208.181]) by mm01.cs.columbia.edu (Postfix) with ESMTPS id 27C214A19F for ; Tue, 2 Nov 2021 16:01:59 -0400 (EDT) Received: by mail-lj1-f181.google.com with SMTP id d23so90334ljj.10 for ; Tue, 02 Nov 2021 13:01:59 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20210112; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=BDslnEzmaYl8XemO8H14C3E5c69KKbu6q3LyWC8hs6c=; b=Y27DdbKfhZ9/em7rMZL3gynod2fwnh07kZ/RrJMtHRxIkaacuz/t1gWiIlisWzp66P 0vy3sU9WnqbGhx5odG2aKcwRyOfePyWlTLndkiWKaDlR2hoamDr2VC6rHkxfOtWpuP+Z ziv8The/TmmcLSQp4curc6nXf41+Kb5ZcCP4bOpkUWs8/1LWyxEvLyTfIx8L7cKL7xWh 95rhU0KD2PlzngyxJiEn+D1lI+/dUUk91seFcdbdceB/C+WrwBIvN2lncT+KH+Ur9yqe rI1OKChd+w93QeyfYRhCaM+RJyUnXCkYukVxTqjjHT/WxI8HhfI7xw38Z7Mw4UX/+a9v 0vQw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=BDslnEzmaYl8XemO8H14C3E5c69KKbu6q3LyWC8hs6c=; b=XKQmRjzWU6q3T9+cmNveokOBXu8wfRqk7K2nNgSDupouSAg0A878UHGLmNAYeGTi9X 7cZw9Ul980vxv6NkjquN7n7Yn9O3vglPLv0KaCtI3NbdakMPJKWf3QrmQvnadBlmpBLI heWT78mLPLaG3xFomw7nu6jjjt+VoZKy3YcwGW8Z5o1jWvNrtBTiF7BIvAm/K45tUPmO fHYcG3yIDpi9SIMoBiJLKLNFmRhiApjMzGQusj1YFGnDXZ/AlfmQrQ3t1gE6QnUklfm+ B3guUF46AfLpP+Cj20qJY/KzJvsPRGqPX5f8BQeSTRA7vOm8EEadeIbKWxUn29n5+TBE il0A== X-Gm-Message-State: AOAM531xGN8P54s9marsLhMaAlsnWVHu6T+FIEs9sPtU1SXajZsvMLJf ug9feeuSAeoAiaslsIthjGmlw2BFaMtpYWO+aEOFNA== X-Google-Smtp-Source: ABdhPJxwGH/Xjrm74EIMk3UQCQLZsG2pEJnnfrQ2FDpM1CoFNZIbHEdfny5vZ0lVDpSfXmbDZCATT/vApVIzPh/Vpzo= X-Received: by 2002:a05:651c:1051:: with SMTP id x17mr38505200ljm.337.1635883317514; Tue, 02 Nov 2021 13:01:57 -0700 (PDT) MIME-Version: 1.0 References: <20211102094651.2071532-1-oupton@google.com> <20211102094651.2071532-7-oupton@google.com> <875ytaak5q.wl-maz@kernel.org> In-Reply-To: From: Oliver Upton Date: Tue, 2 Nov 2021 13:01:46 -0700 Message-ID: Subject: Re: [PATCH v2 6/6] selftests: KVM: Test OS lock behavior To: Marc Zyngier Cc: kvm@vger.kernel.org, Peter Shier , kvmarm@lists.cs.columbia.edu, linux-arm-kernel@lists.infradead.org X-BeenThere: kvmarm@lists.cs.columbia.edu X-Mailman-Version: 2.1.14 Precedence: list List-Id: Where KVM/ARM decisions are made List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Errors-To: kvmarm-bounces@lists.cs.columbia.edu Sender: kvmarm-bounces@lists.cs.columbia.edu On Tue, Nov 2, 2021 at 7:53 AM Oliver Upton wrote: > > > > I haven't had a change to properly review the series, but this one > > definitely caught my eye. My expectations are that BRK is *not* > > affected by the OS Lock. The ARMv8 ARM goes as far as saying: > > > > > > Breakpoint Instruction exceptions are enabled regardless of the state > > of the OS Lock and the OS Double Lock. > > > > > > as well as: > > > > > > There is no enable control for Breakpoint Instruction exceptions. They > > are always enabled, and cannot be masked. > > > > /facepalm I had thought I read "Breakpoint Instruction exceptions" in > the list on D2.5 "The effect of powerdown on debug exceptions", > although on second read I most definitely did not. And if I had read > the bottom of the section, I'd of seen one of the quotes. > > > I wonder how your test succeeds, though. > > Probably because the expectations I wrote match the non-architected > behavior I implemented :-) Alright, gave the series a good once over after this and fixed up quite a few things. Unless you're ready for it, I'll hold back for a bit to avoid spamming inboxes. As an FYI, here's the fixes I have queued up: v2 -> v3: - Stop trapping debug exceptions when the OS Lock is enabled, as it does *not* block software breakpoint exceptions (Marc) - Trap accesses to debug registers if the OS Lock is enabled to prevent the guest from wiping out KVM's configuration of MDSCR_EL1 - Update the debug-exceptions test to expect a software breakpoint exception even when the OS Lock is enabled. -- Thanks, Oliver _______________________________________________ kvmarm mailing list kvmarm@lists.cs.columbia.edu https://lists.cs.columbia.edu/mailman/listinfo/kvmarm From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id DCA02C433EF for ; Tue, 2 Nov 2021 20:03:49 +0000 (UTC) Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 95B1B60551 for ; Tue, 2 Nov 2021 20:03:49 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.1 mail.kernel.org 95B1B60551 Authentication-Results: mail.kernel.org; dmarc=fail (p=reject dis=none) header.from=google.com Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:Cc:To:Subject:Message-ID:Date:From: In-Reply-To:References:MIME-Version:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=d8Ou5M74HtTUUwlPLDdsgxUA1bbq5o6XuLRV6jnLudQ=; b=Dj5eH3Bi4KG2lE zZ7N+U3jydcSCGTsT+IPcDjJqExjOvv2aw5c2Z6eOm0sn0a55qNTQJ76Lmx3en30IJpIBBTa7jCTL bF38owaSB8LP6UFLkfsgHycz4N6CjGW3xaAxE1UzND2BM1yqzUjrP/Dzfoy5tyuuEAwdkdBJtHWMg A1yH27FgCO2Yx3iY9HlrL3jmq2AD7WVb3RVadZivv7gdBN8Wf2FjYI6gamO0ZJ4Al+Cs2rILv8YFx nrrVU4Lnbg8+QfBf5Dm0mlwRx9N0feRcsHi+gVYfou7i2+xuGJRq0wMiYqugPwzjDPW+5GLhqmkmM GGzVLvQwldF6HeC0xtpw==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1mhzyw-002ryt-H0; Tue, 02 Nov 2021 20:02:06 +0000 Received: from mail-lj1-x229.google.com ([2a00:1450:4864:20::229]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1mhzyt-002rxh-6P for linux-arm-kernel@lists.infradead.org; Tue, 02 Nov 2021 20:02:04 +0000 Received: by mail-lj1-x229.google.com with SMTP id e2so69899ljg.13 for ; Tue, 02 Nov 2021 13:01:59 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20210112; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=BDslnEzmaYl8XemO8H14C3E5c69KKbu6q3LyWC8hs6c=; b=Y27DdbKfhZ9/em7rMZL3gynod2fwnh07kZ/RrJMtHRxIkaacuz/t1gWiIlisWzp66P 0vy3sU9WnqbGhx5odG2aKcwRyOfePyWlTLndkiWKaDlR2hoamDr2VC6rHkxfOtWpuP+Z ziv8The/TmmcLSQp4curc6nXf41+Kb5ZcCP4bOpkUWs8/1LWyxEvLyTfIx8L7cKL7xWh 95rhU0KD2PlzngyxJiEn+D1lI+/dUUk91seFcdbdceB/C+WrwBIvN2lncT+KH+Ur9yqe rI1OKChd+w93QeyfYRhCaM+RJyUnXCkYukVxTqjjHT/WxI8HhfI7xw38Z7Mw4UX/+a9v 0vQw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=BDslnEzmaYl8XemO8H14C3E5c69KKbu6q3LyWC8hs6c=; b=gPdDWsdWP/4jGWoKlu2a1M8h0c4svUwy1HDtkO6XhfRZ/NmfcKlwsdsbPxy5CgDR8+ AdGsVGRACHRlHAAqCTSeuZ2W9c0H4E57YtKR6LRl2OhcCxBrgnRZLemIeYmaYN8+HAQJ B5wdvoKFdzjrjJywPal5vPB86KrZ+II7CQSTzgZtzFyEs5cW13Gjt8PdEXsl4veyeDIM DDFBMTzl7YqfWf9u3mXDPW5xK+CFRH2WnDgOXHXL3tO2BG8It7wgvHWVsdR5SMiGh/MM vejr2ozDQkWg4yPPh4ct+4f/LjgLO3k5qPl3B2ABtR+iJzeGa6B1tryyI7JFzEob5py9 IPRQ== X-Gm-Message-State: AOAM530RLfiQqIepArpsaIABmRpYfAghhbM3kNrBoAWpaNvYTuNcOqp2 ZDNnulto1yKJaqk8ydToNNemqceiWc+DLSvxk07aNg== X-Google-Smtp-Source: ABdhPJxwGH/Xjrm74EIMk3UQCQLZsG2pEJnnfrQ2FDpM1CoFNZIbHEdfny5vZ0lVDpSfXmbDZCATT/vApVIzPh/Vpzo= X-Received: by 2002:a05:651c:1051:: with SMTP id x17mr38505200ljm.337.1635883317514; Tue, 02 Nov 2021 13:01:57 -0700 (PDT) MIME-Version: 1.0 References: <20211102094651.2071532-1-oupton@google.com> <20211102094651.2071532-7-oupton@google.com> <875ytaak5q.wl-maz@kernel.org> In-Reply-To: From: Oliver Upton Date: Tue, 2 Nov 2021 13:01:46 -0700 Message-ID: Subject: Re: [PATCH v2 6/6] selftests: KVM: Test OS lock behavior To: Marc Zyngier Cc: kvmarm@lists.cs.columbia.edu, kvm@vger.kernel.org, James Morse , Alexandru Elisei , Suzuki K Poulose , linux-arm-kernel@lists.infradead.org, Andrew Jones , Peter Shier , Ricardo Koller , Reiji Watanabe X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20211102_130203_260260_900524B5 X-CRM114-Status: GOOD ( 20.49 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org On Tue, Nov 2, 2021 at 7:53 AM Oliver Upton wrote: > > > > I haven't had a change to properly review the series, but this one > > definitely caught my eye. My expectations are that BRK is *not* > > affected by the OS Lock. The ARMv8 ARM goes as far as saying: > > > > > > Breakpoint Instruction exceptions are enabled regardless of the state > > of the OS Lock and the OS Double Lock. > > > > > > as well as: > > > > > > There is no enable control for Breakpoint Instruction exceptions. They > > are always enabled, and cannot be masked. > > > > /facepalm I had thought I read "Breakpoint Instruction exceptions" in > the list on D2.5 "The effect of powerdown on debug exceptions", > although on second read I most definitely did not. And if I had read > the bottom of the section, I'd of seen one of the quotes. > > > I wonder how your test succeeds, though. > > Probably because the expectations I wrote match the non-architected > behavior I implemented :-) Alright, gave the series a good once over after this and fixed up quite a few things. Unless you're ready for it, I'll hold back for a bit to avoid spamming inboxes. As an FYI, here's the fixes I have queued up: v2 -> v3: - Stop trapping debug exceptions when the OS Lock is enabled, as it does *not* block software breakpoint exceptions (Marc) - Trap accesses to debug registers if the OS Lock is enabled to prevent the guest from wiping out KVM's configuration of MDSCR_EL1 - Update the debug-exceptions test to expect a software breakpoint exception even when the OS Lock is enabled. -- Thanks, Oliver _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel