From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-3.8 required=3.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,FREEMAIL_FORGED_FROMDOMAIN,FREEMAIL_FROM, HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_PATCH,MAILING_LIST_MULTI,SPF_HELO_NONE, SPF_PASS autolearn=no autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 84D0AC433E1 for ; Thu, 9 Jul 2020 10:20:34 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id 4AA2B2067D for ; Thu, 9 Jul 2020 10:20:34 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="vAFl0E6H" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 4AA2B2067D Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=gmail.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=owner-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix) id A790B6B0002; Thu, 9 Jul 2020 06:20:33 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id A28206B0003; Thu, 9 Jul 2020 06:20:33 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 93EAD6B0006; Thu, 9 Jul 2020 06:20:33 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0067.hostedemail.com [216.40.44.67]) by kanga.kvack.org (Postfix) with ESMTP id 7EB316B0002 for ; Thu, 9 Jul 2020 06:20:33 -0400 (EDT) Received: from smtpin29.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay04.hostedemail.com (Postfix) with ESMTP id 2A71D1EE6 for ; Thu, 9 Jul 2020 10:20:33 +0000 (UTC) X-FDA: 77018143146.29.snail30_2e1315126ec5 Received: from filter.hostedemail.com (10.5.16.251.rfc1918.com [10.5.16.251]) by smtpin29.hostedemail.com (Postfix) with ESMTP id E461A18086CD9 for ; Thu, 9 Jul 2020 10:20:32 +0000 (UTC) X-HE-Tag: snail30_2e1315126ec5 X-Filterd-Recvd-Size: 5718 Received: from mail-pg1-f196.google.com (mail-pg1-f196.google.com [209.85.215.196]) by imf22.hostedemail.com (Postfix) with ESMTP for ; Thu, 9 Jul 2020 10:20:32 +0000 (UTC) Received: by mail-pg1-f196.google.com with SMTP id g67so782382pgc.8 for ; Thu, 09 Jul 2020 03:20:32 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=date:from:subject:to:cc:references:in-reply-to:mime-version :message-id:content-transfer-encoding; bh=K1VxGPW0xuJmXA1rhdwVLxJA7czyM/CyNjmy8WBsRv4=; b=vAFl0E6HBeNrm26G8P0UQdOfXgqNlJcA/tct4oKyTFUwEd43U7dI8PbkM8WGgVIowk JzOfLvU81ZaMeTJzi15ONkYEhz8ZdK1bWR7BWVaIJs/P8JDNNQZ4C6ygk426LLZ1i6Ur FSzzF+6FLikQrB7ZepCeoeEROzURE/Dh8X1u0DbLBpr2ry99jml6TiaDBUgmGT2TZjot Bs/VL2qJTGoqSBj1njDvTMQmdGXXJaLZAQkf7dMbet9Ig0o24iRlaaiRDvelEBe4Vlmq 4o1KND3JDQfEv+NoULX20gLL2VRHXrUZDwdaew59oF71+DhmqI90PweEtb3EfegD5Mb6 BlTA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:subject:to:cc:references:in-reply-to :mime-version:message-id:content-transfer-encoding; bh=K1VxGPW0xuJmXA1rhdwVLxJA7czyM/CyNjmy8WBsRv4=; b=e3hs8zhWm+saZ+6ya2oNqsSDKS0uCBGNqNRASS8sf0z4pf2CLYMh5qJZHa+i5MeN1B SNP8Kc7Guc/U47fdsDsjjSYflEiqFhCGOYVBtNukomMIXAGADB6GDvO+47r5RDs9oyLC BCvZwqWnb47odH++ry4mINR2KHhUaQd4bvW7kvm/pGJtgsvbqAVLWkQpB0l3LYJE64iA u+OQ4ppfbiwB4mKVnGbNZ8xmGhVZhyS7zqFhO3Xdq6wPyiJtm6n2mC80ZPeh6A5QFDFH z1CUUh49k4ORnBSzx+4oVfbiCBew8pXOV4bGs7x1Ya6TgwEj7ZoT3+iI9XM+/fqrne2A ilqg== X-Gm-Message-State: AOAM533hWhMQE2OwGZIfz35TE68EBQdQWYIYW8+K/DPQqNx678rBcgiO YAdGDmzabk8Hu+d1iwofEh0= X-Google-Smtp-Source: ABdhPJyK/kHRiKtUEQazqsog0g6PKjmX1zO9iglcz1L9RZo+7iGTY/FgnI/8ZzYcrflQm4qNDWLuzw== X-Received: by 2002:a63:ab0d:: with SMTP id p13mr52941361pgf.327.1594290031443; Thu, 09 Jul 2020 03:20:31 -0700 (PDT) Received: from localhost (27-33-0-186.tpgi.com.au. [27.33.0.186]) by smtp.gmail.com with ESMTPSA id z2sm2453364pfq.67.2020.07.09.03.20.29 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 09 Jul 2020 03:20:30 -0700 (PDT) Date: Thu, 09 Jul 2020 20:20:23 +1000 From: Nicholas Piggin Subject: Re: [PATCH v2 2/3] powerpc/64s: remove PROT_SAO support To: David Gibson , Paul Mackerras Cc: kvm-ppc@vger.kernel.org, linux-api@vger.kernel.org, linux-mm@kvack.org, linuxppc-dev@lists.ozlabs.org References: <20200703011958.1166620-1-npiggin@gmail.com> <20200703011958.1166620-3-npiggin@gmail.com> <20200709043406.GB2822576@thinks.paulus.ozlabs.org> In-Reply-To: <20200709043406.GB2822576@thinks.paulus.ozlabs.org> MIME-Version: 1.0 Message-Id: <1594288843.m3s9igh1hu.astroid@bobo.none> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable X-Rspamd-Queue-Id: E461A18086CD9 X-Spamd-Result: default: False [0.00 / 100.00] X-Rspamd-Server: rspam04 X-Bogosity: Ham, tests=bogofilter, spamicity=0.000000, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: Excerpts from Paul Mackerras's message of July 9, 2020 2:34 pm: > On Fri, Jul 03, 2020 at 11:19:57AM +1000, Nicholas Piggin wrote: >> ISA v3.1 does not support the SAO storage control attribute required to >> implement PROT_SAO. PROT_SAO was used by specialised system software >> (Lx86) that has been discontinued for about 7 years, and is not thought >> to be used elsewhere, so removal should not cause problems. >>=20 >> We rather remove it than keep support for older processors, because >> live migrating guest partitions to newer processors may not be possible >> if SAO is in use (or worse allowed with silent races). >=20 > This is actually a real problem for KVM, because now we have the > capabilities of the host affecting the characteristics of the guest > virtual machine in a manner which userspace (e.g. QEMU) is unable to > control. >=20 > It would probably be better to disallow SAO on all machines than have > it available on some hosts and not others. (Yes I know there is a > check on CPU_FTR_ARCH_206 in there, but that has been a no-op since we > removed the PPC970 KVM support.) This change doesn't change the SAO difference on the host processors though, just tries to slightly improve it from silently broken to maybe complaining a bit. I didn't want to stop some very old image that uses this and is running okay on an existing host from working, but maybe the existence of such a thing would contradict my reasoning. But then if we don't care about it why care about this KVM behaviour difference at all? > Solving this properly will probably require creating a new KVM host > capability and associated machine parameter in QEMU, along with a new > machine type. Rather than answer any of these questions, I might take the KVM change out and that can be dealt with separately from guest SAO removal. Thanks, Nick >=20 > [snip] >=20 >> diff --git a/arch/powerpc/include/asm/kvm_book3s_64.h b/arch/powerpc/inc= lude/asm/kvm_book3s_64.h >> index 9bb9bb370b53..fac39ff659d4 100644 >> --- a/arch/powerpc/include/asm/kvm_book3s_64.h >> +++ b/arch/powerpc/include/asm/kvm_book3s_64.h >> @@ -398,9 +398,10 @@ static inline bool hpte_cache_flags_ok(unsigned lon= g hptel, bool is_ci) >> { >> unsigned int wimg =3D hptel & HPTE_R_WIMG; >> =20 >> - /* Handle SAO */ >> + /* Handle SAO for POWER7,8,9 */ >> if (wimg =3D=3D (HPTE_R_W | HPTE_R_I | HPTE_R_M) && >> - cpu_has_feature(CPU_FTR_ARCH_206)) >> + cpu_has_feature(CPU_FTR_ARCH_206) && >> + !cpu_has_feature(CPU_FTR_ARCH_31)) >> wimg =3D HPTE_R_M; >=20 > Paul. >=20