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 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 smtp.lore.kernel.org (Postfix) with ESMTPS id D8194C7EE2F for ; Tue, 6 Jun 2023 09:30:22 +0000 (UTC) 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:In-Reply-To:From:References:Cc:To: Subject:MIME-Version:Date:Message-ID:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=MYBWawG9thQkafNWROvN+bswVSZp2wD6HprAK1rffXY=; b=PkYqDEhZrrVsnV t0xfk12J0j+ys0HSNs/ULJxlwoXcfv5AgK/5s7XHYyluRiJ529GuGpmeRI2RO6DTXo/FkY9zO44FJ 5CFcjU8x5Y7We+q9Q/9OumciKISXlnTZ8LEf1giQ7EOQnvaLx7F8HfZCuF3a9Uxha+nzbaXjDVfGR I0d2+P7i631kBGpPzvd30LUdNkT57Tpduh0PW38X5yhuG27AR5Z+0Eb4Af2rmd/xLaF83YVH725q2 wNTKH9klY1qtSBUwrHvXufYyYx7IOvobMC3MQ+aLCMOnFWbn/+fip7WwJ+R2oagBpnpIsnVlA+rgX YaxwAa3MUhj/t64z9kHw==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.96 #2 (Red Hat Linux)) id 1q6T0g-0010CW-1w; Tue, 06 Jun 2023 09:29:50 +0000 Received: from us-smtp-delivery-124.mimecast.com ([170.10.133.124]) by bombadil.infradead.org with esmtps (Exim 4.96 #2 (Red Hat Linux)) id 1q6T0d-0010Bo-0E for linux-arm-kernel@lists.infradead.org; Tue, 06 Jun 2023 09:29:48 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1686043783; h=from:from: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=VvVw+wYo/gtmiGwGSDdmcHXZMo6R18G9lGqfmaFlyIc=; b=QzhgUE5WqziYoHXADD10paJMORru3Ue0HebMwKu42kV+2rc7VUyci4t0iBiT5QqSv96k1Z BzBuoBu+KU6NWMgtpzc0/+k8U0sPalgLpeokq7dfbPDGW1UcsmOGmGoVBRdzKtfZxZnrsk Ov5V0BUN1znb+o55jgzMlHoxcqWjUGI= Received: from mail-qv1-f70.google.com (mail-qv1-f70.google.com [209.85.219.70]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-226-6XV6s1N5PV6t9vCII460xw-1; Tue, 06 Jun 2023 05:29:42 -0400 X-MC-Unique: 6XV6s1N5PV6t9vCII460xw-1 Received: by mail-qv1-f70.google.com with SMTP id 6a1803df08f44-62a25948da5so40444446d6.2 for ; Tue, 06 Jun 2023 02:29:42 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1686043782; x=1688635782; h=content-transfer-encoding:in-reply-to:from:references:cc:to :content-language:subject:user-agent:mime-version:date:message-id :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=VvVw+wYo/gtmiGwGSDdmcHXZMo6R18G9lGqfmaFlyIc=; b=UC74Fv9DttymEbUQ73gKEHdENA7kaKl/SX25lzcMTpUWl5brXN0NTQ+VsVec9CCCR7 ZHvlsqY5QKLreo5GyY6lL9tZWkhoc7F6A9lxCxi9y/rBRB/kYGiZnJMfbR61kteqnEMB qNyL8bIKioJDm7uzj/c8H3agZ/QU6X2gx2KKFZi+iNbRzdjyeijH5WR1UlRGFPB8rR/F tPUjjL0WHKnOO3fyrnPsPErvhrcrAeevrv3hU6Y/oBeH5fzXxkSmCI5Baj+8li5TpIby 6uVrTLOoOrDz10dhcsGDs+NH9PLJvkNeFfW8FSgBq1gS8iVJKMEFfmTn/7iyj2LLzky4 T1og== X-Gm-Message-State: AC+VfDxLK2p6UqRrHg5sdZ95tFiwVuxqb0ZUa1ixeHWkx34qLE/5/If3 /CuysjYqOxUdwBxrYTfN9p4dQFaq4SE8SD/eyRJp83HIw9ySdSdIyad0AJKrU82fWcQcSjjSSlg 2xYJFrapju3GIhx7w4HrdNdlCE6RFvg1hDkQ= X-Received: by 2002:ad4:5ae6:0:b0:621:170:68b7 with SMTP id c6-20020ad45ae6000000b00621017068b7mr2000591qvh.35.1686043782473; Tue, 06 Jun 2023 02:29:42 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ5WKwmouv2fJWc37kUbEfU577Kxfql4Y418iSiwFMDnsPR2/phC23oilrE3UxHMMSY31bx5IA== X-Received: by 2002:ad4:5ae6:0:b0:621:170:68b7 with SMTP id c6-20020ad45ae6000000b00621017068b7mr2000569qvh.35.1686043782212; Tue, 06 Jun 2023 02:29:42 -0700 (PDT) Received: from ?IPV6:2a01:e0a:59e:9d80:527b:9dff:feef:3874? ([2a01:e0a:59e:9d80:527b:9dff:feef:3874]) by smtp.gmail.com with ESMTPSA id w5-20020a0cc245000000b006260c683bf2sm5253563qvh.53.2023.06.06.02.29.38 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Tue, 06 Jun 2023 02:29:41 -0700 (PDT) Message-ID: Date: Tue, 6 Jun 2023 11:29:36 +0200 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.5.0 Subject: Re: [PATCH v10 00/59] KVM: arm64: ARMv8.3/8.4 Nested Virtualization support To: Marc Zyngier Cc: kvmarm@lists.linux.dev, kvm@vger.kernel.org, linux-arm-kernel@lists.infradead.org, Alexandru Elisei , Andre Przywara , Chase Conklin , Christoffer Dall , Ganapatrao Kulkarni , Darren Hart , Jintack Lim , Russell King , Miguel Luis , James Morse , Suzuki K Poulose , Oliver Upton , Zenghui Yu References: <20230515173103.1017669-1-maz@kernel.org> <9cf2356b-f990-1cd2-c7e6-a984e9f604c6@redhat.com> <87r0qpnj2t.wl-maz@kernel.org> From: Eric Auger In-Reply-To: <87r0qpnj2t.wl-maz@kernel.org> X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Language: en-US X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20230606_022947_182253_F3404B1E X-CRM114-Status: GOOD ( 28.85 ) 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 Hi Marc, On 6/6/23 09:30, Marc Zyngier wrote: > Hey Eric, > > On Mon, 05 Jun 2023 12:28:12 +0100, > Eric Auger wrote: >> >> Hi Marc, >> >> On 5/15/23 19:30, Marc Zyngier wrote: >>> This is the 4th drop of NV support on arm64 for this year. >>> >>> For the previous episodes, see [1]. >>> >>> What's changed: >>> >>> - New framework to track system register traps that are reinjected in >>> guest EL2. It is expected to replace the discrete handling we have >>> enjoyed so far, which didn't scale at all. This has already fixed a >>> number of bugs that were hidden (a bunch of traps were never >>> forwarded...). Still a work in progress, but this is going in the >>> right direction. >>> >>> - Allow the L1 hypervisor to have a S2 that has an input larger than >>> the L0 IPA space. This fixes a number of subtle issues, depending on >>> how the initial guest was created. >>> >>> - Consequently, the patch series has gone longer again. Boo. But >>> hopefully some of it is easier to review... >>> >>> [1] https://lore.kernel.org/r/20230405154008.3552854-1-maz@kernel.org >>> >>> Andre Przywara (1): >>> KVM: arm64: nv: vgic: Allow userland to set VGIC maintenance IRQ >> >> I guess you have executed kselftests on L1 guests. Have all the tests >> passed there? On my end it stalls in the KVM_RUN. > > No, I hardly run any kselftest, because they are just not designed to > run at EL2 at all. There's some work to be done there, but I just > don't have the bandwidth for that (hint, wink...) oh OK, I missed that point. If nobody is working on this I can start looking at it. Would be interesting to run them on nested guest too. > >> >> for instance >> tools/testing/selftests/kvm/aarch64/aarch32_id_regs.c fails in >> test_guest_raz(vcpu) on the KVM_RUN. Even with a basic >> >> static void guest_main(void) >> { >> GUEST_DONE(); >> } > > My guess is that the test harness expects things to run at EL1. > Depending on the value you get for HCR_EL2, you could get all sort of > odd behaviours. Also, the harness configures EL1 only, which is > unlikely to work at EL2. My conclusion is that "processor.c" needs to > be taught about EL2, at the very least. > >> >> I get >> aarch32_id_regs-768 [002] ..... 410.544665: kvm_exit: IRQ: >> HSR_EC: 0x0000 (UNKNOWN), PC: 0x0000000000401ec4 >> aarch32_id_regs-768 [002] d.... 410.544666: kvm_entry: PC: >> 0x0000000000401ec4 >> aarch32_id_regs-768 [002] ..... 410.544675: kvm_exit: IRQ: >> HSR_EC: 0x0000 (UNKNOWN), PC: 0x0000000000401ec4 >> aarch32_id_regs-768 [002] d.... 410.544676: kvm_entry: PC: >> 0x0000000000401ec4 >> aarch32_id_regs-768 [002] ..... 410.544685: kvm_exit: IRQ: >> HSR_EC: 0x0000 (UNKNOWN), PC: 0x0000000000401ec4 >> >> looping forever instead of >> >> aarch32_id_regs-1085576 [079] d..1. 1401295.068739: kvm_entry: PC: >> 0x0000000000401ec4 >> aarch32_id_regs-1085576 [079] ...1. 1401295.068745: kvm_exit: TRAP: >> HSR_EC: 0x0020 (IABT_LOW), PC: 0x0000000000401ec4 >> aarch32_id_regs-1085576 [079] d..1. 1401295.068790: kvm_entry: PC: >> 0x0000000000401ec4 >> aarch32_id_regs-1085576 [079] ...1. 1401295.068792: kvm_exit: TRAP: >> HSR_EC: 0x0020 (IABT_LOW), PC: 0x0000000000401ec4 >> aarch32_id_regs-1085576 [079] d..1. 1401295.068794: kvm_entry: PC: >> 0x0000000000401ec4 >> aarch32_id_regs-1085576 [079] ...1. 1401295.068795: kvm_exit: TRAP: >> HSR_EC: 0x0020 (IABT_LOW), PC: 0x0000000000401ec4 >> aarch32_id_regs-1085576 [079] d..1. 1401295.068797: kvm_entry: PC: >> 0x0000000000401ec4 >> ../.. >> >> Any idea or any known restriction wrt kselftests? > > See above. I'd love someone to actually start looking into it and > devise a testing harness that would run both at EL{0,1,2} *at the same > time* so that we can start exercising some of the trap behaviours that > the architecture mandates. > > Also, Alexandru had a some KUT tests a few years ago, but I don't know > what happened of them. Yeah I remember that one too. Alexandru, do you have plans to revive it? That would be also interesting to run kuts on nested, giving a chance to have incremental and more unitary testing. Thanks! Eric > > Thanks, > > M. > _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel