Received: by 2002:a25:6193:0:0:0:0:0 with SMTP id v141csp4110960ybb; Tue, 7 Apr 2020 00:35:54 -0700 (PDT) X-Google-Smtp-Source: APiQypJEMkMjeUK9jRNKYZ6DnSmHnR6BroGF9KS1b9fYuFrnIbqbnorAEM3TiMQxncVMuh5TtzZP X-Received: by 2002:a4a:6549:: with SMTP id z9mr821421oog.37.1586244954176; Tue, 07 Apr 2020 00:35:54 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1586244954; cv=none; d=google.com; s=arc-20160816; b=S/seluXOy2xXliXxjTQzx6eYAozMKybkqzsb0PmU8D7yHUxAPi6Z0/9nnUZDXcwkt+ 8TiQaUrp/yXFnRpV7g4sOHtm/lzS0lqMCE9TY9lVsnF2kSYVtn3R0h0jd4PJ0RERH6xQ yT49Juh1Z8B1SjsNo//D/a5vbe1CcrMKvcfoiPW4xeCgqidxIR6nj+SqUni0upwyKxPU VLD7Eobmll9MMt/mt8jHEXT4B77dmgn06iFuomzw2or+7WF6HF5ZcFIhOhvjnahwbQRk R4H1HgNrVH1QHAIZUTC3PwqnzibBvELjC+P+0KY76Gq0BkLjPKLZOCwLp8IO0CEm8Ppb 7EfA== 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:autocrypt :from:references:cc:to:subject; bh=zA5s7LV4mdyRInRLK/XnspBCGjV9Z/pwdsrsOC+y2JQ=; b=0vd9TxkOiIubn9uLAAWdy8h1U/j5q3l5nX8rh512Yvd6mZpZlyp50oO3wCKP5AunBW DXr0bFpvquVpO4qXiXBUwyS7mSPngSQOJX+junJ4c1lZApp7S6bUJ9CCLohntzcrKjNT uG2A9US3h+gH1DDjNc1RwTadwUd5HoDtMOMBZ1MXHJZ9xji8HESHjaMAE95+neDj+UJ0 Ln2jOyxnTP6+WHnekRnM71czbLE9ln+F1ZC++ZkQE3O3gn4vwKfr5s4G/tTj2aZ1cUza rVSZNLBvXjdGf93n8Ga8CPcq06Iq67dUyLTh+fVirTgeEM0Z0X4CUmTF857HAtO7usyM GO/Q== 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 t4si858005oou.54.2020.04.07.00.35.41; Tue, 07 Apr 2020 00:35:54 -0700 (PDT) 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 S1727841AbgDGHec (ORCPT + 99 others); Tue, 7 Apr 2020 03:34:32 -0400 Received: from mx0a-001b2d01.pphosted.com ([148.163.156.1]:37094 "EHLO mx0a-001b2d01.pphosted.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726030AbgDGHec (ORCPT ); Tue, 7 Apr 2020 03:34:32 -0400 Received: from pps.filterd (m0098409.ppops.net [127.0.0.1]) by mx0a-001b2d01.pphosted.com (8.16.0.42/8.16.0.42) with SMTP id 0377YPlo091802 for ; Tue, 7 Apr 2020 03:34:31 -0400 Received: from e06smtp03.uk.ibm.com (e06smtp03.uk.ibm.com [195.75.94.99]) by mx0a-001b2d01.pphosted.com with ESMTP id 3082j8f655-1 (version=TLSv1.2 cipher=AES256-GCM-SHA384 bits=256 verify=NOT) for ; Tue, 07 Apr 2020 03:34:29 -0400 Received: from localhost by e06smtp03.uk.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Tue, 7 Apr 2020 08:33:42 +0100 Received: from b06cxnps3074.portsmouth.uk.ibm.com (9.149.109.194) 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) Tue, 7 Apr 2020 08:33:38 +0100 Received: from d06av22.portsmouth.uk.ibm.com (d06av22.portsmouth.uk.ibm.com [9.149.105.58]) by b06cxnps3074.portsmouth.uk.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id 0377XmNG26214492 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Tue, 7 Apr 2020 07:33:49 GMT Received: from d06av22.portsmouth.uk.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id D41514C04A; Tue, 7 Apr 2020 07:33:48 +0000 (GMT) Received: from d06av22.portsmouth.uk.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id A35154C058; Tue, 7 Apr 2020 07:33:47 +0000 (GMT) Received: from oc7455500831.ibm.com (unknown [9.145.171.200]) by d06av22.portsmouth.uk.ibm.com (Postfix) with ESMTP; Tue, 7 Apr 2020 07:33:47 +0000 (GMT) Subject: Re: [PATCH v2 1/5] KVM: s390: vsie: Fix region 1 ASCE sanity shadow address checks To: David Hildenbrand , kvm@vger.kernel.org Cc: linux-s390@vger.kernel.org, linux-kernel@vger.kernel.org, Vasily Gorbik , Heiko Carstens , Cornelia Huck , Janosch Frank , stable@vger.kernel.org References: <20200403153050.20569-1-david@redhat.com> <20200403153050.20569-2-david@redhat.com> From: Christian Borntraeger Autocrypt: addr=borntraeger@de.ibm.com; prefer-encrypt=mutual; keydata= xsFNBE6cPPgBEAC2VpALY0UJjGmgAmavkL/iAdqul2/F9ONz42K6NrwmT+SI9CylKHIX+fdf J34pLNJDmDVEde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rLpnzO3evzkfJb1 D5qh3wM1t7PZ+JWTluSX8W25ABEBAAHCwV8EGAECAAkFAk6cPPgCGwwACgkQEXu8gLWmHHz8 2w//VjRlX+tKF3szc0lQi4X0t+pf88uIsvR/a1GRZpppQbn1jgE44hgF559K6/yYemcvTR7r 6Xt7cjWGS4wfaR0+pkWV+2dbw8Xi4DI07/fN00NoVEpYUUnOnupBgychtVpxkGqsplJZQpng v6fauZtyEcUK3dLJH3TdVQDLbUcL4qZpzHbsuUnTWsmNmG4Vi0NsEt1xyd/Wuw+0kM/oFEH1 4BN6X9xZcG8GYUbVUd8+bmio8ao8m0tzo4pseDZFo4ncDmlFWU6hHnAVfkAs4tqA6/fl7RLN JuWBiOL/mP5B6HDQT9JsnaRdzqF73FnU2+WrZPjinHPLeE74istVgjbowvsgUqtzjPIG5pOj cAsKoR0M1womzJVRfYauWhYiW/KeECklci4TPBDNx7YhahSUlexfoftltJA8swRshNA/M90/ i9zDo9ySSZHwsGxG06ZOH5/MzG6HpLja7g8NTgA0TD5YaFm/oOnsQVsf2DeAGPS2xNirmknD jaqYefx7yQ7FJXXETd2uVURiDeNEFhVZWb5CiBJM5c6qQMhmkS4VyT7/+raaEGgkEKEgHOWf ZDP8BHfXtszHqI3Fo1F4IKFo/AP8GOFFxMRgbvlAs8z/+rEEaQYjxYJqj08raw6P4LFBqozr nS4h0HDFPrrp1C2EMVYIQrMokWvlFZbCpsdYbBI= Date: Tue, 7 Apr 2020 09:33:47 +0200 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.5.0 MIME-Version: 1.0 In-Reply-To: <20200403153050.20569-2-david@redhat.com> Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit X-TM-AS-GCONF: 00 x-cbid: 20040707-0012-0000-0000-0000039FD485 X-IBM-AV-DETECTION: SAVI=unused REMOTE=unused XFE=unused x-cbparentid: 20040707-0013-0000-0000-000021DCF4C5 Message-Id: X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10434:6.0.138,18.0.676 definitions=2020-04-07_01:2020-04-07,2020-04-06 signatures=0 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 priorityscore=1501 mlxscore=0 malwarescore=0 suspectscore=0 impostorscore=0 bulkscore=0 lowpriorityscore=0 phishscore=0 spamscore=0 mlxlogscore=839 adultscore=0 clxscore=1015 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2003020000 definitions=main-2004070063 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 03.04.20 17:30, David Hildenbrand wrote: > In case we have a region 1 ASCE, our shadow/g3 address can have any value. > Unfortunately, (-1UL << 64) is undefined and triggers sometimes, > rejecting valid shadow addresses when trying to walk our shadow table > hierarchy. > > The result is that the prefix cannot get mapped and will loop basically > forever trying to map it (-EAGAIN loop). > > After all, the broken check is only a sanity check, our table shadowing > code in kvm_s390_shadow_tables() already checks these conditions, injecting > proper translation exceptions. Turn it into a WARN_ON_ONCE(). After some testing I now triggered this warning: [ 541.633114] ------------[ cut here ]------------ [ 541.633128] WARNING: CPU: 38 PID: 2812 at arch/s390/mm/gmap.c:799 gmap_shadow_pgt_lookup+0x98/0x1a0 [ 541.633129] Modules linked in: vhost_net vhost macvtap macvlan tap kvm xt_CHECKSUM xt_MASQUERADE nf_nat_tftp nf_conntrack_tftp xt_CT tun bridge stp llc xt_tcpudp ip6t_REJECT nf_reject_ipv6 ip6t_rpfilter ipt_REJECT nf_reject_ipv4 xt_conntrack ip6table_nat ip6table_mangle ip6table_raw ip6table_security iptable_nat nf_nat iptable_mangle iptable_raw iptable_security nf_conntrack nf_defrag_ipv6 nf_defrag_ipv4 ip_set nfnetlink ip6table_filter ip6_tables iptable_filter rpcrdma sunrpc rdma_ucm rdma_cm iw_cm ib_cm configfs mlx5_ib s390_trng ghash_s390 prng aes_s390 ib_uverbs des_s390 ib_core libdes sha3_512_s390 genwqe_card sha3_256_s390 vfio_ccw crc_itu_t vfio_mdev sha512_s390 mdev vfio_iommu_type1 sha1_s390 vfio eadm_sch zcrypt_cex4 sch_fq_codel ip_tables x_tables mlx5_core sha256_s390 sha_common pkey zcrypt rng_core autofs4 [ 541.633164] CPU: 38 PID: 2812 Comm: CPU 0/KVM Not tainted 5.6.0+ #354 [ 541.633166] Hardware name: IBM 3906 M04 704 (LPAR) [ 541.633167] Krnl PSW : 0704d00180000000 00000014e05dc454 (gmap_shadow_pgt_lookup+0x9c/0x1a0) [ 541.633169] R:0 T:1 IO:1 EX:1 Key:0 M:1 W:0 P:0 AS:3 CC:1 PM:0 RI:0 EA:3 [ 541.633171] Krnl GPRS: 0000000000000000 0000001f00000000 0000001f487b8000 ffffffff80000000 [ 541.633172] ffffffffffffffff 000003e003defa18 000003e003defa1c 000003e003defa18 [ 541.633173] fffffffffffff000 000003e003defa18 000003e003defa28 0000001f70e06300 [ 541.633174] 0000001f43484000 00000000043ed200 000003e003def978 000003e003def920 [ 541.633203] Krnl Code: 00000014e05dc448: b9800038 ngr %r3,%r8 00000014e05dc44c: a7840014 brc 8,00000014e05dc474 #00000014e05dc450: af000000 mc 0,0 >00000014e05dc454: a728fff5 lhi %r2,-11 00000014e05dc458: a7180000 lhi %r1,0 00000014e05dc45c: b2fa0070 niai 7,0 00000014e05dc460: 4010b04a sth %r1,74(%r11) 00000014e05dc464: b9140022 lgfr %r2,%r2 [ 541.633215] Call Trace: [ 541.633218] [<00000014e05dc454>] gmap_shadow_pgt_lookup+0x9c/0x1a0 [ 541.633257] [<000003ff804c57d6>] kvm_s390_shadow_fault+0x66/0x1e8 [kvm] [ 541.633265] [<000003ff804c72dc>] vsie_run+0x43c/0x710 [kvm] [ 541.633273] [<000003ff804c85ca>] kvm_s390_handle_vsie+0x632/0x750 [kvm] [ 541.633281] [<000003ff804c123c>] kvm_s390_handle_b2+0x84/0x4e0 [kvm] [ 541.633289] [<000003ff804b46b2>] kvm_handle_sie_intercept+0x172/0xcb8 [kvm] [ 541.633297] [<000003ff804b18a8>] __vcpu_run+0x658/0xc90 [kvm] [ 541.633305] [<000003ff804b2920>] kvm_arch_vcpu_ioctl_run+0x248/0x858 [kvm] [ 541.633313] [<000003ff8049d454>] kvm_vcpu_ioctl+0x284/0x7b0 [kvm] [ 541.633316] [<00000014e087d5ae>] ksys_ioctl+0xae/0xe8 [ 541.633318] [<00000014e087d652>] __s390x_sys_ioctl+0x2a/0x38 [ 541.633323] [<00000014e0ff02a2>] system_call+0x2a6/0x2c8 [ 541.633323] Last Breaking-Event-Address: [ 541.633334] [<000003ff804983e0>] kvm_running_vcpu+0x3ea9ee997d8/0x3ea9ee99950 [kvm] [ 541.633335] ---[ end trace f69b6021855ea189 ]--- Unfortunately no dump at that point in time. I have other tests which are clearly fixed by this patch, so we should propbably go forward anyway. Question is, is this just another bug we need to fix or is the assumption that somebody else checked all conditions so we can warn false?