Received: by 2002:a05:6602:2086:0:0:0:0 with SMTP id a6csp4376010ioa; Wed, 27 Apr 2022 02:21:40 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzz1A5YOXmUUmeqaPhc64CbrRBVvtpOuEAUp3xWBBXwQBWI3mtSlldMRkm68nbshNdBMEg/ X-Received: by 2002:a05:6a00:849:b0:50d:4069:60b with SMTP id q9-20020a056a00084900b0050d4069060bmr14760597pfk.76.1651051300132; Wed, 27 Apr 2022 02:21:40 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1651051300; cv=none; d=google.com; s=arc-20160816; b=yeWZ+Fedeo70oMzsR+5GMJ6BIbUtTX7gv17lLnw7JsZVjngsw9ISFcW0iMwbl+R46w jj8wIhv28QOurDOyznFTe1I0jD2g71L3XhkXvJZB56X+Cr6pq2Oghvu8PJCuIZ1MiFY6 V6XLcdIsaq+8Hz9Bz6etAham1dXIb7drz+ZG4wi7KarvIh3ElkzfepUCm1X12IHPcuB4 ApnAxEttU2dd1eLxxlSbvD0Sy3cNfuEGA6Vvy8Ew4p0/ZN4vZ1QXHSxavdK9Sl86GHpp AVzs1cQzyAU/gWOjuMEtoF6kWisNUTrMvmTAVq1Es6q26kiP+rIrJYM2bqluB8YiosWd EIiA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature; bh=T7bjvQ3BcrN7Z6h9Fc26vG+y3bdOGAaPUHj4pY8LJ6g=; b=rX2187b3FyYVZToQdW4ObwS0midWAWcVM5BPLCQFECmHIjiY1SXb4Jk+Mj1hFbQMcl j6KKR6PhJTu9fssuQ3GKrfuLjWzGwW+vqz5nyX1Ul/SLcG2X5ngItUg66cI2MNi9yTrc qpiMjDlfn1UBMjjsH8NFkDUmFxCyo48JnrKUD8zBMF64oVAf70iNaj9ShIjSHBZko4A5 2OTs+2KdxTysZyNKqDxJP0KVKgDEMCrcTIyAPPX6+uSbmmAfqg334Nd3Lc7HJs4XY2qH hn6D2IHnllcQXHfENtzZJK9mKfhxz11s4RwMTFEwNkt3csKIDj6Qegql9P5frUz60vj6 mJWQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@ibm.com header.s=pp1 header.b=QeOf0hyz; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=ibm.com Return-Path: Received: from lindbergh.monkeyblade.net (lindbergh.monkeyblade.net. [2620:137:e000::1:18]) by mx.google.com with ESMTPS id g25-20020a635659000000b003ab2131c72csi957722pgm.304.2022.04.27.02.21.39 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 27 Apr 2022 02:21:40 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:18 as permitted sender) client-ip=2620:137:e000::1:18; Authentication-Results: mx.google.com; dkim=pass header.i=@ibm.com header.s=pp1 header.b=QeOf0hyz; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=ibm.com Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id E2C37232AC6; Wed, 27 Apr 2022 02:07:21 -0700 (PDT) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1354297AbiDZTzE (ORCPT + 99 others); Tue, 26 Apr 2022 15:55:04 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:40608 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1354278AbiDZTzC (ORCPT ); Tue, 26 Apr 2022 15:55:02 -0400 Received: from mx0a-001b2d01.pphosted.com (mx0b-001b2d01.pphosted.com [148.163.158.5]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 3F9D76B09C; Tue, 26 Apr 2022 12:51:54 -0700 (PDT) Received: from pps.filterd (m0098414.ppops.net [127.0.0.1]) by mx0b-001b2d01.pphosted.com (8.17.1.5/8.17.1.5) with ESMTP id 23QJkQTs009986; Tue, 26 Apr 2022 19:51:27 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ibm.com; h=date : from : to : cc : subject : message-id : references : mime-version : content-type : in-reply-to; s=pp1; bh=T7bjvQ3BcrN7Z6h9Fc26vG+y3bdOGAaPUHj4pY8LJ6g=; b=QeOf0hyzkXYEwHLGJeMuxaoU0I2z5QQl1+8yQ4GSOYpEz5DjVDEJ5fb5ZOnyoQYxtAE3 PCCpMW+rY0ABr25y3jvM5Ui4chmZPzyrlHB23ylD2cFNe1RQEniJQsxu5MP7u4U9L7HU ooxYy1CtyntH96ekCadJEhrl3bMjIOLx79gQwSU3sZxh0NlNLyY6XLIsM/7liWm9LM0g p5oASzZjl7hA3sw7QYuw/sVTffwcdD5mCLVPGSjBSIc/fNoDWnI+kliGBCbNh0YwpZGX UKjnrIE19mrpMvNv2iTk6D3YobHaKqSKQKGzZxv/81fycEyJDdApP7p/udYx7z0LVpia Bw== Received: from pps.reinject (localhost [127.0.0.1]) by mx0b-001b2d01.pphosted.com (PPS) with ESMTPS id 3fpq6e82kw-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Tue, 26 Apr 2022 19:51:27 +0000 Received: from m0098414.ppops.net (m0098414.ppops.net [127.0.0.1]) by pps.reinject (8.17.1.5/8.17.1.5) with ESMTP id 23QJm8dW021744; Tue, 26 Apr 2022 19:51:26 GMT Received: from ppma04ams.nl.ibm.com (63.31.33a9.ip4.static.sl-reverse.com [169.51.49.99]) by mx0b-001b2d01.pphosted.com (PPS) with ESMTPS id 3fpq6e82kf-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Tue, 26 Apr 2022 19:51:26 +0000 Received: from pps.filterd (ppma04ams.nl.ibm.com [127.0.0.1]) by ppma04ams.nl.ibm.com (8.16.1.2/8.16.1.2) with SMTP id 23QJo8mP006577; Tue, 26 Apr 2022 19:51:24 GMT Received: from b06avi18626390.portsmouth.uk.ibm.com (b06avi18626390.portsmouth.uk.ibm.com [9.149.26.192]) by ppma04ams.nl.ibm.com with ESMTP id 3fm938vvdt-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Tue, 26 Apr 2022 19:51:24 +0000 Received: from d06av25.portsmouth.uk.ibm.com (d06av25.portsmouth.uk.ibm.com [9.149.105.61]) by b06avi18626390.portsmouth.uk.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id 23QJcJDq48038304 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Tue, 26 Apr 2022 19:38:19 GMT Received: from d06av25.portsmouth.uk.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 38D2111C050; Tue, 26 Apr 2022 19:51:21 +0000 (GMT) Received: from d06av25.portsmouth.uk.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 3F97E11C04C; Tue, 26 Apr 2022 19:51:20 +0000 (GMT) Received: from osiris (unknown [9.145.34.143]) by d06av25.portsmouth.uk.ibm.com (Postfix) with ESMTPS; Tue, 26 Apr 2022 19:51:20 +0000 (GMT) Date: Tue, 26 Apr 2022 21:51:18 +0200 From: Heiko Carstens To: Borislav Petkov Cc: Juergen Gross , linux-kernel@vger.kernel.org, x86@kernel.org, linux-arch@vger.kernel.org, linux-s390@vger.kernel.org, linux-hyperv@vger.kernel.org, virtualization@lists.linux-foundation.org, Arnd Bergmann , Vasily Gorbik , Alexander Gordeev , Christian Borntraeger , Sven Schnelle , Thomas Gleixner , Ingo Molnar , Dave Hansen , "H. Peter Anvin" , "K. Y. Srinivasan" , Haiyang Zhang , Stephen Hemminger , Wei Liu , Dexuan Cui , Andy Lutomirski , Peter Zijlstra , "Michael S. Tsirkin" , Jason Wang , Christoph Hellwig , Oleksandr Tyshchenko Subject: Re: [PATCH 2/2] virtio: replace arch_has_restricted_virtio_memory_access() Message-ID: References: <20220426134021.11210-1-jgross@suse.com> <20220426134021.11210-3-jgross@suse.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: X-TM-AS-GCONF: 00 X-Proofpoint-GUID: q9gEbp0-esGpLxC7emUANKdeJL4GNy7u X-Proofpoint-ORIG-GUID: ikyLc1vizVQ4dnq38vPU_YoCIQAl4_o- X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.205,Aquarius:18.0.858,Hydra:6.0.486,FMLib:17.11.64.514 definitions=2022-04-26_06,2022-04-26_02,2022-02-23_01 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 mlxlogscore=648 suspectscore=0 impostorscore=0 bulkscore=0 clxscore=1011 spamscore=0 mlxscore=0 priorityscore=1501 malwarescore=0 adultscore=0 lowpriorityscore=0 phishscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2202240000 definitions=main-2204260123 X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,RDNS_NONE, SPF_HELO_NONE autolearn=no autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, Apr 26, 2022 at 07:35:43PM +0200, Borislav Petkov wrote: > On Tue, Apr 26, 2022 at 03:40:21PM +0200, Juergen Gross wrote: > > /* protected virtualization */ > > static void pv_init(void) > > { > > if (!is_prot_virt_guest()) > > return; > > > > + platform_set_feature(PLATFORM_VIRTIO_RESTRICTED_MEM_ACCESS); > > Kinda long-ish for my taste. I'll probably call it: > > platform_set() > > as it is implicit that it sets a feature bit. ...and platform_clear(), instead of platform_reset_feature() please. > In any case, yeah, looks ok at a quick glance. It would obviously need > for more people to look at it and say whether it makes sense to them and > whether that's fine to have in generic code but so far, the experience > with cc_platform_* says that it seems to work ok in generic code. We _could_ convert s390's machine flags to this mechanism. Those flags are historically per-cpu, but if I'm not mistaken none of them is performance critical anymore, and those who are could/should probably transformed to jump labels or alternatives anyway.