Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp6877919imu; Thu, 31 Jan 2019 00:56:15 -0800 (PST) X-Google-Smtp-Source: ALg8bN4ogZqZlW1TgpL/HzI+mzPbmIkVQajuZDMUxN3nYlqurnAnnPb1lQwcqdvIWgHeQ/xQv2gA X-Received: by 2002:a63:ec13:: with SMTP id j19mr30419623pgh.6.1548924975624; Thu, 31 Jan 2019 00:56:15 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1548924975; cv=none; d=google.com; s=arc-20160816; b=rctI9/gfhZBNCWbVUXYs3Q75jwxoEyTQT3ObOBMBkIFyNgBKitaDjsEeIbRVskodDL XeU4Y33Ac1lK8k9yVct+CPioQMpdI4+xTRTiEXdwbDg6iSmBnUy6YxpXNyIrfyCZMg5r 9B0gpq/LVwbTeNL5ji3lBXIjLa6qNeaxpQInzjPdwAjp8bbi0smrVCqoIgijQku9ji5b RqUZtrAF94zLClraMkZQ/yPK845GxbBJ/QLYIcaP+DjPBBGpYveVyELAoZQLEr/AifIn qJ3Ydu9jZ4SKDGoAW3xTqaAzJ5haPJfvfn3FIhzzGFiI/WYXnQq/uhCff1QjFJAc3Bu5 Uv0g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:message-id:references:in-reply-to:date :subject:cc:to:from; bh=Y2yMSlSg1xYvuJOYxjEo9ln/RTvzxh2bosGO58h0SiU=; b=twDfATdpCB2nj39mMONB7SW3DZYJo5mmhcZXJiARmSOTGSInOeSVAkVUM8IUdLxTmc zvhxfQ2gYUP/Jov04flTkwy04JN9vgA2/KnLdTMT+QhCoPY4xGB9945PFHJOS9qSNucr fa6GZS6iNqC02fC/9nRqctvyjdrl2Z/oLQ1edCbvU0HnPY8IWObgnoFz5Q4K9RXBbYCR 4bFvgl/9+UXRVt74xLj0JG1uWHZrvU33TfIIJh5mB29HFMHC2Nzl/Bi6YV40q8re+O6s RCx0/KBf+uzeGKYdod3iz/gp9AW/1Vn7kRunyf27pENMCbn/POFGSYeBkbCEoximnxQi bI1g== 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 p4si4204761pli.432.2019.01.31.00.55.59; Thu, 31 Jan 2019 00:56:15 -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 S1731796AbfAaIyK (ORCPT + 99 others); Thu, 31 Jan 2019 03:54:10 -0500 Received: from mx0a-001b2d01.pphosted.com ([148.163.156.1]:59960 "EHLO mx0a-001b2d01.pphosted.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1731511AbfAaIxg (ORCPT ); Thu, 31 Jan 2019 03:53:36 -0500 Received: from pps.filterd (m0098396.ppops.net [127.0.0.1]) by mx0a-001b2d01.pphosted.com (8.16.0.27/8.16.0.27) with SMTP id x0V8htwW006548 for ; Thu, 31 Jan 2019 03:53:35 -0500 Received: from e06smtp07.uk.ibm.com (e06smtp07.uk.ibm.com [195.75.94.103]) by mx0a-001b2d01.pphosted.com with ESMTP id 2qbur66sff-1 (version=TLSv1.2 cipher=AES256-GCM-SHA384 bits=256 verify=NOT) for ; Thu, 31 Jan 2019 03:53:34 -0500 Received: from localhost by e06smtp07.uk.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Thu, 31 Jan 2019 08:53:31 -0000 Received: from b06cxnps4075.portsmouth.uk.ibm.com (9.149.109.197) by e06smtp07.uk.ibm.com (192.168.101.137) with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted; (version=TLSv1/SSLv3 cipher=AES256-GCM-SHA384 bits=256/256) Thu, 31 Jan 2019 08:53:29 -0000 Received: from d06av24.portsmouth.uk.ibm.com (mk.ibm.com [9.149.105.60]) by b06cxnps4075.portsmouth.uk.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id x0V8rShd59637774 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=FAIL); Thu, 31 Jan 2019 08:53:28 GMT Received: from d06av24.portsmouth.uk.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id E402C42049; Thu, 31 Jan 2019 08:53:27 +0000 (GMT) Received: from d06av24.portsmouth.uk.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 8AA9942042; Thu, 31 Jan 2019 08:53:27 +0000 (GMT) Received: from s38lp84.lnxne.boe (unknown [9.152.108.100]) by d06av24.portsmouth.uk.ibm.com (Postfix) with ESMTP; Thu, 31 Jan 2019 08:53:27 +0000 (GMT) From: Michael Mueller To: KVM Mailing List Cc: Linux-S390 Mailing List , linux-kernel@vger.kernel.org, Martin Schwidefsky , Heiko Carstens , Christian Borntraeger , Janosch Frank , David Hildenbrand , Cornelia Huck , Halil Pasic , Pierre Morel , Michael Mueller Subject: [PATCH v7 12/15] KVM: s390: kvm_s390_gisa_clear() now clears the IPM only Date: Thu, 31 Jan 2019 09:52:43 +0100 X-Mailer: git-send-email 2.13.4 In-Reply-To: <20190131085247.13826-1-mimu@linux.ibm.com> References: <20190131085247.13826-1-mimu@linux.ibm.com> X-TM-AS-GCONF: 00 x-cbid: 19013108-0028-0000-0000-000003413604 X-IBM-AV-DETECTION: SAVI=unused REMOTE=unused XFE=unused x-cbparentid: 19013108-0029-0000-0000-000023FF379B Message-Id: <20190131085247.13826-13-mimu@linux.ibm.com> X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10434:,, definitions=2019-01-31_04:,, 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=701 adultscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.0.1-1810050000 definitions=main-1901310070 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Function kvm_s390_gisa_clear() now clears the Interruption Pending Mask of the GISA asap. If the GISA is in the alert list at this time it stays in the list but is removed by process_gib_alert_list(). Signed-off-by: Michael Mueller --- arch/s390/kvm/interrupt.c | 25 ++++++++++++++++++++++--- 1 file changed, 22 insertions(+), 3 deletions(-) diff --git a/arch/s390/kvm/interrupt.c b/arch/s390/kvm/interrupt.c index f37dfb01c63c..341664b94491 100644 --- a/arch/s390/kvm/interrupt.c +++ b/arch/s390/kvm/interrupt.c @@ -249,6 +249,25 @@ static inline int gisa_set_iam(struct kvm_s390_gisa *gisa, u8 iam) return 0; } +/** + * gisa_clear_ipm - clear the GISA interruption pending mask + * + * @gisa: gisa to operate on + * + * Clear the IPM atomically with the next alert address and the IAM + * of the GISA unconditionally. All three fields are located in the + * first long word of the GISA. + */ +static inline void gisa_clear_ipm(struct kvm_s390_gisa *gisa) +{ + u64 word, _word; + + do { + word = READ_ONCE(gisa->u64.word[0]); + _word = word & ~(0xffUL << 24); + } while (cmpxchg(&gisa->u64.word[0], word, _word) != word); +} + static inline void gisa_set_ipm_gisc(struct kvm_s390_gisa *gisa, u32 gisc) { set_bit_inv(IPM_BIT_OFFSET + gisc, (unsigned long *) gisa); @@ -2926,8 +2945,7 @@ void kvm_s390_gisa_clear(struct kvm *kvm) if (!gi->origin) return; - memset(gi->origin, 0, sizeof(struct kvm_s390_gisa)); - gi->origin->next_alert = (u32)(u64)gi->origin; + gisa_clear_ipm(gi->origin); VM_EVENT(kvm, 3, "gisa 0x%pK cleared", gi->origin); } @@ -2940,7 +2958,8 @@ void kvm_s390_gisa_init(struct kvm *kvm) gi->origin = &kvm->arch.sie_page2->gisa; gi->alert.mask = 0; spin_lock_init(&gi->alert.ref_lock); - kvm_s390_gisa_clear(kvm); + memset(gi->origin, 0, sizeof(struct kvm_s390_gisa)); + gi->origin->next_alert = (u32)(u64)gi->origin; VM_EVENT(kvm, 3, "gisa 0x%pK initialized", gi->origin); } -- 2.13.4