[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [PATCH RFC 0/9] x86: Merge cpuid and msr policy
- To: Andrew Cooper <andrew.cooper3@xxxxxxxxxx>
- From: Roger Pau Monné <roger.pau@xxxxxxxxxx>
- Date: Thu, 30 Mar 2023 13:07:29 +0200
- Arc-authentication-results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=citrix.com; dmarc=pass action=none header.from=citrix.com; dkim=pass header.d=citrix.com; arc=none
- Arc-message-signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=yiZrw2W1Hr38wUeRuXjhdbDHN/AfPOdaPN12I3VGs7c=; b=WMeSYDcnkfT5cSwZgUm+Hvc+1uy2AwT9Gr7bw3XL5kRnRx5BEmLJc7wnY2YluBlmiQuDl3c3htqVYnLVE7xAmjpMQC9rNhrc7NZSnJd+E3nyw75kaW/9eypSrVh+yRAHinbtjMk4yNDEVIUm6JDFJ2i5ay+l0zldd5e6SZ7cx+hj93dteqRkRNVLFZB0vH/9asCAcgYgioJ9YE4Rh+b/NytGHvGWvhXcuOozKdw+GN4+pqD5l6oj1sH94whtBL4vZaPTUU6P2nV0HOFyNBpdwG5rAixdocCUax/yCgj6N07qvBQgyqGRe44kc9DVlQatW/Drk8ubgZiIYYXn0WSxqw==
- Arc-seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=j5XDNVDQEJT7O61dswpRDW5XokIt0MEvYATM9I0cuoLPS1/81vU4sRgRb5bz6ea0CCUacR4OSzQ2rXYWJ9jihkJzTF8D2puV+J+AR1i9oog57NGIM7tZ4L0zKVq79MybgVwOzbhFKytkjLTJW/ZGMRDcXmWoZ1yoE1GGXmLXPPx0ftLoxIfcF0Axeu1gXkFWyCcOqDimdEFSGEkHsiMp9z5nBcHyUjLy23Tz1qVaV18wIKCSnJbkYuTIVJuJhHq2eqiP+fIz8zAWEJ53iM25fWk96T2dYBDQtmMR4CXV89y36lyqwzXljxMko3asQjC29rV7pkuyGRnSzTZUZx1REg==
- Authentication-results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=citrix.com;
- Cc: Xen-devel <xen-devel@xxxxxxxxxxxxxxxxxxxx>, Jan Beulich <JBeulich@xxxxxxxx>, Wei Liu <wl@xxxxxxx>
- Delivery-date: Thu, 30 Mar 2023 11:08:27 +0000
- Ironport-data: A9a23:+Z3RHq3c2KZGBfNqEPbD5fVwkn2cJEfYwER7XKvMYLTBsI5bpzRVz GIbWG/XOf2NZjHwLopybIq+80kP65SAx4dkT1NspC1hF35El5HIVI+TRqvS04F+DeWYFR46s J9OAjXkBJppJpMJjk71atANlVEliefTAOK6ULWeUsxIbVcMYD87jh5+kPIOjIdtgNyoayuAo tq3qMDEULOf82cc3lk8tuTS+HuDgNyo4GlD5gdlPagS1LPjvyJ94Kw3dPnZw0TQGuG4LsbiL 87fwbew+H/u/htFIrtJRZ6iLyXm6paLVeS/oiI+t5qK23CulQRrukoPD9IOaF8/ttm8t4sZJ OOhF3CHYVxB0qXkwIzxWvTDes10FfUuFLTveRBTvSEPpqFvnrSFL/hGVSkL0YMkFulfJU913 7tFDmw2dTvSq+6yxI2lT+9giZF2RCXrFNt3VnBI6xj8VK9jareaBqLA6JlfwSs6gd1IEbDGf c0FZDFzbRPGJRpSJlMQD5F4l+Ct7pX9W2QA9BTJ+uxqvS6Kk1MZPLvFabI5fvSQQspYhACAr 3/u9GXlGBAKcteYzFJp91r13rWTw3+jCN96+LuQ5MJJoH3M40coBxQKV3WCmaCGjmKQVIcKQ 6AT0m90xUQoz2S7Q9+4UxCmrXqsuh8HR8EWA+A88BuKyKff/0CeHGdsZhxrZcEitcQ2bSc3z VLPlNTsbRRwtJWFRHTb8a2bxQ5eIgAQJG4GICQDFA0M5oC6pJlp102QCNF+DKSyk9v5Xynqx CyHpzQ/gLNVitMX06K8/hbMhDfESoX1czPZLz7/BgqNhj6Vrqb8D2B0wTA3Ncp9Ebs=
- Ironport-hdrordr: A9a23:/U2fEqOPmT0jhcBcTgWjsMiBIKoaSvp037BK7S1MoH1uA6mlfq WV9sjzuiWatN98Yh8dcLO7Scu9qBHnlaKdiLN5VduftWHd01dAR7sSjrcKrQeAJ8X/nNQtr5 uJccJFeaDN5Y4Rt7eH3OG6eexQv+Vu6MqT9IPjJ+8Gd3ATV0lnhT0JbTqzIwlNayRtI4E2L5 aY7tovnUvaRZxGBv7LYEXsRoL41qT2qK4=
- List-id: Xen developer discussion <xen-devel.lists.xenproject.org>
On Wed, Mar 29, 2023 at 09:51:28PM +0100, Andrew Cooper wrote:
> tl;dr to add MSR_ARCH_CAPS features sensibly, cpu_{featureset<->policy}() need
> to not operate on objects of differing lifetimes, so structs
> {cpuid,msr}_policy need merging and cpu_policy is the obvious name.
So the problem is that there's a chance we might get a cpu_policy
object that contains a valid (allocated) cpuid object, but not an msr
one?
Or the problem is rather with the domain struct containing separate
cpuid/msr fields not encapsulated in the cpu_policy struct?
I don't think the current set of cpu_policy operations permit you to
operate on incomplete objects anyway.
I assume you are worried about the usage of x86_msr_copy_from_buffer()
for example that could load data into the MSR_ARCH_CAPS field for the
msr object without checking that the corresponding CPUID bit is set?
> But this does mean that we now have
>
> cpu_policy->basic.$X
> cpu_policy->feat.$Y
> cpu_policy->arch_caps.$Z
I'm not sure I like the fact that we now can't differentiate between
policy fields related to MSRs or CPUID leafs.
Isn't there a chance we might in the future get some name space
collision by us having decided to unify both?
Thanks, Roger.
|