From patchwork Thu Feb 29 06:53:11 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Yi Wang X-Patchwork-Id: 13576639 Received: from mail-pl1-f178.google.com (mail-pl1-f178.google.com [209.85.214.178]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 757AD4594C; Thu, 29 Feb 2024 06:53:48 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.214.178 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1709189629; cv=none; b=dl1AUsKBrS3tUOK/67sk/CMJ6sgVIu3z+smk5Tm1WeIKuh3pHvz9Zo932TmTMtnFEdSAvnHRn424g14xLmgoLK70PsDc56eC0HxMMbkFSX2EKTInMGwXoMIhW7IHQ3MRvtaoWSlRieLC7sRbZoDfHw4vNc/4qvwEK9DVYyQ336g= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1709189629; c=relaxed/simple; bh=rpPUI8/Ilc1h0gZrxlo0S9MkxaA5lzl3nhDeUQz8WlY=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=lZ4xHPETObuGQyZyI7fhb6M5jNEriaFhKo2CcX81x7wmjbXipLgJQ0HYQeU5p/KmQomXDBnAmrQwtfwyk/o+TPGNugLrlgHfZheoAq0yalP2Lj/PVB0LV4RMUu/G0baAHcoXfntadJ5YUyFupRQh1ZQe27W0Jm5ANLJHOLqkfqk= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com; spf=pass smtp.mailfrom=gmail.com; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b=lpsomyGm; arc=none smtp.client-ip=209.85.214.178 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="lpsomyGm" Received: by mail-pl1-f178.google.com with SMTP id d9443c01a7336-1dc96f64c10so5996475ad.1; Wed, 28 Feb 2024 22:53:48 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1709189628; x=1709794428; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=LzYCOce5vbS2RbT3cfrlWimjZLlkPfrhe1IV1KHmmpQ=; b=lpsomyGmik/3vO9sZ4IA21YIOlmSpYdnlnEDKodzBGH067choMFeG3lAv9pjYKLmre DUzql0CMm1HTwyLXqiuHvq1A4V4xxKE2w2akUG3PXBZMoqS8rGyE0WHasSNRgY04s+iT yvMs/gavcw421rKf6FYXLuyAMFr4wTDz1RKoHZnmyWknFAJ3+U6hs5/8xl0ROrxG2E0M WrVicFcOd5BkiCgaN/4LKVU6VRetMS5hMZwYlBxZCNEdxQToM/xBU0GzWL3oJ5K6G8Gl kDuHhtpILW6QN8kCti6fBbnniAHDm6/bE4fMzsh0Rz9HWDB4Izd5XXObHpVjEf3wqvue uXnQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1709189628; x=1709794428; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=LzYCOce5vbS2RbT3cfrlWimjZLlkPfrhe1IV1KHmmpQ=; b=TM+g7QOkxoPgvfUWGxRcVA/P9JoeddpwyohQHTIY5rANWeTMc1FBRaY6CNzOq4qT4O oJemr0mr7jLecABwJ0oD260eplFgvnx9Oo2MgPqQeV7tPsbQkGi6BKG+1t+wGevoGQ32 neOyhbdiw2t4oXz+eeUfjCDcvSmovc/V8QV69g2mxIauX9CX24H6Jl6oGQCbMAAwhTel XuHm4QkkckrUTaIFI5cb0Di/eqVlWtXml10u/Y9TRQNp7gLu3C1ODXY2+YVhyBeiXvus J8PvXb3+NFfEyzjd4M17Y5I4l8+Y4e+w1Og1BVFQ3eJOgY9IGXA+6Tbxj3yjyo2i7U92 EEPQ== X-Forwarded-Encrypted: i=1; AJvYcCVWrv5/7w/vQSorZxZJWauCwTslo6mcf/wAWLeznuJybeRPiqTwTsAQCyDQ+cr5cKUtAVZ+bQ3T2VFuGwGvV/fSZk43S5sxfgAafqCohp5C/qZH1y1GzxCD/LqEkiQ7J6Um X-Gm-Message-State: AOJu0YwGw8924YSRmfJ/ekh8m4gMn5VwBV6mDqsYyrkHD8/WKqhP1NiQ CEQYWqPjronU27OjY81uE9wmfQYizrf3CtJ5JfbbN+Zs6v/zLjZV X-Google-Smtp-Source: AGHT+IGda8LP7RnnCF1XOEo6jvOCk88OmaEv0BmiQ3NUSVYHPR/reUiX2a6zIhwxj1w+wf9y9XY1mg== X-Received: by 2002:a17:902:c403:b0:1db:ecf1:3b67 with SMTP id k3-20020a170902c40300b001dbecf13b67mr1673914plk.66.1709189627675; Wed, 28 Feb 2024 22:53:47 -0800 (PST) Received: from localhost.localdomain ([43.132.141.8]) by smtp.gmail.com with ESMTPSA id c10-20020a170903234a00b001dc0d1fb3b1sm610509plh.58.2024.02.28.22.53.43 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 28 Feb 2024 22:53:47 -0800 (PST) From: Yi Wang X-Google-Original-From: Yi Wang To: seanjc@google.com, pbonzini@redhat.com, tglx@linutronix.de, mingo@redhat.com, bp@alien8.de, dave.hansen@linux.intel.com, x86@kernel.org, hpa@zytor.com, kvm@vger.kernel.org, linux-kernel@vger.kernel.org, wanpengli@tencent.com, foxywang@tencent.com, oliver.upton@linux.dev, maz@kernel.org, anup@brainfault.org, atishp@atishpatra.org, borntraeger@linux.ibm.com, frankja@linux.ibm.com, imbrenda@linux.ibm.com Cc: up2wing@gmail.com Subject: [RESEND v3 1/3] KVM: setup empty irq routing when create vm Date: Thu, 29 Feb 2024 14:53:11 +0800 Message-Id: <20240229065313.1871095-2-foxywang@tencent.com> X-Mailer: git-send-email 2.39.3 In-Reply-To: <20240229065313.1871095-1-foxywang@tencent.com> References: <20240229065313.1871095-1-foxywang@tencent.com> Precedence: bulk X-Mailing-List: kvm@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 From: Yi Wang Add a new function to setup empty irq routing in kvm path, which can be invoded in non-architecture-specific functions. The difference compared to the kvm_setup_empty_irq_routing() is this function just alloc the empty irq routing and does not need synchronize srcu, as we will call it in kvm_create_vm(). Using the new adding function, we can setup empty irq routing when kvm_create_vm(), so that x86 and s390 no longer need to set empty/dummy irq routing when creating an IRQCHIP 'cause it avoid an synchronize_srcu. Signed-off-by: Yi Wang --- include/linux/kvm_host.h | 1 + virt/kvm/irqchip.c | 19 +++++++++++++++++++ virt/kvm/kvm_main.c | 4 ++++ 3 files changed, 24 insertions(+) diff --git a/include/linux/kvm_host.h b/include/linux/kvm_host.h index 4944136efaa2..e91525c0a4ea 100644 --- a/include/linux/kvm_host.h +++ b/include/linux/kvm_host.h @@ -2000,6 +2000,7 @@ int kvm_set_irq_routing(struct kvm *kvm, const struct kvm_irq_routing_entry *entries, unsigned nr, unsigned flags); +int kvm_setup_empty_irq_routing_lockless(struct kvm *kvm); int kvm_set_routing_entry(struct kvm *kvm, struct kvm_kernel_irq_routing_entry *e, const struct kvm_irq_routing_entry *ue); diff --git a/virt/kvm/irqchip.c b/virt/kvm/irqchip.c index 1e567d1f6d3d..90fc43bd0fe4 100644 --- a/virt/kvm/irqchip.c +++ b/virt/kvm/irqchip.c @@ -237,3 +237,22 @@ int kvm_set_irq_routing(struct kvm *kvm, return r; } + +int kvm_setup_empty_irq_routing_lockless(struct kvm *kvm) +{ + struct kvm_irq_routing_table *new; + u32 i, j; + + new = kzalloc(struct_size(new, map, 1), GFP_KERNEL_ACCOUNT); + if (!new) + return -ENOMEM; + + new->nr_rt_entries = 1; + for (i = 0; i < KVM_NR_IRQCHIPS; i++) + for (j = 0; j < KVM_IRQCHIP_NUM_PINS; j++) + new->chip[i][j] = -1; + + RCU_INIT_POINTER(kvm->irq_routing, new); + + return 0; +} diff --git a/virt/kvm/kvm_main.c b/virt/kvm/kvm_main.c index 7db96875ac46..db1b13fc0502 100644 --- a/virt/kvm/kvm_main.c +++ b/virt/kvm/kvm_main.c @@ -1242,6 +1242,10 @@ static struct kvm *kvm_create_vm(unsigned long type, const char *fdname) if (r) goto out_err; + r = kvm_setup_empty_irq_routing_lockless(kvm); + if (r) + goto out_err; + mutex_lock(&kvm_lock); list_add(&kvm->vm_list, &vm_list); mutex_unlock(&kvm_lock); From patchwork Thu Feb 29 06:53:12 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Yi Wang X-Patchwork-Id: 13576640 Received: from mail-pl1-f175.google.com (mail-pl1-f175.google.com [209.85.214.175]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id BAEB44779E; Thu, 29 Feb 2024 06:53:52 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.214.175 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1709189634; cv=none; b=kuS8ay/xPh9Ks0hEnNU01Ry6EJndcdTloM0Undn6tDoZbQwhmVqA2tPEOrbIjhiv9hXXuSZ68V+NPGAMnAwrE9DLrMVV2KWLd4YpmM0tmmnlUX+BqFUjDQBZLkgrqQwHVHVHqRVKgPl+YwTBj1GLFjim6WKmdsQEEq/RLhlmnkQ= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1709189634; c=relaxed/simple; bh=wLkR7aEG/EhxVLXUVeeUJKpIDRx2DyXyAakTyAkuIO8=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=oRGqGoPhwMCqB6wnCcdoQriWjNbYgnprknXEU77mUIIyy6LdOJPO+deG0qD7NoBt85XaqhAPB9NA7kMctvZO1RqOeTgxUVn+jHr3Uaop+1DAh92in7+X3msMr5xBPChyyeTaD7BzJahN4xbfSkCy0ASGjKC1y1dUhdkX/McNtGI= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com; spf=pass smtp.mailfrom=gmail.com; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b=HkcnJtsj; arc=none smtp.client-ip=209.85.214.175 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="HkcnJtsj" Received: by mail-pl1-f175.google.com with SMTP id d9443c01a7336-1dc5d0162bcso5874685ad.0; Wed, 28 Feb 2024 22:53:52 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1709189632; x=1709794432; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=fPGkmifTwwHLgO5fJhv34X15SDCvJK/C4nnS1+TZMW0=; b=HkcnJtsjwpxsYl71eefUiGDDqfww2cmp0ycPhXwhw5oddEVbQTjCpHZuV8xGPrmjDA fDz/I4Y97eI6G4vPLhO3TW5UtXE5AEQCiiDrD0pdwtTFqXcEPHqbGl0B7lGrAzLWoTYF rGtXKynki3WJSBRUQ2ibFwNTfoPiurI1e/qkoXCBBxNEw7XoEbssLtAZIxU0KLI+PvbI 1X+HZWVTuV2GpOTB7ViQ66ABtazfOCXB0SZP4yYsUr7kVTwhPjoGyIdZ/R5ZTALZf6dv NGCiwtscXI7MrFKjkGEHPQId/6mw3fCRJwSdK4Q6+u+rzjboCIJuaU3WbLQ8XhwR2+si GoSg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1709189632; x=1709794432; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=fPGkmifTwwHLgO5fJhv34X15SDCvJK/C4nnS1+TZMW0=; b=ba0qw5vqQkbGntBWVlMn94OPfyooejUsxddIyTKBDCZqQvlbj9yZRqypYqAugREsEf 6vHXtQUrsXRlp5zx6oJAKVZlQ3dtbATGsONSGmDLtnopEO37ZAWZ9VLPCxlCGD0x2wlp txhk3sP1gpS+mJtuKQKmOACXfKUA6ERNFgd5C6JYSF1skd4QY+xkQBh/v/6MGTknzKsb 9zRC+yMxAf1mAx4KzSpRyxx5B9sEP18X/wZ+gsHt/2pX8H04VV3/flqIFs2CYRDxG3nM K1qed/RcyLKKAkgN4VgDYK9Z6/guOG4TNIUVjTd/+7a4vedFzwCbSSKdKrayGfSTJxww OpXw== X-Forwarded-Encrypted: i=1; AJvYcCWwv1d+mFdok01j0WSVDFDe17zBpgP6g6yJphlIKZTmYVBzuvdnzNahswk6AKfP8hVNzDednjDm/7zrQJhbLBTb1aDMIOI5zgrsj6KGE1vEj+EEzW+exVMJtUY1GyGgFjUM X-Gm-Message-State: AOJu0YwWeTcQ7QpBC2W0b2+AVKpVpc716aOAmZqpaQOI0R9VrhvxLJk5 5+aW9YZT521KRruZ4/DoubiFJ92sN2UWbXzt+0rk7cBF/ezDDyNT X-Google-Smtp-Source: AGHT+IEoVX+qNwQIdAZwon0zsOUV+m9tJa1G03TE/+hKAZWcCwptiImQH4ixo0jkpb35EouxZiB2WA== X-Received: by 2002:a17:902:eccc:b0:1dc:7b6:867a with SMTP id a12-20020a170902eccc00b001dc07b6867amr1473111plh.21.1709189632045; Wed, 28 Feb 2024 22:53:52 -0800 (PST) Received: from localhost.localdomain ([43.132.141.8]) by smtp.gmail.com with ESMTPSA id c10-20020a170903234a00b001dc0d1fb3b1sm610509plh.58.2024.02.28.22.53.47 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 28 Feb 2024 22:53:51 -0800 (PST) From: Yi Wang X-Google-Original-From: Yi Wang To: seanjc@google.com, pbonzini@redhat.com, tglx@linutronix.de, mingo@redhat.com, bp@alien8.de, dave.hansen@linux.intel.com, x86@kernel.org, hpa@zytor.com, kvm@vger.kernel.org, linux-kernel@vger.kernel.org, wanpengli@tencent.com, foxywang@tencent.com, oliver.upton@linux.dev, maz@kernel.org, anup@brainfault.org, atishp@atishpatra.org, borntraeger@linux.ibm.com, frankja@linux.ibm.com, imbrenda@linux.ibm.com Cc: up2wing@gmail.com Subject: [RESEND v3 2/3] KVM: x86: don't setup empty irq routing when KVM_CAP_SPLIT_IRQCHIP Date: Thu, 29 Feb 2024 14:53:12 +0800 Message-Id: <20240229065313.1871095-3-foxywang@tencent.com> X-Mailer: git-send-email 2.39.3 In-Reply-To: <20240229065313.1871095-1-foxywang@tencent.com> References: <20240229065313.1871095-1-foxywang@tencent.com> Precedence: bulk X-Mailing-List: kvm@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 From: Yi Wang We found that it may cost more than 20 milliseconds very accidentally to enable cap of KVM_CAP_SPLIT_IRQCHIP on a host which has many vms already. The reason is that when vmm(qemu/CloudHypervisor) invokes KVM_CAP_SPLIT_IRQCHIP kvm will call synchronize_srcu_expedited() and might_sleep and kworker of srcu may cost some delay during this period. As we have set up empty irq routing when creating vm, so this is no need now. Signed-off-by: Yi Wang --- arch/x86/kvm/irq.h | 1 - arch/x86/kvm/irq_comm.c | 5 ----- arch/x86/kvm/x86.c | 3 --- 3 files changed, 9 deletions(-) diff --git a/arch/x86/kvm/irq.h b/arch/x86/kvm/irq.h index c2d7cfe82d00..76d46b2f41dd 100644 --- a/arch/x86/kvm/irq.h +++ b/arch/x86/kvm/irq.h @@ -106,7 +106,6 @@ void __kvm_migrate_timers(struct kvm_vcpu *vcpu); int apic_has_pending_timer(struct kvm_vcpu *vcpu); int kvm_setup_default_irq_routing(struct kvm *kvm); -int kvm_setup_empty_irq_routing(struct kvm *kvm); int kvm_irq_delivery_to_apic(struct kvm *kvm, struct kvm_lapic *src, struct kvm_lapic_irq *irq, struct dest_map *dest_map); diff --git a/arch/x86/kvm/irq_comm.c b/arch/x86/kvm/irq_comm.c index 16d076a1b91a..99bf53b94175 100644 --- a/arch/x86/kvm/irq_comm.c +++ b/arch/x86/kvm/irq_comm.c @@ -392,11 +392,6 @@ int kvm_setup_default_irq_routing(struct kvm *kvm) static const struct kvm_irq_routing_entry empty_routing[] = {}; -int kvm_setup_empty_irq_routing(struct kvm *kvm) -{ - return kvm_set_irq_routing(kvm, empty_routing, 0, 0); -} - void kvm_arch_post_irq_routing_update(struct kvm *kvm) { if (!irqchip_split(kvm)) diff --git a/arch/x86/kvm/x86.c b/arch/x86/kvm/x86.c index cec0fc2a4b1c..6a2e786aca22 100644 --- a/arch/x86/kvm/x86.c +++ b/arch/x86/kvm/x86.c @@ -6414,9 +6414,6 @@ int kvm_vm_ioctl_enable_cap(struct kvm *kvm, goto split_irqchip_unlock; if (kvm->created_vcpus) goto split_irqchip_unlock; - r = kvm_setup_empty_irq_routing(kvm); - if (r) - goto split_irqchip_unlock; /* Pairs with irqchip_in_kernel. */ smp_wmb(); kvm->arch.irqchip_mode = KVM_IRQCHIP_SPLIT; From patchwork Thu Feb 29 06:53:13 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Yi Wang X-Patchwork-Id: 13576656 Received: from mail-il1-f182.google.com (mail-il1-f182.google.com [209.85.166.182]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 42E61482CD; Thu, 29 Feb 2024 06:53:57 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.166.182 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1709189638; cv=none; b=r5BG5T45awgHUZ9YJQ+HjM9Gzqj37ZI0vcnQf1Ipy5ieyN+gncMyOeNjYpe1cIWadEq2GBgYpsGbWn4MGw5X9eT14P0JFvbP4zRnnWC+Z6zAfIrYFmmiOPAUFnFDuj+P9L2ZCiPE4nk0RdJKUUwriAx06W+PoCZ05DSVW6NY0rs= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1709189638; c=relaxed/simple; bh=RW46AqXVXgdtflxt/tkQwZU7j0j/bAs5uWwQ7lFOUZk=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=eGLsoKn+ef8ghltKcOjwVKBHR39qU5Mfehvthz9nlQchYWbpyyi1+EHwHkfmqxc3dc+E8aaFllFTPE/7GV5ww+KZ910gUDPalrAlmzBMpk6qscCZRsqxqjQAb1h6nhTEp0NQGhKcbS+MfdgUI6USPPqxV5Bc9HIBOB5Yu4F31wc= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com; spf=pass smtp.mailfrom=gmail.com; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b=ViyQo3fm; arc=none smtp.client-ip=209.85.166.182 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="ViyQo3fm" Received: by mail-il1-f182.google.com with SMTP id e9e14a558f8ab-36524116e30so2469855ab.0; Wed, 28 Feb 2024 22:53:57 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1709189636; x=1709794436; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=8UmsTcmfc8pcbPs6rRpAkpag+IwA6bQ9uQr+vxsTK1Q=; b=ViyQo3fmtfinBYxKe8QqrHVPbssoQvAH6+NHcb0Gnbaz3FgbGHG+FsHP2aVvtcoh+g 7DIuE1I6+xHho1ivg931zApG9p1quYY/YLIQjsMY+sz9pkw4i3K4aIreXhs6L25/eoyF h13lty4yjBQseXpHeL4t1I03eCl6S0B7snv0mKwxVjHNvrANA5774At9CGD7Dsfdu587 C8owlMe/ADJTnzctVjVHe4MC+fdYQQkSjORnY7J9Sx5it2xHNceuDlBag1NOcUqKJ3fc M7TX9XOIQ4YTc8ZzUY79LA+HXOSK4NVtX4DvC+xVAhNPSNtnXivNncf6kjOl9aF97u4x DEfA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1709189636; x=1709794436; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=8UmsTcmfc8pcbPs6rRpAkpag+IwA6bQ9uQr+vxsTK1Q=; b=vglaw5dOXYICj0BCt+wbtrw66UZjqawNMbOaN8Os2+Zukh0nUNXnHTy7OUQ0V/uWRx iaanWd5dlipuJ+87bKtLwHzyOUUi3u83hYkPioiAUted8Gk8c8C4JlKLJ6Ji7zA3srFB lFS8osH/w2VnxSzOV2f4W4slIV38/WjG2J0LrXtRzrVUi+OW5PuOdjcX9vZsxqpTQ47o 8ppFid4SXy25MsiXAK3kNLrjQNJePAq1sm0LLDV3AwmlfV1hVkOvs5sQbkCnmjwE6Po2 wvilvpC3hB/QyoIt4ogAENzkk05d3RWNk7kLSz75VYoGu1jBziQfCYTGBD918ewKMRXv lsGQ== X-Forwarded-Encrypted: i=1; AJvYcCVI7zBYcBK8Us8UWvBJBzvgDHFEZDn5KN+WhRnoQ51INHh7Ny46Fn8NMU7IVykLvQ+8x1DLMdIxBsVmHPCUib4MruEXbT9QsYymtIvd2qHdAZZG8azUk8KE/btMbUCYGp+/ X-Gm-Message-State: AOJu0YyKabS56GLJ4y9eecrfc3hNWqIFnwDBudejJ6CyF6vcy4xIVqZv wMJp216FNy7cQivzFsz6gOsuUlyUObEHSSqWwgEvWfKPGB67ELwi X-Google-Smtp-Source: AGHT+IHlIp65PB6Q5D7qxrYJAwPprIVvCnjTGU5iWAN6KoV2G76wnsFViT2u280sNfIex3ohjklECA== X-Received: by 2002:a92:d5c7:0:b0:365:13a8:4090 with SMTP id d7-20020a92d5c7000000b0036513a84090mr1399857ilq.27.1709189636394; Wed, 28 Feb 2024 22:53:56 -0800 (PST) Received: from localhost.localdomain ([43.132.141.8]) by smtp.gmail.com with ESMTPSA id c10-20020a170903234a00b001dc0d1fb3b1sm610509plh.58.2024.02.28.22.53.52 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 28 Feb 2024 22:53:56 -0800 (PST) From: Yi Wang X-Google-Original-From: Yi Wang To: seanjc@google.com, pbonzini@redhat.com, tglx@linutronix.de, mingo@redhat.com, bp@alien8.de, dave.hansen@linux.intel.com, x86@kernel.org, hpa@zytor.com, kvm@vger.kernel.org, linux-kernel@vger.kernel.org, wanpengli@tencent.com, foxywang@tencent.com, oliver.upton@linux.dev, maz@kernel.org, anup@brainfault.org, atishp@atishpatra.org, borntraeger@linux.ibm.com, frankja@linux.ibm.com, imbrenda@linux.ibm.com Cc: up2wing@gmail.com Subject: [RESEND v3 3/3] KVM: s390: don't setup dummy routing when KVM_CREATE_IRQCHIP Date: Thu, 29 Feb 2024 14:53:13 +0800 Message-Id: <20240229065313.1871095-4-foxywang@tencent.com> X-Mailer: git-send-email 2.39.3 In-Reply-To: <20240229065313.1871095-1-foxywang@tencent.com> References: <20240229065313.1871095-1-foxywang@tencent.com> Precedence: bulk X-Mailing-List: kvm@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 From: Yi Wang As we have setup empty irq routing in kvm_create_vm(), there's no need to setup dummy routing when KVM_CREATE_IRQCHIP. Signed-off-by: Yi Wang --- arch/s390/kvm/kvm-s390.c | 9 +-------- 1 file changed, 1 insertion(+), 8 deletions(-) diff --git a/arch/s390/kvm/kvm-s390.c b/arch/s390/kvm/kvm-s390.c index acc81ca6492e..dec3c026a6c1 100644 --- a/arch/s390/kvm/kvm-s390.c +++ b/arch/s390/kvm/kvm-s390.c @@ -2999,14 +2999,7 @@ int kvm_arch_vm_ioctl(struct file *filp, unsigned int ioctl, unsigned long arg) break; } case KVM_CREATE_IRQCHIP: { - struct kvm_irq_routing_entry routing; - - r = -EINVAL; - if (kvm->arch.use_irqchip) { - /* Set up dummy routing. */ - memset(&routing, 0, sizeof(routing)); - r = kvm_set_irq_routing(kvm, &routing, 0, 0); - } + r = 0; break; } case KVM_SET_DEVICE_ATTR: {