Received: by 2002:a05:6358:11c7:b0:104:8066:f915 with SMTP id i7csp6236432rwl; Tue, 4 Apr 2023 09:34:27 -0700 (PDT) X-Google-Smtp-Source: AKy350b9luU5/72m5c5HZx6RMFC1SD3SpQdrMd6AIS1UEYOyaX3ecH0beGP6mLG+0ghzDq2WiA7m X-Received: by 2002:a17:906:950a:b0:88f:a236:69e6 with SMTP id u10-20020a170906950a00b0088fa23669e6mr167404ejx.7.1680626067675; Tue, 04 Apr 2023 09:34:27 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1680626067; cv=none; d=google.com; s=arc-20160816; b=U/U9KKcQKToaZKvvBthYFO4SRFS/IScYMAkijo3+xuC458k9Jck3Z1wc3yW9zS8lsi QRX2KESNl7/2CD8uMhEOBGwu98JY2mzxAatF/lUJ+P8YBwtTmEM1oT3wN3KA/nsXW1b+ Wthgehi/smAUoI8wx4OjsC/V93dvctxuy3gaLjYwm6gw857/AIv5qjBuW9bAsFAELPD8 95UtitwWtXyoccRG6b1D5EuJo6pGxA/GNNB5hk0EQzg31gAQWH9+d+hHLz6Yckwyz1LY c+1pCnw/oCk40tahGxjPUSefZhHRRwLWdgyHVjhRJ0WvUs8kPaMTJO/m7ZUCbXjqcUD9 +T9A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature; bh=OR8OPThlLXGOEBzYBzmSAN3iW0DfsF9WhugEl5eryYw=; b=e5n76JRIHYtSGQDZL3mQLXFVzG/+yg7QNUeMOKX4x3txAf+S8LroNa3/tCxDUmkDgP jrfvRrWLmejXD/qx2db7K6/PswqXo6XBFFoPNTS1VHIaqm5JShB+fRh2Ock2yLIyjV5h lTIsvtvKjVSjhptSSa3esusXLTxbQJvUJvU1XyrhMGoEpK+6TnR20X0W/pd8sjO5oHya kUVLtSS4tEmsAKyYuq1KL5BQfl9lwvIofk1AYfIKWuKkY9VcFKZzlLOFDPHesM6O3JVE +gubiyOdiosWmjq4JbzoGoqjrf/EK4Is/bq2BWO7576MHME5mt1udMFFLN7PuVBjW2go zp/Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@ventanamicro.com header.s=google header.b=LHZgxx0U; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id ld7-20020a1709079c0700b00947ad579408si1600736ejc.695.2023.04.04.09.33.43; Tue, 04 Apr 2023 09:34:27 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@ventanamicro.com header.s=google header.b=LHZgxx0U; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232964AbjDDQbq (ORCPT + 99 others); Tue, 4 Apr 2023 12:31:46 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:37592 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231859AbjDDQbp (ORCPT ); Tue, 4 Apr 2023 12:31:45 -0400 Received: from mail-wm1-x32e.google.com (mail-wm1-x32e.google.com [IPv6:2a00:1450:4864:20::32e]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 2A1213C28 for ; Tue, 4 Apr 2023 09:31:38 -0700 (PDT) Received: by mail-wm1-x32e.google.com with SMTP id p34so19400134wms.3 for ; Tue, 04 Apr 2023 09:31:38 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ventanamicro.com; s=google; t=1680625896; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:from:to:cc:subject:date:message-id:reply-to; bh=OR8OPThlLXGOEBzYBzmSAN3iW0DfsF9WhugEl5eryYw=; b=LHZgxx0Uvqxgjrf9lhng7dAr6TPPHiTRSKrHXCTOtfOb8CYs4/EMFMoV1OzLZWpwGR uq1Jc8hrSzDxUZmY9iskBKhG6Gb/jRP4Ul9SoRgv/mTWBAwTA0kpBlcUwHyVMHh2XU8d j1BIZOEYD1hNgZfX3t+E5OEiaQjqGk76+ox4DnS/k/gsu1Jjtqpq1jCK/0uJB/7QtjTe ksE9+t0invgTY2bO5mrO31j0VH4o2dsGeuHSX/6YMIXa4rR5w8HXnQDkUILE/0p/jgw+ u21UHAMDVVtuVrK75caes0MEJPONWdF3MpjpTGvyOeveu1FEpoWTk1XWupW9P4+970+h ByQw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; t=1680625896; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to; bh=OR8OPThlLXGOEBzYBzmSAN3iW0DfsF9WhugEl5eryYw=; b=bkChDQWvr9vMZ6O3CaawN/5dIXyZgdrMXoxd+ypmTHjlU7JW695czomkl5XL8FiPOn p2SWA0/BoRZ5Kcy60OWpTXPkb5gZbt0wPUJqiX9RihJ13/XJgJK3B8syosKqDKZEly3x /AY+JRewPyk8kxxZ3oe/q0y5zCBy1A7ESP+46tfCO9/deGwlw2YnDo7RaGKKUYjF9G2S vNGoCJHelYCJIoKQmEhJHkrx+z46Q0XYcg9XoPioMdQrXZ3GHUSzdYuebPF/8Hczg1QK I/7qEo0N6Z5Hqk+gSy9xXg8U3VBTmh/NL84LoaiY06D49A8tP83DNR+KY7U+sctGfsu7 8+KA== X-Gm-Message-State: AAQBX9dcVmJg2oKN8sRgmqDT+316poA3mhvAMKvNcNlaxrHwyZLGSKx2 jjZTq9+2FPzl3Sv3QZvD9vnBkg== X-Received: by 2002:a7b:c416:0:b0:3ee:6d55:8b73 with SMTP id k22-20020a7bc416000000b003ee6d558b73mr2636111wmi.29.1680625896621; Tue, 04 Apr 2023 09:31:36 -0700 (PDT) Received: from localhost (2001-1ae9-1c2-4c00-20f-c6b4-1e57-7965.ip6.tmcz.cz. [2001:1ae9:1c2:4c00:20f:c6b4:1e57:7965]) by smtp.gmail.com with ESMTPSA id p1-20020a7bcc81000000b003ef5b011b30sm15638088wma.8.2023.04.04.09.31.36 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 04 Apr 2023 09:31:36 -0700 (PDT) Date: Tue, 4 Apr 2023 18:31:35 +0200 From: Andrew Jones To: Anup Patel Cc: Paolo Bonzini , Atish Patra , Palmer Dabbelt , Paul Walmsley , Anup Patel , kvm@vger.kernel.org, kvm-riscv@lists.infradead.org, linux-riscv@lists.infradead.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH v4 8/9] RISC-V: KVM: Virtualize per-HART AIA CSRs Message-ID: References: <20230404153452.2405681-1-apatel@ventanamicro.com> <20230404153452.2405681-9-apatel@ventanamicro.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20230404153452.2405681-9-apatel@ventanamicro.com> X-Spam-Status: No, score=-0.2 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_NONE,SPF_HELO_NONE,SPF_PASS autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, Apr 04, 2023 at 09:04:51PM +0530, Anup Patel wrote: > The AIA specification introduce per-HART AIA CSRs which primarily > support: > * 64 local interrupts on both RV64 and RV32 > * priority for each of the 64 local interrupts > * interrupt filtering for local interrupts > > This patch virtualize above mentioned AIA CSRs and also extend > ONE_REG interface to allow user-space save/restore Guest/VM > view of these CSRs. > > Signed-off-by: Anup Patel > --- > arch/riscv/include/asm/kvm_aia.h | 88 ++++---- > arch/riscv/include/uapi/asm/kvm.h | 7 + > arch/riscv/kvm/aia.c | 322 ++++++++++++++++++++++++++++++ > 3 files changed, 382 insertions(+), 35 deletions(-) > Reviewed-by: Andrew Jones