From patchwork Sat Jan 16 02:20:37 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Krish Sadhukhan X-Patchwork-Id: 12024541 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=-19.0 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_CR_TRAILER,INCLUDES_PATCH,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS, UNPARSEABLE_RELAY,USER_AGENT_GIT autolearn=ham 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 54F36C433DB for ; Sat, 16 Jan 2021 02:23:53 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 015FE2256F for ; Sat, 16 Jan 2021 02:23:52 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728698AbhAPCXg (ORCPT ); Fri, 15 Jan 2021 21:23:36 -0500 Received: from aserp2130.oracle.com ([141.146.126.79]:49876 "EHLO aserp2130.oracle.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725833AbhAPCXg (ORCPT ); Fri, 15 Jan 2021 21:23:36 -0500 Received: from pps.filterd (aserp2130.oracle.com [127.0.0.1]) by aserp2130.oracle.com (8.16.0.42/8.16.0.42) with SMTP id 10G24taN125791; Sat, 16 Jan 2021 02:22:52 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oracle.com; h=from : to : cc : subject : date : message-id : in-reply-to : references : mime-version : content-transfer-encoding; s=corp-2020-01-29; bh=GiA7Wx2KS5t1Hb9isnMosVuN4QXjqyqUQrz7pk10Szc=; b=r3MccLJyUQGpl8CzidwLbMJoRNEUpPNmx8eqjgGfsYCw5QUJyhCOmU1ruRwkYZ3moTnr SQXmhMP0BVRSKb5lvS6MRqssU++LSiQ1CbkjSUutnKxyo4xvzIZFD8PEciljzK2nrHf1 PgFrnNsPz9BQ4UwoKOWVsnGEgxNnPXd1DITKEUe5ZH/7Av6hOmSXdclIsG2+8WHsHOcU IqjMU82FPBrXpJqDvUa5lQ1mkgvY9WXab8dFhVsDDDGsHeysaQDVDFT2L7m8oTtO7zq3 rhAjQPdaC4GbrJ+11dAOCIe2htpamPIpyq4K21f9YbKXaCifkj9UZBuMprC113dV3s6W 1g== Received: from aserp3020.oracle.com (aserp3020.oracle.com [141.146.126.70]) by aserp2130.oracle.com with ESMTP id 363nna83jp-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Sat, 16 Jan 2021 02:22:52 +0000 Received: from pps.filterd (aserp3020.oracle.com [127.0.0.1]) by aserp3020.oracle.com (8.16.0.42/8.16.0.42) with SMTP id 10G26M3w194851; Sat, 16 Jan 2021 02:20:52 GMT Received: from userv0122.oracle.com (userv0122.oracle.com [156.151.31.75]) by aserp3020.oracle.com with ESMTP id 360kebux94-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Sat, 16 Jan 2021 02:20:51 +0000 Received: from abhmp0003.oracle.com (abhmp0003.oracle.com [141.146.116.9]) by userv0122.oracle.com (8.14.4/8.14.4) with ESMTP id 10G2KoZO019555; Sat, 16 Jan 2021 02:20:50 GMT Received: from nsvm-sadhukhan.osdevelopmeniad.oraclevcn.com (/100.100.230.216) by default (Oracle Beehive Gateway v4.0) with ESMTP ; Fri, 15 Jan 2021 18:20:50 -0800 From: Krish Sadhukhan To: kvm@vger.kernel.org Cc: pbonzini@redhat.com, jmattson@google.com, seanjc@google.com Subject: [PATCH 1/3 v2] nSVM: Check addresses of MSR and IO bitmap Date: Sat, 16 Jan 2021 02:20:37 +0000 Message-Id: <20210116022039.7316-2-krish.sadhukhan@oracle.com> X-Mailer: git-send-email 2.27.0 In-Reply-To: <20210116022039.7316-1-krish.sadhukhan@oracle.com> References: <20210116022039.7316-1-krish.sadhukhan@oracle.com> MIME-Version: 1.0 X-Proofpoint-Virus-Version: vendor=nai engine=6000 definitions=9865 signatures=668683 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 adultscore=0 suspectscore=0 spamscore=0 mlxlogscore=999 malwarescore=0 bulkscore=0 mlxscore=0 phishscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2009150000 definitions=main-2101160010 X-Proofpoint-Virus-Version: vendor=nai engine=6000 definitions=9865 signatures=668683 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 impostorscore=0 spamscore=0 mlxlogscore=999 clxscore=1015 bulkscore=0 adultscore=0 lowpriorityscore=0 suspectscore=0 phishscore=0 mlxscore=0 malwarescore=0 priorityscore=1501 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2009150000 definitions=main-2101160010 Precedence: bulk List-ID: X-Mailing-List: kvm@vger.kernel.org According to section "Canonicalization and Consistency Checks" in APM vol 2, the following guest state is illegal: "The MSR or IOIO intercept tables extend to a physical address that is greater than or equal to the maximum supported physical address." Also check that these addresses are aligned on page boundary. Signed-off-by: Krish Sadhukhan --- arch/x86/kvm/svm/nested.c | 18 ++++++++++++------ 1 file changed, 12 insertions(+), 6 deletions(-) diff --git a/arch/x86/kvm/svm/nested.c b/arch/x86/kvm/svm/nested.c index cb4c6ee10029..2419f392a13d 100644 --- a/arch/x86/kvm/svm/nested.c +++ b/arch/x86/kvm/svm/nested.c @@ -211,7 +211,8 @@ static bool svm_get_nested_state_pages(struct kvm_vcpu *vcpu) return true; } -static bool nested_vmcb_check_controls(struct vmcb_control_area *control) +static bool nested_vmcb_check_controls(struct kvm_vcpu *vcpu, + struct vmcb_control_area *control) { if ((vmcb_is_intercept(control, INTERCEPT_VMRUN)) == 0) return false; @@ -223,10 +224,15 @@ static bool nested_vmcb_check_controls(struct vmcb_control_area *control) !npt_enabled) return false; + if (!page_address_valid(vcpu, control->msrpm_base_pa)) + return false; + if (!page_address_valid(vcpu, control->iopm_base_pa)) + return false; + return true; } -static bool nested_vmcb_checks(struct vcpu_svm *svm, struct vmcb *vmcb12) +static bool nested_vmcb_checks(struct kvm_vcpu *vcpu, struct vmcb *vmcb12) { bool vmcb12_lma; @@ -255,10 +261,10 @@ static bool nested_vmcb_checks(struct vcpu_svm *svm, struct vmcb *vmcb12) (vmcb12->save.cr3 & MSR_CR3_LONG_MBZ_MASK)) return false; } - if (!kvm_is_valid_cr4(&svm->vcpu, vmcb12->save.cr4)) + if (!kvm_is_valid_cr4(vcpu, vmcb12->save.cr4)) return false; - return nested_vmcb_check_controls(&vmcb12->control); + return nested_vmcb_check_controls(vcpu, &vmcb12->control); } static void load_nested_vmcb_control(struct vcpu_svm *svm, @@ -485,7 +491,7 @@ int nested_svm_vmrun(struct vcpu_svm *svm) if (WARN_ON_ONCE(!svm->nested.initialized)) return -EINVAL; - if (!nested_vmcb_checks(svm, vmcb12)) { + if (!nested_vmcb_checks(&svm->vcpu, vmcb12)) { vmcb12->control.exit_code = SVM_EXIT_ERR; vmcb12->control.exit_code_hi = 0; vmcb12->control.exit_info_1 = 0; @@ -1173,7 +1179,7 @@ static int svm_set_nested_state(struct kvm_vcpu *vcpu, goto out_free; ret = -EINVAL; - if (!nested_vmcb_check_controls(ctl)) + if (!nested_vmcb_check_controls(vcpu, ctl)) goto out_free; /* From patchwork Sat Jan 16 02:20:38 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Krish Sadhukhan X-Patchwork-Id: 12024537 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=-19.0 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_CR_TRAILER,INCLUDES_PATCH,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS, UNPARSEABLE_RELAY,USER_AGENT_GIT autolearn=ham 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 4556FC433E0 for ; Sat, 16 Jan 2021 02:21:52 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id E85B4223C8 for ; Sat, 16 Jan 2021 02:21:51 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728560AbhAPCVf (ORCPT ); Fri, 15 Jan 2021 21:21:35 -0500 Received: from aserp2120.oracle.com ([141.146.126.78]:50692 "EHLO aserp2120.oracle.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728324AbhAPCVf (ORCPT ); Fri, 15 Jan 2021 21:21:35 -0500 Received: from pps.filterd (aserp2120.oracle.com [127.0.0.1]) by aserp2120.oracle.com (8.16.0.42/8.16.0.42) with SMTP id 10G24F0K190875; Sat, 16 Jan 2021 02:20:52 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oracle.com; h=from : to : cc : subject : date : message-id : in-reply-to : references : mime-version : content-transfer-encoding; s=corp-2020-01-29; bh=PsWu26ET1Aroe/GiEox5JHJTetUd/Z+jgu1B15egZvs=; b=JhRhal0pfro1Zy+HoLT0zsh4eTeSeCE/QpyeLy7vqZoQLYxDXLc9VuYyfPGjO9sPG0Ny LN4T7AlMOSBPsYkh0m2n2LnuIgGpv/n2+G3Kzzg6uwXoxDc7Kt2yebDJFF96pgdvvfQ2 /AkQdqKfYbArYREdQsUvkM8UT9BHY3/7UMycxYgZDPgLywP7gZiuPPZSIA1FOpsHeyPf jl/im0OefdBHYWlOV9kb3uI2zI5X8Oo34ghIQR6eEc7YbO768NVwis6EhcQjtfWyjJvn DzilnSdYhqzcL4VAcvHvS/ZmXbauHJWYgjpBbYq0h3TXX+NXf4pB27vvJupLtscmdidi Jg== Received: from aserp3030.oracle.com (aserp3030.oracle.com [141.146.126.71]) by aserp2120.oracle.com with ESMTP id 360kd07b32-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Sat, 16 Jan 2021 02:20:51 +0000 Received: from pps.filterd (aserp3030.oracle.com [127.0.0.1]) by aserp3030.oracle.com (8.16.0.42/8.16.0.42) with SMTP id 10G26Vcq113469; Sat, 16 Jan 2021 02:20:51 GMT Received: from aserv0122.oracle.com (aserv0122.oracle.com [141.146.126.236]) by aserp3030.oracle.com with ESMTP id 363p6bspce-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Sat, 16 Jan 2021 02:20:51 +0000 Received: from abhmp0003.oracle.com (abhmp0003.oracle.com [141.146.116.9]) by aserv0122.oracle.com (8.14.4/8.14.4) with ESMTP id 10G2KoXb030838; Sat, 16 Jan 2021 02:20:51 GMT Received: from nsvm-sadhukhan.osdevelopmeniad.oraclevcn.com (/100.100.230.216) by default (Oracle Beehive Gateway v4.0) with ESMTP ; Fri, 15 Jan 2021 18:20:50 -0800 From: Krish Sadhukhan To: kvm@vger.kernel.org Cc: pbonzini@redhat.com, jmattson@google.com, seanjc@google.com Subject: [PATCH 2/3 v2] Test: nSVM: Test MSR and IO bitmap address Date: Sat, 16 Jan 2021 02:20:38 +0000 Message-Id: <20210116022039.7316-3-krish.sadhukhan@oracle.com> X-Mailer: git-send-email 2.27.0 In-Reply-To: <20210116022039.7316-1-krish.sadhukhan@oracle.com> References: <20210116022039.7316-1-krish.sadhukhan@oracle.com> MIME-Version: 1.0 X-Proofpoint-Virus-Version: vendor=nai engine=6000 definitions=9865 signatures=668683 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 bulkscore=0 mlxscore=0 malwarescore=0 adultscore=0 suspectscore=0 spamscore=0 mlxlogscore=999 phishscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2009150000 definitions=main-2101160010 X-Proofpoint-Virus-Version: vendor=nai engine=6000 definitions=9865 signatures=668683 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 spamscore=0 phishscore=0 impostorscore=0 bulkscore=0 adultscore=0 suspectscore=0 malwarescore=0 lowpriorityscore=0 clxscore=1015 mlxlogscore=999 mlxscore=0 priorityscore=1501 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2009150000 definitions=main-2101160010 Precedence: bulk List-ID: X-Mailing-List: kvm@vger.kernel.org According to section "Canonicalization and Consistency Checks" in APM vol 2, the following guest state is illegal: "The MSR or IOIO intercept tables extend to a physical address that is greater than or equal to the maximum supported physical address." Also test that these addresses are aligned on page boundary. Signed-off-by: Krish Sadhukhan --- x86/svm_tests.c | 38 ++++++++++++++++++++++++++++++++++++++ 1 file changed, 38 insertions(+) diff --git a/x86/svm_tests.c b/x86/svm_tests.c index dc86efd..929a3e1 100644 --- a/x86/svm_tests.c +++ b/x86/svm_tests.c @@ -2304,6 +2304,43 @@ static void test_dr(void) vmcb->save.dr7 = dr_saved; } +extern u8 msr_bitmap_area[]; +extern u8 io_bitmap_area[]; + +#define TEST_BITMAP_ADDR(prot_type, bitmap_addr, msg) { \ + vmcb->control.intercept = 1ULL << prot_type; \ + addr_unalign = virt_to_phys(bitmap_addr); \ + if (prot_type == INTERCEPT_MSR_PROT) \ + vmcb->control.msrpm_base_pa = addr_unalign; \ + else \ + vmcb->control.iopm_base_pa = addr_unalign; \ + report(svm_vmrun() == SVM_EXIT_ERR, "Test %s address: %lx", msg,\ + addr_unalign); \ + vmcb->control.msrpm_base_pa = addr_spill_beyond_ram; \ + report(svm_vmrun() == SVM_EXIT_ERR, "Test %s address: %lx", msg,\ + addr_spill_beyond_ram); \ +} \ + +/* + * If the MSR or IOIO intercept table extends to a physical address that + * is greater than or equal to the maximum supported physical address, the + * guest state is illegal. + * + * [ APM vol 2] + */ +static void test_msrpm_iopm_bitmap_addrs(void) +{ + u64 addr_unalign; + u64 addr_spill_beyond_ram = + (u64)(((u64)1 << cpuid_maxphyaddr()) - 4096); + + /* MSR bitmap address */ + TEST_BITMAP_ADDR(INTERCEPT_MSR_PROT, msr_bitmap_area, "MSRPM"); + + /* MSR bitmap address */ + TEST_BITMAP_ADDR(INTERCEPT_IOIO_PROT, io_bitmap_area, "IOPM"); +} + static void svm_guest_state_test(void) { test_set_guest(basic_guest_main); @@ -2313,6 +2350,7 @@ static void svm_guest_state_test(void) test_cr3(); test_cr4(); test_dr(); + test_msrpm_iopm_bitmap_addrs(); } struct svm_test svm_tests[] = { From patchwork Sat Jan 16 02:20:39 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Krish Sadhukhan X-Patchwork-Id: 12024539 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=-19.0 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_CR_TRAILER,INCLUDES_PATCH,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS, UNPARSEABLE_RELAY,USER_AGENT_GIT autolearn=ham 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 B20DAC433E9 for ; Sat, 16 Jan 2021 02:21:52 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 22D4822AAC for ; Sat, 16 Jan 2021 02:21:52 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728754AbhAPCVh (ORCPT ); Fri, 15 Jan 2021 21:21:37 -0500 Received: from userp2130.oracle.com ([156.151.31.86]:46740 "EHLO userp2130.oracle.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728324AbhAPCVg (ORCPT ); Fri, 15 Jan 2021 21:21:36 -0500 Received: from pps.filterd (userp2130.oracle.com [127.0.0.1]) by userp2130.oracle.com (8.16.0.42/8.16.0.42) with SMTP id 10G25nh2109880; Sat, 16 Jan 2021 02:20:52 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oracle.com; h=from : to : cc : subject : date : message-id : in-reply-to : references : mime-version : content-transfer-encoding; s=corp-2020-01-29; bh=FCHR/kvHlyKbKvUjMwXY42SxTz0rqXup5nfnNHN3YTM=; b=kZp8Mho1o8Hiz1VvTHwtA4FE1xzljnx3j0VGEgkgviub4Oj7jKeWr/NTtsxgrk8GhlJi VvOxzj2mVvrhTk7K1b9o1rk5iXN+7dz+Cmlj6IdykKFLVlRynXCkraXJq/DxT4hizqs3 Did2knFiLmSueI/ErKeozWh+rU7l2ExCefGsXXpI93PLOgA5Dhm9p8FqIys7K/AiZJgo 2iX9uRRKL5u/zJiJjpcx8vHj5tkwyPF55LqOokux4lNNp19VCooW4GmcQW1Xn0A9P3NW GqAXF0VXz53Qm09/ifyV6bHAMIuTVYp5FSeE3On2lTYAZOJQnwQZRQTS5RICUvKOLBCK HA== Received: from aserp3020.oracle.com (aserp3020.oracle.com [141.146.126.70]) by userp2130.oracle.com with ESMTP id 360kvkf9gv-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Sat, 16 Jan 2021 02:20:52 +0000 Received: from pps.filterd (aserp3020.oracle.com [127.0.0.1]) by aserp3020.oracle.com (8.16.0.42/8.16.0.42) with SMTP id 10G26Ngb194960; Sat, 16 Jan 2021 02:20:51 GMT Received: from aserv0121.oracle.com (aserv0121.oracle.com [141.146.126.235]) by aserp3020.oracle.com with ESMTP id 360kebux99-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Sat, 16 Jan 2021 02:20:51 +0000 Received: from abhmp0003.oracle.com (abhmp0003.oracle.com [141.146.116.9]) by aserv0121.oracle.com (8.14.4/8.13.8) with ESMTP id 10G2KpGk014944; Sat, 16 Jan 2021 02:20:51 GMT Received: from nsvm-sadhukhan.osdevelopmeniad.oraclevcn.com (/100.100.230.216) by default (Oracle Beehive Gateway v4.0) with ESMTP ; Fri, 15 Jan 2021 18:20:51 -0800 From: Krish Sadhukhan To: kvm@vger.kernel.org Cc: pbonzini@redhat.com, jmattson@google.com, seanjc@google.com Subject: [PATCH 3/3 v2] Test: SVM: Use ALIGN macro when aligning 'io_bitmap_area' Date: Sat, 16 Jan 2021 02:20:39 +0000 Message-Id: <20210116022039.7316-4-krish.sadhukhan@oracle.com> X-Mailer: git-send-email 2.27.0 In-Reply-To: <20210116022039.7316-1-krish.sadhukhan@oracle.com> References: <20210116022039.7316-1-krish.sadhukhan@oracle.com> MIME-Version: 1.0 X-Proofpoint-Virus-Version: vendor=nai engine=6000 definitions=9865 signatures=668683 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 adultscore=0 suspectscore=0 spamscore=0 mlxlogscore=999 malwarescore=0 bulkscore=0 mlxscore=0 phishscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2009150000 definitions=main-2101160010 X-Proofpoint-Virus-Version: vendor=nai engine=6000 definitions=9865 signatures=668683 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 mlxlogscore=999 phishscore=0 lowpriorityscore=0 bulkscore=0 priorityscore=1501 malwarescore=0 clxscore=1015 impostorscore=0 spamscore=0 mlxscore=0 suspectscore=0 adultscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2009150000 definitions=main-2101160010 Precedence: bulk List-ID: X-Mailing-List: kvm@vger.kernel.org Since the macro is available and we already use it for MSR bitmap table, use it for aligning IO bitmap table also. Signed-off-by: Krish Sadhukhan --- x86/svm.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/x86/svm.c b/x86/svm.c index a1808c7..846cf2a 100644 --- a/x86/svm.c +++ b/x86/svm.c @@ -298,7 +298,7 @@ static void setup_svm(void) wrmsr(MSR_EFER, rdmsr(MSR_EFER) | EFER_SVME); wrmsr(MSR_EFER, rdmsr(MSR_EFER) | EFER_NX); - io_bitmap = (void *) (((ulong)io_bitmap_area + 4095) & ~4095); + io_bitmap = (void *) ALIGN((ulong)io_bitmap_area, PAGE_SIZE); msr_bitmap = (void *) ALIGN((ulong)msr_bitmap_area, PAGE_SIZE);