Received: by 2002:ab2:69cc:0:b0:1fd:c486:4f03 with SMTP id n12csp290350lqp; Tue, 11 Jun 2024 04:59:43 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCWcIWi5v9UY6OSL9qCNrlOatlgwQjRCjHEe8P4JOBXExFI0PyyW7UORCqxe9OdFAa4h4XV52RyQy1f4I6nzukwZWFbXvO8utnHsKDvwdg== X-Google-Smtp-Source: AGHT+IG4jajQfmov+6zobvLmhRtr3Es7pItGUgZGNQzO0KwpRrR+8co6Rmti8WuKPsoX8w2aFXep X-Received: by 2002:a05:620a:4005:b0:795:60b0:3f5 with SMTP id af79cd13be357-79560b004b1mr637032985a.34.1718107183571; Tue, 11 Jun 2024 04:59:43 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1718107183; cv=pass; d=google.com; s=arc-20160816; b=zc0zKeAjxlDoVrO94Y9Bm7OdSYvNMIG4TU55eQfmThrmVs6EKiNUZ/gNvUjoe43CdQ TZE8E8jMR5xFfdQ6m0Hw1H18Dxpdf2lo7kqxA9sQo1/VIlxMJqh4K2nREjyluNFkA495 9CcIvhufDl5nyeCC6PY/Hm8sRNyoF6KHKC/jEtA2qjoXNfIZFvjn8m/ZlfmqWP6MHB9c ZR5Z7CHoOaBhaHHAszhXBkDUxgJBPQifu8tiTqkb7WIFij/9wdCre/QHBCqeMPhfdCCT H8r2MurFpdLvEh4t2Quq6n/Q9LGTYFV7ikgPxIMoEwlObQWif7NWG5GrljV3rC/k0PyO h6Hg== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:in-reply-to:from:content-language :references:cc:to:subject:user-agent:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:date:message-id:dkim-signature; bh=BVDD+SHnGM8xPmCxFaRJQGaImXlzhSHBBAzgtsLhu88=; fh=wDkLZq2H3k2/5qysDNM6HUn5EK/ajuFg5JPOVOIiYmg=; b=cZS+iGMqCHRdvTNzciMH21nPi5dgjoxxksaHD+KI96BL3MgHHEv2BakJ3lI0pJV4Ho /XIpULcKu05jdg7s7G2F0D3Ic3nJXU2AoPdpfcGf4XRA2InXhL/OqfUNZfcFzPsG5NQq nAVXC+4IkMIGLcnYT8SLp+ppDwc8oa0mJ55MpIXevJMC0Hj/daq35NN87Xj7ae60fpbV Mv+4S5xd4Oo5RoYORLnVMgQzxneMcOLl5skM/n6b8iRuo45U5kSeTJebHwtc349Lx5TM OEfqTFpFThqb662Yjb+QwRUNALe9y0GDPlMQVaStJVp1FOQciF4oNR8rQ3Nf7Tqtpnjz 6RRw==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@ibm.com header.s=pp1 header.b=kd7aSeuI; arc=pass (i=1 spf=pass spfdomain=linux.ibm.com dkim=pass dkdomain=ibm.com dmarc=pass fromdomain=linux.ibm.com); spf=pass (google.com: domain of linux-kernel+bounces-209817-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) smtp.mailfrom="linux-kernel+bounces-209817-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=REJECT sp=NONE dis=NONE) header.from=ibm.com Return-Path: Received: from ny.mirrors.kernel.org (ny.mirrors.kernel.org. [147.75.199.223]) by mx.google.com with ESMTPS id d75a77b69052e-44102721069si41457271cf.138.2024.06.11.04.59.43 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 11 Jun 2024 04:59:43 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-209817-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) client-ip=147.75.199.223; Authentication-Results: mx.google.com; dkim=pass header.i=@ibm.com header.s=pp1 header.b=kd7aSeuI; arc=pass (i=1 spf=pass spfdomain=linux.ibm.com dkim=pass dkdomain=ibm.com dmarc=pass fromdomain=linux.ibm.com); spf=pass (google.com: domain of linux-kernel+bounces-209817-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) smtp.mailfrom="linux-kernel+bounces-209817-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=REJECT sp=NONE dis=NONE) header.from=ibm.com Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ny.mirrors.kernel.org (Postfix) with ESMTPS id 9673D1C240D8 for ; Tue, 11 Jun 2024 11:58:42 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id BBB6417C23B; Tue, 11 Jun 2024 11:58:07 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=ibm.com header.i=@ibm.com header.b="kd7aSeuI" Received: from mx0b-001b2d01.pphosted.com (mx0b-001b2d01.pphosted.com [148.163.158.5]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id AD01317997D; Tue, 11 Jun 2024 11:58:04 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=148.163.158.5 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1718107086; cv=none; b=XdZyTQn90QVD/xtgJb/AcDheg3VZ3qoK2ih+hZkBzC6lgX5j+xFOk7hcdPbKirBz4xi/EBvr1wDZ9mkIdmIFAuPtZhzbb2NsnzT7WNjgN04gCXg/4xr7mXqouFDfkr2FzILJSIHCymCat3FXXORTk0pCQVzKpQMyDhtLSdEbf04= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1718107086; c=relaxed/simple; bh=Tv7OLKSK83Mq5dlQVd7OKap0aeF6gI8Ag8/q/WPOlUM=; h=Message-ID:Date:MIME-Version:Subject:To:Cc:References:From: In-Reply-To:Content-Type; b=sIF7kWsrLVRqeCg9fKZM65l39MDUW3XKms3cezCvn/gSxVrwgcNMLtSEHq0f9cmXfNeGKyBdnePoWaku9PhmavlrBGvFhz8awh3PkyuTJ8XLPJnT1CvEs/n6u1Wp/VgNIeHdRTfySl9umSAwq9W1r9nEO6DkB0SLeakeqE+PQOI= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linux.ibm.com; spf=pass smtp.mailfrom=linux.ibm.com; dkim=pass (2048-bit key) header.d=ibm.com header.i=@ibm.com header.b=kd7aSeuI; arc=none smtp.client-ip=148.163.158.5 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linux.ibm.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=linux.ibm.com Received: from pps.filterd (m0353722.ppops.net [127.0.0.1]) by mx0a-001b2d01.pphosted.com (8.18.1.2/8.18.1.2) with ESMTP id 45BBRIl3012967; Tue, 11 Jun 2024 11:57:12 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ibm.com; h= message-id:date:mime-version:subject:to:cc:references:from :in-reply-to:content-type:content-transfer-encoding; s=pp1; bh=B VDD+SHnGM8xPmCxFaRJQGaImXlzhSHBBAzgtsLhu88=; b=kd7aSeuI9AgI6BZUm DqzUGU56OAh7gtpZ8F5eXiJ+Aa/ox4KQ3Z4RclJeFMVpxsCROidNROoajIdmHsur zrm5aDdWuogqLo9jqKnq/pScocgZmw5lrRUsBDlkNV0BWCl98iRXMxn0rcZgepLJ tBkhV5LHdt1JUpsiB2HdJDRvYT7gxMH0emgFKeL5cJDCGjg3t3baRhvbV+EtbPdc avGuSKDvKn6rCPyq41LqOjYG+I2TOWBfrcrKi5kGJW4tXerdsLeWRRTrE6bNymcU xiEjv76yUQiWn1KZW3WVbm7NQxIWnaMT2LjOT2okTb9+I08hqz9Gm9GLzO1KLKz7 /2o0g== Received: from pps.reinject (localhost [127.0.0.1]) by mx0a-001b2d01.pphosted.com (PPS) with ESMTPS id 3ypmv4861t-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Tue, 11 Jun 2024 11:57:12 +0000 (GMT) Received: from m0353722.ppops.net (m0353722.ppops.net [127.0.0.1]) by pps.reinject (8.18.0.8/8.18.0.8) with ESMTP id 45BBvB2G022708; Tue, 11 Jun 2024 11:57:11 GMT Received: from ppma22.wdc07v.mail.ibm.com (5c.69.3da9.ip4.static.sl-reverse.com [169.61.105.92]) by mx0a-001b2d01.pphosted.com (PPS) with ESMTPS id 3ypmv485xx-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Tue, 11 Jun 2024 11:57:11 +0000 (GMT) Received: from pps.filterd (ppma22.wdc07v.mail.ibm.com [127.0.0.1]) by ppma22.wdc07v.mail.ibm.com (8.17.1.19/8.17.1.19) with ESMTP id 45B9wWfk027246; Tue, 11 Jun 2024 11:53:14 GMT Received: from smtprelay03.fra02v.mail.ibm.com ([9.218.2.224]) by ppma22.wdc07v.mail.ibm.com (PPS) with ESMTPS id 3yn210nqx4-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Tue, 11 Jun 2024 11:53:14 +0000 Received: from smtpav06.fra02v.mail.ibm.com (smtpav06.fra02v.mail.ibm.com [10.20.54.105]) by smtprelay03.fra02v.mail.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id 45BBr7Lb55509402 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Tue, 11 Jun 2024 11:53:09 GMT Received: from smtpav06.fra02v.mail.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id BAD5F2004B; Tue, 11 Jun 2024 11:53:07 +0000 (GMT) Received: from smtpav06.fra02v.mail.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 351B220049; Tue, 11 Jun 2024 11:53:07 +0000 (GMT) Received: from [9.152.224.222] (unknown [9.152.224.222]) by smtpav06.fra02v.mail.ibm.com (Postfix) with ESMTP; Tue, 11 Jun 2024 11:53:07 +0000 (GMT) Message-ID: <4f52b7a1-e289-4a55-ac2c-b3b453a73f30@linux.ibm.com> Date: Tue, 11 Jun 2024 13:53:07 +0200 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [v5 3/3] KVM: s390: don't setup dummy routing when KVM_CREATE_IRQCHIP To: Sean Christopherson , Yi Wang Cc: 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, frankja@linux.ibm.com, imbrenda@linux.ibm.com, weijiang.yang@intel.com References: <20240506101751.3145407-1-foxywang@tencent.com> <20240506101751.3145407-4-foxywang@tencent.com> Content-Language: en-US From: Christian Borntraeger In-Reply-To: Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-TM-AS-GCONF: 00 X-Proofpoint-ORIG-GUID: rsPaGb5rD6UdPoFa-ruBIV7Sl-sTVwVc X-Proofpoint-GUID: RjB1sVNrrivPZoReTF3WFZNKAQMBjY4z X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.293,Aquarius:18.0.1039,Hydra:6.0.680,FMLib:17.12.28.16 definitions=2024-06-11_07,2024-06-11_01,2024-05-17_01 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 clxscore=1011 mlxscore=0 suspectscore=0 adultscore=0 lowpriorityscore=0 bulkscore=0 mlxlogscore=918 impostorscore=0 phishscore=0 priorityscore=1501 malwarescore=0 spamscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.19.0-2405170001 definitions=main-2406110089 Am 10.06.24 um 18:19 schrieb Sean Christopherson: > On Mon, May 06, 2024, Yi Wang wrote: >> 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 5147b943a864..ba7fd39bcbf4 100644 >> --- a/arch/s390/kvm/kvm-s390.c >> +++ b/arch/s390/kvm/kvm-s390.c >> @@ -2998,14 +2998,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; > > This is wrong, KVM_CREATE_IRQCHIP should fail with -EINVAL if kvm->arch.use_irqchip > is false. > > There's also a functional change here, though I highly doubt it negatively affects > userspace. Nothing in s390 prevents invoking KVM_CREATE_IRQCHIP after > KVM_SET_GSI_ROUTING, so userspace could very theoretically use KVM_CREATE_IRQCHIP > to reset to empty IRQ routing. > > Christian, if it works for you, I'll massage it to this when applying. Oops. Yes please do so.