Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp1125327imu; Thu, 20 Dec 2018 10:30:56 -0800 (PST) X-Google-Smtp-Source: AFSGD/UPq0Q3Oqsts+r9atpdOBxXz3GsvzoKEm2B4Z+eSmWHMuUQcCZKLsyEY7/98YmYwWeC7lBq X-Received: by 2002:a17:902:830a:: with SMTP id bd10mr25307006plb.321.1545330656204; Thu, 20 Dec 2018 10:30:56 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1545330656; cv=none; d=google.com; s=arc-20160816; b=LN+Z8s+b9MXaRcj35Q887lHbj+k476CKfV27dnbU6GTmthvA5n6xc8ZKfRD73mfrWI RlPPO+31lQYF68U/HPs/L9qSvf/Jnci1HDXmIEmUvJQTm2ZDuP4iso+5Jmr5KBWnjWVF wC6/EuHicLtu+I+pB7bXNj0YGKTFixaGjsqnfPOXBV42F992Xhn8XkidEZ/rgidWf4qd D5ZlngSdqEl6OLe76ObrANTYV8/DlhtmTs8zDD+EeC9IEeN11OO4GNaeCXb+uxqDsqua rmFudNadeEon1gef76jjo7NDuyomxrgH06XErQSIsk0GF9mCE1hLR21PK92XKi19/jzj UgQw== 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 :content-language:in-reply-to:mime-version:user-agent:date :organization:from:references:cc:to:subject:reply-to; bh=mLvrXD0Xj34G3B1jXCZM0hiK+JMj/9kcmJ1TXi2Bc4I=; b=vRyFEog7MHnseg+ikoWZAa5qUAT6kHuAaKR91fEPEQau/XVzehNvouUXyMNOfX4P6D BuO9gBUkgreTSLdPKVJ+PE90LH4v1WXi0qtgD9LKBL1jDy8dR9x4d5KYT+n+LCqORGaT inywOIAivG7d1fbESC1i1sXPcaQudUofHb6CDWfDFcMuQ+0dUbY5gA4GaMfBPReKqwrv 9f+NRt3AnE+NXEzz46PUmNJvRcUo3GTxzG7wWp+VvHQPjOcdIHkq4bGj2DZ+xdIQZ112 m44HiW7ShBEz1VzCcCGxpZTybWTk6W9Ums9DynC9smEewQgDtALGyoA11FsnN8HS7Upa Wx6g== 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 b89si19711194pfj.207.2018.12.20.10.30.40; Thu, 20 Dec 2018 10:30:56 -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 S2387545AbeLTOcK (ORCPT + 99 others); Thu, 20 Dec 2018 09:32:10 -0500 Received: from mx0b-001b2d01.pphosted.com ([148.163.158.5]:57764 "EHLO mx0a-001b2d01.pphosted.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1731393AbeLTOcJ (ORCPT ); Thu, 20 Dec 2018 09:32:09 -0500 Received: from pps.filterd (m0098421.ppops.net [127.0.0.1]) by mx0a-001b2d01.pphosted.com (8.16.0.22/8.16.0.22) with SMTP id wBKET5CU030249 for ; Thu, 20 Dec 2018 09:32:08 -0500 Received: from e06smtp04.uk.ibm.com (e06smtp04.uk.ibm.com [195.75.94.100]) by mx0a-001b2d01.pphosted.com with ESMTP id 2pgcqv0mf7-1 (version=TLSv1.2 cipher=AES256-GCM-SHA384 bits=256 verify=NOT) for ; Thu, 20 Dec 2018 09:32:08 -0500 Received: from localhost by e06smtp04.uk.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Thu, 20 Dec 2018 14:32:06 -0000 Received: from b06cxnps4075.portsmouth.uk.ibm.com (9.149.109.197) by e06smtp04.uk.ibm.com (192.168.101.134) with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted; (version=TLSv1/SSLv3 cipher=AES256-GCM-SHA384 bits=256/256) Thu, 20 Dec 2018 14:32:02 -0000 Received: from d06av21.portsmouth.uk.ibm.com (d06av21.portsmouth.uk.ibm.com [9.149.105.232]) by b06cxnps4075.portsmouth.uk.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id wBKEW1IO3015056 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=FAIL); Thu, 20 Dec 2018 14:32:01 GMT Received: from d06av21.portsmouth.uk.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 2FB9E52054; Thu, 20 Dec 2018 14:32:01 +0000 (GMT) Received: from [9.152.224.123] (unknown [9.152.224.123]) by d06av21.portsmouth.uk.ibm.com (Postfix) with ESMTP id C3F6A52050; Thu, 20 Dec 2018 14:32:00 +0000 (GMT) Reply-To: mimu@linux.ibm.com Subject: Re: [PATCH v5 10/15] KVM: s390: add functions to (un)register GISC with GISA 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 References: <20181219191756.57973-1-mimu@linux.ibm.com> <20181219191756.57973-11-mimu@linux.ibm.com> From: Michael Mueller Organization: IBM Date: Thu, 20 Dec 2018 15:32:00 +0100 User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.14; rv:52.0) Gecko/20100101 Thunderbird/52.9.1 MIME-Version: 1.0 In-Reply-To: <20181219191756.57973-11-mimu@linux.ibm.com> Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit X-TM-AS-GCONF: 00 x-cbid: 18122014-0016-0000-0000-00000239395D X-IBM-AV-DETECTION: SAVI=unused REMOTE=unused XFE=unused x-cbparentid: 18122014-0017-0000-0000-000032919589 Message-Id: <23513047-9ef8-c0a3-1b7f-d87e02da4c90@linux.ibm.com> X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10434:,, definitions=2018-12-20_07:,, 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=885 adultscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.0.1-1810050000 definitions=main-1812200119 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 19.12.18 20:17, Michael Mueller wrote: > Add the IAM (Interruption Alert Mask) to the architecture specific > kvm struct. This mask in the GISA is used to define for which ISC > a GIB alert can be issued. > > The functions kvm_s390_gisc_register() and kvm_s390_gisc_unregister() > are used to (un)register a GISC (guest ISC) with a virtual machine and > its GISA. > > Upon successful completion, kvm_s390_gisc_register() returns the > ISC to be used for GIB alert interruptions. A negative return code > indicates an error during registration. > > Theses functions will be used by other adapter types like AP and PCI to > request pass-through interruption support. > > Signed-off-by: Michael Mueller > --- > arch/s390/include/asm/kvm_host.h | 9 ++++++ > arch/s390/kvm/interrupt.c | 66 ++++++++++++++++++++++++++++++++++++++++ > 2 files changed, 75 insertions(+) > ... > --- a/arch/s390/kvm/interrupt.c > +++ b/arch/s390/kvm/interrupt.c > @@ -229,6 +229,25 @@ static inline u8 int_word_to_isc(u32 int_word) > */ > #define IPM_BIT_OFFSET (offsetof(struct kvm_s390_gisa, ipm) * BITS_PER_BYTE) > > +static inline int set_iam(struct kvm_s390_gisa *gisa, u8 iam) I will rename this one here as well to gisa_set_iam() > +{ > + u64 word0, _word0; > + > + do { > + word0 = READ_ONCE(gisa->u64.word[0]); > + /* If the GISA is in the alert list, do nothing. */ > + if ((u64)gisa != word0 >> 32) > + return -EBUSY; > + /* > + * Try to set the IAM or loop, if the IPM has changed > + * or the GISA has been inserted into the alert list. > + */ > + _word0 = (word0 & ~0xffUL) | iam; > + } while (cmpxchg(&gisa->u64.word[0], word0, _word0) != _word0); > + > + return 0; > +} > +