From patchwork Fri Nov 4 15:46:18 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: XiakaiPan <13212017962@163.com> X-Patchwork-Id: 1699659 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@legolas.ozlabs.org Authentication-Results: legolas.ozlabs.org; spf=none (no SPF record) smtp.mailfrom=lists.infradead.org (client-ip=2607:7c80:54:3::133; helo=bombadil.infradead.org; envelope-from=kvm-riscv-bounces+incoming=patchwork.ozlabs.org@lists.infradead.org; receiver=) Authentication-Results: legolas.ozlabs.org; dkim=pass (2048-bit key; secure) header.d=lists.infradead.org header.i=@lists.infradead.org header.a=rsa-sha256 header.s=bombadil.20210309 header.b=JZHatGc3; dkim=fail reason="signature verification failed" (1024-bit key; unprotected) header.d=163.com header.i=@163.com header.a=rsa-sha256 header.s=s110527 header.b=F+qHaSFR; dkim-atps=neutral Received: from bombadil.infradead.org (bombadil.infradead.org [IPv6:2607:7c80:54:3::133]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-384) server-digest SHA384) (No client certificate requested) by legolas.ozlabs.org (Postfix) with ESMTPS id 4N3lNf0gh0z23ls for ; Sat, 5 Nov 2022 02:46:41 +1100 (AEDT) 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:MIME-Version:Message-Id:Date:Subject:Cc :To:From:Reply-To:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:In-Reply-To:References: List-Owner; bh=DywJwOupx6AR2G9l67i6VRTai13Fi9UtojdT1kuQ0oQ=; b=JZHatGc3mEWnxY gOEYFCIvxswowGXj8QkYG7ZBqPr51EfuaEqvJh9os4vY016HPSlWwhsYn+SD7dq1o7Ogt2WNUKMpE lcgW9ssRH7pI4u7jOfk0qW/5dHomj47teaZUKSvS2hGB8n0wfDsWj7S6JY/UXEJYSfrPH0Wg1UW6A 5vCt0g+7AMeHuT7k6C8GgKzylmLdxRMR0IxGz4qYrPucwsoaueYM1xDY15WCP2iP8X/MLNFmlAcPI IHY9e4oFkG6DHwituqBgDJZJrzkgLO4Qz2xfE5Qj3bpN8seIU+h1eYsA1L1PMiU2hk2TJyV8iMuri No1PdF71q52VUsAni1Pw==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1oqytx-004K0I-8v; Fri, 04 Nov 2022 15:46:37 +0000 Received: from m12-12.163.com ([220.181.12.12]) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1oqytu-004JyT-Kr for kvm-riscv@lists.infradead.org; Fri, 04 Nov 2022 15:46:36 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=163.com; s=s110527; h=From:Subject:Date:Message-Id:MIME-Version; bh=+Ic5j 0YuCtJDxLI8df4FVObDettTtqEa8wFfgJYiblI=; b=F+qHaSFR4I3Fi3/hkePzm Ct5ZHQ+6D18P6AYFVTV9eDtAY6Mqix89MZSYmmvukytL8XOdIK/Da/ig2+VVfwwc TXc7U+4DVFsxqQS4fasbyWWp6woreW+W6ga74tMqUcBbDgpu79r/h4IHtyOqQr5S irGIJbRD6nSx8l/NXlYE1I= Received: from DESKTOP-DSBNAJ5.localdomain (unknown [58.60.1.25]) by smtp8 (Coremail) with SMTP id DMCowACnLAvMM2VjkDwVmQ--.3036S2; Fri, 04 Nov 2022 23:46:21 +0800 (CST) From: XiakaiPan <13212017962@163.com> To: kvm-riscv@lists.infradead.org Cc: anup@brainfault.org, atishp@atishpatra.org, XiakaiPan <13212017962@163.com> Subject: [PATCH] RISC-V KVM: Add exit logic to main.c Date: Fri, 4 Nov 2022 23:46:18 +0800 Message-Id: <20221104154618.9953-1-13212017962@163.com> X-Mailer: git-send-email 2.25.1 MIME-Version: 1.0 X-CM-TRANSID: DMCowACnLAvMM2VjkDwVmQ--.3036S2 X-Coremail-Antispam: 1Uf129KBjvdXoW7Xr1kCF4DAw45Ary3Jw18Xwb_yoWxArg_ur 92g34xWryxJa17uFyktws8Wr47C395ta98CrnF9ry8WwnxuF47Kw4Fqan8XryUWrs7C3yS 9F4kZw1fXw1UtjkaLaAFLSUrUUUUbb8apTn2vfkv8UJUUUU8Yxn0WfASr-VFAUDa7-sFnT 9fnUUvcSsGvfC2KfnxnUUI43ZEXa7xRiH7KPUUUUU== X-Originating-IP: [58.60.1.25] X-CM-SenderInfo: rprtjiysqrlmiws6il2tof0z/xtbBog2vhVaEGcJxBwAAs6 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20221104_084635_040305_EAFF2826 X-CRM114-Status: UNSURE ( 5.86 ) X-CRM114-Notice: Please train this message. X-Spam-Score: 0.4 (/) X-Spam-Report: Spam detection software, running on the system "bombadil.infradead.org", has NOT identified this incoming email as spam. The original message has been attached to this so you can view it or label similar future email. If you have any questions, see the administrator of that system for details. Content preview: Several lines of code are inserted to remove KVM module normally using rmmod command just like others. Signed-off-by: XiakaiPan --- arch/riscv/kvm/main.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/arch/riscv/kvm/main.c b/arch/riscv/kvm/main.c index 1549205fe..81f1a761d 100644 --- a/arch/riscv/kvm/main.c +++ b/arch/riscv/kvm/main.c @@ -122,6 +122,12 @@ void kvm_arch_exit(void) { } Content analysis details: (0.4 points, 5.0 required) pts rule name description ---- ---------------------- -------------------------------------------------- -0.0 RCVD_IN_DNSWL_NONE RBL: Sender listed at https://www.dnswl.org/, no trust [220.181.12.12 listed in list.dnswl.org] 0.0 FROM_LOCAL_DIGITS From: localpart has long digit sequence 0.3 FROM_LOCAL_HEX From: localpart has long hexadecimal sequence -0.0 SPF_PASS SPF: sender matches SPF record 0.0 SPF_HELO_NONE SPF: HELO does not publish an SPF Record 0.0 FREEMAIL_FROM Sender email is commonly abused enduser mail provider [13212017962[at]163.com] 0.2 FREEMAIL_ENVFROM_END_DIGIT Envelope-from freemail username ends in digit [13212017962[at]163.com] -0.1 DKIM_VALID_AU Message has a valid DKIM or DK signature from author's domain -0.1 DKIM_VALID Message has at least one valid DKIM or DK signature 0.1 DKIM_SIGNED Message has a DKIM or DK signature, not necessarily valid -0.1 DKIM_VALID_EF Message has a valid DKIM or DK signature from envelope-from domain 0.0 RCVD_IN_MSPIKE_H3 RBL: Good reputation (+3) [220.181.12.12 listed in wl.mailspike.net] 0.0 RCVD_IN_MSPIKE_WL Mailspike good senders X-BeenThere: kvm-riscv@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "kvm-riscv" Errors-To: kvm-riscv-bounces+incoming=patchwork.ozlabs.org@lists.infradead.org Several lines of code are inserted to remove KVM module normally using rmmod command just like others. Signed-off-by: XiakaiPan <13212017962@163.com> Reviewed-by: Andrew Jones Tested-by: Andrew Jones --- arch/riscv/kvm/main.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/arch/riscv/kvm/main.c b/arch/riscv/kvm/main.c index 1549205fe..81f1a761d 100644 --- a/arch/riscv/kvm/main.c +++ b/arch/riscv/kvm/main.c @@ -122,6 +122,12 @@ void kvm_arch_exit(void) { } +static void riscv_kvm_exit(void) +{ + kvm_exit(); +} +module_exit(riscv_kvm_exit); + static int riscv_kvm_init(void) { return kvm_init(NULL, sizeof(struct kvm_vcpu), 0, THIS_MODULE);