Received: by 2002:a05:6a10:c604:0:0:0:0 with SMTP id y4csp2634084pxt; Mon, 9 Aug 2021 05:29:12 -0700 (PDT) X-Google-Smtp-Source: ABdhPJy80vF2WfEdMJtc7snwVpY4TPGpQSHVqmy66R+F62h9CM+sRf3M8NAhQGfI1ad5rxtbjUrA X-Received: by 2002:a5d:925a:: with SMTP id e26mr9827iol.195.1628512152094; Mon, 09 Aug 2021 05:29:12 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1628512152; cv=none; d=google.com; s=arc-20160816; b=BDfW6dpr3mRC8k3vliOXdAjWkpZMQSYu8z9JsTnx8rA+nTHIlpaYkdRIvntQgzLVxk krMXjufbM1YBHwxPAEf/6/43RN/8ecS/L0aLK5wv3yCRoG2ByncNz7IwtQ3LtKTptJqv bKk4jDBTBQiSQmM6nMH4jQnNivxa2/uQ+0yEsEDBBOIMcUNZKf3g6sux8cJsC0pq48UC SrzM7bcycS8lxrh2PAAEYU5u/j7V8qutzv7C7br9Hw4aQ5T0itO5//HYy3klujQTpzjx Op3BsW5HWnGo5rWU0ASUvbA3j485bKfJaUeV488Z0gfKZfrOSApoYHHXW8zv2BGa1G+n 5ThQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:content-language :in-reply-to:mime-version:user-agent:date:message-id:subject:from :references:cc:to:dkim-signature; bh=lBMgmsHqw0YdLKVpdWLFV60bEE3X7POBff7kY81z7+0=; b=DCgXkZTtSWkPdGOs7vNK4thplf7+5LiPw41gifrAXAhj+nDn/M1cmU4FsRI6uY/4BZ E3f/P0Z+A7boCfVrkaYllqWghsr/fNhOEFSlGMk7B4ZadQQGzazuxUQRRYUeB5CXM14G kuY5o3sSRd4gBDAT9Xn6Fe3XwkmNa3n0WkG8A/KBIm68G6QOGKNsSOjULsX/Hc+nGU2t q2Qo4cdzY7XCVQy1+b2Ygw7qEDW95ckTMCIL3eoidlRANmWHCwpTezI4SaQGnVF4cRjQ Sn6wypy8ZT444muX20V405sGJKOs90UraaVq1rEY9GgCgG15ZquV8KiA0Z+QEtvjAhhR Ppdg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=NhlXYLeP; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id w15si23790967iov.42.2021.08.09.05.28.58; Mon, 09 Aug 2021 05:29:12 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=NhlXYLeP; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234346AbhHIKXu (ORCPT + 99 others); Mon, 9 Aug 2021 06:23:50 -0400 Received: from us-smtp-delivery-124.mimecast.com ([170.10.133.124]:33998 "EHLO us-smtp-delivery-124.mimecast.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234717AbhHIKXq (ORCPT ); Mon, 9 Aug 2021 06:23:46 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1628504605; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=lBMgmsHqw0YdLKVpdWLFV60bEE3X7POBff7kY81z7+0=; b=NhlXYLePc588orL/szPFEExZ9i7+Pshae1FCaohyK8yBodDc3nu5qbWGLUSefMte5AOn0H 58CHccqgoN1hmB39/7jJ7443v8n1PkJLH2L70S5NUv3rNhT01hJBG5yNa0AovJvUw1tptP 509QgW/zCjl0LQOCrAXFu0ozgBzmbBc= Received: from mail-ej1-f70.google.com (mail-ej1-f70.google.com [209.85.218.70]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-320-L5MAZnY9PK2tEHK1qezajg-1; Mon, 09 Aug 2021 06:23:24 -0400 X-MC-Unique: L5MAZnY9PK2tEHK1qezajg-1 Received: by mail-ej1-f70.google.com with SMTP id ne21-20020a1709077b95b029057eb61c6fdfso4356879ejc.22 for ; Mon, 09 Aug 2021 03:23:24 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:to:cc:references:from:subject:message-id:date :user-agent:mime-version:in-reply-to:content-language :content-transfer-encoding; bh=lBMgmsHqw0YdLKVpdWLFV60bEE3X7POBff7kY81z7+0=; b=bXF5hgqWrPsMd0+5gzxve5hTnvx5sGwu/jTgPq2bceAARacqR/48OGV1jJKd6fC5DO W+Ox2fD+iMOIT38WWCe1LLHyf9ZDSas3mN3kJGz1QBlAswI7EkQ0YJCRpOMeU6tEgtp0 wvl/vosyaDhtn4ocDZCc2xPztV2AVvS7g5HFHZ04kYTMCyitSVj8/JqbZolsSIVwYye7 /2pRx4rT8QQZiF8WHLcuaSsz9lJgNLvzrwFN+2UPrJZfEknzOn43f+8gT7VyPwzjDtPz VpTklhcJfk0Ah9CUzw2fKMN4STbzoIUG2igvC1u16EkSbo5Gl7T/U0AYGkgmbX0aenvH N/DA== X-Gm-Message-State: AOAM530P0g1PvLTvcjs2FiPV5zNwvFpmq0l4dzmWlfzmk36VUBw8aySq 5xopQqFL0ycUMLC89t/c0Ja4twM1nhu7KhUiTpVvbR7TJ2mKorI9rp5kNK5jArPTalqpnbxMOof C93Lk2YsjIxJdxsOZCnZiJgRc X-Received: by 2002:aa7:c647:: with SMTP id z7mr28762252edr.52.1628504603585; Mon, 09 Aug 2021 03:23:23 -0700 (PDT) X-Received: by 2002:aa7:c647:: with SMTP id z7mr28762236edr.52.1628504603409; Mon, 09 Aug 2021 03:23:23 -0700 (PDT) Received: from ?IPv6:2001:b07:6468:f312:5e2c:eb9a:a8b6:fd3e? ([2001:b07:6468:f312:5e2c:eb9a:a8b6:fd3e]) by smtp.gmail.com with ESMTPSA id l9sm7953930edt.55.2021.08.09.03.23.22 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Mon, 09 Aug 2021 03:23:22 -0700 (PDT) To: Joao Martins , Maxim Levitsky Cc: stable@vger.kernel.org, David Matlack , linux-kernel@vger.kernel.org, kvm@vger.kernel.org References: <20210805105423.412878-1-pbonzini@redhat.com> <4b530fb6-81cc-be36-aa68-92ec01c65775@oracle.com> <5f3c13be-f65d-1793-bd91-7491d3e149b0@redhat.com> From: Paolo Bonzini Subject: Re: [PATCH] selftests: KVM: avoid failures due to reserved HyperTransport region Message-ID: Date: Mon, 9 Aug 2021 12:23:21 +0200 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Thunderbird/78.11.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 09/08/21 12:00, Joao Martins wrote: > [0]https://developer.amd.com/wp-content/resources/56323-PUB_0.78.pdf > > 1286 Spurious #GP May Occur When Hypervisor Running on > Another Hypervisor > > Description > > The processor may incorrectly generate a #GP fault if a hypervisor running on a hypervisor > attempts to access the following secure memory areas: > > • The reserved memory address region starting at FFFD_0000_0000h and extending up to > FFFF_FFFF_FFFFh. > • ASEG and TSEG memory regions for SMM (System Management Mode) > • MMIO APIC Space This errata took a few months to debug so we're quite familiar with it :) but I only knew about the ASEG/TSEG/APIC cases. So this HyperTransport region is not related to this issue, but the errata does point out that FFFD_0000_0000h and upwards is special in guests. The Xen folks also had to deal with it only a couple months ago (https://yhbt.net/lore/all/1eb16baa-6b1b-3b18-c712-4459bd83e1aa@citrix.com/): From "Open-Source Register Reference for AMD Family 17h Processors (PUB)": https://developer.amd.com/wp-content/resources/56255_3_03.PDF "The processor defines a reserved memory address region starting at FFFD_0000_0000h and extending up to FFFF_FFFF_FFFFh." It's still doesn't say that it's at the top of physical address space although I understand that's how it's now implemented. The official document doesn't confirm it will move along with physical address space extension. [...] 1) On parts with <40 bits, its fully hidden from software 2) Before Fam17h, it was always 12G just below 1T, even if there was more RAM above this location 3) On Fam17h and later, it is variable based on SME, and is either just below 2^48 (no encryption) or 2^43 (encryption) > It's > interesting that fn8000_000A EDX[28] is part of the reserved bits from that CPUID leaf. It's only been defined after AMD deemed that the errata was not fixable in current generation processors); it's X86_FEATURE_SVME_ADDR_CHK now. I'll update the patch based on the findings from the Xen team. Paolo