From nobody Wed Nov 27 17:42:36 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of lists.xenproject.org designates 192.237.175.120 as permitted sender) client-ip=192.237.175.120; envelope-from=xen-devel-bounces@lists.xenproject.org; helo=lists.xenproject.org; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of lists.xenproject.org designates 192.237.175.120 as permitted sender) smtp.mailfrom=xen-devel-bounces@lists.xenproject.org ARC-Seal: i=1; a=rsa-sha256; t=1697730096; cv=none; d=zohomail.com; s=zohoarc; b=B1IvKyyC1iR3+K4cqKcJ/zjywY73QvyqgvDyCtUiR25OBXlFOp594YdyCqLtjnwcYmMU+JTwEB1WLSuyGNKz16ewrptJaktXEdnhwP0Pjbwv/0N/9bLsAb58IeXpv/1sc6cedLQTaNUENjgZC2i9C0wdhAOkj/6K6ZgzDFhVaLA= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1697730096; h=Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=2nqUTV3vUpOx9clV41PRsXO9Zf0sXlL57tnkVmGApug=; b=DGarmmTV26yfH6YDD4SuOLN5s80iM0POHQUfMaZQS7lqRpaLmIXMVS/j4BrxGLvKlls8tFTSF3s6OQvsKeYRsz8BdTwu18WwUaGuQALdnqHva9gLw6Mu2PGLNOcmn2shlM1WU7V7fAMniBOGCxLj8f+PgM+nDZxffWWPCGd0pEY= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of lists.xenproject.org designates 192.237.175.120 as permitted sender) smtp.mailfrom=xen-devel-bounces@lists.xenproject.org Return-Path: Received: from lists.xenproject.org (lists.xenproject.org [192.237.175.120]) by mx.zohomail.com with SMTPS id 1697730096890642.487094056376; Thu, 19 Oct 2023 08:41:36 -0700 (PDT) Received: from list by lists.xenproject.org with outflank-mailman.619424.964519 (Exim 4.92) (envelope-from ) id 1qtV8v-0000cv-Cu; Thu, 19 Oct 2023 15:41:01 +0000 Received: by outflank-mailman (output) from mailman id 619424.964519; Thu, 19 Oct 2023 15:41:01 +0000 Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1qtV8v-0000Zm-0t; Thu, 19 Oct 2023 15:41:01 +0000 Received: by outflank-mailman (input) for mailman id 619424; Thu, 19 Oct 2023 15:40:57 +0000 Received: from se1-gles-flk1-in.inumbo.com ([94.247.172.50] helo=se1-gles-flk1.inumbo.com) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1qtV8q-0006dc-Rx for xen-devel@lists.xenproject.org; Thu, 19 Oct 2023 15:40:56 +0000 Received: from desiato.infradead.org (desiato.infradead.org [2001:8b0:10b:1:d65d:64ff:fe57:4e05]) by se1-gles-flk1.inumbo.com (Halon) with ESMTPS id e25ba781-6e95-11ee-9b0e-b553b5be7939; Thu, 19 Oct 2023 17:40:52 +0200 (CEST) Received: from [2001:8b0:10b:1::ebe] (helo=i7.infradead.org) by desiato.infradead.org with esmtpsa (Exim 4.96 #2 (Red Hat Linux)) id 1qtV8M-009yCh-2Y; Thu, 19 Oct 2023 15:40:27 +0000 Received: from dwoodhou by i7.infradead.org with local (Exim 4.96 #2 (Red Hat Linux)) id 1qtV8L-000Ptk-2O; Thu, 19 Oct 2023 16:40:25 +0100 X-Outflank-Mailman: Message body and most headers restored to incoming version X-BeenThere: xen-devel@lists.xenproject.org List-Id: Xen developer discussion List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Errors-To: xen-devel-bounces@lists.xenproject.org Precedence: list X-Inumbo-ID: e25ba781-6e95-11ee-9b0e-b553b5be7939 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=desiato.20200630; h=Sender:Content-Transfer-Encoding: MIME-Version:References:In-Reply-To:Message-Id:Date:Subject:Cc:To:From: Reply-To:Content-Type:Content-ID:Content-Description; bh=2nqUTV3vUpOx9clV41PRsXO9Zf0sXlL57tnkVmGApug=; b=IxYegd780SmdgDUUbQTnWSd/ai wuPPAJoA515FdGO8tU1vSZrNsyj+Eu6YIkOsX/w4u33wqDnGK/ZwF1FZAXaacLiotME7DJPR6U/Jt OuDfbp0EviQEM+jKnxB2735BGSNGjQPB5fQO0QhthLqzSiUxPJRE6nEg1YISAF7SGMMqZmiK5VeSg dzR41WsF4hHTtOF4Yx+UDPvs6VQbtX5ykHz8fZztlFt0rXHlMPaiXHGv2MgylP5snh0qflWdWsndn GcidSGgVKwpcNJ7umDEr2Y0Ng2MicE/qap/rao+XOsK2w46sGJSmaj6tItgKWDiX6XExPu+61OUBD r/Ld6nOw==; From: David Woodhouse To: qemu-devel@nongnu.org Cc: Kevin Wolf , Hanna Reitz , Stefano Stabellini , Anthony Perard , Paul Durrant , =?UTF-8?q?Marc-Andr=C3=A9=20Lureau?= , Paolo Bonzini , Richard Henderson , Eduardo Habkost , "Michael S. Tsirkin" , Marcel Apfelbaum , Jason Wang , Marcelo Tosatti , Cleber Rosa , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , Wainer dos Santos Moschetta , Beraldo Leal , qemu-block@nongnu.org, xen-devel@lists.xenproject.org, kvm@vger.kernel.org, Bernhard Beschow , Joel Upham Subject: [PATCH v2 02/24] i386/xen: fix per-vCPU upcall vector for Xen emulation Date: Thu, 19 Oct 2023 16:39:58 +0100 Message-Id: <20231019154020.99080-3-dwmw2@infradead.org> X-Mailer: git-send-email 2.40.1 In-Reply-To: <20231019154020.99080-1-dwmw2@infradead.org> References: <20231019154020.99080-1-dwmw2@infradead.org> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Sender: David Woodhouse X-SRS-Rewrite: SMTP reverse-path rewritten from by desiato.infradead.org. See http://www.infradead.org/rpr.html X-ZohoMail-DKIM: pass (identity @infradead.org) X-ZM-MESSAGEID: 1697730097255100004 Content-Type: text/plain; charset="utf-8" From: David Woodhouse The per-vCPU upcall vector support had two problems. Firstly it was using the wrong hypercall argument and would always return -EFAULT. And secondly it was using the wrong ioctl() to pass the vector to the kernel and thus the *kernel* would always return -EINVAL. Linux doesn't (yet) use this mode so it went without decent testing for a while. Fixes: 105b47fdf2d0 ("i386/xen: implement HVMOP_set_evtchn_upcall_vector") Signed-off-by: David Woodhouse --- target/i386/kvm/xen-emu.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/target/i386/kvm/xen-emu.c b/target/i386/kvm/xen-emu.c index 0055441b2e..619240398a 100644 --- a/target/i386/kvm/xen-emu.c +++ b/target/i386/kvm/xen-emu.c @@ -306,7 +306,7 @@ static int kvm_xen_set_vcpu_callback_vector(CPUState *c= s) =20 trace_kvm_xen_set_vcpu_callback(cs->cpu_index, vector); =20 - return kvm_vcpu_ioctl(cs, KVM_XEN_HVM_SET_ATTR, &xva); + return kvm_vcpu_ioctl(cs, KVM_XEN_VCPU_SET_ATTR, &xva); } =20 static void do_set_vcpu_callback_vector(CPUState *cs, run_on_cpu_data data) @@ -849,8 +849,7 @@ static bool kvm_xen_hcall_hvm_op(struct kvm_xen_exit *e= xit, X86CPU *cpu, int ret =3D -ENOSYS; switch (cmd) { case HVMOP_set_evtchn_upcall_vector: - ret =3D kvm_xen_hcall_evtchn_upcall_vector(exit, cpu, - exit->u.hcall.params[0]); + ret =3D kvm_xen_hcall_evtchn_upcall_vector(exit, cpu, arg); break; =20 case HVMOP_pagetable_dying: --=20 2.40.1