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 7F877C433F5 for ; Tue, 2 Nov 2021 09:52:06 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 6922C600EF for ; Tue, 2 Nov 2021 09:52:06 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230368AbhKBJyj (ORCPT ); Tue, 2 Nov 2021 05:54:39 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:34804 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231356AbhKBJyU (ORCPT ); Tue, 2 Nov 2021 05:54:20 -0400 Received: from mail-lj1-x232.google.com (mail-lj1-x232.google.com [IPv6:2a00:1450:4864:20::232]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 1C571C0613F5 for ; Tue, 2 Nov 2021 02:51:35 -0700 (PDT) Received: by mail-lj1-x232.google.com with SMTP id i26so31993059ljg.7 for ; Tue, 02 Nov 2021 02:51:35 -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=ltDk5JK6z+dHqY8fdueOIJnXFQ9epuN/VTXpT5MWcbo=; b=dB1O/eAqNcHN1R5TtXUb4Ium887EbOkxo37AnK/8BMd9z/JGifaE1xNVkrSWa5LMMh 07YxdoVTS/OIMoHQHPutCkgiq9L1DjLVN+3aiQGnfasgaMJZT2JkrdBiej0auqMzj4Zq SeM4ASzdOt0EEDJw+/4W7DextFsZHaW0Y9fWezHvThGjnSv7/G41wW+7dEqC1oG/ACET 9Xzc6fMqSJpq/raOpG4T5jn7IdAUg68R+0iuy8UNcVa7NUOJWFTXwhVdThdLVwusOjhS D85uaZLFHrfRqn23fuXjUwJw7svEl6TUbgIJCuE0CD5xCubi44JJLNS7JXRWSf49glWD xPUg== 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=ltDk5JK6z+dHqY8fdueOIJnXFQ9epuN/VTXpT5MWcbo=; b=hFXlOnlanrLCKUccw8q86XSXkxL7hWw0BVgVZ69Ghn0/VQwywfc+ObRrFOEJZ/O5QC fkwCqmJN3MOLEjw+8QJ/wYiN5vDvIqwQmpVQJx8n7t2SlICRxLIwrWl+kJ0tyntZccaX 9L3bSlVrlyL5JEqrwWExPAImELzlnWZS/7vkV8JPtDPew/ahVE4J630MRu0RVy+j1Tuy WMdxPiyaK2CXirOAx2HWphi809l2qUA++GXI/UcRF+Yc6DWsPKOJJjPqW7JopIFEneBW tlkchlqfKfpnQJAp425vo80PYlfCyO+U5QjJ2KHFQ2qwuXpei5zRxCA4/JlPLlcbAL/M wUpA== X-Gm-Message-State: AOAM533kVk7VoQJ3NkBvVtna8z9EQ3LCE/KOiIYs7UcKXwRvQPq1Wfxp mR803yRsbsjaKMLmeNBPD05364QdDHFW+BGi6v5zCA== X-Google-Smtp-Source: ABdhPJzlG6VNtE7PqaH0TRioe9leU6UmH/EsyksQvloUt4hUzw+AxRflWPdOgJuKeeHnODlRb4wS9kPqVoBnzRwawEU= X-Received: by 2002:a05:651c:556:: with SMTP id q22mr24142315ljp.374.1635846692565; Tue, 02 Nov 2021 02:51:32 -0700 (PDT) MIME-Version: 1.0 References: <20211102094651.2071532-1-oupton@google.com> <20211102094651.2071532-3-oupton@google.com> In-Reply-To: <20211102094651.2071532-3-oupton@google.com> From: Oliver Upton Date: Tue, 2 Nov 2021 02:51:21 -0700 Message-ID: Subject: Re: [PATCH v2 2/6] KVM: arm64: Stash OSLSR_EL1 in the cpu context To: kvmarm@lists.cs.columbia.edu Cc: kvm@vger.kernel.org, Marc Zyngier , 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 2:47 AM Oliver Upton wrote: > > An upcoming change to KVM will context switch the OS Lock status between > guest/host. Add OSLSR_EL1 to the cpu context and handle guest reads > using the stored value. > > Wire up a custom handler for writes from userspace and prevent any of > the invariant bits from changing. > > Signed-off-by: Oliver Upton > --- > arch/arm64/include/asm/kvm_host.h | 1 + > arch/arm64/kvm/sys_regs.c | 31 ++++++++++++++++++++++++------- > 2 files changed, 25 insertions(+), 7 deletions(-) > > diff --git a/arch/arm64/include/asm/kvm_host.h b/arch/arm64/include/asm/kvm_host.h > index f8be56d5342b..c98f65c4a1f7 100644 > --- a/arch/arm64/include/asm/kvm_host.h > +++ b/arch/arm64/include/asm/kvm_host.h > @@ -172,6 +172,7 @@ enum vcpu_sysreg { > MDSCR_EL1, /* Monitor Debug System Control Register */ > MDCCINT_EL1, /* Monitor Debug Comms Channel Interrupt Enable Reg */ > DISR_EL1, /* Deferred Interrupt Status Register */ > + OSLSR_EL1, /* OS Lock Status Register */ Sorry Marc, forgot to move this up per your suggestion on the last series. Only caught it once the patch went out the door. -- 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 5A4E8C433F5 for ; Tue, 2 Nov 2021 09:51:40 +0000 (UTC) Received: from mm01.cs.columbia.edu (mm01.cs.columbia.edu [128.59.11.253]) by mail.kernel.org (Postfix) with ESMTP id CB25B60C41 for ; Tue, 2 Nov 2021 09:51:39 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.1 mail.kernel.org CB25B60C41 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 5799C4B12E; Tue, 2 Nov 2021 05:51:39 -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 Tp02fT9UHrqV; Tue, 2 Nov 2021 05:51:38 -0400 (EDT) Received: from mm01.cs.columbia.edu (localhost [127.0.0.1]) by mm01.cs.columbia.edu (Postfix) with ESMTP id 5F9564B150; Tue, 2 Nov 2021 05:51:38 -0400 (EDT) Received: from localhost (localhost [127.0.0.1]) by mm01.cs.columbia.edu (Postfix) with ESMTP id 1CD624B11C for ; Tue, 2 Nov 2021 05:51:37 -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 x0vATYDc-Nzb for ; Tue, 2 Nov 2021 05:51:35 -0400 (EDT) Received: from mail-lj1-f177.google.com (mail-lj1-f177.google.com [209.85.208.177]) by mm01.cs.columbia.edu (Postfix) with ESMTPS id 0E8ED4B104 for ; Tue, 2 Nov 2021 05:51:34 -0400 (EDT) Received: by mail-lj1-f177.google.com with SMTP id 1so28021643ljv.2 for ; Tue, 02 Nov 2021 02:51:34 -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=ltDk5JK6z+dHqY8fdueOIJnXFQ9epuN/VTXpT5MWcbo=; b=dB1O/eAqNcHN1R5TtXUb4Ium887EbOkxo37AnK/8BMd9z/JGifaE1xNVkrSWa5LMMh 07YxdoVTS/OIMoHQHPutCkgiq9L1DjLVN+3aiQGnfasgaMJZT2JkrdBiej0auqMzj4Zq SeM4ASzdOt0EEDJw+/4W7DextFsZHaW0Y9fWezHvThGjnSv7/G41wW+7dEqC1oG/ACET 9Xzc6fMqSJpq/raOpG4T5jn7IdAUg68R+0iuy8UNcVa7NUOJWFTXwhVdThdLVwusOjhS D85uaZLFHrfRqn23fuXjUwJw7svEl6TUbgIJCuE0CD5xCubi44JJLNS7JXRWSf49glWD xPUg== 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=ltDk5JK6z+dHqY8fdueOIJnXFQ9epuN/VTXpT5MWcbo=; b=ewtlc0fwipT4tkpCD5CfSTjdBkjJTNSRF4ufL3Pet8l62zGUzz8nRbm7GWRTeeVJlK jt9/FPReErmN/jygw0/Y2P2+/xkISSVMwWLIgUKMK6EB5/1RoPXRRik3j0XccP0yY6vy V6NtPnh1VWXk/07JDTw4T4bhOACiiDq2QrTcqjG1SIFrkVDDWHqUNlp0HCppLIKpT8b0 AFtIIR1BHJ7/3gwNUDRLJvh0nzjcF7SimHxudUrgEewi1wk6UooplVamQf+mLz6P3/Pp J/X36IY+DE3fpeqgN9hUJrzEWfT/xYfsM4fd+WOdT7WTitGxPh81XPyKwxOd2QA3mJzs o/vw== X-Gm-Message-State: AOAM532zbDfRIqsozzFS6tTZdRvm/Bdvwq7VaxYWXToRV+N3bX8GSYvg KQY9fE78jKuTmIGZna7K8biO6U0CAV9S2UPQ0n3JzH6MKZy1Qw== X-Google-Smtp-Source: ABdhPJzlG6VNtE7PqaH0TRioe9leU6UmH/EsyksQvloUt4hUzw+AxRflWPdOgJuKeeHnODlRb4wS9kPqVoBnzRwawEU= X-Received: by 2002:a05:651c:556:: with SMTP id q22mr24142315ljp.374.1635846692565; Tue, 02 Nov 2021 02:51:32 -0700 (PDT) MIME-Version: 1.0 References: <20211102094651.2071532-1-oupton@google.com> <20211102094651.2071532-3-oupton@google.com> In-Reply-To: <20211102094651.2071532-3-oupton@google.com> From: Oliver Upton Date: Tue, 2 Nov 2021 02:51:21 -0700 Message-ID: Subject: Re: [PATCH v2 2/6] KVM: arm64: Stash OSLSR_EL1 in the cpu context To: kvmarm@lists.cs.columbia.edu Cc: kvm@vger.kernel.org, Marc Zyngier , Peter Shier , 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 2:47 AM Oliver Upton wrote: > > An upcoming change to KVM will context switch the OS Lock status between > guest/host. Add OSLSR_EL1 to the cpu context and handle guest reads > using the stored value. > > Wire up a custom handler for writes from userspace and prevent any of > the invariant bits from changing. > > Signed-off-by: Oliver Upton > --- > arch/arm64/include/asm/kvm_host.h | 1 + > arch/arm64/kvm/sys_regs.c | 31 ++++++++++++++++++++++++------- > 2 files changed, 25 insertions(+), 7 deletions(-) > > diff --git a/arch/arm64/include/asm/kvm_host.h b/arch/arm64/include/asm/kvm_host.h > index f8be56d5342b..c98f65c4a1f7 100644 > --- a/arch/arm64/include/asm/kvm_host.h > +++ b/arch/arm64/include/asm/kvm_host.h > @@ -172,6 +172,7 @@ enum vcpu_sysreg { > MDSCR_EL1, /* Monitor Debug System Control Register */ > MDCCINT_EL1, /* Monitor Debug Comms Channel Interrupt Enable Reg */ > DISR_EL1, /* Deferred Interrupt Status Register */ > + OSLSR_EL1, /* OS Lock Status Register */ Sorry Marc, forgot to move this up per your suggestion on the last series. Only caught it once the patch went out the door. -- 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 1C03AC433EF for ; Tue, 2 Nov 2021 09:53:39 +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 D254460C4B for ; Tue, 2 Nov 2021 09:53:38 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.1 mail.kernel.org D254460C4B 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=m3naXYHIvC1jF+KvVNNhlibNWPKnuTeRGpYJ8ZXrZb0=; b=tda2kAtSzJbKDG UVi1/SqaSAJRbRVUtE/tZ73xaQs9OkxKVpKjqDIn/OvmBzL/uZEjThYdN7g8qTyFZ2dktqsHY9/gf K0f5JjaE5JXJxiSX5sXy33vx3uAq6yAQyuDT/VPLR2fCbeZ24hgXTsEfy1tb8i5hFw4B70M8Oko/V 6fh/HWNae0rwqPTi9j6zszZ4xchHAsOEJWZPSCDiJCxyB81dhooh+KG9/66vgjwSIGjIEGhex/Hbk MBC+mwYTFWWrTaviqg+k+C2WHt4fb/kSCSuy9A+8zCH2UsGW0+yjd6XAiN8mXC8OlkCqTcmGd4KK1 k8aJCbgkzwzyJS4a1fFQ==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1mhqST-001BOI-NU; Tue, 02 Nov 2021 09:51:58 +0000 Received: from mail-lj1-x234.google.com ([2a00:1450:4864:20::234]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1mhqS7-001BE9-Mb for linux-arm-kernel@lists.infradead.org; Tue, 02 Nov 2021 09:51:37 +0000 Received: by mail-lj1-x234.google.com with SMTP id v23so1157521ljk.5 for ; Tue, 02 Nov 2021 02:51:34 -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=ltDk5JK6z+dHqY8fdueOIJnXFQ9epuN/VTXpT5MWcbo=; b=dB1O/eAqNcHN1R5TtXUb4Ium887EbOkxo37AnK/8BMd9z/JGifaE1xNVkrSWa5LMMh 07YxdoVTS/OIMoHQHPutCkgiq9L1DjLVN+3aiQGnfasgaMJZT2JkrdBiej0auqMzj4Zq SeM4ASzdOt0EEDJw+/4W7DextFsZHaW0Y9fWezHvThGjnSv7/G41wW+7dEqC1oG/ACET 9Xzc6fMqSJpq/raOpG4T5jn7IdAUg68R+0iuy8UNcVa7NUOJWFTXwhVdThdLVwusOjhS D85uaZLFHrfRqn23fuXjUwJw7svEl6TUbgIJCuE0CD5xCubi44JJLNS7JXRWSf49glWD xPUg== 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=ltDk5JK6z+dHqY8fdueOIJnXFQ9epuN/VTXpT5MWcbo=; b=BND1/BLnE9IMFvozx3yExITxdANYmPdE0DtSZ54tgAP71HJbSjkBtZDY8uHZtE9pBF XdpJv1cYDg+tg+nSwkG9+sKwiedKLJm7n2HO/vorD82W4rNeiBnoAHkhuB4ClU3+uIzN c0a31EK4I0tnZEK+7De/nEqA9JyU6Y8Lkeremlqrmmw/l+vpcR4g78cfM/Lm5kMNH3vy PO3560CNGuLTq3uwuLWjC7WDLG8x0qNuxQPy1BJhZUF5OpVhDI+AWPvr1jMgcfaFhaF9 y8bXfTuqtKCZsfqJiu7xm3OSU5KRfEQba+Eue24PPZdBjzQdz5FdHMDCwN93pwb4fVS/ ipwQ== X-Gm-Message-State: AOAM530P1YDkE86Qp9tNgzMIT+Fplz6Xzey1tqWW52tKhb2xzPMe2ZhZ 6JhE169Khpd4s+FAAt6LBLUbWCQHsYE7Mqw1GY87bw== X-Google-Smtp-Source: ABdhPJzlG6VNtE7PqaH0TRioe9leU6UmH/EsyksQvloUt4hUzw+AxRflWPdOgJuKeeHnODlRb4wS9kPqVoBnzRwawEU= X-Received: by 2002:a05:651c:556:: with SMTP id q22mr24142315ljp.374.1635846692565; Tue, 02 Nov 2021 02:51:32 -0700 (PDT) MIME-Version: 1.0 References: <20211102094651.2071532-1-oupton@google.com> <20211102094651.2071532-3-oupton@google.com> In-Reply-To: <20211102094651.2071532-3-oupton@google.com> From: Oliver Upton Date: Tue, 2 Nov 2021 02:51:21 -0700 Message-ID: Subject: Re: [PATCH v2 2/6] KVM: arm64: Stash OSLSR_EL1 in the cpu context To: kvmarm@lists.cs.columbia.edu Cc: kvm@vger.kernel.org, Marc Zyngier , 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_025135_782191_C01117F1 X-CRM114-Status: GOOD ( 16.59 ) 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 2:47 AM Oliver Upton wrote: > > An upcoming change to KVM will context switch the OS Lock status between > guest/host. Add OSLSR_EL1 to the cpu context and handle guest reads > using the stored value. > > Wire up a custom handler for writes from userspace and prevent any of > the invariant bits from changing. > > Signed-off-by: Oliver Upton > --- > arch/arm64/include/asm/kvm_host.h | 1 + > arch/arm64/kvm/sys_regs.c | 31 ++++++++++++++++++++++++------- > 2 files changed, 25 insertions(+), 7 deletions(-) > > diff --git a/arch/arm64/include/asm/kvm_host.h b/arch/arm64/include/asm/kvm_host.h > index f8be56d5342b..c98f65c4a1f7 100644 > --- a/arch/arm64/include/asm/kvm_host.h > +++ b/arch/arm64/include/asm/kvm_host.h > @@ -172,6 +172,7 @@ enum vcpu_sysreg { > MDSCR_EL1, /* Monitor Debug System Control Register */ > MDCCINT_EL1, /* Monitor Debug Comms Channel Interrupt Enable Reg */ > DISR_EL1, /* Deferred Interrupt Status Register */ > + OSLSR_EL1, /* OS Lock Status Register */ Sorry Marc, forgot to move this up per your suggestion on the last series. Only caught it once the patch went out the door. -- Oliver _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel