Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp3676233imu; Mon, 28 Jan 2019 08:53:28 -0800 (PST) X-Google-Smtp-Source: ALg8bN4a4Kbiuvqfbf0Oj0u84Bd2o96IK+wxzb1U38Z+ngRvQc1Wb5qCC8rgfAloc+4LlPT6jiCP X-Received: by 2002:a62:61c3:: with SMTP id v186mr22797255pfb.55.1548694408814; Mon, 28 Jan 2019 08:53:28 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1548694408; cv=none; d=google.com; s=arc-20160816; b=MZDcl9E/64orU/zmk2Gtk2qXcdVDk1MZichjCzncEzelFCHgJ+MvgV1k6/oRDh5/Jd Z4DfXjkXTX+Od/uSx+4jtpNQxj0Y2ygECxFMvsmbQilt8rxA6IPQC0hSpNOlwv0lz18Z J28aMlQL/jdd+iOz0I5xU8/PCXQvkS63AGY7lIm8n/OwDjddSjE/brM8trBms2jsaVnD ZxemJBm64kUR2Sf1MLYxCbR13KzXYWKvFlw4wKmNgOhLJ/W1zMXgi0VRvj4MmZvqks0A 9BaAgj0Il72wdlqmF+j3iL21DZZDGlQy0z3SpNCIUX4j1n39oJYezAXAFwQKyYby/DaS pPdg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:message-id:content-transfer-encoding :mime-version:organization:references:in-reply-to:subject:cc:to:from :date; bh=Mh3sPp1RmVwS75yjz0KyBwvzJbBAipDT8x13reXb7IA=; b=r2OEX22FamgsIb4LwJAkodq7rL4mZPSRjZbPIKw5IF8BBXqZhVJ4OK1qog/P6VBm9x 3uv9N8WKmjF7LzrLayEQ7eT0Bb2i0/3A0+QKatH69DhtwrIBF+CCF02bmolP6QixqZa4 ALDYALwny9jn1/z+KHKSoofuc0e6msBnhAPQRSJ6uG/i/kLQV9OzUOrNsMo3H9tI+Smq wf/HebjWaDchoSIYS88CMm/aMI2paGOQltg0jEEeyVpnI5pLfFQtbq1TYHuAxDXTlpCl m0ETryoeAApQ5anjFqscb6vzwIqS+gAHYsH6g+C9BfApyu+A4hR1Z71bE9XW6oA5R7cS ezLQ== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=ibm.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id u123si15544254pgb.516.2019.01.28.08.53.13; Mon, 28 Jan 2019 08:53:28 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=ibm.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2388976AbfA1QvH (ORCPT + 99 others); Mon, 28 Jan 2019 11:51:07 -0500 Received: from mx0b-001b2d01.pphosted.com ([148.163.158.5]:41518 "EHLO mx0a-001b2d01.pphosted.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1729197AbfA1QvF (ORCPT ); Mon, 28 Jan 2019 11:51:05 -0500 Received: from pps.filterd (m0098417.ppops.net [127.0.0.1]) by mx0a-001b2d01.pphosted.com (8.16.0.27/8.16.0.27) with SMTP id x0SGhbtc069472 for ; Mon, 28 Jan 2019 11:51:03 -0500 Received: from e06smtp03.uk.ibm.com (e06smtp03.uk.ibm.com [195.75.94.99]) by mx0a-001b2d01.pphosted.com with ESMTP id 2qa3ye5r17-1 (version=TLSv1.2 cipher=AES256-GCM-SHA384 bits=256 verify=NOT) for ; Mon, 28 Jan 2019 11:51:03 -0500 Received: from localhost by e06smtp03.uk.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Mon, 28 Jan 2019 16:51:01 -0000 Received: from b06cxnps4076.portsmouth.uk.ibm.com (9.149.109.198) by e06smtp03.uk.ibm.com (192.168.101.133) with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted; (version=TLSv1/SSLv3 cipher=AES256-GCM-SHA384 bits=256/256) Mon, 28 Jan 2019 16:50:58 -0000 Received: from d06av24.portsmouth.uk.ibm.com (d06av24.portsmouth.uk.ibm.com [9.149.105.60]) by b06cxnps4076.portsmouth.uk.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id x0SGouVp3539248 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=FAIL); Mon, 28 Jan 2019 16:50:56 GMT Received: from d06av24.portsmouth.uk.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id A309942041; Mon, 28 Jan 2019 16:50:56 +0000 (GMT) Received: from d06av24.portsmouth.uk.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 47BE542049; Mon, 28 Jan 2019 16:50:56 +0000 (GMT) Received: from oc2783563651 (unknown [9.152.97.178]) by d06av24.portsmouth.uk.ibm.com (Postfix) with ESMTP; Mon, 28 Jan 2019 16:50:56 +0000 (GMT) Date: Mon, 28 Jan 2019 17:50:54 +0100 From: Halil Pasic To: Michael Mueller Cc: KVM Mailing List , Linux-S390 Mailing List , linux-kernel@vger.kernel.org, Martin Schwidefsky , Heiko Carstens , Christian Borntraeger , Janosch Frank , David Hildenbrand , Cornelia Huck , Pierre Morel Subject: Re: [PATCH v6 07/13] KVM: s390: introduce struct kvm_s390_gisa_interrupt In-Reply-To: <20190124125939.130763-8-mimu@linux.ibm.com> References: <20190124125939.130763-1-mimu@linux.ibm.com> <20190124125939.130763-8-mimu@linux.ibm.com> Organization: IBM X-Mailer: Claws Mail 3.11.1 (GTK+ 2.24.31; x86_64-redhat-linux-gnu) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-TM-AS-GCONF: 00 x-cbid: 19012816-0012-0000-0000-000002EE0A8A X-IBM-AV-DETECTION: SAVI=unused REMOTE=unused XFE=unused x-cbparentid: 19012816-0013-0000-0000-0000212549ED Message-Id: <20190128175054.67979549@oc2783563651> X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10434:,, definitions=2019-01-28_09:,, signatures=0 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 priorityscore=1501 malwarescore=0 suspectscore=0 phishscore=0 bulkscore=0 spamscore=0 clxscore=1015 lowpriorityscore=0 mlxscore=0 impostorscore=0 mlxlogscore=644 adultscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.0.1-1810050000 definitions=main-1901280126 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, 24 Jan 2019 13:59:33 +0100 Michael Mueller wrote: > Use this struct analog to the kvm interruption structs > for kvm emulated floating and local interruptions. > Further fields will be added with this series as > required. > > Signed-off-by: Michael Mueller While looking at this I was asking myself what guards against invalid gisa pointer dereference e.g. when pending_irqs() is called (see below). AFAIU we set up gisa_int.origin only if we have css_general_characteristics.aiv. Opinions? Anyway if it is a problem, it is a pre-existing one (should be fixed ASAP but does not affect the validity of this patch). Reviewed-by: Halil Pasic > --- > arch/s390/include/asm/kvm_host.h | 6 ++++- > arch/s390/kvm/interrupt.c | 52 +++++++++++++++++++++++----------------- > arch/s390/kvm/kvm-s390.c | 2 +- > 3 files changed, 36 insertions(+), 24 deletions(-) > > diff --git a/arch/s390/include/asm/kvm_host.h b/arch/s390/include/asm/kvm_host.h > index c259a67c4298..0941571d34eb 100644 > --- a/arch/s390/include/asm/kvm_host.h > +++ b/arch/s390/include/asm/kvm_host.h > @@ -803,6 +803,10 @@ struct kvm_s390_vsie { > struct page *pages[KVM_MAX_VCPUS]; > }; > [..] > diff --git a/arch/s390/kvm/interrupt.c b/arch/s390/kvm/interrupt.c > index 942cc7d33766..ee91d1de0036 100644 > --- a/arch/s390/kvm/interrupt.c > +++ b/arch/s390/kvm/interrupt.c > @@ -246,7 +246,8 @@ static inline unsigned long pending_irqs_no_gisa(struct kvm_vcpu *vcpu) > static inline unsigned long pending_irqs(struct kvm_vcpu *vcpu) > { > return pending_irqs_no_gisa(vcpu) | > - gisa_get_ipm(vcpu->kvm->arch.gisa) << IRQ_PEND_IO_ISC_7; > + gisa_get_ipm(vcpu->kvm->arch.gisa_int.origin) << Unconditional call to gisa_get_ipm(), and get ipm just accesses ->ipm. > + IRQ_PEND_IO_ISC_7; > } > [..] > void kvm_s390_gisa_init(struct kvm *kvm) > { > + struct kvm_s390_gisa_interrupt *gi = &kvm->arch.gisa_int; > + > if (!css_general_characteristics.aiv) > return; > - kvm->arch.gisa = &kvm->arch.sie_page2->gisa; > + gi->origin = &kvm->arch.sie_page2->gisa; Should stay NULL if !css_general_characteristics.aiv. > kvm_s390_gisa_clear(kvm); > - VM_EVENT(kvm, 3, "gisa 0x%pK initialized", kvm->arch.gisa); > + VM_EVENT(kvm, 3, "gisa 0x%pK initialized", gi->origin); > } >