From patchwork Tue Sep 8 08:13:29 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Haibo Xu X-Patchwork-Id: 249295 Delivered-To: patch@linaro.org Received: by 2002:a92:5b9c:0:0:0:0:0 with SMTP id c28csp4339157ilg; Tue, 8 Sep 2020 01:19:01 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxs+7yuVq+o72334IaQ7pcpnXrphmyFjKRquY5GJHHIhc4lHS2HVi6IYvlrbOKVuiP4ct55 X-Received: by 2002:a25:3b06:: with SMTP id i6mr33019697yba.270.1599553141023; Tue, 08 Sep 2020 01:19:01 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1599553141; cv=none; d=google.com; s=arc-20160816; b=A78YCHloZU+Sj8T4+CRrzjyEViscUlO+dWWQRgCbWZtJ980fk4doD/GuIhQYfgwHIY pcLcd8uMCp/XH1PlK92AfTNllQwXuybYnb66XpILJELSkuRcSj40SnnADcNWxOAdJuxk OW1zItqh8Sr0iF8ne6963G+UjqSHr6VDw1TpuKwsOa0kTb/MWA1B/TXC+zlaA79LtzPi NwP01v2FOoWoV5MVUSbt7bPOksCEzRIGWBF7KsUgJADSjUPMlAdzD1Xdw1CTsCz094oN Cuhk4IXdm8ZCO5YH3bLZlXl2OAjW04ZIIcJsbBUbvQLfVKPCX2/odIaOYKfOolyVelMG YslA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:cc:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:content-transfer-encoding :mime-version:references:in-reply-to:message-id:date:subject:to:from :dkim-signature; bh=65uW6/eJtxdVQ3erFH0nAd+ZJZrP6B7JK355CS4Evd4=; b=E4aNWYFAArhDA0ZoDer1NUdcsz0LiYGbUgWN8dEjWDw1+gtBRcy0/i75qHhaj/qp20 Z1R2G9xjhU6VmmOPT+OQ0PgqwvjlUJOpYwBziHcEGiBXuGOJhmBq2JdS2c5/ub1lA6mw W/Pv4GwCJtqlfVQ/g/lzSE1e19C5H1c1PeDYjWflLZ9Aaa/qQgQPZvGMiwqNIWXDzAEW ZXiZdZLw6/Q8sRSCGTviBvHC0PTnR4eje7ibGtrX/O17y5fOiMLtxbZ7+NgQRokU4cHc 2d9J0n6w7B72yRvopfMQRvYAi0E006ztEXCxdUVVKxRs5xLnXGLTpdxYCnrTThSXYOB1 WsuA== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@linaro.org header.s=google header.b=DtnWrrkp; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from lists.gnu.org (lists.gnu.org. [209.51.188.17]) by mx.google.com with ESMTPS id r23si18487456ybc.448.2020.09.08.01.19.00 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Tue, 08 Sep 2020 01:19:01 -0700 (PDT) Received-SPF: pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; Authentication-Results: mx.google.com; dkim=fail header.i=@linaro.org header.s=google header.b=DtnWrrkp; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from localhost ([::1]:45968 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1kFYqC-0006fq-Hm for patch@linaro.org; Tue, 08 Sep 2020 04:19:00 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:58562) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kFYlL-00065X-SN for qemu-devel@nongnu.org; Tue, 08 Sep 2020 04:13:59 -0400 Received: from mail-pf1-x441.google.com ([2607:f8b0:4864:20::441]:39530) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1kFYlJ-0000Ug-32 for qemu-devel@nongnu.org; Tue, 08 Sep 2020 04:13:59 -0400 Received: by mail-pf1-x441.google.com with SMTP id n14so2383086pff.6 for ; Tue, 08 Sep 2020 01:13:56 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=65uW6/eJtxdVQ3erFH0nAd+ZJZrP6B7JK355CS4Evd4=; b=DtnWrrkppBALmGDk6WyZ9zbWxElLLqFd9TEqM/7gVsatasdVioc4gVzJGhrkQU9CvY r2seFpZkf0Y1tPjBnQyLjqAuOpjzpCRNPksrPmfQNiigepK13Nzi5oVqsvBaVgNd7Yqt rL0zvLs0SSBsVDDts6Zuc+vRtb15G7Rzrwk+j1f9ka9gg+UzTcYTLTc3qaRMgja/OzLf /4wMqxn6l9fb19RXdpnL6D2BN+nM6O7UufmEBfKYS7tKXrYtn3dsCEjegd79OV55L3Cd SCS8xqINFAHT7ELkaZItAMT+PXx+/aful3FmFbCbdJI1Q6sB58nE4NNhcDMe0mOlTi4v ElYA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=65uW6/eJtxdVQ3erFH0nAd+ZJZrP6B7JK355CS4Evd4=; b=InAqCmhOiu0jO7vXx6/dv3cvoD+2QMx4DGflnMASkJSwX7NJwepA5Un3phqEATwT1h fkB7ucnLqo5HzAWtp48sF8HZQuARnSU3zGIOgzbG1VvRTl5LSP+ih/thOXEHmIyBAptl AsFMWCp3Y7mrFK7lpq+xcOXf/TRgqKOTRmWVSDuC9IZXZoJw7CrIuVO6zJiKHAX3+uP9 H/BWODq7esUOuzd+9xMlNuVs/TPZO9OUBY1IJj+zT5RwgxXgFlNPlQHLk7kNLXA2gTHH klD8ldZ9aJdPw2S26TJaktSua4wb/kKZ1AFlUt4IdMfnhksdYVQJfZr8CMLVP3IrvnMN CDGg== X-Gm-Message-State: AOAM5306DJZC//L9hvwSk0F8pgceg2sQWW4Rtdrzr71Sb+7qWsX+E7c3 hVVAPJbsj7TfR+MBIsBQSxgf X-Received: by 2002:a17:902:ba81:b029:d0:cbe1:e7ad with SMTP id k1-20020a170902ba81b02900d0cbe1e7admr104185pls.30.1599552835913; Tue, 08 Sep 2020 01:13:55 -0700 (PDT) Received: from localhost.localdomain ([147.75.106.138]) by smtp.gmail.com with ESMTPSA id m190sm16934788pfm.184.2020.09.08.01.13.54 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 08 Sep 2020 01:13:55 -0700 (PDT) From: Haibo Xu To: drjones@redhat.com, richard.henderson@linaro.org Subject: [PATCH v2 11/12] target/arm/kvm: spe: Enable userspace irqchip support. Date: Tue, 8 Sep 2020 08:13:29 +0000 Message-Id: <6aaa406b824d0c427acbc3f3abfbbe841f3bb93c.1599549462.git.haibo.xu@linaro.org> X-Mailer: git-send-email 2.25.1 In-Reply-To: References: MIME-Version: 1.0 Received-SPF: pass client-ip=2607:f8b0:4864:20::441; envelope-from=haibo.xu@linaro.org; helo=mail-pf1-x441.google.com X-detected-operating-system: by eggs.gnu.org: No matching host in p0f cache. That's all we know. X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=unavailable autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: peter.maydell@linaro.org, qemu-arm@nongnu.org, philmd@redhat.com, qemu-devel@nongnu.org, Haibo Xu Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: "Qemu-devel" Since the current kernel patches haven't enabled the userspace irqchip support, this patch is not verified yet! Signed-off-by: Haibo Xu --- linux-headers/linux/kvm.h | 1 + target/arm/kvm.c | 5 +++++ 2 files changed, 6 insertions(+) -- 2.17.1 Reviewed-by: Andrew Jones diff --git a/linux-headers/linux/kvm.h b/linux-headers/linux/kvm.h index 8840cbb01c..35ef0ae842 100644 --- a/linux-headers/linux/kvm.h +++ b/linux-headers/linux/kvm.h @@ -1672,6 +1672,7 @@ struct kvm_assigned_msix_entry { #define KVM_ARM_DEV_EL1_VTIMER (1 << 0) #define KVM_ARM_DEV_EL1_PTIMER (1 << 1) #define KVM_ARM_DEV_PMU (1 << 2) +#define KVM_ARM_DEV_SPE (1 << 3) struct kvm_hyperv_eventfd { __u32 conn_id; diff --git a/target/arm/kvm.c b/target/arm/kvm.c index 58f991e890..7950ff1d83 100644 --- a/target/arm/kvm.c +++ b/target/arm/kvm.c @@ -820,6 +820,11 @@ MemTxAttrs kvm_arch_post_run(CPUState *cs, struct kvm_run *run) switched_level &= ~KVM_ARM_DEV_PMU; } + if (switched_level & KVM_ARM_DEV_SPE) { + qemu_set_irq(cpu->spe_interrupt, + !!(run->s.regs.device_irq_level & KVM_ARM_DEV_SPE)); + switched_level &= ~KVM_ARM_DEV_SPE; + } if (switched_level) { qemu_log_mask(LOG_UNIMP, "%s: unhandled in-kernel device IRQ %x\n", __func__, switched_level);