|
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] Re: [Xen-devel] [V2 PATCH 7/9] x86/hvm: pkeys, add pkeys support for guest_walk_tables
>>> On 27.11.15 at 10:52, <huaitong.han@xxxxxxxxx> wrote:
> @@ -90,6 +92,53 @@ static uint32_t set_ad_bits(void *guest_p, void *walk_p,
> int set_dirty)
> return 0;
> }
>
> +#if GUEST_PAGING_LEVELS >= 4
> +uint32_t leaf_pte_pkeys_check(struct vcpu *vcpu, uint32_t pfec,
> + uint32_t pte_access, uint32_t pte_pkeys)
> +{
> + bool_t pkru_ad, pkru_wd;
> + bool_t ff, wf, uf, rsvdf, pkuf;
> + unsigned int pkru = 0;
> +
> + uf = pfec & PFEC_user_mode;
> + wf = pfec & PFEC_write_access;
> + rsvdf = pfec & PFEC_reserved_bit;
> + ff = pfec & PFEC_insn_fetch;
> + pkuf = pfec & PFEC_prot_key;
None of these operations yield valid bool_t values. All of them
should be using !!(), and readability would imo benefit if you
made the expressions initializers instead of assignments.
Jan
_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxx
http://lists.xen.org/xen-devel
|
![]() |
Lists.xenproject.org is hosted with RackSpace, monitoring our |