Received: by 2002:a25:8b12:0:0:0:0:0 with SMTP id i18csp746143ybl; Tue, 13 Aug 2019 01:51:53 -0700 (PDT) X-Google-Smtp-Source: APXvYqz2gJrJut6dVd3w0Xvcl50M+32ZleuHQhKTHIEck7BVPu1XgoK5Neip/PWp71wG+tPl6MfF X-Received: by 2002:a63:5162:: with SMTP id r34mr32610202pgl.229.1565686313503; Tue, 13 Aug 2019 01:51:53 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1565686313; cv=none; d=google.com; s=arc-20160816; b=mh1uDqrcHVbAM2dUj6CiLLSK4SJaqjEmqi+RDPYCNr2qEGvMXdw5NzypF2L5I9JXod xl5zsybM60zIHNbK4x/OZIVYXcPdRRidqUD07bnSzyyEdjGKeCGC41gT4pbNW3BM7Ajs xxM9Zxo+QcXNftzKKVUMNkLsFNGqWDR5Gzq8TYWR3KmcAmiFdgm068JViSqijltjlgE/ knV7kqq7jTdZcHguyCYlBa+d1r2ZBjmkCWPVLWWdy9FvQxcckeVrcy5VdP1DijF3Vqnm zjTtUw++QM9gD7TQyHDZan71ff9CMjOeEy/hjRRFYD23fpvBUtDOFgZxGri/pJ3XECxO H8cw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date:dkim-signature; bh=mW5A/F96LGmeoUnuyfmkeD+8FPBFF0FLdDwgDAb/O+4=; b=L15s5vpmL8KRVvQQOkmg0Qc5X2+JAEd9BQ1p4qmkfMwEqGp1ziVTjEGGOLUuH+87hn 037BBLf+n3jHR5V+TyKrN/ofWfjU9Zvq8aPchgeSorbLIx9ZtBj2FFMDlKn+wrg3JOcF DlQahHoRzBXvUnDnOjMzdlT3UAbdWBUYyM9SAjN+TbuWw7oNUhYmOUYX/MCSp9doI84c SiyhDhTFIune5L6DQh2hO1yRxpULW4WkfFZcEUIL0gz87Q06l+GRU5tPUtWO+BiO0MAR N3M+SHHcfjPFWCrvomq9vy+t2gP/YOYqFxs78oQONApFMhFkRsTXDIx5baYqHxU7Iw1T qRpQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=XBkayP6v; 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=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id a141si9326669pfd.49.2019.08.13.01.51.38; Tue, 13 Aug 2019 01:51:53 -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; dkim=pass header.i=@gmail.com header.s=20161025 header.b=XBkayP6v; 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=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727404AbfHMHt2 (ORCPT + 99 others); Tue, 13 Aug 2019 03:49:28 -0400 Received: from mail-pl1-f193.google.com ([209.85.214.193]:44310 "EHLO mail-pl1-f193.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725842AbfHMHt2 (ORCPT ); Tue, 13 Aug 2019 03:49:28 -0400 Received: by mail-pl1-f193.google.com with SMTP id t14so48914923plr.11 for ; Tue, 13 Aug 2019 00:49:27 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to:user-agent; bh=mW5A/F96LGmeoUnuyfmkeD+8FPBFF0FLdDwgDAb/O+4=; b=XBkayP6vpR2jredVX5f2OX73KWFMemXcpqfKfVTkjP/SxilMyFFk3gv87Ny5WFEP0j V1lEm6hG8O/zaGjtmle7HgVR10AOwRoH1MnGCbIuEzr0p22taiIryAtPSOUfQ6jmybRT NijkDaVah0XCYE8hb4Oj2lOfLS8wum0QRDmfmom7WtsY5zR3oSpFxNs0ppHsLrH81KZM YdwNnMxVOGC2b2gc9iX99+Ai+abklEly8bBj720EFBjUEEt/iy8vhVhDxOAXW0eIV1OO gmc13YQLgzDdlcvoklIx+AGMI/V5Eocmtb8jsp3VUHUvzL7Wy//hLcfbx7iSWibXNXV2 n8Yg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to:user-agent; bh=mW5A/F96LGmeoUnuyfmkeD+8FPBFF0FLdDwgDAb/O+4=; b=QySLm6xgMNiCDkOSLb1PZd9SYj0lGHlygogbU5ylhYMwVS/gPg7oF4kYNAMtOEQ92y 9VrGUGq26tCY+0TOmPtcQRl4z2mk9dGSfcTfjiIE6IXdv5OdT8+2BXgN78pA3jxq2oU2 Y08Lb+y7PmkCVELb1gCw8FpBzAhneGVKN8uqdevP7dMBSFU3O4VOI8Voew62blQ/A2xd +OcVfk28k83+TSjNynk1glj861pxKFiT4jUoWZ4fdeZ+N9ms9QugyiShfP+xs3rvyRJZ 7nTF0j50ct4xRzK7OodRTabNhCtW4c3Ixn23Gzvuu4MDhn6mdkdg/rZ5ebQq82/CuC9P cCtA== X-Gm-Message-State: APjAAAWXKMFAF+4aXWa6GslpMO/rtmuZKix9ZBsMwa5yh4uZMubNZI1n 4KxOV9hE/VsK7vrNogUega4= X-Received: by 2002:a17:902:441:: with SMTP id 59mr28555496ple.62.1565682563480; Tue, 13 Aug 2019 00:49:23 -0700 (PDT) Received: from localhost (c-73-189-176-234.hsd1.ca.comcast.net. [73.189.176.234]) by smtp.gmail.com with ESMTPSA id e17sm1101800pjt.6.2019.08.13.00.49.21 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Tue, 13 Aug 2019 00:49:22 -0700 (PDT) Date: Tue, 13 Aug 2019 00:49:20 -0700 From: Isaku Yamahata To: "Kani, Toshi" Cc: "isaku.yamahata@gmail.com" , "bp@alien8.de" , "linux-kernel@vger.kernel.org" , "fei1.li@intel.com" , "x86@kernel.org" Subject: Re: [PATCH 0/3] x86/mtrr, pat: make PAT independent from MTRR Message-ID: <20190813074920.GA24196@private.email.ne.jp> References: <20190809070647.GA2152@zn.tnic> <3355d77da5e094ad1d3149b9236cdd204486fd69.camel@hpe.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <3355d77da5e094ad1d3149b9236cdd204486fd69.camel@hpe.com> User-Agent: Mutt/1.10.1 (2018-07-13) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Fri, Aug 09, 2019 at 07:51:17PM +0000, "Kani, Toshi" wrote: > On Fri, 2019-08-09 at 09:06 +0200, Borislav Petkov wrote: > > On Thu, Aug 08, 2019 at 08:54:17PM -0700, Isaku Yamahata wrote: > > > Make PAT(Page Attribute Table) independent from > > > MTRR(Memory Type Range Register). > > > Some environments (mainly virtual ones) support only PAT, but not MTRR > > > because PAT replaces MTRR. > > > It's tricky and no gain to support both MTRR and PAT except compatibility. > > > So some VM technologies don't support MTRR, but only PAT. > > I do not think it is technically correct on bare metal. AFAIK, MTRR is > still the only way to setup cache attribute in real-mode, which BIOS SMI > handler relies on in SMM. Then you're claiming if it's baremetal, both MTRR and PAT should be enabled/disabled at the same time? > > > This patch series makes PAT available on such environments without MTRR. > > > > And this "justification" is not even trying. Which "VM technologies" are > > those? Why do we care? What's the impact? Why do we want this? > > > > You need to sell this properly. > > Agreed. If the situation is still the same, Xen does not support MTRR, > and the kernel sets the PAT table to the BIOS hand-off state when MTRR > is disabled. The change below accommodated the fact that Xen hypervisor > enables WC before hand-off, which is different from the default BIOS > hand-off state. The kernel does not support setting PAT when MTRR is > disabled due to the dependency Isaku mentioned. > > > https://www.mail-archive.com/linux-kernel@vger.kernel.org/msg1107094.html Thanks for supplement. In addition to Xen, KVM+qemu can enable/disable MTRR, PAT independently. So user may want to disable MTRR to reduce attack surface. ACRN doesn't support MTRR. Let me include those description for next respin. -- Isaku Yamahata