From patchwork Wed Jul 17 19:33:30 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tamas K Lengyel X-Patchwork-Id: 11048187 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 262FF6C5 for ; Wed, 17 Jul 2019 19:35:52 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 16F3A204FB for ; Wed, 17 Jul 2019 19:35:52 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 0B60F285D6; Wed, 17 Jul 2019 19:35:52 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-5.2 required=2.0 tests=BAYES_00,MAILING_LIST_MULTI, RCVD_IN_DNSWL_MED autolearn=ham version=3.3.1 Received: from lists.xenproject.org (lists.xenproject.org [192.237.175.120]) (using TLSv1.2 with cipher AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id AF64D204FB for ; Wed, 17 Jul 2019 19:35:51 +0000 (UTC) Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.89) (envelope-from ) id 1hnpgZ-0000HF-NT; Wed, 17 Jul 2019 19:33:55 +0000 Received: from us1-rack-dfw2.inumbo.com ([104.130.134.6]) by lists.xenproject.org with esmtp (Exim 4.89) (envelope-from ) id 1hnpgY-0000HA-G4 for xen-devel@lists.xenproject.org; Wed, 17 Jul 2019 19:33:54 +0000 X-Inumbo-ID: cf2ac699-a8c9-11e9-8980-bc764e045a96 Received: from mail-io1-f65.google.com (unknown [209.85.166.65]) by us1-rack-dfw2.inumbo.com (Halon) with ESMTPS id cf2ac699-a8c9-11e9-8980-bc764e045a96; Wed, 17 Jul 2019 19:33:53 +0000 (UTC) Received: by mail-io1-f65.google.com with SMTP id h6so47595072iom.7 for ; Wed, 17 Jul 2019 12:33:53 -0700 (PDT) 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=dxEk0mar3gB6TPwI/s5SG4wooFUT3eoEszYbANfY1oc=; b=bKrVtqKKorTHtBnHN15/lol85TfHi4Y9sICxv3wJUn0CBpXV+gQVUEiu+TKAIHzSql ClwnWqSdZWgTa0LBskIqdvbMM0JtXUOi0qRLOmS88mmrJQatOo+2cjp9ixE6yD6OZUuq PL+Y/QtjeUS2VD4Vo+0Nh90LyzucflNUqYGSnYb+F2ID5VlkqM5wvD8gvZZVixtOk6zg IDOI1LEBggJjct7edUssR3ad9F1lU2a2WwtgILKZ6TT1l2qzzdPthA35tx8MIOymwjfr dJ5I5mNMoErdIASy1c2NX6YUnXUyNyQ/W6gVU7Mx0lW0bdYEdS6KT4qq1UtcJyUmtY2P hoEg== X-Gm-Message-State: APjAAAVsYzxCtrbGJ6DCNucE0yMkMFHok9VgSQzDPM2cGmKiF9PYw6RO Q+O3zU5Z+uqrekuEUwyq1Rpmchwk X-Google-Smtp-Source: APXvYqwAR68Lju9JlmoQ7FOS/CvPVVIGnrTSQucvgrp8xIkHG1K9SBh5ZBuD7GR1ewK/CJffHW4bTA== X-Received: by 2002:a6b:4107:: with SMTP id n7mr34993597ioa.12.1563392032353; Wed, 17 Jul 2019 12:33:52 -0700 (PDT) Received: from l1.lan (c-71-205-12-124.hsd1.co.comcast.net. [71.205.12.124]) by smtp.gmail.com with ESMTPSA id v13sm21743421ioq.13.2019.07.17.12.33.51 (version=TLS1_3 cipher=AEAD-AES256-GCM-SHA384 bits=256/256); Wed, 17 Jul 2019 12:33:51 -0700 (PDT) From: Tamas K Lengyel To: xen-devel@lists.xenproject.org Date: Wed, 17 Jul 2019 13:33:30 -0600 Message-Id: <20190717193335.11991-1-tamas@tklengyel.com> X-Mailer: git-send-email 2.20.1 MIME-Version: 1.0 Subject: [Xen-devel] [PATCH v6 0/5] x86/mem_sharing: assorted fixes X-BeenThere: xen-devel@lists.xenproject.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: Xen developer discussion List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Cc: Tamas K Lengyel Errors-To: xen-devel-bounces@lists.xenproject.org Sender: "Xen-devel" X-Virus-Scanned: ClamAV using ClamSMTP This is an assorted series of fixes to the memory sharing subsystem. Patch 1-2: fix general brokeness of the system Patch 3-5: nice-to-haves & cleanups, could be applied independently from the rest of the patches in the series Tamas K Lengyel (5): x86/mem_sharing: reorder when pages are unlocked and released x86/mem_sharing: copy a page_lock version to be internal to memshr x86/mem_sharing: enable mem_share audit mode only in debug builds x86/mem_sharing: compile mem_sharing subsystem only when kconfig is enabled x86/mem_sharing: style cleanup xen/arch/x86/Kconfig | 6 +- xen/arch/x86/domain.c | 2 + xen/arch/x86/domctl.c | 2 + xen/arch/x86/mm/Makefile | 2 +- xen/arch/x86/mm/mem_sharing.c | 355 +++++++++++++++++------------- xen/arch/x86/x86_64/compat/mm.c | 2 + xen/arch/x86/x86_64/mm.c | 2 + xen/common/Kconfig | 3 - xen/common/domain.c | 6 +- xen/common/grant_table.c | 2 +- xen/common/memory.c | 2 +- xen/common/vm_event.c | 6 +- xen/include/asm-x86/mem_sharing.h | 32 +++ xen/include/asm-x86/mm.h | 18 +- xen/include/xen/mm.h | 2 +- xen/include/xen/sched.h | 2 +- xen/include/xsm/dummy.h | 2 +- xen/include/xsm/xsm.h | 4 +- xen/xsm/dummy.c | 2 +- xen/xsm/flask/hooks.c | 4 +- 20 files changed, 266 insertions(+), 190 deletions(-)