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 0E276C433EF for ; Mon, 4 Apr 2022 05:29:49 +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:MIME-Version:References: Message-ID:Subject:Cc:To:From:Date:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=+oE+n7Xlbyl/oqSg7Mt3gC9QUqTDfcQ1KF6HO60DTJ8=; b=lDAkuwHSareZfk Kimu4MMvUWPVtItbN0/1uYafHET9UIHFh7yjF91HKnenDRWzZoESZ+HHrJZZI4FsBfEz0A6e9Kkj6 ZwBLsMG6HKPeMsR54mkbxMYWNWQiUqaIyh3W0wcBoPbebgTslDOWfvtfx8qRBrcY6y4jITCER0nOT BK3XOWsH0h6JFkaG55TH7LIKyDnCN/tuQYqhv+ifpCSg3GivtbhhTT9xKlRaigOhFhEmxmXHdiLZ5 is2Xgt1NHgSfWDdpxWFEbJ0i/3y8qrKj/jCw6dSRVHR/krRQml1VUcqyD3cXHiP/o2zsXLc6R0MN8 Xe91QBqTuUvy52pDx8AA==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1nbFGg-00DJ72-VG; Mon, 04 Apr 2022 05:28:47 +0000 Received: from mail-io1-xd30.google.com ([2607:f8b0:4864:20::d30]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1nbFGd-00DJ5E-Fq for linux-arm-kernel@lists.infradead.org; Mon, 04 Apr 2022 05:28:44 +0000 Received: by mail-io1-xd30.google.com with SMTP id b16so9994921ioz.3 for ; Sun, 03 Apr 2022 22:28:38 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20210112; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to; bh=4vQFrjglrchZfWnBhpFno0OG8+JYEPYgRfkxp+2Eq7o=; b=LiOBtM7e9EsGoXdzZHjt3VAlfi+P8jggYvXUvinv1GwvKXhD/C1MVwLT0WYFC4rAGp jmol3SXOFoa4Z4ooFSn6wsQKtk8C3Lub7I7baeX4E74lH/ovookztTEfvijFA4NvE4yk Wjt7jhgVAkfRGf4TYEeICMrubHLMEH3B+edLHVG3HJr27PFedThMd11inj5vbzFOhq96 vBZU9QHgDlLdKkJugc7xPxBG/N9cSEvyLt5EBYWMKySVdKf7U4oUVmzo38Mv4CikzJr+ w1TfMl2QfEk6pVs4s09A2AqAYL6GMRWZoMh4P8xfkPK2EgaK2cujVFdvqxTkGY1/5ON9 rMiA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to; bh=4vQFrjglrchZfWnBhpFno0OG8+JYEPYgRfkxp+2Eq7o=; b=hE9QUkQx7C0OmDdq0OPHZHYN6PLxXj9hdIrU96JsB0wqVgV7bKfpeM6zsL4GXGpW6I iPuLhU9il/VB2grgfuWmBMR572N54/66Sj9pyV17xPI5k8JCsrG5SQd9h7h0cH4La+1r oStM6j8we/B+/rxWxNB94mi1VdA45ZpnCc0LZnys0crmhWRxLoRrlRhyrD6SU3Pelyy3 R4ZzybUK6iraD+cjHdrk/TCq6rWwtTh/Avh21FQhD4Ak4K/diWDfBe8olEbGw+GjyDlk Hem/EseqaUX+AFXML3iH110c2feLMONnQhzrN1fCfi6n0v8McJaJrkfCOhZv7wUceZid mJOw== X-Gm-Message-State: AOAM532L1egdeJknk8RdGRR7AtFWCRdiHcBgJfnhsInpE8Kvh/xqszCx Q3UEC5d+XmEsG7SURLJlBAyv8g== X-Google-Smtp-Source: ABdhPJwnrz63bQuIY0Qz/p4MN+rMjCvcRj6uMmNM+SGy8AWlCr6QKV0I4658w5YLbDhl2gu2ASyxBg== X-Received: by 2002:a02:224d:0:b0:321:370b:6d59 with SMTP id o74-20020a02224d000000b00321370b6d59mr11248053jao.104.1649050117857; Sun, 03 Apr 2022 22:28:37 -0700 (PDT) Received: from google.com (194.225.68.34.bc.googleusercontent.com. [34.68.225.194]) by smtp.gmail.com with ESMTPSA id u10-20020a92da8a000000b002ca48fff4c7sm435056iln.13.2022.04.03.22.28.36 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 03 Apr 2022 22:28:36 -0700 (PDT) Date: Mon, 4 Apr 2022 05:28:33 +0000 From: Oliver Upton To: Reiji Watanabe Cc: kvmarm@lists.cs.columbia.edu, kvm@vger.kernel.org, Marc Zyngier , James Morse , Alexandru Elisei , Suzuki K Poulose , Linux ARM , Peter Shier , Ricardo Koller Subject: Re: [PATCH v2 2/3] KVM: arm64: Plumb cp10 ID traps through the AArch64 sysreg handler Message-ID: References: <20220401010832.3425787-1-oupton@google.com> <20220401010832.3425787-3-oupton@google.com> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20220403_222843_587799_9C84F85A X-CRM114-Status: GOOD ( 14.32 ) 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 Reiji, On Sun, Apr 03, 2022 at 08:57:47PM -0700, Reiji Watanabe wrote: > > +int kvm_handle_cp10_id(struct kvm_vcpu *vcpu) > > +{ > > + int Rt = kvm_vcpu_sys_get_rt(vcpu); > > + u32 esr = kvm_vcpu_get_esr(vcpu); > > + struct sys_reg_params params; > > + int ret; > > + > > + /* UNDEF on any unhandled register or an attempted write */ > > + if (!kvm_esr_cp10_id_to_sys64(esr, ¶ms) || params.is_write) { > > + kvm_inject_undefined(vcpu); > > Nit: For debugging, it might be more useful to use unhandled_cp_access() > (, which needs to be changed to support ESR_ELx_EC_CP10_ID though) > rather than directly calling kvm_inject_undefined(). A very worthy nit, you spotted my laziness in shunting straight to kvm_inject_undefined() :) Thinking about this a bit more deeply, this code should be dead. The only time either of these conditions would happen is on a broken implementation. Probably should still handle it gracefully in case the CP10 handling in KVM becomes (or is in my own patch!) busted. > Reviewed-by: Reiji Watanabe Appreciated! -- Thanks, Oliver _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel