From patchwork Thu Apr 1 12:55:32 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Haibo Xu X-Patchwork-Id: 413610 Delivered-To: patch@linaro.org Received: by 2002:a02:8562:0:0:0:0:0 with SMTP id g89csp529753jai; Thu, 1 Apr 2021 05:56:33 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxnFI4ClheGJuL1oTe6i7Rnr6NF4jCet9hxEM+B2gNCKMdgDMUm2Oim5jS3NvfvqCBOdQm0 X-Received: by 2002:a5e:d901:: with SMTP id n1mr6525839iop.84.1617281793712; Thu, 01 Apr 2021 05:56:33 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1617281793; cv=none; d=google.com; s=arc-20160816; b=YjRAgg1f/r747GtgHO/wJm3ttJhQT4DQfdrL/5zdYB9ejiql75iEjKNV1HGZE5SOJK +tUD2G7aQgmXmsXj5SjGUWQo8ZTa45lgXcaDfL0Sv57psiRke/dpqzaUgtiLinI5d1iK al2de3wTan9uz3VgiQzPI+is8LNGtiMF99loqesexDXVWPrhMwxs9rteKqmX5f38w3bD LE9p8TMF2pXXNECHUWEggjQne1pKbqEjbK1CRUZLPd6NdofsbPPPGTaGtb2sKVocaiZa dd356+DSatLVPYzzm27iPx9N0vjzPrziRoPHUsHvgZTIwaC2HqpNokMKPBtq7ZGkFRA3 LfUQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:cc:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:content-transfer-encoding :mime-version:message-id:date:subject:to:from:dkim-signature; bh=5RkNLC5WI+uRZhYZKVcGch990QPAIEFOdI+kgFgPscg=; b=fpQ46/MZMc08Vepn+muLtxp04yiJo9rb48P+izQBdZW8lf7qCCEWl86WidaBBRxVt9 qo9CcAv2Rs4CvTKBuhsNhvImNEgblrASKuBRm0rX+Xl0iYI/KoqUuSnoXPb1qRzIRqiG 7vDrO62crPpOab3I9w4eWO37aXA/qrEfuxNc3UWSqNHXcb5QK+i8Luq4BHEqfGq1LJZC V1RJt8bOVlSOWd4r9qR3a3aw7Ldt7hv+d0dUP26m/BoGAsR0d5EVYJztlSnooSmSNDJC s3qQzfnbqd0ioVQMGM4oZ9FNd7LULQj8PoRcHUYD1uk35F0AOO6c6X82YTW+CdtpXeCe Qxhw== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@linaro.org header.s=google header.b=lySFpGRp; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from lists.gnu.org (lists.gnu.org. [209.51.188.17]) by mx.google.com with ESMTPS id n19si4795237jat.39.2021.04.01.05.56.33 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Thu, 01 Apr 2021 05:56:33 -0700 (PDT) Received-SPF: pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; Authentication-Results: mx.google.com; dkim=fail header.i=@linaro.org header.s=google header.b=lySFpGRp; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from localhost ([::1]:54316 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1lRwsD-0002C6-3t for patch@linaro.org; Thu, 01 Apr 2021 08:56:33 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:57070) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lRwrW-0001gx-6K for qemu-devel@nongnu.org; Thu, 01 Apr 2021 08:55:50 -0400 Received: from mail-oi1-x236.google.com ([2607:f8b0:4864:20::236]:37826) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1lRwrU-0002xB-Bz for qemu-devel@nongnu.org; Thu, 01 Apr 2021 08:55:49 -0400 Received: by mail-oi1-x236.google.com with SMTP id k25so1672258oic.4 for ; Thu, 01 Apr 2021 05:55:47 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=5RkNLC5WI+uRZhYZKVcGch990QPAIEFOdI+kgFgPscg=; b=lySFpGRpFCVhpkTG1mIVxCwCe8MRPa62h/Le11fY7EqzwuGNrwJhQG4cRaGPOHdxmZ h9vVeRoRC+jSMN1cthB/X5YdIecNtksl2l5wG5BqT9I8Il9HE1zW/hFZeohBaQgR7Tkc L1JXvF59SjKXt7CWHnVpMAU3r3BFUG44z+5nBiSY9UWhebXYoNOF/+58OxcSxO7iIlV1 6VCK/YjD3wz2zerjmQLMJ1EbWmQx+3foChOhCao5lEjJCnCcouCQAogH6OxqDnKRb/7Z R8Sa+lRnv2mH37jPpsRWThVBmbbve6a0b/5BA36stiEDoI9iHXME4Jyph7Td4mfgvbme ChpA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=5RkNLC5WI+uRZhYZKVcGch990QPAIEFOdI+kgFgPscg=; b=LIuVAD7M8zQ/Eds09PYEiutKwl/VCUe0CJagR4wbayXezYTfmpk57UWsCoeBf7AURY JfkbZfxS5XO5vuCiIfzElj34qWZ03B/52iCpe1AeKteDS+qlON+e1uwICK280enQ3PyG XDOGDfuryiRSxSi+eATzFCYPWdq6+F0uRNYJxdeDNNLYYQI7FzCgfTDs666bxFFtpfFx Ph7xRYUkLPt764EgMbOK8WmmFeOyIvJicMguj2R8X4YvUVgwnkgPTB6A272dvTg0kEV3 dt1EV1ZdNv65vBBuGKf9Unt5rDN6coUHTszZFkES2WCUkx2Kp2EA+kZrYI9wn6ozwXY+ 9Lbg== X-Gm-Message-State: AOAM531xEYyJG37R4M5Df2057gKwAooBorWgNytX03vJmBiwV9y5E+lV JiOU/05RhGP2bsfceKsjJuaNJEeCDiUdbCE= X-Received: by 2002:aca:1909:: with SMTP id l9mr5825428oii.144.1617281747188; Thu, 01 Apr 2021 05:55:47 -0700 (PDT) Received: from localhost.localdomain ([147.75.106.138]) by smtp.gmail.com with ESMTPSA id w11sm1082245ooc.35.2021.04.01.05.55.46 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 01 Apr 2021 05:55:46 -0700 (PDT) From: Haibo Xu To: qemu-devel@nongnu.org, qemu-arm@nongnu.org Subject: [PATCH RESEND v2 0/6] target/arm: Add nested virtualization support Date: Thu, 1 Apr 2021 12:55:32 +0000 Message-Id: X-Mailer: git-send-email 2.25.1 MIME-Version: 1.0 Received-SPF: pass client-ip=2607:f8b0:4864:20::236; envelope-from=haibo.xu@linaro.org; helo=mail-oi1-x236.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=unavailable autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: peter.maydell@linaro.org, drjones@redhat.com, richard.henderson@linaro.org, abologna@redhat.com, Haibo Xu , philmd@redhat.com Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: "Qemu-devel" v2: - Move the NV to a CPU feature flag(Andrea&Andrew) - Add CPU feature 'el2' test(Andrew) Many thanks to Andrea and Andrew for their comments! This series add support for ARMv8.3/8.4 nested virtualization support in KVM mode. It's based on Marc Zyngier's kernel KVM patches[1], and has been tested on a FVP model to run a L2 guest with Qemu. Now the feature can be enabled by "-M virt,accel=kvm -cpu host,el2=on" when starting a VM. [1] https://git.kernel.org/pub/scm/linux/kernel/git/maz/arm-platforms.git/log/?h=kvm-arm64/nv-5.12-WIP Haibo Xu (6): Update linux header with new arm64 NV macro target/arm/kvm: Add helper to detect el2 when using KVM target/arm/kvm: Add an option to turn on/off el2 support hw/intc/arm_gicv3: Enable support for setting vGIC maintenance IRQ target/arm/cpu: Enable 'el2' to work with host/max cpu target/arm: Add vCPU feature 'el2' test. hw/arm/virt.c | 19 ++++++++--- hw/intc/arm_gicv3_common.c | 1 + hw/intc/arm_gicv3_kvm.c | 16 +++++++++ include/hw/intc/arm_gicv3_common.h | 1 + linux-headers/asm-arm64/kvm.h | 2 ++ linux-headers/linux/kvm.h | 1 + target/arm/cpu.c | 14 +++++++- target/arm/cpu.h | 4 +++ target/arm/cpu64.c | 53 ++++++++++++++++++++++++++++++ target/arm/kvm64.c | 15 +++++++++ target/arm/kvm_arm.h | 13 ++++++++ target/arm/monitor.c | 2 +- tests/qtest/arm-cpu-features.c | 9 +++++ 13 files changed, 144 insertions(+), 6 deletions(-) -- 2.17.1